cosmos-sdk/docs/core/upgrade.md

161 lines
8.3 KiB
Markdown
Raw Normal View History

documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
<!--
order: 15
-->
# In-Place Store Migrations
::: warning
Read and understand all of the in-place store migration documentation before you run a migration on a live chain.
:::
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
Upgrade your app modules smoothly with custom in-place store migration logic. {synopsis}
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
The Cosmos SDK uses two methods to perform upgrades.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
- Exporting the entire application state to a JSON file using the `export` CLI command, making changes, and then starting a new binary with the changed JSON file as the genesis file. See [Chain Upgrade Guide to v0.42](/v0.42/migrations/chain-upgrade-guide-040.html).
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
- Version v0.44 and later can perform upgrades in place to significantly decrease the upgrade time for chains with a larger state. Use the [Module Upgrade Guide](../building-modules/upgrade.md) to set up your application modules to take advantage of in-place upgrades.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
This document provides steps to use the In-Place Store Migrations upgrade method.
## Tracking Module Versions
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
Each module gets assigned a consensus version by the module developer. The consensus version serves as the breaking change version of the module. The Cosmos SDK keeps track of all module consensus versions in the x/upgrade `VersionMap` store. During an upgrade, the difference between the old `VersionMap` stored in state and the new `VersionMap` is calculated by the Cosmos SDK. For each identified difference, the module-specific migrations are run and the respective consensus version of each upgraded module is incremented.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
### Consensus Version
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
The consensus version is defined on each app module by the module developer and serves as the breaking change version of the module. The consensus version informs the SDK on which modules need to be upgraded. For example, if the bank module was version 2 and an upgrade introduces bank module 3, the SDK upgrades the bank module and runs the "version 2 to 3" migration script.
### Version Map
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
The version map is a mapping of module names to consensus versions. The map is persisted to x/upgrade's state for use during in-place migrations. When migrations finish, the updated version map is persisted in the state.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
## Upgrade Handlers
Upgrades use an `UpgradeHandler` to facilitate migrations. The `UpgradeHandler` functions implemented by the app developer must conform to the following function signature. These functions retrieve the `VersionMap` from x/upgrade's state and return the new `VersionMap` to be stored in x/upgrade after the upgrade. The diff between the two `VersionMap`s determines which modules need upgrading.
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
```go
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
type UpgradeHandler func(ctx sdk.Context, plan Plan, fromVM VersionMap) (VersionMap, error)
```
Inside these functions, you must perform any upgrade logic to include in the provided `plan`. All upgrade handler functions must end with the following line of code:
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
```go
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
return app.mm.RunMigrations(ctx, cfg, fromVM)
```
## Running Migrations
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
Migrations are run inside of an `UpgradeHandler` using `app.mm.RunMigrations(ctx, cfg, vm)`. The `UpgradeHandler` functions describe the functionality to occur during an upgrade. The `RunMigration` function loops through the `VersionMap` argument and runs the migration scripts for all versions that are less than the versions of the new binary app module. After the migrations are finished, a new `VersionMap` is returned to persist the upgraded module versions to state.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
```go
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
cfg := module.NewConfigurator(...)
app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
// ...
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
// additional upgrade logic
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
// ...
// returns a VersionMap with the updated module ConsensusVersions
return app.mm.RunMigrations(ctx, fromVM)
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
})
```
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
To learn more about configuring migration scripts for your modules, see the [Module Upgrade Guide](../building-modules/upgrade.md).
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
### Order Of Migrations
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
By default, all migrations are run in module name alphabetical ascending order, except `x/auth` which is run last. The reason is state dependencies between x/auth and other modules (you can read more in [issue #10606](https://github.com/cosmos/cosmos-sdk/issues/10606)).
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
If you want to change the order of migration then you should call `app.mm.SetOrderMigrations(module1, module2, ...)` in your app.go file. The function will panic if you forget to include a module in the argument list.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
## Adding New Modules During Upgrades
You can introduce entirely new modules to the application during an upgrade. New modules are recognized because they have not yet been registered in `x/upgrade`'s `VersionMap` store. In this case, `RunMigrations` calls the `InitGenesis` function from the corresponding module to set up its initial state.
2021-06-17 08:04:33 -07:00
### Add StoreUpgrades for New Modules
All chains preparing to run in-place store migrations will need to manually add store upgrades for new modules and then configure the store loader to apply those upgrades. This ensures that the new module's stores are added to the multistore before the migrations begin.
docs: add chain upgrade guide v0.43 (backport #9567) (#9725) * docs: add chain upgrade guide v0.43 (#9567) ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> This pull request adds a chain upgrade guide and example for v0.43. This pull request also removes migration documentation specific to v0.42 and adds links to v0.42 documentation when referencing genesis migrations. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - n/a - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [x] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) (cherry picked from commit 6098d7ed556e36d5dc67920248dcc462a4aaa2c0) # Conflicts: # cosmovisor/README.md * resolve conflicts Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-07-20 03:30:42 -07:00
```go
2021-06-17 08:04:33 -07:00
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(err)
}
if upgradeInfo.Name == "my-plan" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
// add store upgrades for new modules
// Example:
2021-06-17 08:04:33 -07:00
// Added: []string{"foo", "bar"},
// ...
}
// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
```
## Genesis State
When starting a new chain, the consensus version of each module MUST be saved to state during the application's genesis. To save the consensus version, add the following line to the `InitChainer` method in `app.go`:
```diff
func (app *MyApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
...
+ app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
...
}
```
This information is used by the Cosmos SDK to detect when modules with newer versions are introduced to the app.
feat: support in-place migration ordering (backport #10614) (#10890) * feat: support in-place migration ordering (#10614) ## Description Closes: #10604 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) (cherry picked from commit da929211d6f78014e3b40de3dc01e0ffcf0104cb) # Conflicts: # CHANGELOG.md # docs/core/upgrade.md # types/errors/errors.go # types/module/module.go * conflict fix * Add Features section * fix conflicts Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2022-01-05 16:05:01 -08:00
For a new module `foo`, `InitGenesis` is called by `RunMigration` only when `foo` is registered in the module manager but it's not set in the `fromVM`. Therefore, if you want to skip `InitGenesis` when a new module is added to the app, then you should set its module version in `fromVM` to the module consensus version:
```go
app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// ...
// Set foo's version to the latest ConsensusVersion in the VersionMap.
// This will skip running InitGenesis on Foo
fromVM[foo.ModuleName] = foo.AppModule{}.ConsensusVersion()
return app.mm.RunMigrations(ctx, fromVM)
})
```
### Overwriting Genesis Functions
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
The Cosmos SDK offers modules that the application developer can import in their app. These modules often have an `InitGenesis` function already defined.
You can write your own `InitGenesis` function for an imported module. To do this, manually trigger your custom genesis function in the upgrade handler.
::: warning
You MUST manually set the consensus version in the version map passed to the `UpgradeHandler` function. Without this, the SDK will run the Module's existing `InitGenesis` code even if you triggered your custom function in the `UpgradeHandler`.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
:::
```go
import foo "github.com/my/module/foo"
app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
// Register the consensus version in the version map
// to avoid the SDK from triggering the default
// InitGenesis function.
fromVM["foo"] = foo.AppModule{}.ConsensusVersion()
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
// Run custom InitGenesis for foo
app.mm["foo"].InitGenesis(ctx, app.appCodec, myCustomGenesisState)
return app.mm.RunMigrations(ctx, cfg, fromVM)
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
})
```
## Syncing a Full Node to an Upgraded Blockchain
You can sync a full node to an existing blockchain which has been upgraded using Cosmovisor
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
In order to successfully sync, you must start with the initial binary that the blockchain started with at genesis. Cosmovisor will handle downloading and switching to the binaries associated with each sequential upgrade.
documentation for in-place migrations with x/upgrade module (#8967) * upgrade draft docs * upgrade draft docs2 * change to generic id * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/README.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * added lines for version map and consensus versions * fix headers, add synopsis tag * docs for new modules * fix * remove line * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/building-modules/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * SetUpgradeHandler example snippet * -general clean up of docs -include PR #9007 information * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Update docs/core/upgrade.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> * fix self-reference * clearer definitions for overwriting genesis functions * add sync section * forgot to save this * update description of initgenesis modules * specify upgrade method * Update docs/core/upgrade.md Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Barrie Byron <barrie.byron@tendermint.com> Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-14 01:49:17 -07:00
To learn more about Cosmovisor, see the [Cosmovisor Quick Start](../run-node/cosmovisor.md).