Skip to content

Commit

Permalink
Rc0/v6.0.0 (#1079)
Browse files Browse the repository at this point in the history
* Vega 6.0.0 (#1077)

* fix: delete new modules from fromVM map to not skip init genesis

* fix: migrate auth module after staking

* chore: update changelog

* chore: update changelog

Co-authored-by: yaruwangway <[email protected]>
  • Loading branch information
okwme and yaruwangway authored Nov 24, 2021
1 parent 07f9892 commit 6ed5b73
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v6.0.0] - 2021-11-11
## [v6.0.0] - 2021-11-24

* (gaia) Add NewSetUpContextDecorator to anteDecorators
* (gaia) Reconfigure SetUpgradeHandler to ensure vesting is configured after auth and new modules have InitGenesis run.
* (golang) Bump golang prerequisite to 1.17.
* (gaia) Bump [Liquidity](https://github.com/gravity-devs/liquidity) module to [v1.4.2](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.2).
* (gaia) Bump [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) to [v0.44.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.3). See the [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.44.x/CHANGELOG.md#v0443---2021-10-21) for details.
Expand Down Expand Up @@ -378,8 +380,8 @@ See the [Tendermint v0.34.7 SDK changelog](https://github.com/tendermint/tenderm

<!-- Release links -->

[Unreleased]: https://github.com/cosmos/gaia/compare/v6.0.0-rc3...HEAD
[v6.0.0]: https://github.com/cosmos/gaia/releases/tag/v6.0.0-rc3
[Unreleased]: https://github.com/cosmos/gaia/compare/v6.0.0...HEAD
[v6.0.0]: https://github.com/cosmos/gaia/releases/tag/v6.0.0
[v5.0.7]: https://github.com/cosmos/gaia/releases/tag/v5.0.7
[v5.0.6]: https://github.com/cosmos/gaia/releases/tag/v5.0.6
[v5.0.5]: https://github.com/cosmos/gaia/releases/tag/v5.0.5
Expand Down
1 change: 1 addition & 0 deletions app/ante_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
Expand Down
22 changes: 17 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,12 +573,24 @@ func NewGaiaApp(
for moduleName := range app.mm.Modules {
fromVM[moduleName] = 1
}
// override versions for _new_ modules as to not skip InitGenesis
fromVM[authz.ModuleName] = 0
fromVM[feegrant.ModuleName] = 0
fromVM[routertypes.ModuleName] = 0
// delete new modules from the map, for _new_ modules as to not skip InitGenesis
delete(fromVM, authz.ModuleName)
delete(fromVM, feegrant.ModuleName)
delete(fromVM, routertypes.ModuleName)

// make fromVM[authtypes.ModuleName] = 2 to skip the first RunMigrations for auth (because from version 2 to migration version 2 will not migrate)
fromVM[authtypes.ModuleName] = 2

// the first RunMigrations, which will migrate all the old modules except auth module
newVM, err := app.mm.RunMigrations(ctx, app.configurator, fromVM)
if err != nil {
return nil, err
}
// now update auth version back to 1, to make the second RunMigrations includes only auth
newVM[authtypes.ModuleName] = 1

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
// RunMigrations twice is just a way to make auth module's migrates after staking
return app.mm.RunMigrations(ctx, app.configurator, newVM)
},
)

Expand Down

0 comments on commit 6ed5b73

Please sign in to comment.