Skip to content
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

fix: amino encoding registration for multisig #911

Closed
wants to merge 6 commits into from

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented May 2, 2023

Description

Fixes errors seen in testnet and prod where multisig would return errors like

panic: unable to resolve type URL /cosmos.crypto.ed25519.PubKey

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustMarshalJSON(...)
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/codec/proto_codec.go:147
github.com/cosmos/interchain-security/x/ccv/provider/types.MsgAssignConsumerKey.GetSignBytes({{0xc000517618, 0x8}, {0xc00129e7c0, 0x34}, 0xc0001ab800})
	github.com/cosmos/interchain-security@v1.1.0/x/ccv/provider/types/msg.go:62 +0xd8
github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx.StdSignBytes({0x7ffc8fcc927c, 0x8}, 0x175, 0x0, 0x0, {{0x362ba70?, 0x1f?, 0xc00159e4d0?}, 0x45a5bc?}, {0xc00154b5f0, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/x/auth/legacy/legacytx/stdsign.go:61 +0x284
github.com/cosmos/cosmos-sdk/x/auth/tx.signModeLegacyAminoJSONHandler.GetSignBytes({}, 0x45a130?, {{0x7ffc8fcc927c?, 0xc00159e5d8?}, 0x414045?, 0xc00159e598?}, {0x2751518?, 0xc0001093c0?})
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/x/auth/tx/legacy_amino_json.go:49 +0x1a7
github.com/cosmos/cosmos-sdk/x/auth/signing.SignModeHandlerMap.GetSignBytes({0x1, {0xc0010693f8, 0x2, 0x2}, 0xc0010a81b0}, 0x27647f0?, {{0x7ffc8fcc927c, 0x8}, 0x175, 0x0}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/x/auth/signing/handler_map.go:59 +0xa2
github.com/cosmos/cosmos-sdk/client/tx.Sign({{0x2776450, 0xc000521740}, {0x276f2c0, 0xc000e4b0c0}, {0x2766638, 0x362ba70}, 0x175, 0x0, 0x30d40, 0x0, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/client/tx/tx.go:388 +0x389
github.com/cosmos/cosmos-sdk/x/auth/client.SignTxWithSignerAddress({{0x2776450, 0xc000521740}, {0x276f2c0, 0xc000e4b0c0}, {0x2766638, 0x362ba70}, 0x175, 0x0, 0x30d40, 0x0, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/x/auth/client/tx.go:92 +0x2a6
github.com/cosmos/cosmos-sdk/x/auth/client/cli.makeSignCmd.func1(0xc001144c00?, {0xc000e495f0, 0x1, 0x9?})
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/x/auth/client/cli/tx_sign.go:246 +0x745
github.com/spf13/cobra.(*Command).execute(0xc001144c00, {0xc000e49560, 0x9, 0x9})
	github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000f78c00)
	github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.6.1/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/cobra@v1.6.1/command.go:961
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0?, {0xc000dd55a8, 0x11})
	github.com/cosmos/cosmos-sdk@v0.45.13-ics/server/cmd/execute.go:36 +0x1eb
main.main()
	github.com/cosmos/gaia/v9/cmd/gaiad/main.go:16 +0x2c

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if API or client breaking change
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry to CHANGELOG.md
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

@tac0turtle
Copy link
Member

LGTM

@shaspitz shaspitz marked this pull request as ready for review May 2, 2023 15:43
@mmulji-ic
Copy link
Contributor

@smarshall-spitzbart can we add an automated test that checks this is ok?

@shaspitz
Copy link
Contributor Author

shaspitz commented May 2, 2023

@smarshall-spitzbart can we add an automated test that checks this is ok?

yes, need to get this PR working in docker first

@shaspitz shaspitz marked this pull request as draft May 2, 2023 18:01
@@ -11,6 +12,7 @@ import (
// RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgAssignConsumerKey{}, "ccv/MsgAssignConsumerKey", nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cdc.RegisterConcrete(&MsgAssignConsumerKey{}, "ccv/MsgAssignConsumerKey", nil)
cdc.RegisterConcrete(&MsgAssignConsumerKey{}, "/interchain_security.ccv.provider.v1.MsgAssignConsumerKey", nil)

should we use full path here?

@shaspitz
Copy link
Contributor Author

shaspitz commented May 4, 2023

Closing in favor of #916. If this PR were to fix the issue, it would be the more elegant solution, unfortunately I couldn't get it to work

@shaspitz shaspitz closed this May 4, 2023
@shaspitz shaspitz deleted the shawn/fix-multisig branch May 4, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants