diff --git a/tests/e2e/config.go b/tests/e2e/config.go index aeba23430c..f6f16f650c 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -161,23 +161,14 @@ func SlashThrottleTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -187,21 +178,13 @@ func SlashThrottleTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"0.10\" | " + ".app_state.provider.params.slash_meter_replenish_period = \"20s\"", }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -226,23 +209,13 @@ func DefaultTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -252,21 +225,12 @@ func DefaultTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -303,23 +267,13 @@ func DemocracyTestConfig(allowReward bool) TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -328,21 +282,12 @@ func DemocracyTestConfig(allowReward bool) TestConfig { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, -<<<<<<< HEAD - chainID("democ"): { - chainId: chainID("democ"), - binaryName: "democracyd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: consumerGenChanges, -======= ChainID("democ"): { ChainId: ChainID("democ"), - BinaryName: "interchain-security-cdd", + BinaryName: "democracyd", IpPrefix: "7.7.9", VotingWaitTime: 20, GenesisChanges: consumerGenChanges, ->>>>>>> origin/main }, }, tendermintConfigOverride: `s/timeout_commit = "5s"/timeout_commit = "1s"/;` + @@ -362,23 +307,13 @@ func MultiConsumerTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -387,41 +322,24 @@ func MultiConsumerTestConfig() TestConfig { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\"", }, -<<<<<<< HEAD - chainID("densu"): { - chainId: chainID("densu"), - binaryName: "consumerd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + ChainID("densu"): { ChainId: ChainID("densu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.9", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -445,23 +363,13 @@ func ChangeoverTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -471,23 +379,13 @@ func ChangeoverTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, -<<<<<<< HEAD - chainID("sover"): { - chainId: chainID("sover"), - binaryName: "sovereignd", - upgradeBinary: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("sover"): { ChainId: ChainID("sover"), - BinaryName: "interchain-security-sd", - UpgradeBinary: "interchain-security-cdd", + BinaryName: "sovereignd", + UpgradeBinary: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + diff --git a/x/ccv/consumer/migrations/v2/migration_test.go b/x/ccv/consumer/migrations/v2/migration_test.go index 94193cc1f2..1d54127442 100644 --- a/x/ccv/consumer/migrations/v2/migration_test.go +++ b/x/ccv/consumer/migrations/v2/migration_test.go @@ -8,6 +8,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" v2 "github.com/cosmos/interchain-security/v3/x/ccv/consumer/migrations/v2" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" diff --git a/x/ccv/provider/migrations/v3/migration_test.go b/x/ccv/provider/migrations/v3/migration_test.go index d82fb3c904..40b93122ae 100644 --- a/x/ccv/provider/migrations/v3/migration_test.go +++ b/x/ccv/provider/migrations/v3/migration_test.go @@ -19,41 +19,41 @@ func TestMigrate2To3(t *testing.T) { providerKeeper.SetConsumerClientId(ctx, "chain-3", "client-3") // Queue some data for chain-1 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 66, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 67, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 68, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 69, testutil.GetNewVSCMaturedPacketData()) // Queue some data for chain-2 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 789, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 790, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 791, testutil.GetNewVSCMaturedPacketData()) // Queue some data for chain-3 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 123, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 124, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 125, testutil.GetNewVSCMaturedPacketData()) // Confirm getter methods return expected values - slash1, vscm1 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") //nolint:staticcheck // SA1019: used in migration tests + slash1, vscm1 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") require.Len(t, slash1, 2) require.Len(t, vscm1, 2) - slash2, vscm2 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") //nolint:staticcheck // SA1019: used in migration tests + slash2, vscm2 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") require.Len(t, slash2, 1) require.Len(t, vscm2, 2) - slash3, vscm3 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") //nolint:staticcheck // SA1019: used in migration tests + slash3, vscm3 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") require.Len(t, slash3, 1) require.Len(t, vscm3, 2) @@ -91,13 +91,13 @@ func TestMigrate2To3(t *testing.T) { require.NoError(t, err) // Confirm throttled data is now deleted - slash1, vscm1 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") //nolint:staticcheck // SA1019: used in migration tests + slash1, vscm1 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") require.Empty(t, slash1) require.Empty(t, vscm1) - slash2, vscm2 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") //nolint:staticcheck // SA1019: used in migration tests + slash2, vscm2 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") require.Empty(t, slash2) require.Empty(t, vscm2) - slash3, vscm3 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") //nolint:staticcheck // SA1019: used in migration tests + slash3, vscm3 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") require.Empty(t, slash3) require.Empty(t, vscm3) diff --git a/x/ccv/provider/migrations/v3/migrations.go b/x/ccv/provider/migrations/v3/migrations.go index 0022d4584a..f07b85565e 100644 --- a/x/ccv/provider/migrations/v3/migrations.go +++ b/x/ccv/provider/migrations/v3/migrations.go @@ -12,14 +12,14 @@ import ( // on the provider in the v2 consensus version (jail throttling v1). func MigrateQueuedPackets(ctx sdk.Context, k providerkeeper.Keeper) error { for _, consumer := range k.GetAllConsumerChains(ctx) { - slashData, vscmData := k.LegacyGetAllThrottledPacketData(ctx, consumer.ChainId) //nolint:staticcheck // SA1019: function used for migration + slashData, vscmData := k.LegacyGetAllThrottledPacketData(ctx, consumer.ChainId) if len(slashData) > 0 { k.Logger(ctx).Error(fmt.Sprintf("slash data being dropped: %v", slashData)) } for _, data := range vscmData { k.HandleVSCMaturedPacket(ctx, consumer.ChainId, data) } - k.LegacyDeleteThrottledPacketDataForConsumer(ctx, consumer.ChainId) //nolint:staticcheck // SA1019: function used for migration + k.LegacyDeleteThrottledPacketDataForConsumer(ctx, consumer.ChainId) } return nil } diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index 6ab621f0e1..e5900bcf04 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -1,13 +1,14 @@ package types import ( + "github.com/cosmos/ibc-go/v7/modules/core/exported" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ) // RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types