From 90070005bf1ee7cd4569fbc4c35535c6c6c82e0d Mon Sep 17 00:00:00 2001 From: Dheeraj Dubey Date: Thu, 7 Jul 2022 01:26:55 +0530 Subject: [PATCH] remove ica module from this release --- app/app.go | 77 +++++++++++++------------ app/upgrades/testnet/v2_0_0/upgrades.go | 21 +++---- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/app/app.go b/app/app.go index 98b371748..a157d164c 100644 --- a/app/app.go +++ b/app/app.go @@ -3,11 +3,11 @@ package app import ( "fmt" - ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" + /*ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" icahost "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host" icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" + icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"*/ "io" "os" @@ -253,7 +253,7 @@ var ( wasm.AppModuleBasic{}, liquidity.AppModuleBasic{}, rewards.AppModuleBasic{}, - ica.AppModuleBasic{}, + //ica.AppModuleBasic{}, ) ) @@ -289,21 +289,21 @@ type App struct { mkeys map[string]*sdk.MemoryStoreKey // keepers - AccountKeeper authkeeper.AccountKeeper - FeegrantKeeper feegrantkeeper.Keeper - BankKeeper bankkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IbcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - ICAHostKeeper *icahostkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + FeegrantKeeper feegrantkeeper.Keeper + BankKeeper bankkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + CrisisKeeper crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + IbcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + //ICAHostKeeper *icahostkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper IbcTransferKeeper ibctransferkeeper.Keeper @@ -312,7 +312,7 @@ type App struct { ScopedIBCTransferKeeper capabilitykeeper.ScopedKeeper ScopedIBCOracleKeeper capabilitykeeper.ScopedKeeper ScopedBandoracleKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + //ScopedICAHostKeeper capabilitykeeper.ScopedKeeper BandoracleKeeper bandoraclemodulekeeper.Keeper AssetKeeper assetkeeper.Keeper @@ -359,7 +359,7 @@ func New( keys = sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, icahosttypes.StoreKey, upgradetypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey /*icahosttypes.StoreKey,*/, upgradetypes.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, vaulttypes.StoreKey, assettypes.StoreKey, collectortypes.StoreKey, liquidationtypes.StoreKey, markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey, @@ -403,7 +403,7 @@ func New( app.ParamsKeeper.Subspace(crisistypes.ModuleName) app.ParamsKeeper.Subspace(ibctransfertypes.ModuleName) app.ParamsKeeper.Subspace(ibchost.ModuleName) - app.ParamsKeeper.Subspace(icahosttypes.SubModuleName) + //app.ParamsKeeper.Subspace(icahosttypes.SubModuleName) app.ParamsKeeper.Subspace(vaulttypes.ModuleName) app.ParamsKeeper.Subspace(assettypes.ModuleName) app.ParamsKeeper.Subspace(collectortypes.ModuleName) @@ -435,11 +435,11 @@ func New( // grant capabilities for the ibc and ibc-transfer modules var ( - scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - scopedIBCOracleKeeper = app.CapabilityKeeper.ScopeToModule(markettypes.ModuleName) - scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) - scopedICAHostKeeper = app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedIBCOracleKeeper = app.CapabilityKeeper.ScopeToModule(markettypes.ModuleName) + scopedWasmKeeper = app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + //scopedICAHostKeeper = app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) scopedBandoracleKeeper = app.CapabilityKeeper.ScopeToModule(bandoraclemoduletypes.ModuleName) ) @@ -529,7 +529,7 @@ func New( scopedIBCKeeper, ) - icaHostKeeper := icahostkeeper.NewKeeper( + /*icaHostKeeper := icahostkeeper.NewKeeper( appCodec, app.keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), app.IbcKeeper.ChannelKeeper, @@ -540,7 +540,7 @@ func New( ) app.ICAHostKeeper = &icaHostKeeper - icaHostIBCModule := icahost.NewIBCModule(*app.ICAHostKeeper) + icaHostIBCModule := icahost.NewIBCModule(*app.ICAHostKeeper)*/ app.AssetKeeper = assetkeeper.NewKeeper( app.cdc, app.keys[assettypes.StoreKey], @@ -776,7 +776,7 @@ func New( ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) ibcRouter.AddRoute(bandoraclemoduletypes.ModuleName, bandOracleIBCModule) ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IbcKeeper.ChannelKeeper)) - ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) + //ibcRouter.AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) app.IbcKeeper.SetRouter(ibcRouter) // Create evidence Keeper for to register the IBC light client misbehaviour evidence route app.EvidenceKeeper = *evidencekeeper.NewKeeper( @@ -812,7 +812,7 @@ func New( evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(app.cdc, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), ibc.NewAppModule(app.IbcKeeper), - ica.NewAppModule(nil, app.ICAHostKeeper), + //ica.NewAppModule(nil, app.ICAHostKeeper), params.NewAppModule(app.ParamsKeeper), transferModule, asset.NewAppModule(app.cdc, app.AssetKeeper), @@ -837,7 +837,7 @@ func New( // NOTE: staking module is required if HistoricalEntries param > 0 app.mm.SetOrderBeginBlockers( upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, - evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, + evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, /* icatypes.ModuleName,*/ bandoraclemoduletypes.ModuleName, markettypes.ModuleName, lockertypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, authtypes.ModuleName, capabilitytypes.ModuleName, authz.ModuleName, transferModule.Name(), assettypes.ModuleName, collectortypes.ModuleName, vaulttypes.ModuleName, @@ -850,7 +850,7 @@ func New( crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, minttypes.ModuleName, bandoraclemoduletypes.ModuleName, markettypes.ModuleName, lockertypes.ModuleName, distrtypes.ModuleName, genutiltypes.ModuleName, vesting.AppModuleBasic{}.Name(), evidencetypes.ModuleName, ibchost.ModuleName, - icatypes.ModuleName, vaulttypes.ModuleName, liquidationtypes.ModuleName, auctiontypes.ModuleName, tokenminttypes.ModuleName, + /*icatypes.ModuleName,*/ vaulttypes.ModuleName, liquidationtypes.ModuleName, auctiontypes.ModuleName, tokenminttypes.ModuleName, wasmtypes.ModuleName, authtypes.ModuleName, slashingtypes.ModuleName, authz.ModuleName, paramstypes.ModuleName, capabilitytypes.ModuleName, upgradetypes.ModuleName, transferModule.Name(), lendtypes.ModuleName, assettypes.ModuleName, collectortypes.ModuleName, banktypes.ModuleName, rewardstypes.ModuleName, liquiditytypes.ModuleName, esmtypes.ModuleName, @@ -872,7 +872,7 @@ func New( minttypes.ModuleName, crisistypes.ModuleName, ibchost.ModuleName, - icatypes.ModuleName, + //icatypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, ibctransfertypes.ModuleName, @@ -943,6 +943,10 @@ func New( // Note that since this reads from the store, we can only perform it when // `loadLatest` is set to true. ctx := app.BaseApp.NewUncachedContext(true, tmprototypes.Header{}) + + if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) + } app.CapabilityKeeper.InitMemStore(ctx) app.CapabilityKeeper.Seal() } @@ -950,10 +954,11 @@ func New( app.ScopedIBCKeeper = scopedIBCKeeper app.ScopedIBCTransferKeeper = scopedTransferKeeper app.ScopedIBCOracleKeeper = scopedIBCOracleKeeper - app.ScopedICAHostKeeper = scopedICAHostKeeper + //app.ScopedICAHostKeeper = scopedICAHostKeeper app.ScopedBandoracleKeeper = scopedBandoracleKeeper app.ScopedWasmKeeper = scopedWasmKeeper + return app } @@ -1095,7 +1100,7 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { wasm.ModuleName: {authtypes.Burner}, liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - icatypes.ModuleName: nil, + //icatypes.ModuleName: nil, } } @@ -1145,7 +1150,7 @@ func (a *App) registerUpgradeHandlers() { tokenminttypes.ModuleName, vaulttypes.ModuleName, feegrant.ModuleName, - icahosttypes.StoreKey, + //icahosttypes.StoreKey, }, } } diff --git a/app/upgrades/testnet/v2_0_0/upgrades.go b/app/upgrades/testnet/v2_0_0/upgrades.go index f6f1e15f2..21ca728f9 100644 --- a/app/upgrades/testnet/v2_0_0/upgrades.go +++ b/app/upgrades/testnet/v2_0_0/upgrades.go @@ -3,16 +3,7 @@ package v2_0_0 import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/x/authz" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" ) // CreateUpgradeHandler creates an SDK upgrade handler for v2_0_0 @@ -21,13 +12,16 @@ func CreateUpgradeHandler( configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - // Refs: + /*// Refs: // - https://docs.cosmos.network/master/building-modules/upgrade.html#registering-migrations // - https://docs.cosmos.network/master/migrations/chain-upgrade-guide-044.html#chain-upgrade // Add Interchain Accounts host module // set the ICS27 consensus version so InitGenesis is not run - fromVM[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion() + //fromVM[icatypes.ModuleName] = mm.Modules[icatypes.ModuleName].ConsensusVersion() + + // save oldIcaVersion, so we can skip icahost.InitModule in longer term tests. + oldIcaVersion := fromVM[icatypes.ModuleName] // create ICS27 Controller submodule params, controller module not enabled. controllerParams := icacontrollertypes.Params{} @@ -60,7 +54,10 @@ func CreateUpgradeHandler( if !correctTypecast { panic("mm.Modules[icatypes.ModuleName] is not of type ica.AppModule") } - icamodule.InitModule(ctx, controllerParams, hostParams) + // skip InitModule in upgrade tests after the upgrade has gone through. + if oldIcaVersion != fromVM[icatypes.ModuleName] { + icamodule.InitModule(ctx, controllerParams, hostParams) + }*/ newVM, err := mm.RunMigrations(ctx, configurator, fromVM)