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

feat: add --unsafe-remove-modules flag to Rollback cmd #546

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

pirtleshell
Copy link
Member

  • adds public DeleteLatestVersion method on root multistore
    • this calls recently exposed DeleteVersionsFrom method on iavl store which writes deletion of versions from given version upwards to disk.
    • interface for IAVL tree was extended to include this. Requires iavl v1.2.0-kava.1.
  • 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:

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

* adds public DeleteKVStore method on root multistore
* 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
```
like DeleteVersionsTo, but deletes the given version & upwards
store/rootmulti/store.go Outdated Show resolved Hide resolved
store/rootmulti/store.go Show resolved Hide resolved
store/rootmulti/store.go Outdated Show resolved Hide resolved
the DeleteVersionsFrom on the unwrapped KVStore should be sufficient
@pirtleshell pirtleshell requested a review from drklee3 June 21, 2024 19:22
Copy link
Member

@drklee3 drklee3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! would be nice with passing CI jobs but that can be done later 😅

@pirtleshell pirtleshell merged commit dfce46d into kava-release-v0.47.10-iavl-v1 Jun 21, 2024
10 of 21 checks passed
@pirtleshell pirtleshell deleted the rp-iavl-v1-rollback-update branch June 21, 2024 21:30
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.

2 participants