You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proto: enum definitions should follow the *_UNSPECIFIED guideline #736
One last thing from my side. I'm reading this, and I think it would be a good moment to rename all *_UNKNOWN enums we have to *_UNSPECIFIED, to align with the recommendations.
Also, please check if we have an enum without an UNKNOWN/UNSPECIFIED zero-value
@sergio-mena There is one enum with a zero value that semantically is not "unspecified": CheckTxType in abci, used in RequestCheckTx. Since it's pretty established by now, is there a way we can fix this without breaking wire compatibility?
There are also some enum definitions that don't pass the ENUM_VALUE_PREFIX lint. We might want to fix these as well, as long as we are renaming things.
Oh, you're right! I didn't think of this when I added the comment in #495.
There is the convention in Tendermint Core/CometBFT, in particular in ABCI, that a zero "error code" means the request went OK.
This convention has been in place from the mists of time, so I think we'll need to stick to it and accept that deviation from the protobuf "dos and don'ts".
It appears that doing a lot of redefinitions just to change the _UNKNOWN suffix to _UNSPECIFIED causes a lot of versioning churn, while the enums BlockIdFlag and SignedMsgType are otherwise already good style wise.
As the style guide and the buf lint configuration docs suggest, the suffix name is a recommended default and we can choose another as long as the 0 value is reserved for the special case of no meaningful value given.
Maybe we should stick with _UNKNOWN as our preference?
Activity
mzabaluev commentedon Apr 20, 2023
@sergio-mena There is one enum with a zero value that semantically is not "unspecified":
CheckTxTypeinabci, used inRequestCheckTx. Since it's pretty established by now, is there a way we can fix this without breaking wire compatibility?mzabaluev commentedon Apr 20, 2023
There are also some enum definitions that don't pass the ENUM_VALUE_PREFIX lint. We might want to fix these as well, as long as we are renaming things.
sergio-mena commentedon Apr 26, 2023
Oh, you're right! I didn't think of this when I added the comment in #495.
There is the convention in Tendermint Core/CometBFT, in particular in ABCI, that a zero "error code" means the request went OK.
This convention has been in place from the mists of time, so I think we'll need to stick to it and accept that deviation from the protobuf "dos and don'ts".
mzabaluev commentedon Jun 13, 2023
It appears that doing a lot of redefinitions just to change the
_UNKNOWNsuffix to_UNSPECIFIEDcauses a lot of versioning churn, while the enumsBlockIdFlagandSignedMsgTypeare otherwise already good style wise.As the style guide and the buf lint configuration docs suggest, the suffix name is a recommended default and we can choose another as long as the 0 value is reserved for the special case of no meaningful value given.
Maybe we should stick with
_UNKNOWNas our preference?mzabaluev commentedon Jul 4, 2023
Completed in #975 (in the
feature/proto-upgradebranch)mzabaluev commentedon Oct 16, 2023
#1443 is adding a fix, setting the
Typefield in theRequestCheckTxmessage to a non-zero enum value everywhere such a message is created.