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
While working on #11275, I discovered that some Msg's use ValAddress bech32 encoding rather than AccAddress bech32 for Msg signers, (i.e. cosmosvaloper12345abcef vs cosmos12345abcef), specifically:
x/staking
MsgCreateValidator
MsgEditValidator
x/slashing
MsgUnjail
x/distribution
MsgWithdrawValidatorCommission
Proposal
I can think of a few approaches for dealing with this:
Refactor these Msg's to use AccAddress bech32
Support either ValAddress or AccAddress in address.Codec and decode both to address bytes
Add some special annotations to indicate which signers use ValAddress encoding. For instance we could write (cosmos_proto.scalar) = "cosmos.ValidatorAddressString" on these fields to indicate the encoding
I'm personally leaning towards approach 3 because it's the most explicit and isn't protocol breaking. I actually see many messages which use validator addresses annotated with cosmos.AddressString as their cosmos_proto.scalar encoding and this is just incorrect. At a minimum we should fix these annotations. If we do fix them, then it's a matter of refactoring our existing GetSigners code to handle these cases. This is annoying for sure, but better long term as we can also refactor this code to support bytes signers in the future as some people discussed in #13140.
The text was updated successfully, but these errors were encountered:
Problem Definition
While working on #11275, I discovered that some Msg's use
ValAddress
bech32 encoding rather thanAccAddress
bech32 for Msg signers, (i.e.cosmosvaloper12345abcef
vscosmos12345abcef
), specifically:MsgCreateValidator
MsgEditValidator
MsgUnjail
MsgWithdrawValidatorCommission
Proposal
I can think of a few approaches for dealing with this:
AccAddress
bech32ValAddress
orAccAddress
inaddress.Codec
and decode both to address bytesValAddress
encoding. For instance we could write(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"
on these fields to indicate the encodingI'm personally leaning towards approach 3 because it's the most explicit and isn't protocol breaking. I actually see many messages which use validator addresses annotated with
cosmos.AddressString
as theircosmos_proto.scalar
encoding and this is just incorrect. At a minimum we should fix these annotations. If we do fix them, then it's a matter of refactoring our existingGetSigners
code to handle these cases. This is annoying for sure, but better long term as we can also refactor this code to supportbytes
signers in the future as some people discussed in #13140.The text was updated successfully, but these errors were encountered: