Skip to content

Commit f69c82f

Browse files
mergify[bot]tomtautac0turtle
authored
feat: extra logging in in-place store migrations (backport #10768) (#11107)
* feat: extra logging in in-place store migrations (#10768) ## Description Closes: #10689 it'd also be good to add more fine-grained tracking of individual migrations, but there doesn't seem to be a quick way of doing it. Perhaps the best is to leave it to each migration implementation to add its own internal logging? --- ### 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~ - [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 - [x] 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)~ - [x] added a changelog entry to `CHANGELOG.md` - [ ] ~included comments for [documenting Go code](https://blog.golang.org/godoc)~ - [ ] ~updated the relevant documentation or specification~ - [x] 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 8b74157) # Conflicts: # types/module/module.go * fix conflict * remove files Co-authored-by: Tomas Tauber <[email protected]> Co-authored-by: marbar3778 <[email protected]>
1 parent 0c9bbbc commit f69c82f

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
122122

123123
### Improvements
124124

125+
* [\#10768](https://github.com/cosmos/cosmos-sdk/pull/10768) Added extra logging for tracking in-place store migrations
125126
* [\#10262](https://github.com/cosmos/cosmos-sdk/pull/10262) Remove unnecessary logging in `x/feegrant` simulation.
126127
* [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins`
127128
* [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary

types/module/configurator.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package module
22

33
import (
4+
"fmt"
5+
46
"github.com/gogo/protobuf/grpc"
57

68
"github.com/cosmos/cosmos-sdk/codec"
@@ -103,6 +105,7 @@ func (c configurator) runModuleMigrations(ctx sdk.Context, moduleName string, fr
103105
if !found {
104106
return sdkerrors.Wrapf(sdkerrors.ErrNotFound, "no migration found for module %s from version %d to version %d", moduleName, i, i+1)
105107
}
108+
ctx.Logger().Info(fmt.Sprintf("migrating module %s from version %d to version %d", moduleName, i, i+1))
106109

107110
err := migrateFn(ctx)
108111
if err != nil {

types/module/module.go

+1
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ func (m Manager) RunMigrations(ctx sdk.Context, cfg Configurator, fromVM Version
455455
}
456456

457457
moduleValUpdates := module.InitGenesis(ctx, cfgtor.cdc, module.DefaultGenesis(cfgtor.cdc))
458+
ctx.Logger().Info(fmt.Sprintf("adding a new module: %s", moduleName))
458459
// The module manager assumes only one module will update the
459460
// validator set, and that it will not be by a new module.
460461
if len(moduleValUpdates) > 0 {

0 commit comments

Comments
 (0)