-
Notifications
You must be signed in to change notification settings - Fork 625
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: simapp and upgrade configuration for e2e v7 upgrade #3136
Conversation
.github/workflows/e2e-upgrade.yaml
Outdated
@@ -24,7 +24,7 @@ jobs: | |||
chain-binary: simd | |||
chain-a-tag: v6.1.0 | |||
chain-b-tag: v6.1.0 | |||
chain-upgrade-tag: v7.0.0-rc0 | |||
chain-upgrade-tag: pr-3136 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will essentially need to be v7.0.0-rc1
when this PR is merged, backported and tagged in rc1.
consensusparamtypes.StoreKey, | ||
crisistypes.StoreKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds store keys for x/consensus
and x/crisis
.
The new x/consensus
module maintains consensus parameters previously maintained by the base app subspace.
The x/crisis
module previously existed but without a store key. With the deprecation of x/params
, the crisis module now uses its own dedicated store to maintain params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this logic is repeated for every new module. If we need to do it again for a new module, it'd probably make sense to turn into a helper function. Looks great to me as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree. We could possible adopt the osmosis upgrade structure, but may require some refactoring of app.go.
paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) | ||
paramsKeeper.Subspace(crisistypes.ModuleName) | ||
paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding WithKeyTable(<params_key_table>)
for each module here in order to register param key-value types in x/param
for migration.
This registration was previously done in each NewKeeper
function of the corresponding module. E.g.
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
}
The param set pair types need to be registered in order to perform the migrations for modules maintaining their own params, otherwise we fail here. Essentially, the key-value attributes are maintained in memory in this map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find. Will this be removable in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can remove this post v7. We will have to do something similar when we migrate params for ibc-go modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we can remove this post v7.
Should we have an issue for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #3141
@@ -305,7 +309,7 @@ func NewSimApp( | |||
app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) | |||
|
|||
// set the BaseApp's parameter store | |||
app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) | |||
app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[consensusparamtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a misconfiguration in #2672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! Excellent work debugging these test failures! Each of these issues seem quite difficult to dig up. 🙏 ❤️
paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) | ||
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) | ||
paramsKeeper.Subspace(crisistypes.ModuleName) | ||
paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find. Will this be removable in the future?
consensusparamtypes.StoreKey, | ||
crisistypes.StoreKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this logic is repeated for every new module. If we need to do it again for a new module, it'd probably make sense to turn into a helper function. Looks great to me as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work, @damiannolan. Another rabbit hole you managed to get out of sound and safe! :)
These changes in app.go
, do we need them in the app.go
of the interchain-account-demo repo?
Yeah, I think it would be good to include the changes from #2672 and this PR. The upgrade specific stuff is probably fine to leave out, unless you plan to try using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work with the investigation and fixes for these issues ❤️
* Register required types for upgrade E2E tests * removed temporary function update * registering additional types and specifying rc0 tag in upgrade test * updated workflow tag * bump version to 6.1.0 * adding keytables to params subspaces in app.go * replace with pr docker build for testing * adding more wait for blocks * temporarily add new grpc services * removing last addition * configure store loaders for upgrade * adding consensus params migration from baseapp * testing without baseapp param migration * readd baseapp params migration * commiting updates, autocli and reflection svc * fix in run e2e script * adding crisis storekey to store upgrades * removing additional wait for blocks --------- Co-authored-by: Cian Hatton <[email protected]> (cherry picked from commit 80f162c) # Conflicts: # .github/workflows/e2e-upgrade.yaml # e2e/scripts/run-e2e.sh
…3143) * simapp and upgrade configuration for e2e v7 upgrade (#3136) * Register required types for upgrade E2E tests * removed temporary function update * registering additional types and specifying rc0 tag in upgrade test * updated workflow tag * bump version to 6.1.0 * adding keytables to params subspaces in app.go * replace with pr docker build for testing * adding more wait for blocks * temporarily add new grpc services * removing last addition * configure store loaders for upgrade * adding consensus params migration from baseapp * testing without baseapp param migration * readd baseapp params migration * commiting updates, autocli and reflection svc * fix in run e2e script * adding crisis storekey to store upgrades * removing additional wait for blocks --------- Co-authored-by: Cian Hatton <[email protected]> (cherry picked from commit 80f162c) # Conflicts: # .github/workflows/e2e-upgrade.yaml # e2e/scripts/run-e2e.sh * rm -rf e2e * rm e2e-upgrade.yaml --------- Co-authored-by: Damian Nolan <[email protected]>
* Register required types for upgrade E2E tests * removed temporary function update * registering additional types and specifying rc0 tag in upgrade test * updated workflow tag * bump version to 6.1.0 * adding keytables to params subspaces in app.go * replace with pr docker build for testing * adding more wait for blocks * temporarily add new grpc services * removing last addition * configure store loaders for upgrade * adding consensus params migration from baseapp * testing without baseapp param migration * readd baseapp params migration * commiting updates, autocli and reflection svc * fix in run e2e script * adding crisis storekey to store upgrades * removing additional wait for blocks --------- Co-authored-by: Cian Hatton <[email protected]>
Description
ref: cosmos/cosmos-sdk#14992
closes: #3131
Commit Message / Changelog Entry
NA
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.