Cosmos-sdk: v040: `migrate` command is missing migrations for SoftwareUpgradeProposals data

Created on 9 Nov 2020  Â·  3Comments  Â·  Source: cosmos/cosmos-sdk

Summary of Bug


We were testing the upgrade path from 039 to 040 on BigBang testnet and it failed due to missing migration for proposals state. Migrate command should handle these state migrations as well.

Here's the error log:

panic: unrecognized concrete type name cosmos-sdk/SoftwareUpgradeProposal

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/codec.(*LegacyAmino).MustUnmarshalJSON(...)
    github.com/cosmos/[email protected]/codec/amino.go:171
github.com/cosmos/cosmos-sdk/x/genutil/legacy/v040.Migrate(0xc000b70e70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ffc21c89bf4, 0x9, 0x202f5c0, 0xc000e67e50, ...)
    github.com/cosmos/[email protected]/x/genutil/legacy/v040/migrate.go:131 +0x1d96
github.com/cosmos/cosmos-sdk/x/genutil/client/cli.MigrateGenesisCmd.func1(0xc000aad600, 0xc0001db080, 0x2, 0x4, 0x0, 0x0)
    github.com/cosmos/[email protected]/x/genutil/client/cli/migrate.go:93 +0x1f8
github.com/spf13/cobra.(*Command).execute(0xc000aad600, 0xc0001db000, 0x4, 0x4, 0xc000aad600, 0xc0001db000)
    github.com/spf13/[email protected]/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc00027f080, 0x1bcbe5b, 0x5, 0xc000e69d20)
    github.com/spf13/[email protected]/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    github.com/spf13/[email protected]/command.go:895
github.com/spf13/cobra.(*Command).ExecuteContext(...)
    github.com/spf13/[email protected]/command.go:888
github.com/ovrclk/akash/cmd/akashd/cmd.Execute(0xc00027f080, 0x203b680, 0xc0000131a0)
    github.com/ovrclk/akash/cmd/akashd/cmd/root.go:86 +0x165
main.main()
    github.com/ovrclk/akash/cmd/akashd/main.go:12 +0x2a

Version

v0.40.0-rc2

Steps to Reproduce

  • Start a chain with 039
  • Create a software upgrade proposal, deposit and vote
  • Export the state using (should use 039 binary), export --for-zero-height --height <someheight> > old_039_state.json
  • Migrate the state using (should use 040 binary), migrate old_039_state.json > new_v40_genesis.json

/cc @zmanian @clevinson @amaurymartiny @aaronc


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
bug encoding

Most helpful comment

Good find. Doesn't affect the cosmos hub.

All 3 comments

Good find. Doesn't affect the cosmos hub.

https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/gov/legacy/v036/types.go#L130

The migration code only contains code for text proposals, so parameter change proposals and community pool spend proposals are also unsupported, so I think the current Cosmos Hub state will also be affected.

Thanks @nnkken for the findings. @amaurymartiny and I are working on updating the migration code to cover these as well.

Was this page helpful?
0 / 5 - 0 ratings