Module migration fails when code upload access is set to `OnlyAddress`
pwnfoo opened this issue · comments
Steps to reproduce
- Compile a binary from a
0.3x
version and start chain ( tested with tagv.0.33.0
) - Set code upload access with
OnlyAddress
- Propose upgrade to
0.4x
, compile a0.4x
binary and upgrade (tested withv0.45.0
) - Upgrade panics with below message :
INF migrating module upgrade from version 1 to version 2 module=server
INF migrating module wasm from version 2 to version 3 module=server
panic: upload access: type: empty
goroutine 7 [running]:
github.com/cosmos/cosmos-sdk/x/upgrade/keeper.Keeper.ApplyUpgrade({{_, _}, _, {_, _}, {_, _}, _, {_, _}, ...}, ...)
github.com/cosmos/cosmos-sdk@v0.47.5/x/upgrade/keeper/keeper.go:361 +0x398
github.com/cosmos/cosmos-sdk/x/upgrade.BeginBlocker(_, {{0x10531c9d0, 0x14000368080}, {0x105330010, 0x14001400e80}, {{0xb, 0x0}, {0x14001248a08, 0x4}, 0x9b, ...}, ...}, ...)
This seems to be an error originating from the ValidateBasic method
Thanks for reporting the issue!
When we migrate the params from the legacy param keeper to the module a ValidateBasic is called. As OnlyAddress
was deprecated and removed later, this validation fails now.
The quick solution would be to not use OnlyAddress
but AnyOfAddresses
instead. Does this work for you?
I did notice that it was deprecated and the solution works well. However, when looking over at the migration code for v3->v4, specifically here, I thought it was expected for the module to handle this migration automatically.
Seemed a little counter-intuitive, so decided to open this issue.
This is clearly a 🐛 on our side. Removing old code seems to be a bigger challenge. I appreciate the issue and will work on a fix. But this can take some time to be released