-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use versioned keys for dynamically adding and remove commit st…
…ores (#3320) As was discovered with the apphash mismatch in celestiaorg/celestia-app#3167, by adding both v1 and v2 stores in the constructor we actually end up with a different app hash to `v1.x` as now there are a bunch of empy but initialized stores. What's needed is a mechanism that can start with only the v1 stores and then during the upgrade process add or remove the store for v2 as necessary. The main problem with this is that because we are using a branch of state we can't actually modify the stores until we write the new state to disk. Hence we can no longer perform the migration in `EndBlock` but in `Commit` whereby we first write state, then create the new stores, then perform the module migrations (like call `InitGenesis`) and then write it again finally returning the app hash. This PR depends on celestiaorg/cosmos-sdk#387 which introduces the upgrade hooks during `Commit`. This PR itself adds the two hooks for updating the stores and performing the migrations. --------- Co-authored-by: Rootul Patel <[email protected]>
- Loading branch information
Showing
17 changed files
with
612 additions
and
442 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.