-
Notifications
You must be signed in to change notification settings - Fork 294
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
Remove optional fields throughout protos #2933
Comments
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. This commit updates the protos; still to come is the required Rust changes for compatibility. Refs #2933.
Still very much in-progress. Modifying the governance proposal code not to use options got me all tangled up. Had a helpful conversation with @plaidfinch, recommending deeper proto changes that will accommodate, but I expect I'll need more support before this is done. Still a couple more things to bang on before I ask for help again, though. |
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. This commit updates the protos; still to come is the required Rust changes for compatibility. Refs #2933.
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. This commit updates the protos; still to come is the required Rust changes for compatibility. Refs #2933.
Paired with @aubrika today, who pointed out some comparable patterns for de-optionalizing. Used that approach to handle conversions of memo ciphertexts, bonding options, and how commit strings are handled in signaling proposals. Still outstanding however is sane handling of the "withdrawn" proposal state in the governance module. Planning to ask @plaidfinch for another pairing session to get that over the finish line. |
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. This commit updates the protos; still to come is the required Rust changes for compatibility. Refs #2933.
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. This commit updates the protos; still to come is the required Rust changes for compatibility. Refs #2933.
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. In order to preserve the representation of optionality, we use submessages in the proto types, so we can include or omit the named field. A notable exception is for encrypted memos: since the encrypted memo payload must be a specific length, we can check for whether it's empty, and map an empty encrypted memo to None. H/t to @plaidfinch for describing the submessage pattern to me, and implementing it on the governance changes. Closes #2933.
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. In order to preserve the representation of optionality, we use submessages in the proto types, so we can include or omit the named field. A notable exception is for encrypted memos: since the encrypted memo payload must be a specific length, we can check for whether it's empty, and map an empty encrypted memo to None. H/t to @plaidfinch for describing the submessage pattern to me, and implementing it on the governance changes. Closes #2933.
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.
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.
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.
The
protoc-gen-gocosmos
tool, used to generate golang code from protobuf definitions for many Cosmos projects, does not support the use ofoptional
fields in proto3 syntax. We encountered this on strangelove-ventures/interchaintest#644 (comment). To unblock, let's drop use of optional fields, updating code where necessary.The text was updated successfully, but these errors were encountered: