-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Add optional extension interface to manually specify GetSigners #16112
Comments
This is a bit painful because we are now extracting signers by decoding the messages using the google.golang.org/protobuf API. This means that if a type is built with gogo proto we will extract its signers by unmarshaling to dynamicpb. So even if we define a custom signers interface on the gogo proto message, that won't get picked up by the GetSigners code unless we're very careful and maybe do some hacky things. Also we have validation in To address the validation issue, I propose a new option Two approaches I can think of to handle this custom method are:
Maybe best to try both of them and then this gives people options. Also, I wonder how this would be dealt with by dynamic clients like autocli or with cross lang modules. Thinking of the cross lang perspective of services all the way down, we'd probably want some sort of |
Just so I understand the use case, why can |
I am still thinking about a use-case of having a multisig msg wrapper: type ContractMultisig struct {
DAOid uint64
PreDeterminedSigners []AccAddress
Msg Any
} |
if they want to provide the same ux as ethereuem they do signers differently, we should aim to provide a way for users to do this sort of thing. In ethereum you dont specify the signer, you recover the signer from the signature. |
can we just say if it doesnt have cosmos.v1.signer we assume the user has a getsigners method on the message? If the user forgets both then it would break the chain. I would have loved to have a migration path for current users as well so they can migrate over a release since this will be needed by everyone Which ever path is taken, this is a requirement for the merge of the pr and inclusion in a release |
SignerService makes sense to me I think the biggest ick I have about this change is the fact that you're effectively just replacing a deprecated function with another functionally identical function. I'm a huge fan of address recover from the signature's recovery bit, and my bias would be to push that. (I know not possible for all curves but still my bias) |
@aaronc with the way Polaris handles eth txs this all is a moot point. We simply unwrap to Geth type recover and don't worry about anything else https://github.com/berachain/polaris/blob/main/cosmos/proto/polaris/evm/v1alpha1/tx.proto |
I don't think we can just assume it has a custom |
I'll be working on #16184 this week and hoping to get it merged ASAP. |
🔥 |
Likewise, collaborating in #16340. |
wouldn't the real solution be to make the proto tag optional? |
You're proposing |
Yeah instead of defining this second proto tag. and then reuse the GetSigners() function to prevent the breaking change. if the msg.signer tag is missing, the GetSigners isn't generated by the proto gen and thus will need to be manually added. way cleaner |
Not adding another proto tag makes sense to me. If omitted and a message is to be signed, this design has |
@itsdevbear We're getting close to merging #16340. You'd register a custom get signer func like this test shows: cosmos-sdk/tests/integration/tx/context_test.go Lines 18 to 28 in 410935f
We're using "pulsar" types (the latest official google protobuf spec/lib) for registration instead of the gogo types generated from cosmos-sdk/gogoproto since all of x/tx is built on ProtoReflect capable messages. My preference is not to support gogo at all in x/tx or this API. Even if your chain uses gogo they will be packed into pulsar types anyway in signing code. Does this solution work for your team? |
Note we don't need to require pulsar codegen. Just the official codegen or pulsar |
To handle EVM use cases (ex https://github.com/evmos/evmos/blob/95c83a1ed48063f1643ef853ca77d5d42a8d7639/x/evm/types/msg.go#L204) we need an alternative to
cosmos.msg.v1.signer
as implemented in #11275. I propose this interface:This way the interface doesn't overlap with the existing and deprecated
GetSigners() []sdk.AccAddress
The text was updated successfully, but these errors were encountered: