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

feat(proto)!: remove optional fields in protos #2951

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

conorsch
Copy link
Contributor

The cosmos fork of gogoproto, used to generate golang code from BSR, doesn't support "optional" fields in proto3 syntax. Rather than sort that out, we're removing use of optional to unblock integration work on interchaintest.

For the most part, we can still represent optionality by special-casing zero (for blockheights) and empty (for encrypted memos). The exception is governance protos, which require use of a submessage type to represent the optional "withdrawn" state on proposal outcomes. H/t to @plaidfinch for describing the submessage pattern to me, and implementing it on the governance changes.

Closes #2933.

This PR re-implements and therefore supersedes #2940; only one of the two should be merged.

@conorsch conorsch temporarily deployed to smoke-test August 21, 2023 16:22 — with GitHub Actions Inactive
@conorsch
Copy link
Contributor Author

We plan to merge #2943, then rebase this work on top, at which point it'll be ready for review.

The cosmos fork of gogoproto, used to generate golang code from BSR,
doesn't support "optional" fields in proto3 syntax. Rather than sort
that out, we're removing use of optional to unblock integration work on
interchaintest.

For the most part, we can still represent optionality by special-casing
zero (for blockheights) and empty (for encrypted memos). The exception
is governance protos, which require use of a submessage type to
represent the optional "withdrawn" state on proposal outcomes.
H/t to @plaidfinch for describing the submessage pattern to me,
and implementing it on the governance changes.

Closes #2933.
@conorsch conorsch force-pushed the no-optional-fields-in-protos-v2 branch from 110440b to 339619b Compare August 21, 2023 17:55
@conorsch conorsch temporarily deployed to smoke-test August 21, 2023 17:55 — with GitHub Actions Inactive
@conorsch
Copy link
Contributor Author

Rebased. Turns out there weren't any conflicts with #2943 after all. Ready for review!

Copy link
Member

@hdevalence hdevalence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hdevalence hdevalence merged commit dbbf8c7 into main Aug 21, 2023
7 of 8 checks passed
@hdevalence hdevalence deleted the no-optional-fields-in-protos-v2 branch August 21, 2023 18:27
@cratelyn cratelyn added the protobuf-changes Makes changes to the protobuf definitions. label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protobuf-changes Makes changes to the protobuf definitions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove optional fields throughout protos
3 participants