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: simapp and upgrade configuration for e2e v7 upgrade #3136

Merged
merged 19 commits into from
Feb 14, 2023

Conversation

damiannolan
Copy link
Member

@damiannolan damiannolan commented Feb 10, 2023

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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@damiannolan damiannolan changed the title fix: adding x/param keytable registration to allow migrations to proceed fix: simapp and upgrade configuration for e2e v7 upgrade Feb 10, 2023
@@ -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
Copy link
Member Author

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.

Comment on lines +973 to +974
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member Author

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.

Comment on lines +911 to +918
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())
Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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())
Copy link
Member Author

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

Copy link
Contributor

@colin-axner colin-axner left a 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. 🙏 ❤️

Comment on lines +911 to +918
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())
Copy link
Contributor

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?

Comment on lines +973 to +974
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
Copy link
Contributor

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

Copy link
Contributor

@crodriguezvega crodriguezvega left a 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?

@damiannolan
Copy link
Member Author

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 icad for upgrades.

Copy link
Contributor

@chatton chatton left a 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 ❤️

Base automatically changed from cian/issue#3131-e2e-upgrade-tests-are-failing-after-broadcast-mode-changes to main February 14, 2023 10:32
@damiannolan damiannolan merged commit 80f162c into main Feb 14, 2023
@damiannolan damiannolan deleted the damian/add-params-key-tables branch February 14, 2023 11:26
mergify bot pushed a commit that referenced this pull request Feb 14, 2023
* 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
damiannolan added a commit that referenced this pull request Feb 14, 2023
…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]>
stackman27 pushed a commit to stackman27/ibc-go that referenced this pull request Mar 13, 2023
* 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]>
@faddat faddat mentioned this pull request Jun 23, 2023
9 tasks
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.

E2E upgrade tests are failing
4 participants