This is to use zero-copy deserialization from protobuf encoded bytes to the generated Rust types, and to make conversion between the generated Rust types and idiomatic Astria types cheaper.
This issue has a few steps:
- Update the protobuf compilation tool to emit
Bytes instead of Vec<u8>
- (generate new code by running the tool)
- Update all conversions in
astria-core between the protobuf and native domain types (primarily all try_from_raw, try_from_raw_ref, into_raw, and to_raw).
- Update all code that broke because it required
Vec<u8> (I expect this primarily affecting tests).
For step 3 in particular care should be taken to not end up with conversions Bytes -> Vec<u8> -> Bytes because we have some instances where we convert Bytes to Vec<u8>.
This is to use zero-copy deserialization from protobuf encoded bytes to the generated Rust types, and to make conversion between the generated Rust types and idiomatic Astria types cheaper.
This issue has a few steps:
Bytesinstead ofVec<u8>astria-corebetween the protobuf and native domain types (primarily alltry_from_raw,try_from_raw_ref,into_raw, andto_raw).Vec<u8>(I expect this primarily affecting tests).For step 3 in particular care should be taken to not end up with conversions
Bytes -> Vec<u8> -> Bytesbecause we have some instances where we convertBytestoVec<u8>.