Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gaia v6.0.0-rc2 #979

Merged
merged 24 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v2.5.2
version: v1.42.1
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

* (gaia) Bump [Liquidity](https://github.com/Gravity-Devs/liquidity) module to [v1.4.1](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.1). See the [CHANGELOG.md](https://github.com/Gravity-Devs/liquidity/blob/v1.4.1/CHANGELOG.md#v141---20211025) for details.

## [6.0.0] - 2021-09-17

Expand Down
20 changes: 17 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ import (
dbm "github.com/tendermint/tm-db"

gaiaappparams "github.com/cosmos/gaia/v6/app/params"
"github.com/strangelove-ventures/packet-forward-middleware/router"
routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/router/keeper"
routertypes "github.com/strangelove-ventures/packet-forward-middleware/router/types"

// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
)
Expand Down Expand Up @@ -140,6 +144,7 @@ var (
transfer.AppModuleBasic{},
vesting.AppModuleBasic{},
liquidity.AppModuleBasic{},
router.AppModuleBasic{},
)

// module account permissions
Expand Down Expand Up @@ -194,6 +199,7 @@ type GaiaApp struct { // nolint: golint
FeeGrantKeeper feegrantkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
LiquidityKeeper liquiditykeeper.Keeper
RouterKeeper routerkeeper.Keeper

// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -243,7 +249,7 @@ func NewGaiaApp(
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, liquiditytypes.StoreKey, ibctransfertypes.StoreKey,
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey,
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, routertypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -402,9 +408,12 @@ func NewGaiaApp(
)
transferModule := transfer.NewAppModule(app.TransferKeeper)

app.RouterKeeper = routerkeeper.NewKeeper(appCodec, keys[routertypes.StoreKey], app.GetSubspace(routertypes.ModuleName), app.TransferKeeper, app.DistrKeeper)

routerModule := router.NewAppModule(app.RouterKeeper, transferModule)
// create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
ibcRouter.AddRoute(ibctransfertypes.ModuleName, routerModule)
app.IBCKeeper.SetRouter(ibcRouter)

// create evidence keeper with router
Expand Down Expand Up @@ -446,6 +455,7 @@ func NewGaiaApp(
params.NewAppModule(app.ParamsKeeper),
liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper),
transferModule,
routerModule,
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -462,6 +472,7 @@ func NewGaiaApp(
stakingtypes.ModuleName,
liquiditytypes.ModuleName,
ibchost.ModuleName,
routertypes.ModuleName,
)
app.mm.SetOrderEndBlockers(
crisistypes.ModuleName,
Expand Down Expand Up @@ -494,6 +505,7 @@ func NewGaiaApp(
ibctransfertypes.ModuleName,
feegrant.ModuleName,
authz.ModuleName,
routertypes.ModuleName,
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
Expand Down Expand Up @@ -564,6 +576,7 @@ func NewGaiaApp(
// override versions for _new_ modules as to not skip InitGenesis
fromVM[authz.ModuleName] = 0
fromVM[feegrant.ModuleName] = 0
fromVM[routertypes.ModuleName] = 0

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
Expand All @@ -576,7 +589,7 @@ func NewGaiaApp(

if upgradeInfo.Name == upgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := store.StoreUpgrades{
Added: []string{authz.ModuleName, feegrant.ModuleName},
Added: []string{authz.ModuleName, feegrant.ModuleName, routertypes.ModuleName},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
Expand Down Expand Up @@ -757,6 +770,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(liquiditytypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(routertypes.ModuleName).WithKeyTable(routertypes.ParamKeyTable())

return paramsKeeper
}
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
counter := int16(0)

for ; iter.Valid(); iter.Next() {
addr := sdk.ValAddress(iter.Key()[1:])
addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key()))
validator, found := app.StakingKeeper.GetValidator(ctx, addr)
if !found {
panic("expected validator, not found")
Expand Down
236 changes: 0 additions & 236 deletions app/migrate.go

This file was deleted.

Loading