Skip to content

Commit

Permalink
docs: update upgrade doc and changelog for MigrationModuleManager (#1…
Browse files Browse the repository at this point in the history
…7373)

Co-authored-by: Julien Robert <[email protected]>
(cherry picked from commit df7cc3e)
  • Loading branch information
mmsqe authored and mergify[bot] committed Aug 13, 2023
1 parent 53398b5 commit 2caf078
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ 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
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/building-apps/03-app-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2caf078

Please sign in to comment.