0xPolygonMiden / miden-node

Reference implementation of the node for the Polygon Miden rollup
MIT License
52 stars 37 forks source link

style: standardize protobuf type aliases #454

Open Mirko-von-Leipzig opened 1 month ago

Mirko-von-Leipzig commented 1 month ago

We currently use a variety of styles to refer to and alias protobuf message types.

This comes up within the proto crate itself, where we have mappings from the domain type T and the generated protobuf type T. In particular when implementing conversions to and from these types.

In the long run we hope to refactor the proto crate to have less clutter, but until then we should at least be consistent in how we refer to these types.

A quick and dirty option is to go through all instances referring to the proto types and make them consistent e.g. have them look like proto::T so that a conversion function is

impl From<BlockHeader> for proto::BlockHeader {...}

Another more thorough option is to re-organize the proto crate so that all domain types are exported at the root level, and all protobuf messages are in a module e.g. raw.

This would be a breaking change though, but maybe its not so bad :)

See here for example.