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

cli: add --unsafe-remove-modules flag to Rollback #549

Merged

Conversation

pirtleshell
Copy link
Member

like #546 but using our mainnet (iavl v0) cosmos-sdk branch as the base

i originally went about exposing DeleteVersionsFrom on the iavl tree (Kava-Labs/iavl#1), but realized i could just use the already-existing DeleteVersion instead of adding another forked dependency to maintain.

  • rollback command accepts list of store keys names to forcibly delete

this is useful for rolling back an upgrade that adds modules.
rollbacks are performed by loading & committing the previous version.
without this new functionality, the rollback will fail because no store
version will exist for modules added during the upgrade.

to properly rollback the state, pass in a list of the added module names
and they will be completely removed before the rollback of pre-existing
modules takes place:

chain rollback --unsafe-remove-modules mynewmodule,othernewmodule

Currently testing this works as expected.

* rollback command accepts list of store keys names to forcibly delete

this is useful for rolling back an upgrade that adds modules.
rollbacks are performed by loading & committing the previous version.
without this new functionality, the rollback will fail because no store
version will exist for modules added during the upgrade.

to properly rollback the state, pass in a list of the added module names
and they will be completely removed before the rollback of pre-existing
modules takes place:
```
chain rollback --unsafe-remove-modules mynewmodule,othernewmodule
```
Comment on lines +1029 to +1034
for k := range rs.storesParams {
if k.Name() == keyName {
key = k
break
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@pirtleshell pirtleshell merged commit 9683c31 into kava-v0.47.10-release-x Jun 25, 2024
20 of 25 checks passed
@pirtleshell pirtleshell deleted the rp-iavl-v0-rollback-delete-modules branch June 25, 2024 22:20
pirtleshell added a commit that referenced this pull request Aug 1, 2024
* rollback command accepts list of store keys names to forcibly delete

this is useful for rolling back an upgrade that adds modules.
rollbacks are performed by loading & committing the previous version.
without this new functionality, the rollback will fail because no store
version will exist for modules added during the upgrade.

to properly rollback the state, pass in a list of the added module names
and they will be completely removed before the rollback of pre-existing
modules takes place:
```
chain rollback --unsafe-remove-modules mynewmodule,othernewmodule
```
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.

1 participant