-
Notifications
You must be signed in to change notification settings - Fork 43
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
Issues with amino signing StakeAuthorization, or maybe outdated protobuff? #658
Comments
Thanks @wojciechowskip — can you share your telescope configuration? You likely need to enable interfaces, which should create the proper encoders for the accepts/implements Any interfaces such as authz |
Sure thing, are you referring options in codegen.ts? If yes these are my options (default ones, cuz havent really changed em):
After looking at I guess its enabled, right? |
@pyramation is that something on telescope side? Matter of config or an issue? Since it does not work for me only for MsgGrant with StakeAuthorization. I was trying to put custom converter for this case but unfortunately it messes everything up :/ Any advice for a temporary workaround to speed things up? Btw this is a way I am creating a message: import { cosmos } from 'my-generated-lib'
const {
MsgGrant,
Grant,
} = cosmos.authz.v1beta1;
const {
StakeAuthorization,
AuthorizationType,
StakeAuthorization_Validators,
} = cosmos.staking.v1beta1;
...
return {
typeUrl: COSMOS_MESSAGE_TYPE_URL.GRANT,
value: MsgGrant.fromPartial({
granter: granterAddress,
grantee: granteeAddress,
grant: Grant.fromPartial({
expiration: expiredDate, // date format
authorization: {
typeUrl: COSMOS_MESSAGE_TYPE_URL.STAKE_AUTHORIZATION, // '/cosmos.staking.v1beta1.StakeAuthorization'
value: StakeAuthorization.encode(
StakeAuthorization.fromPartial({
maxTokens, // Coin
authorizationType: AuthorizationType.AUTHORIZATION_TYPE_DELEGATE, // 1
allowList: StakeAuthorization_Validators.fromPartial({
address: validatorAddresses,
}),
})
).finish(),
},
}),
}),
}; and this is signing client creation: import {
cosmosAminoConverters, cosmosProtoRegistry,
} from 'my-generated-lib';
const protoRegistry: ReadonlyArray<[string, GeneratedType]> = [
...cosmosProtoRegistry,
];
const aminoConverters = {
...cosmosAminoConverters,
};
...
return SigningStargateClient.connectWithSigner(rpcEndpoint, offlineSigner, {
registry,
aminoTypes,
});
|
https://github.com/cosmology-tech/create-cosmos-app/tree/main/examples/authz checkout this example for now, we'll dig into these accepts/implements interface issues after Cosmoverse — hopefully this working demo can help! it has the StakeAuthorization in it |
Hi, I've tested telescope today which basically solved my issues with FeeGrant (I wasnt able to amino sign these types of transactions with default converters from cosmjs and now I can - thats great). First impression - great tool you've provided to the community. Thank you!
But after getting rid of cosmjs amino converters and using my newly generated ones via telescope I've fixed one issue but something what was working before, now stopped :/
StakeAuthorization transaction with MsgGrant returns me:
Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (2815654), sequence (23) and chain-id (cosmoshub-4): unauthorized
Which is very generic error telling that 'Hey dude, your converters are shit!'. But I am wondering why. From what I was able to compare, before my msg looked like this (and was working):
And now it looks like this (and doesnt work):
I followed classic telescope guide from ur README, all works great except this. Looking at proto files and comparing the ones which were installed by telescope and the ones from cosmos-sdk I can say they are different for example for proto
x/staking/proto/cosmos/staking/v1beta1/authz.proto
May this difference be an issue? That protobuffs for telescope are outdated? Or maybe something else?
The text was updated successfully, but these errors were encountered: