cosmos / ibc-proto-rs

Rust Protobuf definitions and gRPC clients for interacting with Cosmos SDK, IBC and Interchain Security
Apache License 2.0
50 stars 29 forks source link

Use `pbjson_build` to ensure that proto types have `Serialize, Deserialize` impls compatible with ProtoJSON #95

Closed hdevalence closed 1 year ago

hdevalence commented 1 year ago

It's useful to be able to serialize and deserialize ProtoJSON. This can only be done together with the proto codegen, not by downstream users, so it happens in the ibc-proto crate or not at all.

To do it, the pbjson_build crate could be hooked into the proto compiler; an example can be found in the Penumbra repo: https://github.com/penumbra-zone/penumbra/blob/main/tools/proto-compiler/src/main.rs#L47 This also involves changing the WKTs to ones that support ProtoJSON, so it's definitely a breaking change.

hdevalence commented 1 year ago

It looks like this was done in #92, but not yet released. I see an 0.31.0-alpha.2 tag; is there any reason not to release it as 0.31?

romac commented 1 year ago

The initial idea was to give @Wizdave97 and others time to make sure that these changes work for them. It then fell under our radar, sorry about that. I think it's indeed time to do a final release now. I'll get on it!

romac commented 1 year ago

Done in https://github.com/cosmos/ibc-proto-rs/pull/92 and released in v0.31.0.

hdevalence commented 1 year ago

Amazing, thanks!