Closed yaruwangway closed 2 years ago
solved, thank you @colin-axner
the issue is when addding upgrade store, i need to add Added: []string{icacontrollertypes.StoreKey, icahosttypes.StoreKey}
both substores, not the module Added: []string{icatypes.ModuleName},
The reason:
loadVersion will check the store upgrades when initializing the stores
https://github.com/cosmos/cosmos-sdk/blob/master/store/rootmulti/store.go#L218-#L228
Following up with more information:
The issue is that StoreUpgrades
is actually initializing the stores with appropriate versions for modules which are added during an upgrade. It loops over the store keys set in the params and checks if the upgrades.IsAdded(key)
The bug here is that we were recommending the icatypes.ModuleName
to be set in StoreUpgrades. We don't have a store key for icatypes.ModuleName
, we have 2 stores, one for controller and one for host. So really the StoreUpgrades should be:
Added: []string{icacontrollertypes.StoreKey, icahosttypes.StoreKey},
So the loadVersion
is looping over existing store keys and checking if they are in storeUpgrades
(which controller/host weren't and thus the initialVersion was never being set. I'm unsure why it doesn't error until the height tries to be pruned. I'm guessing initial version defaults to 0 and maybe when it pruning it prunes only on stores with an initial version < pruning height, but in reality the initial version of our stores aren't created until after pruning height and thus there is nothing to prune
Summary of Bug
Gaia upgrade from v6 to a binary built from
theta-prepare
branch in local test according to this tutorial.panic upon upgrade height:
if in
theta-prepare
branch, I change the ibc-go version fromrc-1
torc-0
, I will have the same paniccannot delete latest saved version
after upgrade and produce a few blocks.the panic is from iavl tree, https://github.com/cosmos/iavl/blob/d99448032e95a6ce05d342737cd745a20ef0b6ce/mutable_tree.go#L568
How to avoid the above panic?
if I delete
ica module
in the upgradehandler, https://github.com/cosmos/gaia/blob/619e66e3104e03bcf320fb37cc663e5e37da7d32/app/app.go#L655-L668, i can upgrade without panic.Hypha sets
pruning="nothing"
in app.toml, also can upgrade without panic. https://github.com/cosmos/testnets/pull/301#issuecomment-1061261930use "fresh" genesis, which means use
gaia init
to generate genesis, rather than use the exported genesis from livehub, this can also upgrade without panic. https://github.com/cosmos/testnets/pull/301#issuecomment-1061980037Version
Steps to Reproduce
Gaia upgrade from v6 to a binary built from
theta-prepare
branch in local test according to this tutorial.For Admin Use