From e4656093955578b2efa6e8c2ea8dd8823008bba3 Mon Sep 17 00:00:00 2001 From: insumity Date: Mon, 9 Sep 2024 12:18:41 +0200 Subject: [PATCH] fix!: add migration of non-legacy proposals (#3316) * init commit * Update app/upgrades/v20/upgrades.go Co-authored-by: Marius Poke * Update app/upgrades/v20/upgrades.go Co-authored-by: Marius Poke * Update app/upgrades/v20/upgrades.go Co-authored-by: Marius Poke * Update app/upgrades/v20/upgrades.go Co-authored-by: Marius Poke * small fixes; took into account comments * fix linter issues * bump ICS to v6 * fix linter * make format --------- Co-authored-by: Marius Poke --- app/app.go | 2 +- app/app_helpers.go | 4 +- app/keepers/keepers.go | 9 +- app/keepers/keys.go | 2 +- app/modules.go | 6 +- app/upgrades/v20/upgrades.go | 401 +++++++++++------- app/upgrades/v20/upgrades_test.go | 229 +++++++++- go.mod | 4 +- go.sum | 10 +- tests/e2e/chain.go | 2 +- tests/e2e/e2e_gov_test.go | 2 +- tests/e2e/query.go | 2 +- tests/integration/interchain_security_test.go | 8 +- 13 files changed, 509 insertions(+), 172 deletions(-) diff --git a/app/app.go b/app/app.go index 0dd09c22f1c..330488b080a 100644 --- a/app/app.go +++ b/app/app.go @@ -20,7 +20,7 @@ import ( dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/proto" ibctesting "github.com/cosmos/ibc-go/v8/testing" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" diff --git a/app/app_helpers.go b/app/app_helpers.go index 93303079707..1d056b43be1 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -4,8 +4,8 @@ import ( capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" - icstest "github.com/cosmos/interchain-security/v5/testutil/integration" - ibcproviderkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" + icstest "github.com/cosmos/interchain-security/v6/testutil/integration" + ibcproviderkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper" ) // ProviderApp interface implementations for icstest tests diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 781fb648c1f..a1e3310b64b 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -33,9 +33,9 @@ import ( porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" - icsprovider "github.com/cosmos/interchain-security/v5/x/ccv/provider" - icsproviderkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + icsprovider "github.com/cosmos/interchain-security/v6/x/ccv/provider" + icsproviderkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" @@ -376,8 +376,7 @@ func NewAppKeeper( govRouter := govv1beta1.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)). - AddRoute(providertypes.RouterKey, icsprovider.NewProviderProposalHandler(appKeepers.ProviderKeeper)) + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)) // Set legacy router for backwards compatibility with gov v1beta1 appKeepers.GovKeeper.SetLegacyRouter(govRouter) diff --git a/app/keepers/keys.go b/app/keepers/keys.go index c4d51b3bd74..e4cf9fe31fb 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -11,7 +11,7 @@ import ( ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" storetypes "cosmossdk.io/store/types" evidencetypes "cosmossdk.io/x/evidence/types" diff --git a/app/modules.go b/app/modules.go index d51acab9206..8afebc13489 100644 --- a/app/modules.go +++ b/app/modules.go @@ -15,9 +15,9 @@ import ( ibc "github.com/cosmos/ibc-go/v8/modules/core" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" - no_valupdates_genutil "github.com/cosmos/interchain-security/v5/x/ccv/no_valupdates_genutil" - no_valupdates_staking "github.com/cosmos/interchain-security/v5/x/ccv/no_valupdates_staking" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + no_valupdates_genutil "github.com/cosmos/interchain-security/v6/x/ccv/no_valupdates_genutil" + no_valupdates_staking "github.com/cosmos/interchain-security/v6/x/ccv/no_valupdates_staking" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" "cosmossdk.io/x/evidence" evidencetypes "cosmossdk.io/x/evidence/types" diff --git a/app/upgrades/v20/upgrades.go b/app/upgrades/v20/upgrades.go index 02b7b4b216f..15e43b63a05 100644 --- a/app/upgrades/v20/upgrades.go +++ b/app/upgrades/v20/upgrades.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" errorsmod "cosmossdk.io/errors" upgradetypes "cosmossdk.io/x/upgrade/types" @@ -14,8 +14,10 @@ import ( codec "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/gaia/v20/app/keepers" @@ -23,11 +25,11 @@ import ( // Constants for the new parameters in the v20 upgrade. const ( - // MaxValidators will be set to 200 (up from 180), + // NewMaxValidators will be set to 200 (up from 180), // to allow the first 20 inactive validators // to participate on consumer chains. NewMaxValidators = 200 - // MaxProviderConsensusValidators will be set to 180, + // NewMaxProviderConsensusValidators will be set to 180, // to preserve the behaviour of only the first 180 // validators participating in consensus on the Cosmos Hub. NewMaxProviderConsensusValidators = 180 @@ -67,11 +69,11 @@ func CreateUpgradeHandler( return vm, errorsmod.Wrapf(err, "initializing LastProviderConsensusValSet during migration") } - ctx.Logger().Info("Migrating ICS legacy proposals...") + ctx.Logger().Info("Migrating ICS proposals...") msgServer := providerkeeper.NewMsgServerImpl(&keepers.ProviderKeeper) - err = MigrateICSLegacyProposals(ctx, msgServer, keepers.ProviderKeeper, *keepers.GovKeeper) + err = MigrateICSProposals(ctx, msgServer, keepers.ProviderKeeper, *keepers.GovKeeper) if err != nil { - return vm, errorsmod.Wrapf(err, "migrating ICS legacy proposals during migration") + return vm, errorsmod.Wrapf(err, "migrating ICS proposals during migration") } ctx.Logger().Info("Setting ICS consumers metadata...") @@ -138,14 +140,13 @@ func InitializeLastProviderConsensusValidatorSet( lastValidators = append(lastValidators, consensusVal) } - providerKeeper.SetLastProviderConsensusValSet(ctx, lastValidators) - return nil + return providerKeeper.SetLastProviderConsensusValSet(ctx, lastValidators) } -// MigrateICSLegacyProposals migrates ICS legacy proposals -func MigrateICSLegacyProposals(ctx sdk.Context, msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper) error { - proposals := []govtypes.Proposal{} - err := govKeeper.Proposals.Walk(ctx, nil, func(key uint64, proposal govtypes.Proposal) (stop bool, err error) { +// MigrateICSProposals migrates ICS legacy proposals +func MigrateICSProposals(ctx sdk.Context, msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper) error { + proposals := []govtypesv1.Proposal{} + err := govKeeper.Proposals.Walk(ctx, nil, func(key uint64, proposal govtypesv1.Proposal) (stop bool, err error) { proposals = append(proposals, proposal) return false, nil // go through the entire collection }) @@ -153,7 +154,12 @@ func MigrateICSLegacyProposals(ctx sdk.Context, msgServer providertypes.MsgServe return errorsmod.Wrapf(err, "iterating through proposals") } for _, proposal := range proposals { - err := MigrateProposal(ctx, msgServer, providerKeeper, govKeeper, proposal) + err := MigrateICSLegacyProposal(ctx, msgServer, providerKeeper, govKeeper, proposal) + if err != nil { + return errorsmod.Wrapf(err, "migrating legacy proposal %d", proposal.Id) + } + + err = MigrateICSProposal(ctx, msgServer, providerKeeper, govKeeper, proposal) if err != nil { return errorsmod.Wrapf(err, "migrating proposal %d", proposal.Id) } @@ -161,18 +167,135 @@ func MigrateICSLegacyProposals(ctx sdk.Context, msgServer providertypes.MsgServe return nil } -// MigrateProposal migrates an ICS proposal -func MigrateProposal( +func ConsumerAdditionProposalToMsgConsumerAddition(proposal providertypes.ConsumerAdditionProposal) providertypes.MsgConsumerAddition { //nolint:staticcheck + return providertypes.MsgConsumerAddition{ //nolint:staticcheck + ChainId: proposal.ChainId, + InitialHeight: proposal.InitialHeight, + GenesisHash: proposal.GenesisHash, + BinaryHash: proposal.BinaryHash, + SpawnTime: proposal.SpawnTime, + UnbondingPeriod: proposal.UnbondingPeriod, + CcvTimeoutPeriod: proposal.CcvTimeoutPeriod, + TransferTimeoutPeriod: proposal.TransferTimeoutPeriod, + ConsumerRedistributionFraction: proposal.ConsumerRedistributionFraction, + BlocksPerDistributionTransmission: proposal.BlocksPerDistributionTransmission, + HistoricalEntries: proposal.HistoricalEntries, + DistributionTransmissionChannel: proposal.DistributionTransmissionChannel, + Top_N: proposal.Top_N, + ValidatorsPowerCap: proposal.ValidatorsPowerCap, + ValidatorSetCap: proposal.ValidatorSetCap, + Allowlist: proposal.Allowlist, + Denylist: proposal.Denylist, + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + MinStake: proposal.MinStake, + AllowInactiveVals: proposal.AllowInactiveVals, + } +} + +func ConsumerRemovalProposalToMsgConsumerRemoval(proposal providertypes.ConsumerRemovalProposal) providertypes.MsgConsumerRemoval { //nolint:staticcheck + return providertypes.MsgConsumerRemoval{ //nolint:staticcheck + ChainId: proposal.ChainId, + StopTime: proposal.StopTime, + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + } +} + +func ConsumerModificationProposalToMsgConsumerModification(proposal providertypes.ConsumerModificationProposal) providertypes.MsgConsumerModification { //nolint:staticcheck + return providertypes.MsgConsumerModification{ //nolint:staticcheck + Title: proposal.Title, + Description: proposal.Description, + ChainId: proposal.ChainId, + Top_N: proposal.Top_N, + ValidatorsPowerCap: proposal.ValidatorsPowerCap, + ValidatorSetCap: proposal.ValidatorSetCap, + Allowlist: proposal.Allowlist, + Denylist: proposal.Denylist, + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + MinStake: proposal.MinStake, + AllowInactiveVals: proposal.AllowInactiveVals, + } +} + +func ChangeRewardDenomsProposalToMsgChangeRewardDenoms(proposal providertypes.ChangeRewardDenomsProposal, authority string) providertypes.MsgChangeRewardDenoms { + return providertypes.MsgChangeRewardDenoms{ + DenomsToAdd: proposal.DenomsToAdd, + DenomsToRemove: proposal.DenomsToRemove, + Authority: authority, + } +} + +func MigrateICSProposal( ctx sdk.Context, msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper, - proposal govtypes.Proposal, + proposal govtypesv1.Proposal, ) error { // ignore proposals that were rejected or failed - if proposal.Status != govtypes.StatusDepositPeriod && - proposal.Status != govtypes.StatusVotingPeriod && - proposal.Status != govtypes.StatusPassed { + if proposal.Status != govtypesv1.StatusDepositPeriod && + proposal.Status != govtypesv1.StatusVotingPeriod && + proposal.Status != govtypesv1.StatusPassed { + return nil + } + + proposalMessages := proposal.GetMessages() + for index, proposalMsg := range proposalMessages { + switch msg := proposalMsg.GetCachedValue().(type) { + case *providertypes.MsgConsumerAddition: //nolint:staticcheck + err := MigrateMsgConsumerAddition( + ctx, + msgServer, + providerKeeper, + govKeeper, + proposal.Id, + *msg, + index, + ) + if err != nil { + return err + } + case *providertypes.MsgConsumerRemoval: //nolint:staticcheck + err := MigrateMsgConsumerRemoval( + ctx, + msgServer, + providerKeeper, + govKeeper, + proposal.Id, + *msg, + index, + ) + if err != nil { + return err + } + case *providertypes.MsgConsumerModification: //nolint:staticcheck + err := MigrateMsgConsumerModification( + ctx, + providerKeeper, + govKeeper, + proposal.Id, + *msg, + index, + ) + if err != nil { + return err + } + } + } + + return nil +} + +func MigrateICSLegacyProposal( + ctx sdk.Context, + msgServer providertypes.MsgServer, + providerKeeper providerkeeper.Keeper, + govKeeper govkeeper.Keeper, + proposal govtypesv1.Proposal, +) error { + // ignore proposals that were rejected or failed + if proposal.Status != govtypesv1.StatusDepositPeriod && + proposal.Status != govtypesv1.StatusVotingPeriod && + proposal.Status != govtypesv1.StatusPassed { return nil } @@ -185,73 +308,74 @@ func MigrateProposal( msg := messages[0] // ignore non-legacy proposals - sdkLegacyMsg, isLegacyProposal := msg.GetCachedValue().(*govtypes.MsgExecLegacyContent) + sdkLegacyMsg, isLegacyProposal := msg.GetCachedValue().(*govtypesv1.MsgExecLegacyContent) if !isLegacyProposal { return nil } - content, err := govtypes.LegacyContentFromMessage(sdkLegacyMsg) + content, err := govtypesv1.LegacyContentFromMessage(sdkLegacyMsg) if err != nil { return err } switch msg := content.(type) { - case *providertypes.ConsumerAdditionProposal: - return MigrateConsumerAdditionProposal( - ctx, + case *providertypes.ConsumerAdditionProposal: //nolint:staticcheck + return MigrateMsgConsumerAddition(ctx, msgServer, providerKeeper, govKeeper, - proposal, - msg, - ) + proposal.Id, + ConsumerAdditionProposalToMsgConsumerAddition(*msg), + 0) - case *providertypes.ConsumerRemovalProposal: - return MigrateConsumerRemovalProposal( + case *providertypes.ConsumerRemovalProposal: //nolint:staticcheck + return MigrateMsgConsumerRemoval( ctx, msgServer, providerKeeper, govKeeper, - proposal, - msg, + proposal.Id, + ConsumerRemovalProposalToMsgConsumerRemoval(*msg), + 0, ) - case *providertypes.ConsumerModificationProposal: - return MigrateConsumerModificationProposal( + case *providertypes.ConsumerModificationProposal: //nolint:staticcheck + return MigrateMsgConsumerModification( ctx, - msgServer, providerKeeper, govKeeper, - proposal, - msg, + proposal.Id, + ConsumerModificationProposalToMsgConsumerModification(*msg), + 0, ) case *providertypes.ChangeRewardDenomsProposal: - return MigrateChangeRewardDenomsProposal( + return MigrateMsgChangeRewardDenoms( ctx, - msgServer, - providerKeeper, govKeeper, - proposal, - msg, + proposal.Id, + ChangeRewardDenomsProposalToMsgChangeRewardDenoms(*msg, "authority"), + 0, ) } return nil } -// MigrateConsumerAdditionProposal migrates a ConsumerAdditionProposal -func MigrateConsumerAdditionProposal( +func MigrateMsgConsumerAddition( ctx sdk.Context, msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper, - proposal govtypes.Proposal, - msg *providertypes.ConsumerAdditionProposal, + proposalID uint64, + msg providertypes.MsgConsumerAddition, //nolint:staticcheck + indexOfMessageInProposal int, ) error { - if proposal.Status == govtypes.StatusPassed { - // ConsumerAdditionProposal that passed -- it was added to the - // list of pending consumer addition proposals, which was deleted during - // the migration of the provider module + proposal, err := govKeeper.Proposals.Get(ctx, proposalID) + if err != nil { + return err + } + if proposal.Status == govtypesv1.StatusPassed { + // MsgConsumerAddition that passed for _, consumerID := range providerKeeper.GetAllActiveConsumerIds(ctx) { chainID, err := providerKeeper.GetConsumerChainId(ctx, consumerID) if err != nil { @@ -275,8 +399,13 @@ func MigrateConsumerAdditionProposal( // chain to be launched at msg.SpawnTime. // create a new consumer chain with all the parameters - metadata := metadataFromCAP(msg) - initParams, err := initParamsFromCAP(msg) + metadata := providertypes.ConsumerMetadata{ + Name: msg.ChainId, + Description: "TBA", + Metadata: "TBA", + } + + initParams, err := CreateConsumerInitializationParameters(msg) if err != nil { // invalid init params -- ignore proposal ctx.Logger().Error( @@ -287,7 +416,9 @@ func MigrateConsumerAdditionProposal( ) return nil } - powerShapingParams, err := powerShapingParamsFromCAP(msg) + + powerShapingParams, err := CreatePowerShapingParameters(msg.Top_N, msg.ValidatorsPowerCap, msg.ValidatorSetCap, + msg.Allowlist, msg.Denylist, msg.MinStake, msg.AllowInactiveVals) if err != nil { // invalid power shaping params -- ignore proposal ctx.Logger().Error( @@ -329,13 +460,18 @@ func MigrateConsumerAdditionProposal( ), ) } else { - // ConsumerAdditionProposal that was submitted, but not yet passed. + // proposal that was submitted, but not yet passed. // If the proposal is invalid, remove it. // Otherwise, create a new consumer chain (MsgCreateConsumer), and // replace the proposal's content with a MsgUpdateConsumer - metadata := metadataFromCAP(msg) - initParams, err := initParamsFromCAP(msg) + metadata := providertypes.ConsumerMetadata{ + Name: msg.ChainId, + Description: "TBA", + Metadata: "TBA", + } + + initParams, err := CreateConsumerInitializationParameters(msg) if err != nil { // invalid init params -- delete proposal if err := govKeeper.DeleteProposal(ctx, proposal.Id); err != nil { @@ -349,7 +485,9 @@ func MigrateConsumerAdditionProposal( ) return nil } - powerShapingParams, err := powerShapingParamsFromCAP(msg) + + powerShapingParams, err := CreatePowerShapingParameters(msg.Top_N, msg.ValidatorsPowerCap, msg.ValidatorSetCap, + msg.Allowlist, msg.Denylist, msg.MinStake, msg.AllowInactiveVals) if err != nil { // invalid power shaping params -- delete proposal if err := govKeeper.DeleteProposal(ctx, proposal.Id); err != nil { @@ -395,7 +533,7 @@ func MigrateConsumerAdditionProposal( if err != nil { return err } - proposal.Messages[0] = anyMsg + proposal.Messages[indexOfMessageInProposal] = anyMsg if err := govKeeper.SetProposal(ctx, proposal); err != nil { return err } @@ -409,69 +547,54 @@ func MigrateConsumerAdditionProposal( return nil } -// metadataFromCAP returns ConsumerMetadata from a ConsumerAdditionProposal -func metadataFromCAP(prop *providertypes.ConsumerAdditionProposal) providertypes.ConsumerMetadata { - metadata := providertypes.ConsumerMetadata{ - Name: prop.Title, - Description: prop.Description, - Metadata: "TBA", - } - err := providertypes.ValidateConsumerMetadata(metadata) - if err != nil { - metadata.Name = providertypes.TruncateString(metadata.Name, providertypes.MaxNameLength) - metadata.Description = providertypes.TruncateString(metadata.Description, providertypes.MaxDescriptionLength) - } - return metadata -} - -// initParamsFromCAP returns ConsumerInitializationParameters from -// a ConsumerAdditionProposal -func initParamsFromCAP( - prop *providertypes.ConsumerAdditionProposal, -) (providertypes.ConsumerInitializationParameters, error) { +func CreateConsumerInitializationParameters(msgConsumerAddition providertypes.MsgConsumerAddition) (providertypes.ConsumerInitializationParameters, error) { //nolint:staticcheck initParams := providertypes.ConsumerInitializationParameters{ - InitialHeight: prop.InitialHeight, - GenesisHash: prop.GenesisHash, - BinaryHash: prop.BinaryHash, - SpawnTime: prop.SpawnTime, - UnbondingPeriod: prop.UnbondingPeriod, - CcvTimeoutPeriod: prop.CcvTimeoutPeriod, - TransferTimeoutPeriod: prop.TransferTimeoutPeriod, - ConsumerRedistributionFraction: prop.ConsumerRedistributionFraction, - BlocksPerDistributionTransmission: prop.BlocksPerDistributionTransmission, - HistoricalEntries: prop.HistoricalEntries, - DistributionTransmissionChannel: prop.DistributionTransmissionChannel, + InitialHeight: msgConsumerAddition.InitialHeight, + GenesisHash: msgConsumerAddition.GenesisHash, + BinaryHash: msgConsumerAddition.BinaryHash, + SpawnTime: msgConsumerAddition.SpawnTime, + UnbondingPeriod: msgConsumerAddition.UnbondingPeriod, + CcvTimeoutPeriod: msgConsumerAddition.CcvTimeoutPeriod, + TransferTimeoutPeriod: msgConsumerAddition.TransferTimeoutPeriod, + ConsumerRedistributionFraction: msgConsumerAddition.ConsumerRedistributionFraction, + BlocksPerDistributionTransmission: msgConsumerAddition.BlocksPerDistributionTransmission, + HistoricalEntries: msgConsumerAddition.HistoricalEntries, + DistributionTransmissionChannel: msgConsumerAddition.DistributionTransmissionChannel, } err := providertypes.ValidateInitializationParameters(initParams) return initParams, err } -// powerShapingParamsFromCAP returns PowerShapingParameters from a ConsumerAdditionProposal -func powerShapingParamsFromCAP( - prop *providertypes.ConsumerAdditionProposal, +func CreatePowerShapingParameters( + topN uint32, validatorsPowerCap uint32, validatorSetCap uint32, allowlist []string, denylist []string, + minStake uint64, allowInactiveVals bool, ) (providertypes.PowerShapingParameters, error) { powerShapingParams := providertypes.PowerShapingParameters{ - Top_N: prop.Top_N, - ValidatorsPowerCap: prop.ValidatorsPowerCap, - ValidatorSetCap: prop.ValidatorSetCap, - Allowlist: prop.Allowlist, - Denylist: prop.Denylist, - MinStake: prop.MinStake, - AllowInactiveVals: prop.AllowInactiveVals, + Top_N: topN, + ValidatorsPowerCap: validatorsPowerCap, + ValidatorSetCap: validatorSetCap, + Allowlist: allowlist, + Denylist: denylist, + MinStake: minStake, + AllowInactiveVals: allowInactiveVals, } err := providertypes.ValidatePowerShapingParameters(powerShapingParams) return powerShapingParams, err } -// MigrateConsumerRemovalProposal migrates a ConsumerRemovalProposal -func MigrateConsumerRemovalProposal( +func MigrateMsgConsumerRemoval( ctx sdk.Context, msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper, - proposal govtypes.Proposal, - msg *providertypes.ConsumerRemovalProposal, + proposalID uint64, + msg providertypes.MsgConsumerRemoval, //nolint:staticcheck + indexOfMessageInProposal int, ) error { + proposal, err := govKeeper.Proposals.Get(ctx, proposalID) + if err != nil { + return err + } // identify the consumer chain rmConsumerID := "" for _, consumerID := range providerKeeper.GetAllActiveConsumerIds(ctx) { @@ -492,7 +615,7 @@ func MigrateConsumerRemovalProposal( proposal.Id, msg.ChainId, ), ) - if proposal.Status != govtypes.StatusPassed { + if proposal.Status != govtypesv1.StatusPassed { // if the proposal didn't pass yet, then just remove it if err := govKeeper.DeleteProposal(ctx, proposal.Id); err != nil { return err @@ -512,7 +635,7 @@ func MigrateConsumerRemovalProposal( Owner: govKeeper.GetAuthority(), } - if proposal.Status == govtypes.StatusPassed { + if proposal.Status == govtypesv1.StatusPassed { // ConsumerRemovalProposal that passed -- it was added to the // list of pending consumer removal proposals, which was deleted during // the migration of the provider module @@ -533,14 +656,15 @@ func MigrateConsumerRemovalProposal( ), ) } else { - // ConsumerRemovalProposal that was submitted, but not yet passed + // proposal that was submitted, but not yet passed // replace the message in the proposal with a MsgRemoveConsumer anyMsg, err := codec.NewAnyWithValue(&msgRemoveConsumer) if err != nil { return err } - proposal.Messages[0] = anyMsg + + proposal.Messages[indexOfMessageInProposal] = anyMsg if err := govKeeper.SetProposal(ctx, proposal); err != nil { return err } @@ -554,17 +678,20 @@ func MigrateConsumerRemovalProposal( return nil } -// MigrateConsumerModificationProposal migrates a ConsumerModificationProposal -func MigrateConsumerModificationProposal( +func MigrateMsgConsumerModification( ctx sdk.Context, - msgServer providertypes.MsgServer, providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper, - proposal govtypes.Proposal, - msg *providertypes.ConsumerModificationProposal, + proposalID uint64, + msg providertypes.MsgConsumerModification, //nolint:staticcheck + indexOfMessageInProposal int, ) error { - if proposal.Status == govtypes.StatusPassed { - // ConsumerModificationProposal that passed -- it was already handled in + proposal, err := govKeeper.Proposals.Get(ctx, proposalID) + if err != nil { + return err + } + if proposal.Status == govtypesv1.StatusPassed { + // proposal that passed -- it was already handled in // a previous block since these proposals are handled immediately ctx.Logger().Info( fmt.Sprintf( @@ -575,7 +702,7 @@ func MigrateConsumerModificationProposal( return nil } - // ConsumerModificationProposal that was submitted, but not yet passed + // proposal that was submitted, but not yet passed modifyConsumerID := "" for _, consumerID := range providerKeeper.GetAllActiveConsumerIds(ctx) { chainID, err := providerKeeper.GetConsumerChainId(ctx, consumerID) @@ -602,7 +729,8 @@ func MigrateConsumerModificationProposal( } // replace the message in the proposal with a MsgUpdateConsumer - powerShapingParams, err := powerShapingParamsFromCMP(msg) + powerShapingParams, err := CreatePowerShapingParameters(msg.Top_N, msg.ValidatorsPowerCap, msg.ValidatorSetCap, + msg.Allowlist, msg.Denylist, msg.MinStake, msg.AllowInactiveVals) if err != nil { // invalid power shaping params -- delete proposal if err := govKeeper.DeleteProposal(ctx, proposal.Id); err != nil { @@ -627,7 +755,7 @@ func MigrateConsumerModificationProposal( if err != nil { return err } - proposal.Messages[0] = anyMsg + proposal.Messages[indexOfMessageInProposal] = anyMsg if err := govKeeper.SetProposal(ctx, proposal); err != nil { return err } @@ -640,34 +768,19 @@ func MigrateConsumerModificationProposal( return nil } -// powerShapingParamsFromCMP returns PowerShapingParameters from a ConsumerModificationProposal -func powerShapingParamsFromCMP( - prop *providertypes.ConsumerModificationProposal, -) (providertypes.PowerShapingParameters, error) { - powerShapingParams := providertypes.PowerShapingParameters{ - Top_N: prop.Top_N, - ValidatorsPowerCap: prop.ValidatorsPowerCap, - ValidatorSetCap: prop.ValidatorSetCap, - Allowlist: prop.Allowlist, - Denylist: prop.Denylist, - MinStake: prop.MinStake, - AllowInactiveVals: prop.AllowInactiveVals, - } - err := providertypes.ValidatePowerShapingParameters(powerShapingParams) - return powerShapingParams, err -} - -// MigrateChangeRewardDenomsProposal migrates a ChangeRewardDenomsProposal -func MigrateChangeRewardDenomsProposal( +func MigrateMsgChangeRewardDenoms( ctx sdk.Context, - msgServer providertypes.MsgServer, - providerKeeper providerkeeper.Keeper, govKeeper govkeeper.Keeper, - proposal govtypes.Proposal, - msg *providertypes.ChangeRewardDenomsProposal, + proposalID uint64, + msg providertypes.MsgChangeRewardDenoms, + indexOfMessageInProposal int, ) error { - if proposal.Status == govtypes.StatusPassed { - // ChangeRewardDenomsProposal that passed -- it was already handled in + proposal, err := govKeeper.Proposals.Get(ctx, proposalID) + if err != nil { + return err + } + if proposal.Status == govtypesv1.StatusPassed { + // proposal that passed -- it was already handled in // a previous block since these proposals are handled immediately ctx.Logger().Info( fmt.Sprintf("Proposal with ID(%d) was skipped as it was already handled", proposal.Id), @@ -699,7 +812,7 @@ func MigrateChangeRewardDenomsProposal( if err != nil { return err } - proposal.Messages[0] = anyMsg + proposal.Messages[indexOfMessageInProposal] = anyMsg if err := govKeeper.SetProposal(ctx, proposal); err != nil { return err } diff --git a/app/upgrades/v20/upgrades_test.go b/app/upgrades/v20/upgrades_test.go index 0d19d0c0b60..c42afb9716a 100644 --- a/app/upgrades/v20/upgrades_test.go +++ b/app/upgrades/v20/upgrades_test.go @@ -1,19 +1,246 @@ package v20_test import ( + "encoding/base64" "encoding/json" + "fmt" "testing" + "time" "github.com/stretchr/testify/require" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + providerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" + "github.com/cosmos/interchain-security/v6/x/ccv/types" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/gaia/v20/app/helpers" v20 "github.com/cosmos/gaia/v20/app/upgrades/v20" ) +func GetTestMsgConsumerAddition() providertypes.MsgConsumerAddition { //nolint:staticcheck + return providertypes.MsgConsumerAddition{ //nolint:staticcheck + ChainId: "a ChainId", + InitialHeight: clienttypes.NewHeight(4, 5), + GenesisHash: []byte(base64.StdEncoding.EncodeToString([]byte("gen_hash"))), + BinaryHash: []byte(base64.StdEncoding.EncodeToString([]byte("bin_hash"))), + SpawnTime: time.Now().UTC(), + UnbondingPeriod: types.DefaultConsumerUnbondingPeriod, + CcvTimeoutPeriod: types.DefaultCCVTimeoutPeriod, + TransferTimeoutPeriod: types.DefaultTransferTimeoutPeriod, + ConsumerRedistributionFraction: types.DefaultConsumerRedistributeFrac, + BlocksPerDistributionTransmission: types.DefaultBlocksPerDistributionTransmission, + HistoricalEntries: types.DefaultHistoricalEntries, + DistributionTransmissionChannel: "", + Top_N: 50, + ValidatorsPowerCap: 0, + ValidatorSetCap: 0, + Allowlist: nil, + Denylist: nil, + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + } +} + +func TestMigrateMsgConsumerAdditionWithNotPassedProposalAndInvalidParams(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + + providerKeeper := gaiaApp.ProviderKeeper + govKeeper := gaiaApp.GovKeeper + + // assert that when a not-passed proposal has invalid params, it gets deleted + // create a sample message, so we can use it in the proposal + messages := make([]*codectypes.Any, 1) + messages[0] = &codectypes.Any{TypeUrl: "", Value: []byte{}} + proposal := v1.Proposal{Messages: messages} + err := govKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + // verify the proposal can be found + _, err = govKeeper.Proposals.Get(ctx, 0) + require.NoError(t, err) + + msgConsumerAddition := GetTestMsgConsumerAddition() + msgConsumerAddition.Top_N = 13 // invalid param, not in [0]\union[50, 100] + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + err = v20.MigrateMsgConsumerAddition(ctx, msgServer, + providerKeeper, + *govKeeper, + 0, + msgConsumerAddition, + 0) + require.NoError(t, err) + + // verify that the proposal got deleted (we cannot find it) + _, err = govKeeper.Proposals.Get(ctx, 0) + require.ErrorContains(t, err, "not found") + + // (indirectly) verify that `CreateConsumer` was not called by checking that consumer id was not updated + consumerID, found := providerKeeper.GetConsumerId(ctx) + require.False(t, found) + require.Equal(t, uint64(0), consumerID) +} + +func TestMigrateMsgConsumerAdditionWithNotPassedProposalAndValidParams(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + + providerKeeper := gaiaApp.ProviderKeeper + govKeeper := gaiaApp.GovKeeper + + // create a proposal with 2 messages and only update the second message (call `MigrateConsumerAddition` with + // `indexOfMessageInProposal` being 1) + messages := make([]*codectypes.Any, 2) + messages[0] = &codectypes.Any{TypeUrl: "", Value: []byte{1, 2, 3}} + messages[1] = &codectypes.Any{TypeUrl: "", Value: []byte{}} + proposal := v1.Proposal{Messages: messages} + err := govKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + msgConsumerAddition := GetTestMsgConsumerAddition() + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + err = v20.MigrateMsgConsumerAddition(ctx, msgServer, + providerKeeper, + *govKeeper, + 0, + msgConsumerAddition, + 1) + require.NoError(t, err) + + // (indirectly) verify that `CreateConsumer` was called by checking that consumer id was updated + consumerID, found := providerKeeper.GetConsumerId(ctx) + require.True(t, found) + require.Equal(t, uint64(1), consumerID) + consumerMetadata, err := providerKeeper.GetConsumerMetadata(ctx, "0") + require.NoError(t, err) + fmt.Println(consumerMetadata) + require.Equal(t, msgConsumerAddition.ChainId, consumerMetadata.Name) + + proposal, err = govKeeper.Proposals.Get(ctx, 0) + require.NoError(t, err) + // first message was not updated + require.Equal(t, messages[0].TypeUrl, proposal.Messages[0].TypeUrl) + require.Equal(t, messages[0].Value, proposal.Messages[0].Value) + + // verify that the proposal's second message now contains a `MsgUpdateConsumer` message + initParams, err := v20.CreateConsumerInitializationParameters(msgConsumerAddition) + require.NoError(t, err) + + powerShapingParams, err := v20.CreatePowerShapingParameters(msgConsumerAddition.Top_N, msgConsumerAddition.ValidatorsPowerCap, + msgConsumerAddition.ValidatorSetCap, msgConsumerAddition.Allowlist, msgConsumerAddition.Denylist, msgConsumerAddition.MinStake, + msgConsumerAddition.AllowInactiveVals) + require.NoError(t, err) + + expectedMsgUpdateConsumer := providertypes.MsgUpdateConsumer{ + Owner: govKeeper.GetAuthority(), + ConsumerId: "0", + Metadata: nil, + InitializationParameters: &initParams, + PowerShapingParameters: &powerShapingParams, + } + expectedMsgUpdateConsumerBytes, err := expectedMsgUpdateConsumer.Marshal() + require.NoError(t, err) + require.Equal(t, "/interchain_security.ccv.provider.v1.MsgUpdateConsumer", proposal.Messages[1].TypeUrl) + require.Equal(t, expectedMsgUpdateConsumerBytes, proposal.Messages[1].Value) +} + +func TestMigrateMsgConsumerAdditionWithPassedProposal(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + + providerKeeper := gaiaApp.ProviderKeeper + govKeeper := gaiaApp.GovKeeper + + // create a passed proposal with one message + messages := make([]*codectypes.Any, 1) + messages[0] = &codectypes.Any{TypeUrl: "", Value: []byte{1, 2, 3}} + proposal := v1.Proposal{Messages: messages, Status: v1.ProposalStatus_PROPOSAL_STATUS_PASSED} + err := govKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + msgConsumerAddition := GetTestMsgConsumerAddition() + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + err = v20.MigrateMsgConsumerAddition(ctx, msgServer, + providerKeeper, + *govKeeper, + 0, + msgConsumerAddition, + 0) + require.NoError(t, err) + + // (indirectly) verify that `CreateConsumer` was called by checking that consumer id was updated + consumerID, found := providerKeeper.GetConsumerId(ctx) + require.True(t, found) + require.Equal(t, uint64(1), consumerID) + consumerMetadata, err := providerKeeper.GetConsumerMetadata(ctx, "0") + require.NoError(t, err) + require.Equal(t, msgConsumerAddition.ChainId, consumerMetadata.Name) + + proposal, err = govKeeper.Proposals.Get(ctx, 0) + require.NoError(t, err) + // first message was not updated + require.Equal(t, messages[0].TypeUrl, proposal.Messages[0].TypeUrl) + require.Equal(t, messages[0].Value, proposal.Messages[0].Value) + + // verify that the proposal's second message now contains a `MsgUpdateConsumer` message + initParams, err := v20.CreateConsumerInitializationParameters(msgConsumerAddition) + require.NoError(t, err) + + powerShapingParams, err := v20.CreatePowerShapingParameters(msgConsumerAddition.Top_N, msgConsumerAddition.ValidatorsPowerCap, + msgConsumerAddition.ValidatorSetCap, msgConsumerAddition.Allowlist, msgConsumerAddition.Denylist, msgConsumerAddition.MinStake, + msgConsumerAddition.AllowInactiveVals) + require.NoError(t, err) + + actualInitParams, err := providerKeeper.GetConsumerInitializationParameters(ctx, "0") + require.NoError(t, err) + actualPowerShapingParams, err := providerKeeper.GetConsumerPowerShapingParameters(ctx, "0") + require.NoError(t, err) + require.Equal(t, powerShapingParams, actualPowerShapingParams) + require.Equal(t, initParams, actualInitParams) +} + +func TestMigrateMsgConsumerAdditionWithPassedProposalOfAnAlreadyHandleChain(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + + providerKeeper := gaiaApp.ProviderKeeper + govKeeper := gaiaApp.GovKeeper + + // create a passed proposal with one message + messages := make([]*codectypes.Any, 1) + messages[0] = &codectypes.Any{TypeUrl: "", Value: []byte{1, 2, 3}} + proposal := v1.Proposal{Messages: messages, Status: v1.ProposalStatus_PROPOSAL_STATUS_PASSED} + err := govKeeper.SetProposal(ctx, proposal) + require.NoError(t, err) + + msgConsumerAddition := GetTestMsgConsumerAddition() + + // the chain is already handled and launched + providerKeeper.FetchAndIncrementConsumerId(ctx) + providerKeeper.SetConsumerPhase(ctx, "0", providertypes.CONSUMER_PHASE_LAUNCHED) + providerKeeper.SetConsumerChainId(ctx, "0", msgConsumerAddition.ChainId) + + msgServer := providerkeeper.NewMsgServerImpl(&providerKeeper) + err = v20.MigrateMsgConsumerAddition(ctx, msgServer, + providerKeeper, + *govKeeper, + 0, + msgConsumerAddition, + 0) + require.NoError(t, err) + + // (indirectly) verify that `CreateConsumer` was not called by checking there are no consumer metadata + _, err = providerKeeper.GetConsumerMetadata(ctx, "0") + require.Error(t, err) +} + func TestSetICSConsumerMetadata(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) diff --git a/go.mod b/go.mod index 4a180119394..bc351d31337 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ibc-go/v8 v8.5.0 - github.com/cosmos/interchain-security/v5 v5.0.0-20240905162918-300530f18130 + github.com/cosmos/interchain-security/v6 v6.0.0-20240906165300-5b6252c77268 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 github.com/ory/dockertest/v3 v3.11.0 @@ -50,7 +50,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.65.0 // indirect + google.golang.org/grpc v1.66.0 // indirect ) require ( diff --git a/go.sum b/go.sum index 57792e5448d..affb0d2ecb1 100644 --- a/go.sum +++ b/go.sum @@ -443,10 +443,8 @@ github.com/cosmos/ibc-go/v8 v8.5.0 h1:OjaSXz480JT8ZuMrASxGgS7XzloZ2NuuJPwZB/fKDg github.com/cosmos/ibc-go/v8 v8.5.0/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= -github.com/cosmos/interchain-security/v5 v5.0.0-20240904161413-954f77c8c6f2 h1:Z07VkkzgXyiboGTzCBCjlHfOZwdnq/pts3i+LCRn3Kc= -github.com/cosmos/interchain-security/v5 v5.0.0-20240904161413-954f77c8c6f2/go.mod h1:y3LdR1GPxF8SMFRb/V38OWGZNwEriJDFlka/hoH1GEk= -github.com/cosmos/interchain-security/v5 v5.0.0-20240905162918-300530f18130 h1:RKrwueaofyJhrlJ/57TxFpbf5unMG2BcX8kmmTDVRoc= -github.com/cosmos/interchain-security/v5 v5.0.0-20240905162918-300530f18130/go.mod h1:EYGBSusSaB9XgW5f5mFgN/sDW25hWn9shlZSKOe41ek= +github.com/cosmos/interchain-security/v6 v6.0.0-20240906165300-5b6252c77268 h1:UJEywL1Fi/HYAFao8fUQxvQXudrt2Vv+D3BL9JK/osM= +github.com/cosmos/interchain-security/v6 v6.0.0-20240906165300-5b6252c77268/go.mod h1:+5zIZEzkL4yNHB/UWXCu75t6GeEgEmWHbz5OnBWiL0o= 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.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -1967,8 +1965,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 42ba30ecfe0..c2ab65ec2be 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -8,7 +8,7 @@ import ( dbm "github.com/cosmos/cosmos-db" ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" "cosmossdk.io/log" evidencetypes "cosmossdk.io/x/evidence/types" diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index fc6b57d7e74..5a6b7aceea8 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" "cosmossdk.io/math" upgradetypes "cosmossdk.io/x/upgrade/types" diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 40edf553a0f..e788ba9efc0 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -9,7 +9,7 @@ import ( ratelimittypes "github.com/cosmos/ibc-apps/modules/rate-limiting/v8/types" icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" - providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" evidencetypes "cosmossdk.io/x/evidence/types" diff --git a/tests/integration/interchain_security_test.go b/tests/integration/interchain_security_test.go index 79406657495..2c0797216d8 100644 --- a/tests/integration/interchain_security_test.go +++ b/tests/integration/interchain_security_test.go @@ -6,10 +6,10 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - appConsumer "github.com/cosmos/interchain-security/v5/app/consumer" - "github.com/cosmos/interchain-security/v5/tests/integration" - icstestingutils "github.com/cosmos/interchain-security/v5/testutil/ibc_testing" - "github.com/cosmos/interchain-security/v5/x/ccv/types" + appConsumer "github.com/cosmos/interchain-security/v6/app/consumer" + "github.com/cosmos/interchain-security/v6/tests/integration" + icstestingutils "github.com/cosmos/interchain-security/v6/testutil/ibc_testing" + "github.com/cosmos/interchain-security/v6/x/ccv/types" "cosmossdk.io/math"