From 9e75d78bd6adc490acee869ac98217a1623a9c6d Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Tue, 20 Aug 2024 12:29:36 +0200 Subject: [PATCH] chore: remove ibc, ibc-middleware, ica and ics --- ante/ante.go | 9 -- app/app.go | 8 -- app/app_helpers.go | 56 ---------- app/keepers/keepers.go | 186 +++---------------------------- app/keepers/keys.go | 11 -- app/modules.go | 54 +-------- go.mod | 12 +- go.sum | 14 --- tests/e2e/chain.go | 3 - tests/e2e/e2e_query_exec_test.go | 47 -------- tests/e2e/genesis.go | 45 -------- 11 files changed, 21 insertions(+), 424 deletions(-) delete mode 100644 app/app_helpers.go delete mode 100644 tests/e2e/e2e_query_exec_test.go diff --git a/ante/ante.go b/ante/ante.go index 5696b989..932f77ee 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,9 +1,6 @@ package ante import ( - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" @@ -19,7 +16,6 @@ import ( type HandlerOptions struct { ante.HandlerOptions Codec codec.BinaryCodec - IBCkeeper *ibckeeper.Keeper StakingKeeper *stakingkeeper.Keeper TxFeeChecker ante.TxFeeChecker } @@ -34,10 +30,6 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.SignModeHandler == nil { return nil, errorsmod.Wrap(atomoneerrors.ErrLogic, "sign mode handler is required for AnteHandler") } - if opts.IBCkeeper == nil { - return nil, errorsmod.Wrap(atomoneerrors.ErrLogic, "IBC keeper is required for AnteHandler") - } - if opts.StakingKeeper == nil { return nil, errorsmod.Wrap(atomoneerrors.ErrNotFound, "staking param store is required for AnteHandler") } @@ -60,7 +52,6 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler), ante.NewIncrementSequenceDecorator(opts.AccountKeeper), - ibcante.NewRedundantRelayDecorator(opts.IBCkeeper), } return sdk.ChainAnteDecorators(anteDecorators...), nil diff --git a/app/app.go b/app/app.go index ce526ef9..060bcd86 100644 --- a/app/app.go +++ b/app/app.go @@ -20,9 +20,6 @@ import ( "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" errorsmod "cosmossdk.io/errors" @@ -67,7 +64,6 @@ var ( var ( _ runtime.AppI = (*AtomOneApp)(nil) _ servertypes.Application = (*AtomOneApp)(nil) - _ ibctesting.TestingApp = (*AtomOneApp)(nil) ) // AtomOneApp extends an ABCI application, but with most of its parameters exported. @@ -222,7 +218,6 @@ func NewAtomOneApp( SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, Codec: appCodec, - IBCkeeper: app.IBCKeeper, StakingKeeper: app.StakingKeeper, // If TxFeeChecker is nil the default ante TxFeeChecker is used TxFeeChecker: nil, @@ -295,9 +290,6 @@ func (app *AtomOneApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) ma // remove module accounts that are ALLOWED to received funds delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - // Remove the ConsumerRewardsPool from the group of blocked recipient addresses in bank - delete(modAccAddrs, authtypes.NewModuleAddress(providertypes.ConsumerRewardsPool).String()) - return modAccAddrs } diff --git a/app/app_helpers.go b/app/app_helpers.go deleted file mode 100644 index 0343f6f9..00000000 --- a/app/app_helpers.go +++ /dev/null @@ -1,56 +0,0 @@ -package atomone - -import ( - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" - icstest "github.com/cosmos/interchain-security/v3/testutil/integration" - ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" - - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" -) - -// ProviderApp interface implementations for icstest tests - -// GetProviderKeeper implements the ProviderApp interface. -func (app *AtomOneApp) GetProviderKeeper() ibcproviderkeeper.Keeper { //nolint:nolintlint - return app.ProviderKeeper -} - -// GetStakingKeeper implements the TestingApp interface. Needed for ICS. -func (app *AtomOneApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { //nolint:nolintlint - return app.StakingKeeper -} - -// GetIBCKeeper implements the TestingApp interface. -func (app *AtomOneApp) GetIBCKeeper() *ibckeeper.Keeper { //nolint:nolintlint - return app.IBCKeeper -} - -// GetScopedIBCKeeper implements the TestingApp interface. -func (app *AtomOneApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { //nolint:nolintlint - return app.ScopedIBCKeeper -} - -// GetTestStakingKeeper implements the ProviderApp interface. -func (app *AtomOneApp) GetTestStakingKeeper() icstest.TestStakingKeeper { //nolint:nolintlint - return app.StakingKeeper -} - -// GetTestBankKeeper implements the ProviderApp interface. -func (app *AtomOneApp) GetTestBankKeeper() icstest.TestBankKeeper { //nolint:nolintlint - return app.BankKeeper -} - -// GetTestSlashingKeeper implements the ProviderApp interface. -func (app *AtomOneApp) GetTestSlashingKeeper() icstest.TestSlashingKeeper { //nolint:nolintlint - return app.SlashingKeeper -} - -// GetTestDistributionKeeper implements the ProviderApp interface. -func (app *AtomOneApp) GetTestDistributionKeeper() icstest.TestDistributionKeeper { //nolint:nolintlint - return app.DistrKeeper -} - -func (app *AtomOneApp) GetTestAccountKeeper() icstest.TestAccountKeeper { //nolint:nolintlint - return app.AccountKeeper -} diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index a642e98e..3953c389 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -8,26 +8,6 @@ import ( "github.com/cometbft/cometbft/libs/log" - pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" - pfmrouterkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" - pfmroutertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -77,42 +57,21 @@ type AppKeepers struct { memKeys map[string]*storetypes.MemoryStoreKey // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.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 - // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - IBCKeeper *ibckeeper.Keeper - ICAHostKeeper icahostkeeper.Keeper + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.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 EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper AuthzKeeper authzkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper - - // ICS - ProviderKeeper ibcproviderkeeper.Keeper - - PFMRouterKeeper *pfmrouterkeeper.Keeper - - // Modules - ICAModule ica.AppModule - TransferModule transfer.AppModule - PFMRouterModule pfmrouter.AppModule - ProviderModule ibcprovider.AppModule - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedIBCProviderKeeper capabilitykeeper.ScopedKeeper } func NewAppKeeper( @@ -160,17 +119,13 @@ func NewAppKeeper( bApp.SetParamStore(&appKeepers.ConsensusParamsKeeper) // add capability keeper and ScopeToModule for ibc module + // TODO remove if no IBC ? appKeepers.CapabilityKeeper = capabilitykeeper.NewKeeper( appCodec, appKeepers.keys[capabilitytypes.StoreKey], appKeepers.memKeys[capabilitytypes.MemStoreKey], ) - appKeepers.ScopedIBCKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) - appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - appKeepers.ScopedIBCProviderKeeper = appKeepers.CapabilityKeeper.ScopeToModule(providertypes.ModuleName) - // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating // their scoped modules in `NewApp` with `ScopeToModule` appKeepers.CapabilityKeeper.Seal() @@ -257,7 +212,6 @@ func NewAppKeeper( stakingtypes.NewMultiStakingHooks( appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks(), - appKeepers.ProviderKeeper.Hooks(), ), ) @@ -271,16 +225,6 @@ func NewAppKeeper( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // UpgradeKeeper must be created before IBCKeeper - appKeepers.IBCKeeper = ibckeeper.NewKeeper( - appCodec, - appKeepers.keys[ibcexported.StoreKey], - appKeepers.GetSubspace(ibcexported.ModuleName), - appKeepers.StakingKeeper, - appKeepers.UpgradeKeeper, - appKeepers.ScopedIBCKeeper, - ) - // provider depends on gov, so gov must be registered first govConfig := govtypes.DefaultConfig() // set the MaxMetadataLen for proposals to the same value as it was pre-sdk v0.47.x @@ -295,47 +239,23 @@ func NewAppKeeper( govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - appKeepers.ProviderKeeper = ibcproviderkeeper.NewKeeper( - appCodec, - appKeepers.keys[providertypes.StoreKey], - appKeepers.GetSubspace(providertypes.ModuleName), - appKeepers.ScopedIBCProviderKeeper, - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, - appKeepers.IBCKeeper.ConnectionKeeper, - appKeepers.IBCKeeper.ClientKeeper, - appKeepers.StakingKeeper, - appKeepers.SlashingKeeper, - appKeepers.AccountKeeper, - appKeepers.DistrKeeper, - appKeepers.BankKeeper, - appKeepers.GovKeeper, - authtypes.FeeCollectorName, - ) - - appKeepers.ProviderModule = ibcprovider.NewAppModule(&appKeepers.ProviderKeeper, appKeepers.GetSubspace(providertypes.ModuleName)) // Register the proposal types // Deprecated: Avoid adding new handlers, instead use the new proposal flow // by granting the governance module the right to execute the message. // See: https://docs.cosmos.network/main/modules/gov#proposal-messages + // + // TODO(tb): remove completely govRouter and rely only on proposals that + // embed sdk.Msg ? govRouter := govv1beta1.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)). - AddRoute(providertypes.RouterKey, ibcprovider.NewProviderProposalHandler(appKeepers.ProviderKeeper)) + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)) // Set legacy router for backwards compatibility with gov v1beta1 appKeepers.GovKeeper.SetLegacyRouter(govRouter) - appKeepers.GovKeeper = appKeepers.GovKeeper.SetHooks( - govtypes.NewMultiGovHooks( - appKeepers.ProviderKeeper.Hooks(), - ), - ) - evidenceKeeper := evidencekeeper.NewKeeper( appCodec, appKeepers.keys[evidencetypes.StoreKey], @@ -345,75 +265,6 @@ func NewAppKeeper( // If evidence needs to be handled for the app, set routes in router here and seal appKeepers.EvidenceKeeper = *evidenceKeeper - // ICA Host keeper - appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, - appKeepers.keys[icahosttypes.StoreKey], - appKeepers.GetSubspace(icahosttypes.SubModuleName), - appKeepers.IBCKeeper.ChannelKeeper, // ICS4Wrapper - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, - appKeepers.AccountKeeper, - appKeepers.ScopedICAHostKeeper, - bApp.MsgServiceRouter(), - ) - - // PFMRouterKeeper must be created before TransferKeeper - authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() - appKeepers.PFMRouterKeeper = pfmrouterkeeper.NewKeeper( - appCodec, - appKeepers.keys[pfmroutertypes.StoreKey], - nil, // Will be zero-value here. Reference is set later on with SetTransferKeeper. - appKeepers.IBCKeeper.ChannelKeeper, - appKeepers.DistrKeeper, - appKeepers.BankKeeper, - appKeepers.IBCKeeper.ChannelKeeper, - authority, - ) - - appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, - appKeepers.keys[ibctransfertypes.StoreKey], - appKeepers.GetSubspace(ibctransfertypes.ModuleName), - appKeepers.PFMRouterKeeper, // ISC4 Wrapper: PFM Router middleware - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, - appKeepers.AccountKeeper, - appKeepers.BankKeeper, - appKeepers.ScopedTransferKeeper, - ) - // Must be called on PFMRouter AFTER TransferKeeper initialized - appKeepers.PFMRouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) - - // Middleware Stacks - appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper) - appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper) - appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper, appKeepers.GetSubspace(pfmroutertypes.ModuleName)) - - // create IBC module from bottom to top of stack - var transferStack porttypes.IBCModule - transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper) - transferStack = pfmrouter.NewIBCMiddleware( - transferStack, - appKeepers.PFMRouterKeeper, - 0, - pfmrouterkeeper.DefaultForwardTransferPacketTimeoutTimestamp, - pfmrouterkeeper.DefaultRefundTransferPacketTimeoutTimestamp, - ) - - // Add transfer stack to IBC Router - - // Create Interchain Accounts Stack - var icaHostStack porttypes.IBCModule = icahost.NewIBCModule(appKeepers.ICAHostKeeper) - - // Create IBC Router & seal - ibcRouter := porttypes.NewRouter(). - AddRoute(icahosttypes.SubModuleName, icaHostStack). - AddRoute(ibctransfertypes.ModuleName, transferStack). - AddRoute(providertypes.ModuleName, appKeepers.ProviderModule) - - appKeepers.IBCKeeper.SetRouter(ibcRouter) - return appKeepers } @@ -439,11 +290,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019 - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibcexported.ModuleName) - paramsKeeper.Subspace(icahosttypes.SubModuleName) - paramsKeeper.Subspace(pfmroutertypes.ModuleName).WithKeyTable(pfmroutertypes.ParamKeyTable()) - paramsKeeper.Subspace(providertypes.ModuleName) return paramsKeeper } diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 5996f243..9ce492e3 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -1,12 +1,6 @@ package keepers import ( - routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -39,16 +33,11 @@ func (appKeepers *AppKeepers) GenerateKeys() { slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, - ibcexported.StoreKey, upgradetypes.StoreKey, evidencetypes.StoreKey, - ibctransfertypes.StoreKey, - icahosttypes.StoreKey, capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, - routertypes.StoreKey, - providertypes.StoreKey, consensusparamtypes.StoreKey, ) diff --git a/app/modules.go b/app/modules.go index 40e74be3..10de2dc2 100644 --- a/app/modules.go +++ b/app/modules.go @@ -1,21 +1,6 @@ package atomone import ( - pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" - pfmroutertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - icsprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - icsproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -64,14 +49,11 @@ import ( var maccPerms = map[string][]string{ authtypes.FeeCollectorName: nil, distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, minttypes.ModuleName: {authtypes.Minter}, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, // liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - providertypes.ConsumerRewardsPool: nil, } // ModuleBasics defines the module BasicManager is in charge of setting up basic, @@ -86,15 +68,11 @@ var ModuleBasics = module.NewBasicManager( mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( + // TODO remove since no compat needed with old gov handler system? []govclient.ProposalHandler{ paramsclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - icsproviderclient.ConsumerAdditionProposalHandler, - icsproviderclient.ConsumerRemovalProposalHandler, - icsproviderclient.ChangeRewardDenomsProposalHandler, }, ), sdkparams.AppModuleBasic{}, @@ -102,15 +80,9 @@ var ModuleBasics = module.NewBasicManager( slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, - ibc.AppModuleBasic{}, - ibctm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - pfmrouter.AppModuleBasic{}, - ica.AppModuleBasic{}, - icsprovider.AppModuleBasic{}, consensus.AppModuleBasic{}, metaprotocols.AppModuleBasic{}, ) @@ -143,13 +115,8 @@ func appModules( evidence.NewAppModule(app.EvidenceKeeper), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - ibc.NewAppModule(app.IBCKeeper), sdkparams.NewAppModule(app.ParamsKeeper), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), - app.TransferModule, - app.ICAModule, - app.PFMRouterModule, - app.ProviderModule, metaprotocols.NewAppModule(), } } @@ -176,10 +143,6 @@ func simulationModules( sdkparams.NewAppModule(app.ParamsKeeper), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - ibc.NewAppModule(app.IBCKeeper), - app.TransferModule, - app.ICAModule, - app.ProviderModule, } } @@ -209,16 +172,11 @@ func orderBeginBlockers() []string { banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, - ibcexported.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - pfmroutertypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, - providertypes.ModuleName, consensusparamtypes.ModuleName, metaprotocolstypes.ModuleName, } @@ -237,10 +195,6 @@ func orderEndBlockers() []string { crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, - ibcexported.ModuleName, - ibctransfertypes.ModuleName, - icatypes.ModuleName, - pfmroutertypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -254,7 +208,6 @@ func orderEndBlockers() []string { paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - providertypes.ModuleName, consensusparamtypes.ModuleName, metaprotocolstypes.ModuleName, } @@ -280,17 +233,12 @@ func orderInitBlockers() []string { minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, - ibctransfertypes.ModuleName, - ibcexported.ModuleName, - icatypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, - pfmroutertypes.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - providertypes.ModuleName, consensusparamtypes.ModuleName, metaprotocolstypes.ModuleName, } diff --git a/go.mod b/go.mod index de7cd9c2..ff42852f 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,6 @@ require ( github.com/cosmos/cosmos-sdk v0.47.10 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b - github.com/cosmos/ibc-go/v7 v7.3.2 - github.com/cosmos/interchain-security/v3 v3.3.0 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 github.com/ory/dockertest/v3 v3.10.0 @@ -25,7 +22,6 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 ) require ( @@ -34,11 +30,11 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.5 // indirect cloud.google.com/go/storage v1.30.1 // indirect - github.com/golang/protobuf v1.5.3 + github.com/golang/protobuf v1.5.3 // indirect // github.com/gravity-devs/liquidity v1.6.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/grpc v1.60.1 + google.golang.org/grpc v1.60.1 // indirect ) require ( @@ -75,7 +71,6 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.1 // indirect - github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect @@ -126,12 +121,12 @@ require ( github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect - github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -202,6 +197,7 @@ require ( golang.org/x/tools v0.7.0 // indirect google.golang.org/api v0.149.0 // indirect google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index af9012cf..bb3547d7 100644 --- a/go.sum +++ b/go.sum @@ -408,14 +408,6 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b h1:VwhHRRIPdMshBMb2TP7xrkY4Ee8CJWsHZvucYeJ56no= -github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.3-0.20240228213828-cce7f56d000b/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= -github.com/cosmos/ibc-go/v7 v7.3.2 h1:FeUDcBX7VYY0e0iRmcVkPPUjYfAqIc//QuHXo8JHz9c= -github.com/cosmos/ibc-go/v7 v7.3.2/go.mod h1:IMeOXb7gwpZ+/nOG5BuUkdW4weM1ezvN4PQPws4uzOI= -github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= -github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/interchain-security/v3 v3.3.3-lsm h1:xcOcMBFSC5TEK6W7Y4el4F6JsjYJLLsB7gLwA7zkZ2Q= -github.com/cosmos/interchain-security/v3 v3.3.3-lsm/go.mod h1:CkPCAlk6xSHyUO6nUrzz+HLqrfpnBHMQIJHVo6YuhLo= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= @@ -803,8 +795,6 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= -github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -1027,8 +1017,6 @@ github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4 github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= -github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 h1:WPEclU0y0PMwUzdDcaKZvld4aXpa3fkzjiUMQdcBEHg= -github.com/oxyno-zeta/gomock-extra-matcher v1.2.0/go.mod h1:S0r7HmKeCGsHmvIVFMjKWwswb4+30nCNWbXRMBVPkaU= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1271,8 +1259,6 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= -go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 77011224..03178f30 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -6,8 +6,6 @@ import ( tmrand "github.com/cometbft/cometbft/libs/rand" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -53,7 +51,6 @@ func init() { upgradetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) distribtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) - providertypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) metaprotocoltypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) cdc = encodingConfig.Marshaler diff --git a/tests/e2e/e2e_query_exec_test.go b/tests/e2e/e2e_query_exec_test.go deleted file mode 100644 index 6834bd1f..00000000 --- a/tests/e2e/e2e_query_exec_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package e2e - -import ( - "context" - "fmt" - "time" - - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - - "github.com/cosmos/cosmos-sdk/client/flags" -) - -func (s *IntegrationTestSuite) execQueryConsumerChains( - c *chain, - valIdx int, - homePath string, - queryValidation func(res ccvtypes.QueryConsumerChainsResponse, consumerChainId string) bool, - consumerChainID string, -) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Querying consumer chains for chain: %s", c.id) - atomoneCommand := []string{ - atomonedBinary, - "query", - "provider", - "list-consumer-chains", - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), - "--output=json", - } - - s.executeAtomoneTxCommand(ctx, c, atomoneCommand, valIdx, s.validateQueryConsumers(queryValidation, consumerChainID)) - s.T().Logf("Successfully queried consumer chains for chain %s", c.id) -} - -func (s *IntegrationTestSuite) validateQueryConsumers(queryValidation func(ccvtypes.QueryConsumerChainsResponse, string) bool, consumerChainID string) func([]byte, []byte) bool { - return func(stdOut []byte, stdErr []byte) bool { - var queryConsumersRes ccvtypes.QueryConsumerChainsResponse - if err := cdc.UnmarshalJSON(stdOut, &queryConsumersRes); err != nil { - s.T().Logf("Error unmarshalling query consumer chains: %s", err.Error()) - return false - } - return queryValidation(queryConsumersRes, consumerChainID) - } -} diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 74a4b85b..1e1793b2 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -8,9 +8,6 @@ import ( tmtypes "github.com/cometbft/cometbft/types" - icagen "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/genesis/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -116,48 +113,6 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, gl } appState[banktypes.ModuleName] = bankGenStateBz - // add ica host allowed msg types - var icaGenesisState icagen.GenesisState - - if appState[icatypes.ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[icatypes.ModuleName], &icaGenesisState) - } - - icaGenesisState.HostGenesisState.Params.AllowMessages = []string{ - "/cosmos.authz.v1beta1.MsgExec", - "/cosmos.authz.v1beta1.MsgGrant", - "/cosmos.authz.v1beta1.MsgRevoke", - "/cosmos.bank.v1beta1.MsgSend", - "/cosmos.bank.v1beta1.MsgMultiSend", - "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", - "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "/cosmos.distribution.v1beta1.MsgFundCommunityPool", - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "/cosmos.feegrant.v1beta1.MsgGrantAllowance", - "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", - "/cosmos.gov.v1beta1.MsgVoteWeighted", - "/cosmos.gov.v1beta1.MsgSubmitProposal", - "/cosmos.gov.v1beta1.MsgDeposit", - "/cosmos.gov.v1beta1.MsgVote", - "/cosmos.staking.v1beta1.MsgEditValidator", - "/cosmos.staking.v1beta1.MsgDelegate", - "/cosmos.staking.v1beta1.MsgUndelegate", - "/cosmos.staking.v1beta1.MsgBeginRedelegate", - "/cosmos.staking.v1beta1.MsgCreateValidator", - "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", - "/ibc.applications.transfer.v1.MsgTransfer", - "/tendermint.liquidity.v1beta1.MsgCreatePool", - "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch", - "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch", - "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch", - } - - icaGenesisStateBz, err := cdc.MarshalJSON(&icaGenesisState) - if err != nil { - return fmt.Errorf("failed to marshal interchain accounts genesis state: %w", err) - } - appState[icatypes.ModuleName] = icaGenesisStateBz - stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) stakingGenState.Params.BondDenom = denom stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState)