Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmonize on proto-types for representing well-known protobuf message types #1053

Open
mzabaluev opened this issue Dec 13, 2021 · 2 comments
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request serialization technical debt Issues that are important, but not urgent, that should eventually receive attention

Comments

@mzabaluev
Copy link
Contributor

mzabaluev commented Dec 13, 2021

Version(s) of tendermint-rs: v0.23.2, master

Description

There is code in ibc-rs that jumps through hoops for the sole reason that the protobuf message structures generated for IBC use proto-types, while tendermint-proto includes a homespun variant of structures representing google.protobuf.

This was done in #639 which predates the rearchitecting with domain types and derives serde impls directly on the protobuf message types. This is less preferable than putting the serde concern cleanly onto the domain types, since only the latter can enforce value validity.

Definition of "done"

tendermint-proto uses proto-types to represent Timestamp, Duration, and possibly other well-known message types.
The corresponding domain types in tendermint respond to all serde needs.

@mzabaluev mzabaluev added enhancement New feature or request serialization domain-types Anything relating to the creation, modification or removal of domain types technical debt Issues that are important, but not urgent, that should eventually receive attention labels Dec 13, 2021
@tony-iqlusion
Copy link
Collaborator

We've had some requests downstream in cosmos-sdk-proto for better alternatives for representing well-known types:

The latter suggests using prost-wkt which is a richer crate for representing well-known types than prost-types and it also includes serde support.

It also has helper methods for packing and unpacking messages to/from an Any type which would be very helpful.

@mzabaluev
Copy link
Contributor Author

Using "rich" crates to support non-protobuf functionality within prost-targeted types may not be the best long term approach. I've put some thoughts in #654 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-types Anything relating to the creation, modification or removal of domain types enhancement New feature or request serialization technical debt Issues that are important, but not urgent, that should eventually receive attention
Projects
None yet
Development

No branches or pull requests

2 participants