From 3a96bb9f7f14ad2c7cd3c31a4315884a39e494e1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 13 Aug 2023 15:29:10 +0200 Subject: [PATCH] docs: update upgrade doc and changelog for MigrationModuleManager (backport #17373) (#17378) --- UPGRADING.md | 8 ++++++++ docs/docs/building-apps/03-app-upgrade.md | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/UPGRADING.md b/UPGRADING.md index 1668638a10d2..c59fd9ce98e0 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -66,6 +66,14 @@ allows an application to define handlers for these methods via `ExtendVoteHandle and `VerifyVoteExtensionHandler` respectively. Please see [here](https://docs.cosmos.network/v0.50/building-apps/vote-extensions) for more info. +#### Upgrade + +**Users using `depinject` / app v2 do not need any changes, this is abstracted for them.** +```diff ++ app.BaseApp.SetMigrationModuleManager(app.ModuleManager) +``` +BaseApp added `SetMigrationModuleManager` for apps to set their ModuleManager which implements `RunMigrationBeginBlock`. This is essential for BaseApp to run `BeginBlock` of upgrade module and inject `ConsensusParams` to context for `beginBlocker` during `beginBlock`. + #### Events The log section of `abci.TxResult` is not populated in the case of successful diff --git a/docs/docs/building-apps/03-app-upgrade.md b/docs/docs/building-apps/03-app-upgrade.md index 25f989e4543a..11430f8a3490 100644 --- a/docs/docs/building-apps/03-app-upgrade.md +++ b/docs/docs/building-apps/03-app-upgrade.md @@ -50,6 +50,18 @@ the rest of the block as normal. Once 2/3 of the voting power has upgraded, the resume the consensus mechanism. If the majority of operators add a custom `do-upgrade` script, this should be a matter of minutes and not even require them to be awake at that time. +## Set Migration Module Manager + +:::tip +Users using `depinject` / app v2 do not need any changes, this is abstracted for them. +::: + +After app initiation, call `SetMigrationModuleManager` with ModuleManager to give BaseApp access to `RunMigrationBeginBlock`: + +```go +app.BaseApp.SetMigrationModuleManager(app.ModuleManager) +``` + ## Integrating With An App Setup an upgrade Keeper for the app and then define a `BeginBlocker` that calls the upgrade