From 5c139053ac85eb3e042720ff22708b4fdde4de4e Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 16 Jul 2024 18:15:10 +0300 Subject: [PATCH 1/5] init commit --- .../1964-deprecate-soft-opt-out.md | 2 + .../features/1964-deprecate-soft-opt-out.md | 2 + .../1964-deprecate-soft-opt-out.md | 2 + docs/docs/features/proposals.md | 8 - tests/e2e/actions.go | 1 - tests/e2e/steps_active_set_changes.go | 6 - tests/e2e/steps_consumer_misbehaviour.go | 2 +- tests/e2e/steps_partial_set_security.go | 57 +--- .../e2e/tracehandler_testdata/changeover.json | 31 +- .../consumer-double-sign.json | 24 +- .../consumer-misbehaviour.json | 25 +- .../e2e/tracehandler_testdata/democracy.json | 43 ++- .../democracyRewardsSteps.json | 43 ++- .../e2e/tracehandler_testdata/happyPath.json | 252 ++++----------- .../multipleConsumers.json | 119 +++++++- .../e2e/tracehandler_testdata/shorthappy.json | 59 +++- .../tracehandler_testdata/slashThrottle.json | 43 ++- tests/integration/soft_opt_out.go | 286 ------------------ tests/mbt/driver/setup.go | 1 - x/ccv/consumer/keeper/params.go | 7 - x/ccv/consumer/keeper/params_test.go | 3 +- x/ccv/consumer/keeper/soft_opt_out.go | 126 -------- x/ccv/consumer/keeper/soft_opt_out_test.go | 120 -------- x/ccv/consumer/keeper/validators.go | 13 - x/ccv/consumer/module.go | 3 - x/ccv/consumer/types/genesis_test.go | 3 - x/ccv/consumer/types/keys.go | 9 +- x/ccv/consumer/types/keys_test.go | 2 +- x/ccv/consumer/types/params_test.go | 28 +- x/ccv/provider/keeper/proposal.go | 1 - x/ccv/provider/keeper/proposal_test.go | 5 +- x/ccv/provider/types/legacy_proposal.go | 2 +- x/ccv/types/params.go | 31 +- 33 files changed, 454 insertions(+), 905 deletions(-) create mode 100644 .changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md create mode 100644 .changelog/unreleased/features/1964-deprecate-soft-opt-out.md create mode 100644 .changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md delete mode 100644 tests/integration/soft_opt_out.go delete mode 100644 x/ccv/consumer/keeper/soft_opt_out.go delete mode 100644 x/ccv/consumer/keeper/soft_opt_out_test.go diff --git a/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..73de583293 --- /dev/null +++ b/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..73de583293 --- /dev/null +++ b/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..73de583293 --- /dev/null +++ b/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/docs/docs/features/proposals.md b/docs/docs/features/proposals.md index 5f5457fc0a..44ea4f0298 100644 --- a/docs/docs/features/proposals.md +++ b/docs/docs/features/proposals.md @@ -77,14 +77,6 @@ Minimal example: } ``` -:::warning -Before the introduction of Partial Set Security, consumer chains typically included a "soft opt-out mechanism" -which allows the bottom N% of the provider's validators to not validate the consumer chain, without being jailed for downtime on the provider. -After the introduction of Partial Set Security, the use of the soft opt-out mechanism is discouraged, and consumer chains are -encouraged to use the topN parameter to not force validators with little stake to validate the chain. -::: - - ## `ConsumerModificationProposal` Proposal type used to change the power shaping parameters of a running consumer chain, as well as to change a Top N running consumer chain to an Opt-In chain and vice versa. diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 4a3e59876d..b7207d72c8 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -468,7 +468,6 @@ func (tr Chain) submitConsumerModificationProposal( } bz, err = cmd.CombinedOutput() - if err != nil { log.Fatal(err, "\n", string(bz)) } diff --git a/tests/e2e/steps_active_set_changes.go b/tests/e2e/steps_active_set_changes.go index 1fc06a73b6..a61009137e 100644 --- a/tests/e2e/steps_active_set_changes.go +++ b/tests/e2e/steps_active_set_changes.go @@ -91,12 +91,6 @@ func stepsActiveSetChanges() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 700000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{}, }, diff --git a/tests/e2e/steps_consumer_misbehaviour.go b/tests/e2e/steps_consumer_misbehaviour.go index 1071da368a..bec4c61394 100644 --- a/tests/e2e/steps_consumer_misbehaviour.go +++ b/tests/e2e/steps_consumer_misbehaviour.go @@ -37,7 +37,7 @@ func stepsStartChainsForConsumerMisbehaviour(consumerName string) []Step { ConsumerChain: ChainID(consumerName), SpawnTime: 0, InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, - TopN: 100, + TopN: 0, }, State: State{ ChainID("provi"): ChainState{ diff --git a/tests/e2e/steps_partial_set_security.go b/tests/e2e/steps_partial_set_security.go index 9a0daa5acf..98316f45bb 100644 --- a/tests/e2e/steps_partial_set_security.go +++ b/tests/e2e/steps_partial_set_security.go @@ -123,12 +123,6 @@ func stepsOptInChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -618,12 +612,6 @@ func stepsTopNChain() []Step { {Id: ValidatorID("bob"), Stake: 300000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 500000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -1149,12 +1137,6 @@ func stepsValidatorSetCappedChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -1385,12 +1367,6 @@ func stepsValidatorsPowerCappedChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -1511,8 +1487,10 @@ func stepsValidatorsAllowlistedChain() []Step { InitialHeight: clienttypes.Height{RevisionNumber: 0, RevisionHeight: 1}, TopN: 0, // only "alice" and "bob" are allowlisted (see `getDefaultValidators` in `tests/e2e/config.go`) - Allowlist: []string{"cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", - "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39"}, + Allowlist: []string{ + "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", + "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", + }, }, State: State{ ChainID("provi"): ChainState{ @@ -1622,12 +1600,6 @@ func stepsValidatorsAllowlistedChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -1831,12 +1803,6 @@ func stepsValidatorsDenylistedChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -2039,12 +2005,6 @@ func stepsModifyChain() []Step { {Id: ValidatorID("bob"), Stake: 200000000, Allocation: 10000000000}, {Id: ValidatorID("carol"), Stake: 300000000, Allocation: 10000000000}, }, - // For consumers that're launching with the provider being on an earlier version - // of ICS before the soft opt-out threshold was introduced, we need to set the - // soft opt-out threshold to 0.05 in the consumer genesis to ensure that the - // consumer binary doesn't panic. Sdk requires that all params are set to valid - // values from the genesis file. - GenesisChanges: ".app_state.ccvconsumer.params.soft_opt_out_threshold = \"0.05\"", }, State: State{ ChainID("consu"): ChainState{ @@ -2249,8 +2209,10 @@ func stepsModifyChain() []Step { Deposit: 10000001, ConsumerChain: ChainID("consu"), // only "alice" and "carol" are allowlisted (see `getDefaultValidators` in `tests/e2e/config.go`) - Allowlist: []string{"cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", - "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"}, + Allowlist: []string{ + "cosmosvalcons1qmq08eruchr5sf5s3rwz7djpr5a25f7xw4mceq", + "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6", + }, }, State: State{ ChainID("provi"): ChainState{ @@ -2437,7 +2399,8 @@ func stepsModifyChain() []Step { ExpectError: true, // because this chain is now Top 100%, no validator can opt out }, State: State{}, - }} + }, + } return s } diff --git a/tests/e2e/tracehandler_testdata/changeover.json b/tests/e2e/tracehandler_testdata/changeover.json index 91b53a87cd..af1f68a91a 100644 --- a/tests/e2e/tracehandler_testdata/changeover.json +++ b/tests/e2e/tracehandler_testdata/changeover.json @@ -21,6 +21,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -52,6 +53,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -99,6 +101,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -147,6 +150,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -165,7 +169,7 @@ "Deposit": 10000000, "Status": "2" }, - "Type": "main.UpgradeProposal" + "Type": "e2e.UpgradeProposal" } } } @@ -190,6 +194,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -208,7 +213,7 @@ "Deposit": 10000000, "Status": "3" }, - "Type": "main.UpgradeProposal" + "Type": "e2e.UpgradeProposal" } } } @@ -235,7 +240,11 @@ "revision_height": 111 }, "DistributionChannel": "channel-0", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -247,6 +256,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -266,7 +276,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -298,6 +308,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -317,7 +328,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -358,6 +369,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -378,6 +390,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -430,6 +443,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -461,6 +475,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -481,6 +496,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -512,6 +528,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -541,6 +558,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -572,6 +590,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -592,6 +611,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -623,6 +643,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/consumer-double-sign.json b/tests/e2e/tracehandler_testdata/consumer-double-sign.json index 7551c2c77d..f2696cb70c 100644 --- a/tests/e2e/tracehandler_testdata/consumer-double-sign.json +++ b/tests/e2e/tracehandler_testdata/consumer-double-sign.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -356,6 +368,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -380,6 +393,7 @@ "carol": 500000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -408,6 +422,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -432,6 +447,7 @@ "carol": 500000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -463,6 +479,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -487,6 +504,7 @@ "carol": 500000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/consumer-misbehaviour.json b/tests/e2e/tracehandler_testdata/consumer-misbehaviour.json index c7f68b5273..50709a9a00 100644 --- a/tests/e2e/tracehandler_testdata/consumer-misbehaviour.json +++ b/tests/e2e/tracehandler_testdata/consumer-misbehaviour.json @@ -28,6 +28,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -53,7 +54,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 0, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -65,6 +70,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -82,9 +88,9 @@ "InitialHeight": { "revision_height": 1 }, - "Status": "PROPOSAL_STATUS_VOTING_PERIOD" + "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -107,6 +113,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -155,6 +162,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -174,7 +182,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -203,6 +211,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -222,6 +231,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -274,6 +284,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -293,6 +304,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -322,6 +334,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -364,6 +377,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -386,6 +400,7 @@ "bob": 20000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -416,6 +431,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -438,6 +454,7 @@ "bob": 20000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/democracy.json b/tests/e2e/tracehandler_testdata/democracy.json index 2dc179c0da..b1431d0ee8 100644 --- a/tests/e2e/tracehandler_testdata/democracy.json +++ b/tests/e2e/tracehandler_testdata/democracy.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -372,6 +384,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -392,6 +405,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -422,6 +436,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -453,6 +468,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -483,6 +499,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -522,6 +539,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": true, @@ -564,6 +582,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": true, @@ -602,6 +621,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -621,7 +641,7 @@ "receive_enabled": true } }, - "Type": "main.IBCTransferParamsProposal" + "Type": "e2e.IBCTransferParamsProposal" } } } @@ -651,6 +671,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -670,7 +691,7 @@ "receive_enabled": true } }, - "Type": "main.IBCTransferParamsProposal" + "Type": "e2e.IBCTransferParamsProposal" } } } @@ -691,6 +712,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": false, @@ -725,6 +747,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -760,6 +783,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -789,6 +813,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": false, @@ -826,6 +851,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -846,6 +872,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -877,6 +904,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -897,6 +925,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -928,6 +957,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -957,6 +987,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -977,6 +1008,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1011,6 +1043,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json index b270031542..0c96ba328e 100644 --- a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json +++ b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -372,6 +384,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -392,6 +405,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -422,6 +436,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -453,6 +468,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -483,6 +499,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -522,6 +539,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": true, @@ -564,6 +582,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": true, @@ -602,6 +621,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -621,7 +641,7 @@ "receive_enabled": true } }, - "Type": "main.IBCTransferParamsProposal" + "Type": "e2e.IBCTransferParamsProposal" } } } @@ -651,6 +671,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -670,7 +691,7 @@ "receive_enabled": true } }, - "Type": "main.IBCTransferParamsProposal" + "Type": "e2e.IBCTransferParamsProposal" } } } @@ -691,6 +712,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": false, @@ -725,6 +747,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -760,6 +783,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -789,6 +813,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": { "IsRewarded": { "alice": true, @@ -826,6 +851,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -846,6 +872,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -877,6 +904,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -897,6 +925,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -928,6 +957,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -957,6 +987,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -977,6 +1008,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1011,6 +1043,7 @@ "bob": 40000000 }, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/happyPath.json b/tests/e2e/tracehandler_testdata/happyPath.json index fea88c2e92..566ebbfe24 100644 --- a/tests/e2e/tracehandler_testdata/happyPath.json +++ b/tests/e2e/tracehandler_testdata/happyPath.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -358,6 +370,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -378,6 +391,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -408,6 +422,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -439,6 +454,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -469,6 +485,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -502,6 +519,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -528,6 +546,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -559,6 +578,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -585,6 +605,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -616,6 +637,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -636,6 +658,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -667,6 +690,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -698,6 +722,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -718,6 +743,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -749,6 +775,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -780,6 +807,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -800,6 +828,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -831,189 +860,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - } - } - }, - { - "ActionType": "main.RedelegateTokensAction", - "Action": { - "Chain": "provi", - "Src": "alice", - "Dst": "carol", - "TxSender": "alice", - "Amount": 450000000 - }, - "State": { - "consu": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 510, - "bob": 500, - "carol": 500 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - }, - "provi": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - } - } - }, - { - "ActionType": "main.RelayPacketsAction", - "Action": { - "ChainA": "provi", - "ChainB": "consu", - "Port": "provider", - "Channel": 0 - }, - "State": { - "consu": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - } - } - }, - { - "ActionType": "main.DowntimeSlashAction", - "Action": { - "Chain": "consu", - "Validator": "alice" - }, - "State": { - "consu": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - }, - "provi": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - } - } - }, - { - "ActionType": "main.RelayPacketsAction", - "Action": { - "ChainA": "provi", - "ChainB": "consu", - "Port": "provider", - "Channel": 0 - }, - "State": { - "consu": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, - "Rewards": null, - "ConsumerChains": null, - "AssignedKeys": null, - "ProviderKeys": null, - "ConsumerPendingPacketQueueSize": null, - "RegisteredConsumerRewardDenoms": null, - "ClientsFrozenHeights": null, - "HasToValidate": null, - "Proposals": null - }, - "provi": { - "ValBalances": null, - "ProposedConsumerChains": null, - "ValPowers": { - "alice": 60, - "bob": 500, - "carol": 950 - }, - "StakedTokens": null, - "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1046,6 +893,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1066,6 +914,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1097,6 +946,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1126,6 +976,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1146,6 +997,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1176,6 +1028,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1196,6 +1049,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1227,6 +1081,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1256,6 +1111,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1276,6 +1132,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1307,6 +1164,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1336,6 +1194,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1356,6 +1215,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1387,6 +1247,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1416,6 +1277,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1436,6 +1298,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1467,6 +1330,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1496,6 +1360,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1516,6 +1381,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1547,6 +1413,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1567,6 +1434,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1602,6 +1470,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1620,7 +1489,7 @@ "StopTime": 0, "Status": "2" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1651,6 +1520,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1669,7 +1539,7 @@ "StopTime": 0, "Status": "4" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1693,6 +1563,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1711,7 +1582,7 @@ "StopTime": 0, "Status": "2" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1742,6 +1613,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": {}, "AssignedKeys": null, @@ -1758,7 +1630,7 @@ "StopTime": 0, "Status": "3" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } diff --git a/tests/e2e/tracehandler_testdata/multipleConsumers.json b/tests/e2e/tracehandler_testdata/multipleConsumers.json index 3dbac1f88d..1e4bbc3ed3 100644 --- a/tests/e2e/tracehandler_testdata/multipleConsumers.json +++ b/tests/e2e/tracehandler_testdata/multipleConsumers.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -352,7 +364,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -366,6 +382,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -385,7 +402,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -408,6 +425,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -440,6 +458,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -474,6 +493,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -517,6 +537,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -536,7 +557,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -577,6 +598,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -597,6 +619,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -651,6 +674,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -671,6 +695,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -691,6 +716,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -722,6 +748,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -742,6 +769,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -762,6 +790,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -793,6 +822,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -813,6 +843,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -833,6 +864,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -864,6 +896,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -884,6 +917,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -904,6 +938,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -935,6 +970,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -955,6 +991,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -975,6 +1012,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1006,6 +1044,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1026,6 +1065,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1046,6 +1086,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1078,6 +1119,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1098,6 +1140,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1118,6 +1161,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1149,6 +1193,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1169,6 +1214,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1189,6 +1235,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1220,6 +1267,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1240,6 +1288,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1260,6 +1309,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1289,6 +1339,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1309,6 +1360,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1329,6 +1381,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1360,6 +1413,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1380,6 +1434,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1400,6 +1455,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1431,6 +1487,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1451,6 +1508,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1482,6 +1540,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1502,6 +1561,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1531,6 +1591,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1551,6 +1612,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1571,6 +1633,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1602,6 +1665,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1622,6 +1686,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1642,6 +1707,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1673,6 +1739,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1693,6 +1760,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1713,6 +1781,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1742,6 +1811,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1762,6 +1832,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1782,6 +1853,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1813,6 +1885,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1833,6 +1906,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1853,6 +1927,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1884,6 +1959,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1904,6 +1980,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1924,6 +2001,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1953,6 +2031,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1973,6 +2052,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1993,6 +2073,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2024,6 +2105,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2044,6 +2126,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2064,6 +2147,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2095,6 +2179,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2115,6 +2200,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2135,6 +2221,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2164,6 +2251,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2184,6 +2272,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2204,6 +2293,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2235,6 +2325,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2255,6 +2346,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2275,6 +2367,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2306,6 +2399,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2326,6 +2420,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2346,6 +2441,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2375,6 +2471,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2395,6 +2492,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2415,6 +2513,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2446,6 +2545,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2466,6 +2566,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2486,6 +2587,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2517,6 +2619,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2537,6 +2640,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2557,6 +2661,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2588,6 +2693,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -2608,6 +2714,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, diff --git a/tests/e2e/tracehandler_testdata/shorthappy.json b/tests/e2e/tracehandler_testdata/shorthappy.json index 4a93c4b713..d4cfe8c0c5 100644 --- a/tests/e2e/tracehandler_testdata/shorthappy.json +++ b/tests/e2e/tracehandler_testdata/shorthappy.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -358,6 +370,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -378,6 +391,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -408,6 +422,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -439,6 +454,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -469,6 +485,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -500,6 +517,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -520,6 +538,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -551,6 +570,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -583,6 +603,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -603,6 +624,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -634,6 +656,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -663,6 +686,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -683,6 +707,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -713,6 +738,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -733,6 +759,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -764,6 +791,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -793,6 +821,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -813,6 +842,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -844,6 +874,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -873,6 +904,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -893,6 +925,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -924,6 +957,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -953,6 +987,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -973,6 +1008,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1004,6 +1040,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1033,6 +1070,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1053,6 +1091,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1084,6 +1123,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1104,6 +1144,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -1139,6 +1180,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1157,7 +1199,7 @@ "StopTime": 0, "Status": "2" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1188,6 +1230,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1206,7 +1249,7 @@ "StopTime": 0, "Status": "4" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1230,6 +1273,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -1248,7 +1292,7 @@ "StopTime": 0, "Status": "2" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -1279,6 +1323,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": {}, "AssignedKeys": null, @@ -1295,7 +1340,7 @@ "StopTime": 0, "Status": "3" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } diff --git a/tests/e2e/tracehandler_testdata/slashThrottle.json b/tests/e2e/tracehandler_testdata/slashThrottle.json index 68ce3a0c6d..513d16118a 100644 --- a/tests/e2e/tracehandler_testdata/slashThrottle.json +++ b/tests/e2e/tracehandler_testdata/slashThrottle.json @@ -34,6 +34,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -59,7 +60,11 @@ "revision_height": 1 }, "DistributionChannel": "", - "TopN": 100 + "TopN": 100, + "ValidatorsPowerCap": 0, + "ValidatorSetCap": 0, + "Allowlist": null, + "Denylist": null }, "State": { "provi": { @@ -73,6 +78,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -92,7 +98,7 @@ }, "Status": "2" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -115,6 +121,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -147,6 +154,7 @@ "ProposedConsumerChains": null, "ValPowers": null, "StakedTokens": null, + "IBCTransferParams": null, "Params": null, "Rewards": null, "ConsumerChains": null, @@ -181,6 +189,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": { @@ -224,6 +233,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -243,7 +253,7 @@ }, "Status": "3" }, - "Type": "main.ConsumerAdditionProposal" + "Type": "e2e.ConsumerAdditionProposal" } } } @@ -284,6 +294,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -304,6 +315,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -358,6 +370,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -378,6 +391,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -408,6 +422,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -439,6 +454,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -469,6 +485,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -498,6 +515,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -518,6 +536,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -549,6 +568,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -569,6 +589,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -598,6 +619,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -618,6 +640,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -649,6 +672,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -669,6 +693,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -698,6 +723,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -718,6 +744,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -742,6 +769,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -762,6 +790,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -789,6 +818,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -809,6 +839,7 @@ }, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, @@ -839,6 +870,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": { "consu": true @@ -857,7 +889,7 @@ "StopTime": 0, "Status": "2" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } @@ -888,6 +920,7 @@ "ValPowers": null, "StakedTokens": null, "IBCTransferParams": null, + "Params": null, "Rewards": null, "ConsumerChains": {}, "AssignedKeys": null, @@ -904,7 +937,7 @@ "StopTime": 0, "Status": "3" }, - "Type": "main.ConsumerRemovalProposal" + "Type": "e2e.ConsumerRemovalProposal" } } } diff --git a/tests/integration/soft_opt_out.go b/tests/integration/soft_opt_out.go deleted file mode 100644 index 4af1f79c94..0000000000 --- a/tests/integration/soft_opt_out.go +++ /dev/null @@ -1,286 +0,0 @@ -package integration - -import ( - "bytes" - "sort" - - "cosmossdk.io/core/comet" - "cosmossdk.io/math" - abci "github.com/cometbft/cometbft/abci/types" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - consumerKeeper "github.com/cosmos/interchain-security/v5/x/ccv/consumer/keeper" - ccv "github.com/cosmos/interchain-security/v5/x/ccv/types" - - cmttypes "github.com/cometbft/cometbft/proto/tendermint/types" -) - -// TestSoftOptOut tests the soft opt-out feature -// - if a validator in the top 95% doesn't sign 50 blocks on the consumer, a SlashPacket is sent to the provider -// - if a validator in the bottom 5% doesn't sign 50 blocks on the consumer, a SlashPacket is NOT sent to the provider -// - if a validator in the bottom 5% doesn't sign 49 blocks on the consumer, -// then it moves to the top 95% and doesn't sign one more block, a SlashPacket is NOT sent to the provider -func (suite *CCVTestSuite) TestSoftOptOut() { - var votes []abci.VoteInfo - - testCases := []struct { - name string - downtimeFunc func(*consumerKeeper.Keeper, *slashingkeeper.Keeper, []byte, int) - targetValidator int - expJailed bool - expSlashPacket bool - }{ - { - "downtime top 95%", - func(ck *consumerKeeper.Keeper, sk *slashingkeeper.Keeper, valAddr []byte, valIdx int) { - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].BlockIdFlag = cmttypes.BlockIDFlagAbsent - } - } - blocksToDowntime, err := sk.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - minSigned, err := sk.MinSignedPerWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - blocksToDowntime = blocksToDowntime - minSigned + 1 - - slashingBeginBlocker(suite, votes, blocksToDowntime) - }, - 0, - true, - true, - }, - { - "downtime bottom 5%", - func(ck *consumerKeeper.Keeper, sk *slashingkeeper.Keeper, valAddr []byte, valIdx int) { - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].BlockIdFlag = cmttypes.BlockIDFlagAbsent - } - } - blocksToDowntime, err := sk.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - minSigned, err := sk.MinSignedPerWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - blocksToDowntime = blocksToDowntime - minSigned + 1 - slashingBeginBlocker(suite, votes, blocksToDowntime) - }, - 3, - true, - false, - }, - { - "downtime bottom 5% first and then top 95%, but not enough", - func(ck *consumerKeeper.Keeper, sk *slashingkeeper.Keeper, valAddr []byte, valIdx int) { - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].BlockIdFlag = cmttypes.BlockIDFlagAbsent - } - } - blocksToDowntime, err := sk.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - minSigned, err := sk.MinSignedPerWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - blocksToDowntime = blocksToDowntime - minSigned - slashingBeginBlocker(suite, votes, blocksToDowntime) - - // Increase the power of this validator (to bring it in the top 95%) - delAddr := suite.providerChain.SenderAccount.GetAddress() - bondAmt := math.NewInt(100).Mul(sdk.DefaultPowerReduction) - delegateByIdx(suite, delAddr, bondAmt, valIdx) - - suite.nextEpoch() - - // Relay 1 VSC packet from provider to consumer - relayAllCommittedPackets(suite, suite.providerChain, suite.path, ccv.ProviderPortID, suite.path.EndpointB.ChannelID, 1) - - // Update validator from store - val, found := ck.GetCCValidator(suite.consumerCtx(), valAddr) - suite.Require().True(found) - smallestNonOptOutPower := ck.GetSmallestNonOptOutPower(suite.consumerCtx()) - suite.Require().Equal(val.Power, smallestNonOptOutPower) - - // Let the validator continue not signing, but not enough to get jailed - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].Validator.Power = val.Power - } - } - slashingBeginBlocker(suite, votes, 10) - }, - 2, - false, - false, - }, - { - "donwtime bottom 5% first and then top 95% until jailed", - func(ck *consumerKeeper.Keeper, sk *slashingkeeper.Keeper, valAddr []byte, valIdx int) { - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].BlockIdFlag = cmttypes.BlockIDFlagAbsent - } - } - blocksToDowntime, err := sk.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - minSigned, err := sk.MinSignedPerWindow(suite.consumerCtx()) - suite.Require().NoError(err) - - blocksToDowntime = blocksToDowntime - minSigned - slashingBeginBlocker(suite, votes, blocksToDowntime) - - // Increase the power of this validator (to bring it in the top 95%) - delAddr := suite.providerChain.SenderAccount.GetAddress() - bondAmt := math.NewInt(100).Mul(sdk.DefaultPowerReduction) - delegateByIdx(suite, delAddr, bondAmt, valIdx) - - suite.nextEpoch() - - // Relay 1 VSC packet from provider to consumer - relayAllCommittedPackets(suite, suite.providerChain, suite.path, ccv.ProviderPortID, suite.path.EndpointB.ChannelID, 1) - - // Update validator from store - val, found := ck.GetCCValidator(suite.consumerCtx(), valAddr) - suite.Require().True(found) - smallestNonOptOutPower := ck.GetSmallestNonOptOutPower(suite.consumerCtx()) - suite.Require().Equal(val.Power, smallestNonOptOutPower) - - // Let the validator continue not signing until it gets jailed. - // Due to the starting height being just updated, the signed blocked window needs to pass. - for i, voteInfo := range votes { - if bytes.Equal(voteInfo.Validator.Address, valAddr) { - votes[i].Validator.Power = val.Power - } - } - - sigBlockWindow, err := sk.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - slashingBeginBlocker(suite, votes, sigBlockWindow+1) - }, - 2, - true, - true, - }, - } - - for i, tc := range testCases { - // initial setup - suite.SetupCCVChannel(suite.path) - - consumerKeeper := suite.consumerApp.GetConsumerKeeper() - consumerSlashingKeeper := suite.consumerApp.GetTestSlashingKeeper() - - // Setup validator power s.t. the bottom 5% is non-empty - validatorPowers := []int64{1000, 500, 50, 10} - suite.setupValidatorPowers(validatorPowers) - - suite.nextEpoch() - - // Relay 1 VSC packet from provider to consumer - relayAllCommittedPackets(suite, suite.providerChain, suite.path, ccv.ProviderPortID, suite.path.EndpointB.ChannelID, 1) - - // Check that the third validator is the first in the top 95% - smallestNonOptOutPower := consumerKeeper.GetSmallestNonOptOutPower(suite.consumerCtx()) - suite.Require().Equal(validatorPowers[1], smallestNonOptOutPower, "test: "+tc.name) - - // Get the list of all CCV validators - vals := consumerKeeper.GetAllCCValidator(suite.consumerCtx()) - // Note that GetAllCCValidator is iterating over a map so the result need to be sorted - sort.Slice(vals, func(i, j int) bool { - if vals[i].Power != vals[j].Power { - return vals[i].Power > vals[j].Power - } - return bytes.Compare(vals[i].Address, vals[j].Address) > 0 - }) - - // Let everyone sign the first 100 blocks (default value for slahing.SignedBlocksWindow param). - // This populates the signingInfo of the slashing module so that - // the check for starting height passes. - votes = []abci.VoteInfo{} - for _, val := range vals { - votes = append(votes, abci.VoteInfo{ - Validator: abci.Validator{Address: val.Address, Power: val.Power}, - BlockIdFlag: cmttypes.BlockIDFlagCommit, - }) - } - - consuSlashingWindow, err := consumerSlashingKeeper.SignedBlocksWindow(suite.consumerCtx()) - suite.Require().NoError(err) - slashingBeginBlocker(suite, votes, consuSlashingWindow) - - // Downtime infraction - sk := consumerSlashingKeeper.(slashingkeeper.Keeper) - tc.downtimeFunc(&consumerKeeper, &sk, vals[tc.targetValidator].Address, tc.targetValidator) - - // Check the signing info for target validator - consAddr := sdk.ConsAddress(vals[tc.targetValidator].Address) - info, _ := consumerSlashingKeeper.GetValidatorSigningInfo(suite.consumerCtx(), consAddr) - if tc.expJailed { - // expect increased jail time - consumerJailDowntimeDuration, err := consumerSlashingKeeper.DowntimeJailDuration(suite.consumerCtx()) - suite.Require().NoError(err) - suite.Require().True( - info.JailedUntil.Equal(suite.consumerCtx().BlockTime().Add(consumerJailDowntimeDuration)), - "test: "+tc.name+"; did not update validator jailed until signing info", - ) - // expect missed block counters reset - suite.Require().Zero(info.MissedBlocksCounter, "test: "+tc.name+"; did not reset validator missed block counter") - suite.Require().Zero(info.IndexOffset, "test: "+tc.name) - consumerSlashingKeeper.IterateMissedBlockBitmap(suite.consumerCtx(), consAddr, func(_ int64, missed bool) bool { - suite.Require().True(missed, "test: "+tc.name) - return false - }) - } else { - suite.Require().True( - // expect not increased jail time - info.JailedUntil.Before(suite.consumerCtx().BlockTime()), - "test: "+tc.name+"; validator jailed until signing info was updated", - ) - suite.Require().Positive(info.IndexOffset, "test: "+tc.name) - } - - pendingPackets := consumerKeeper.GetPendingPackets(suite.consumerCtx()) - if tc.expSlashPacket { - // Check that slash packet is queued - suite.Require().NotEmpty(pendingPackets, "test: "+tc.name+"; pending packets empty") - suite.Require().Len(pendingPackets, 1, "test: "+tc.name+"; pending packets len should be 1 is %d", len(pendingPackets)) - cp := pendingPackets[0] - suite.Require().Equal(ccv.SlashPacket, cp.Type, "test: "+tc.name) - sp := cp.GetSlashPacketData() - suite.Require().Equal(stakingtypes.Infraction_INFRACTION_DOWNTIME, sp.Infraction, "test: "+tc.name) - suite.Require().Equal(vals[tc.targetValidator].Address, sp.Validator.Address, "test: "+tc.name) - } else { - suite.Require().Empty(pendingPackets, "test: "+tc.name+"; pending packets non-empty") - } - - if i+1 < len(testCases) { - // reset suite - suite.SetupTest() - } - } -} - -// slashingBeginBlocker is a mock for the slashing BeginBlocker. -// It applies the votes for a sequence of blocks -func slashingBeginBlocker(s *CCVTestSuite, votes []abci.VoteInfo, blocks int64) { - consumerSlashingKeeper := s.consumerApp.GetTestSlashingKeeper() - currentHeight := s.consumerCtx().BlockHeight() - for s.consumerCtx().BlockHeight() < currentHeight+blocks { - for _, voteInfo := range votes { - consumerSlashingKeeper.HandleValidatorSignature( - s.consumerCtx(), - voteInfo.Validator.Address, - voteInfo.Validator.Power, - comet.BlockIDFlag(voteInfo.GetBlockIdFlag()), - ) - } - s.consumerChain.NextBlock() - } -} diff --git a/tests/mbt/driver/setup.go b/tests/mbt/driver/setup.go index 87b7b16e62..acdae7554b 100644 --- a/tests/mbt/driver/setup.go +++ b/tests/mbt/driver/setup.go @@ -499,7 +499,6 @@ func createConsumerGenesis(modelParams ModelParams, providerChain *ibctesting.Te ccvtypes.DefaultConsumerRedistributeFrac, ccvtypes.DefaultHistoricalEntries, modelParams.UnbondingPeriodPerChain[ChainId(consumerClientState.ChainId)], - ccvtypes.DefaultSoftOptOutThreshold, []string{}, []string{}, ccvtypes.DefaultRetryDelayPeriod, diff --git a/x/ccv/consumer/keeper/params.go b/x/ccv/consumer/keeper/params.go index f72b627322..6a9f35dbfe 100644 --- a/x/ccv/consumer/keeper/params.go +++ b/x/ccv/consumer/keeper/params.go @@ -113,13 +113,6 @@ func (k Keeper) GetUnbondingPeriod(ctx sdk.Context) time.Duration { return params.UnbondingPeriod } -// GetSoftOptOutThreshold returns the percentage of validators at the bottom of the set -// that can opt out of running the consumer chain -func (k Keeper) GetSoftOptOutThreshold(ctx sdk.Context) string { - params := k.GetConsumerParams(ctx) - return params.SoftOptOutThreshold -} - func (k Keeper) GetRewardDenoms(ctx sdk.Context) []string { params := k.GetConsumerParams(ctx) return params.RewardDenoms diff --git a/x/ccv/consumer/keeper/params_test.go b/x/ccv/consumer/keeper/params_test.go index 18d3f5a2b2..a9f6cc10d9 100644 --- a/x/ccv/consumer/keeper/params_test.go +++ b/x/ccv/consumer/keeper/params_test.go @@ -28,7 +28,6 @@ func TestParams(t *testing.T) { ccv.DefaultConsumerRedistributeFrac, ccv.DefaultHistoricalEntries, ccv.DefaultConsumerUnbondingPeriod, - ccv.DefaultSoftOptOutThreshold, rewardDenoms, provideRewardDenoms, ccv.DefaultRetryDelayPeriod, @@ -39,7 +38,7 @@ func TestParams(t *testing.T) { newParams := ccv.NewParams(false, 1000, "channel-2", "cosmos19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddwhu7lm", - 7*24*time.Hour, 25*time.Hour, "0.5", 500, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour) + 7*24*time.Hour, 25*time.Hour, "0.5", 500, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour) consumerKeeper.SetParams(ctx, newParams) params = consumerKeeper.GetConsumerParams(ctx) require.Equal(t, newParams, params) diff --git a/x/ccv/consumer/keeper/soft_opt_out.go b/x/ccv/consumer/keeper/soft_opt_out.go deleted file mode 100644 index 39b5bc22bc..0000000000 --- a/x/ccv/consumer/keeper/soft_opt_out.go +++ /dev/null @@ -1,126 +0,0 @@ -package keeper - -import ( - "encoding/binary" - "errors" - "fmt" - "sort" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - - "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" -) - -// BeginBlockSoftOptOut executes BeginBlock logic for the Soft Opt-Out sub-protocol -func (k Keeper) BeginBlockSoftOptOut(ctx sdk.Context) { - // Update smallest validator power that cannot opt out. - k.UpdateSmallestNonOptOutPower(ctx) - - // Update the SigningInfo structs of the Slashing module - k.UpdateSlashingSigningInfo(ctx) -} - -// SetSmallestNonOptOutPower sets the smallest validator power that cannot soft opt out. -func (k Keeper) SetSmallestNonOptOutPower(ctx sdk.Context, power uint64) { - store := ctx.KVStore(k.storeKey) - store.Set(types.SmallestNonOptOutPowerKey(), sdk.Uint64ToBigEndian(power)) -} - -// UpdateSmallestNonOptOutPower updates the smallest validator power that cannot soft opt out. -// This is the smallest validator power such that the sum of the power of all validators with a lower power -// is less than [SoftOptOutThreshold] of the total power of all validators. -func (k Keeper) UpdateSmallestNonOptOutPower(ctx sdk.Context) { - // get soft opt-out threshold - optOutThreshold := math.LegacyMustNewDecFromStr(k.GetSoftOptOutThreshold(ctx)) - if optOutThreshold.IsZero() { - // If the SoftOptOutThreshold is zero, then soft opt-out is disable. - // Setting the smallest non-opt-out power to zero, fixes the diff-testing - // when soft opt-out is disable. - k.SetSmallestNonOptOutPower(ctx, uint64(0)) - return - } - - // get all validators - valset := k.GetAllCCValidator(ctx) - - // Valset should only be empty for hacky tests. Log error in case this ever happens in prod. - if len(valset) == 0 { - k.Logger(ctx).Error("UpdateSoftOptOutThresholdPower called with empty validator set") - return - } - - // sort validators by power ascending - sort.SliceStable(valset, func(i, j int) bool { - return valset[i].Power < valset[j].Power - }) - - // get total power in set - totalPower := math.LegacyZeroDec() - for _, val := range valset { - totalPower = totalPower.Add(math.LegacyNewDec(val.Power)) - } - - // get power of the smallest validator that cannot soft opt out - powerSum := math.LegacyZeroDec() - for _, val := range valset { - powerSum = powerSum.Add(math.LegacyNewDec(val.Power)) - // if powerSum / totalPower > SoftOptOutThreshold - if powerSum.Quo(totalPower).GT(optOutThreshold) { - // set smallest non opt out power - k.SetSmallestNonOptOutPower(ctx, uint64(val.Power)) - k.Logger(ctx).Info("smallest non opt out power updated", "power", val.Power) - return - } - } - panic("UpdateSoftOptOutThresholdPower should not reach this point. Incorrect logic!") -} - -// GetSmallestNonOptOutPower returns the smallest validator power that cannot soft opt out. -func (k Keeper) GetSmallestNonOptOutPower(ctx sdk.Context) int64 { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.SmallestNonOptOutPowerKey()) - if bz == nil { - return 0 - } - return int64(binary.BigEndian.Uint64(bz)) -} - -func (k Keeper) UpdateSlashingSigningInfo(ctx sdk.Context) { - smallestNonOptOutPower := k.GetSmallestNonOptOutPower(ctx) - - // Update SigningInfo for opted out validators - valset := k.GetAllCCValidator(ctx) - // Note that we don't need to sort the valset as GetAllCCValidator - // uses KVStorePrefixIterator that iterates over all the keys with - // a certain prefix in ascending order - for _, val := range valset { - consAddr := sdk.ConsAddress(val.Address) - signingInfo, err := k.slashingKeeper.GetValidatorSigningInfo(ctx, consAddr) - if errors.Is(err, slashingtypes.ErrNoSigningInfoFound) { - continue - } else if err != nil { - panic(fmt.Errorf("failed to get validator signing info for validator %s", consAddr)) - } - if val.Power < smallestNonOptOutPower { - // validator CAN opt-out from validating on consumer chains - if !val.OptedOut { - // previously the validator couldn't opt-out - val.OptedOut = true - } - } else { - // validator CANNOT opt-out from validating on consumer chains - if val.OptedOut { - // previously the validator could opt-out - signingInfo.StartHeight = ctx.BlockHeight() - val.OptedOut = false - } - } - - if err := k.slashingKeeper.SetValidatorSigningInfo(ctx, consAddr, signingInfo); err != nil { - panic(fmt.Errorf("failed to update validator signing info for validator %s", consAddr)) - } - k.SetCCValidator(ctx, val) - } -} diff --git a/x/ccv/consumer/keeper/soft_opt_out_test.go b/x/ccv/consumer/keeper/soft_opt_out_test.go deleted file mode 100644 index 5c21133832..0000000000 --- a/x/ccv/consumer/keeper/soft_opt_out_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - tmtypes "github.com/cometbft/cometbft/types" - - "github.com/cosmos/interchain-security/v5/testutil/crypto" - testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" - ccvtypes "github.com/cosmos/interchain-security/v5/x/ccv/types" -) - -// Tests that UpdateSmallestNonOptOutPower updates the smallest validator power that cannot soft opt out. -// Soft opt out allows the bottom [SoftOptOutThreshold] portion of validators in the set to opt out. -// UpdateSmallestNonOptOutPower should update the smallest validator power that cannot opt out. -func TestUpdateSmallestNonOptOutPower(t *testing.T) { - cIds := crypto.GenMultipleCryptoIds(7, 682934679238) - - testCases := []struct { - name string - // soft opt out threshold set as param - optOutThresh string - // validators to set in store - validators []*tmtypes.Validator - // expected smallest power of validator which cannot opt out - expSmallestNonOptOutValPower int64 - }{ - { - name: "One", - optOutThresh: "0.05", - validators: []*tmtypes.Validator{ - tmtypes.NewValidator(cIds[0].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[1].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[2].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[3].TMCryptoPubKey(), 3), - tmtypes.NewValidator(cIds[4].TMCryptoPubKey(), 49), - tmtypes.NewValidator(cIds[5].TMCryptoPubKey(), 51), - }, - // 107 total power, validator with 3 power passes 0.05 threshold (6 / 107 = 0.056) and cannot opt out - expSmallestNonOptOutValPower: 3, - }, - { - name: "One in different order", - optOutThresh: "0.05", - validators: []*tmtypes.Validator{ - tmtypes.NewValidator(cIds[0].TMCryptoPubKey(), 3), - tmtypes.NewValidator(cIds[1].TMCryptoPubKey(), 51), - tmtypes.NewValidator(cIds[2].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[3].TMCryptoPubKey(), 49), - tmtypes.NewValidator(cIds[4].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[5].TMCryptoPubKey(), 1), - }, - // Same result as first test case, just confirms order of validators doesn't matter - expSmallestNonOptOutValPower: 3, - }, - { - name: "Two", - optOutThresh: "0.05", - validators: []*tmtypes.Validator{ - tmtypes.NewValidator(cIds[0].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[1].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[2].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[3].TMCryptoPubKey(), 3), - tmtypes.NewValidator(cIds[4].TMCryptoPubKey(), 500), - }, - // 506 total power, validator with 500 passes 0.05 threshold and cannot opt out - expSmallestNonOptOutValPower: 500, - }, - { - name: "Three", - optOutThresh: "0.199999", - validators: []*tmtypes.Validator{ - tmtypes.NewValidator(cIds[0].TMCryptoPubKey(), 54), - tmtypes.NewValidator(cIds[1].TMCryptoPubKey(), 53), - tmtypes.NewValidator(cIds[2].TMCryptoPubKey(), 52), - tmtypes.NewValidator(cIds[3].TMCryptoPubKey(), 51), - tmtypes.NewValidator(cIds[4].TMCryptoPubKey(), 50), - tmtypes.NewValidator(cIds[5].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[6].TMCryptoPubKey(), 1), - }, - // 262 total power, (50 + 1 + 1) / 262 ~= 0.19, validator with 51 passes 0.199999 threshold and cannot opt out - expSmallestNonOptOutValPower: 51, - }, - { - name: "soft opt-out disabled", - optOutThresh: "0", - validators: []*tmtypes.Validator{ - tmtypes.NewValidator(cIds[0].TMCryptoPubKey(), 54), - tmtypes.NewValidator(cIds[1].TMCryptoPubKey(), 53), - tmtypes.NewValidator(cIds[2].TMCryptoPubKey(), 52), - tmtypes.NewValidator(cIds[3].TMCryptoPubKey(), 51), - tmtypes.NewValidator(cIds[4].TMCryptoPubKey(), 50), - tmtypes.NewValidator(cIds[5].TMCryptoPubKey(), 1), - tmtypes.NewValidator(cIds[6].TMCryptoPubKey(), 1), - }, - expSmallestNonOptOutValPower: 0, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - consumerKeeper, ctx, ctrl, _ := testkeeper.GetConsumerKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - moduleParams := ccvtypes.DefaultParams() - moduleParams.SoftOptOutThreshold = tc.optOutThresh - consumerKeeper.SetParams(ctx, moduleParams) - defer ctrl.Finish() - - // set validators in store - SetCCValidators(t, consumerKeeper, ctx, tc.validators) - - // update smallest power of validator which cannot opt out - consumerKeeper.UpdateSmallestNonOptOutPower(ctx) - - // expect smallest power of validator which cannot opt out to be updated - require.Equal(t, tc.expSmallestNonOptOutValPower, consumerKeeper.GetSmallestNonOptOutPower(ctx)) - }) - } -} diff --git a/x/ccv/consumer/keeper/validators.go b/x/ccv/consumer/keeper/validators.go index 2c4f0d79ab..3388edd5ae 100644 --- a/x/ccv/consumer/keeper/validators.go +++ b/x/ccv/consumer/keeper/validators.go @@ -142,19 +142,6 @@ func (k Keeper) SlashWithInfractionReason(goCtx context.Context, addr sdk.ConsAd } // Otherwise infraction happened after the changeover was completed. - - // if this is a downtime infraction and the validator is allowed to - // soft opt out, do not queue a slash packet - if infraction == stakingtypes.Infraction_INFRACTION_DOWNTIME { - if power < k.GetSmallestNonOptOutPower(ctx) { - // soft opt out - k.Logger(ctx).Debug("soft opt out", - "validator", addr, - "power", power, - ) - return math.ZeroInt(), nil - } - } // get VSC ID for infraction height vscID := k.GetHeightValsetUpdateID(ctx, uint64(infractionHeight)) diff --git a/x/ccv/consumer/module.go b/x/ccv/consumer/module.go index 49e19542be..a175f2e450 100644 --- a/x/ccv/consumer/module.go +++ b/x/ccv/consumer/module.go @@ -158,9 +158,6 @@ func (AppModule) ConsensusVersion() uint64 { func (am AppModule) BeginBlock(goCtx context.Context) error { ctx := sdk.UnwrapSDKContext(goCtx) - // Execute BeginBlock logic for the Soft Opt-Out sub-protocol - am.keeper.BeginBlockSoftOptOut(ctx) - channelID, found := am.keeper.GetProviderChannel(ctx) if found && am.keeper.IsChannelClosed(ctx, channelID) { // The CCV channel was established, but it was then closed; diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index 1efa8339c7..d66bd924cb 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -230,7 +230,6 @@ func TestValidateInitialGenesisState(t *testing.T) { ccv.DefaultConsumerRedistributeFrac, ccv.DefaultHistoricalEntries, ccv.DefaultConsumerUnbondingPeriod, - ccv.DefaultSoftOptOutThreshold, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, @@ -250,7 +249,6 @@ func TestValidateInitialGenesisState(t *testing.T) { ccv.DefaultConsumerRedistributeFrac, ccv.DefaultHistoricalEntries, ccv.DefaultConsumerUnbondingPeriod, - ccv.DefaultSoftOptOutThreshold, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, @@ -456,7 +454,6 @@ func TestValidateRestartConsumerGenesisState(t *testing.T) { ccv.DefaultConsumerRedistributeFrac, ccv.DefaultHistoricalEntries, ccv.DefaultConsumerUnbondingPeriod, - ccv.DefaultSoftOptOutThreshold, []string{}, []string{}, ccv.DefaultRetryDelayPeriod, diff --git a/x/ccv/consumer/types/keys.go b/x/ccv/consumer/types/keys.go index 184524ccb9..e39eff088e 100644 --- a/x/ccv/consumer/types/keys.go +++ b/x/ccv/consumer/types/keys.go @@ -65,8 +65,9 @@ const ( // [DEPRECATED] LastStandaloneHeightByteKey - // SmallestNonOptOutPowerByteKey is the byte that will store the smallest val power that cannot opt out - SmallestNonOptOutPowerByteKey + // NOTE: This key is deprecated, but left in place to avoid consumer state migrations + // [DEPRECATED] + DeprecatedSmallestNonOptOutPowerByteKey // HistoricalInfoKey is the byte prefix that will store the historical info for a given height HistoricalInfoBytePrefix @@ -209,10 +210,6 @@ func InitGenesisHeightKey() []byte { return []byte{InitGenesisHeightByteKey} } -func SmallestNonOptOutPowerKey() []byte { - return []byte{SmallestNonOptOutPowerByteKey} -} - // StandaloneTransferChannelIDKey returns the key to the transfer channelID that existed from a standalone chain // changing over to a consumer func StandaloneTransferChannelIDKey() []byte { diff --git a/x/ccv/consumer/types/keys_test.go b/x/ccv/consumer/types/keys_test.go index 7ca5ce2a10..14f31a64ee 100644 --- a/x/ccv/consumer/types/keys_test.go +++ b/x/ccv/consumer/types/keys_test.go @@ -31,7 +31,7 @@ func getAllKeyPrefixes() []byte { PreCCVByteKey, InitialValSetByteKey, LastStandaloneHeightByteKey, - SmallestNonOptOutPowerByteKey, + DeprecatedSmallestNonOptOutPowerByteKey, HistoricalInfoBytePrefix, PacketMaturityTimeBytePrefix, HeightValsetUpdateIDBytePrefix, diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index ee4d45a80d..a1cb9d651e 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -19,59 +19,59 @@ func TestValidateParams(t *testing.T) { {"default params", ccvtypes.DefaultParams(), true}, { "custom valid params", - ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), true, + ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), true, }, { "custom invalid params, block per dist transmission", - ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, dist transmission channel", - ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, ccv timeout", - ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, transfer timeout", - ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, consumer redist fraction is negative", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, consumer redist fraction is over 1", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, bad consumer redist fraction ", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, negative num historical entries", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, negative unbonding period", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, invalid reward denom", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"u"}, []string{}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{"u"}, []string{}, 2*time.Hour), false, }, { "custom invalid params, invalid provider reward denom", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{"a"}, 2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{}, []string{"a"}, 2*time.Hour), false, }, { "custom invalid params, retry delay period is negative", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{}, -2*time.Hour), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{}, []string{}, -2*time.Hour), false, }, { "custom invalid params, retry delay period is zero", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{}, 0), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, []string{}, []string{}, 0), false, }, } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 8d471f086b..3cc8d0b9a8 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -324,7 +324,6 @@ func (k Keeper) MakeConsumerGenesis( prop.ConsumerRedistributionFraction, prop.HistoricalEntries, prop.UnbondingPeriod, - "0.05", []string{}, []string{}, ccv.DefaultRetryDelayPeriod, diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 3cd957f61a..4b6cf9bad3 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -16,9 +16,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - sdk "github.com/cosmos/cosmos-sdk/types" - abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" cryptotestutil "github.com/cosmos/interchain-security/v5/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v5/testutil/keeper" @@ -693,7 +692,7 @@ func TestMakeConsumerGenesis(t *testing.T) { "consumer_redistribution_fraction": "0.75", "historical_entries": 10000, "unbonding_period": 1728000000000000, - "soft_opt_out_threshold": "0.05", + "soft_opt_out_threshold": "0", "reward_denoms": [], "provider_reward_denoms": [], "retry_delay_period": 3600000000000 diff --git a/x/ccv/provider/types/legacy_proposal.go b/x/ccv/provider/types/legacy_proposal.go index 37c068e1c2..83b23156f9 100644 --- a/x/ccv/provider/types/legacy_proposal.go +++ b/x/ccv/provider/types/legacy_proposal.go @@ -97,7 +97,7 @@ func (cccp *ConsumerAdditionProposal) ProposalType() string { } // ValidatePSSFeatures returns an error if the `topN` and `validatorsPowerCap` parameters are no in the correct ranges -func ValidatePSSFeatures(topN uint32, validatorsPowerCap uint32) error { +func ValidatePSSFeatures(topN, validatorsPowerCap uint32) error { // Top N corresponds to the top N% of validators that have to validate the consumer chain and can only be 0 (for an // Opt In chain) or in the range [50, 100] (for a Top N chain). if topN != 0 && (topN < 50 || topN > 100) { diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 475389d7df..f1098f6ee3 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -55,7 +55,6 @@ var ( KeyConsumerRedistributionFrac = []byte("ConsumerRedistributionFraction") KeyHistoricalEntries = []byte("HistoricalEntries") KeyConsumerUnbondingPeriod = []byte("UnbondingPeriod") - KeySoftOptOutThreshold = []byte("SoftOptOutThreshold") KeyRewardDenoms = []byte("RewardDenoms") KeyProviderRewardDenoms = []byte("ProviderRewardDenoms") KeyRetryDelayPeriod = []byte("RetryDelayPeriod") @@ -79,7 +78,7 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, distributionTransmissionChannel, providerFeePoolAddrStr string, ccvTimeoutPeriod, transferTimeoutPeriod time.Duration, consumerRedistributionFraction string, historicalEntries int64, - consumerUnbondingPeriod time.Duration, softOptOutThreshold string, + consumerUnbondingPeriod time.Duration, rewardDenoms, providerRewardDenoms []string, retryDelayPeriod time.Duration, ) ConsumerParams { return ConsumerParams{ @@ -92,10 +91,11 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, ConsumerRedistributionFraction: consumerRedistributionFraction, HistoricalEntries: historicalEntries, UnbondingPeriod: consumerUnbondingPeriod, - SoftOptOutThreshold: softOptOutThreshold, - RewardDenoms: rewardDenoms, - ProviderRewardDenoms: providerRewardDenoms, - RetryDelayPeriod: retryDelayPeriod, + // DEPRECATED but setting here to 0 (i.e., disabled) for older versions of interchain-security + SoftOptOutThreshold: "0", + RewardDenoms: rewardDenoms, + ProviderRewardDenoms: providerRewardDenoms, + RetryDelayPeriod: retryDelayPeriod, } } @@ -113,7 +113,6 @@ func DefaultParams() ConsumerParams { DefaultConsumerRedistributeFrac, DefaultHistoricalEntries, DefaultConsumerUnbondingPeriod, - DefaultSoftOptOutThreshold, rewardDenoms, provideRewardDenoms, DefaultRetryDelayPeriod, @@ -199,24 +198,6 @@ func ValidateProviderFeePoolAddrStr(i interface{}) error { return nil } -func ValidateSoftOptOutThreshold(i interface{}) error { - str, ok := i.(string) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - dec, err := math.LegacyNewDecFromStr(str) - if err != nil { - return err - } - if dec.IsNegative() { - return fmt.Errorf("soft opt out threshold cannot be negative, got %s", str) - } - if !dec.Sub(math.LegacyMustNewDecFromStr("0.2")).IsNegative() { - return fmt.Errorf("soft opt out threshold cannot be greater than 0.2, got %s", str) - } - return nil -} - func ValidateDenoms(i interface{}) error { v, ok := i.([]string) if !ok { From cd1bb67c6b13d97d101b42f951b816ab1d7e0590 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 16 Jul 2024 18:23:01 +0300 Subject: [PATCH 2/5] fix changelog names --- .../unreleased/api-breaking/1964-deprecate-soft-opt-out.md | 2 -- .../unreleased/api-breaking/1995-deprecate-soft-opt-out.md | 2 ++ .changelog/unreleased/features/1964-deprecate-soft-opt-out.md | 2 -- .changelog/unreleased/features/1995-deprecate-soft-opt-out.md | 2 ++ .../unreleased/state-breaking/1964-deprecate-soft-opt-out.md | 2 -- .../unreleased/state-breaking/1995-deprecate-soft-opt-out.md | 2 ++ 6 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 .changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md create mode 100644 .changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md delete mode 100644 .changelog/unreleased/features/1964-deprecate-soft-opt-out.md create mode 100644 .changelog/unreleased/features/1995-deprecate-soft-opt-out.md delete mode 100644 .changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md create mode 100644 .changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md diff --git a/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md deleted file mode 100644 index 73de583293..0000000000 --- a/.changelog/unreleased/api-breaking/1964-deprecate-soft-opt-out.md +++ /dev/null @@ -1,2 +0,0 @@ -- Remove soft opt-out feature. - ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..8b6d35982d --- /dev/null +++ b/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file diff --git a/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md deleted file mode 100644 index 73de583293..0000000000 --- a/.changelog/unreleased/features/1964-deprecate-soft-opt-out.md +++ /dev/null @@ -1,2 +0,0 @@ -- Remove soft opt-out feature. - ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..8b6d35982d --- /dev/null +++ b/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md b/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md deleted file mode 100644 index 73de583293..0000000000 --- a/.changelog/unreleased/state-breaking/1964-deprecate-soft-opt-out.md +++ /dev/null @@ -1,2 +0,0 @@ -- Remove soft opt-out feature. - ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md new file mode 100644 index 0000000000..8b6d35982d --- /dev/null +++ b/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md @@ -0,0 +1,2 @@ +- Remove soft opt-out feature. + ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file From 7059c4f166555e7e7cbcbecd29023cb476cddb6b Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 16 Jul 2024 18:29:04 +0300 Subject: [PATCH 3/5] fix tests --- x/ccv/consumer/migrations/v3/legacy_params.go | 9 --------- x/ccv/consumer/migrations/v3/migration_test.go | 2 -- 2 files changed, 11 deletions(-) diff --git a/x/ccv/consumer/migrations/v3/legacy_params.go b/x/ccv/consumer/migrations/v3/legacy_params.go index 0906455e21..8734cb4266 100644 --- a/x/ccv/consumer/migrations/v3/legacy_params.go +++ b/x/ccv/consumer/migrations/v3/legacy_params.go @@ -21,7 +21,6 @@ func GetConsumerParamsLegacy(ctx sdk.Context, paramSpace ccvtypes.LegacyParamSub getConsumerRedistributionFrac(ctx, paramSpace), getHistoricalEntries(ctx, paramSpace), getUnbondingPeriod(ctx, paramSpace), - getSoftOptOutThreshold(ctx, paramSpace), getRewardDenoms(ctx, paramSpace), getProviderRewardDenoms(ctx, paramSpace), getRetryDelayPeriod(ctx, paramSpace), @@ -89,14 +88,6 @@ func getUnbondingPeriod(ctx sdk.Context, paramStore ccvtypes.LegacyParamSubspace return period } -// getSoftOptOutThreshold returns the percentage of validators at the bottom of the set -// that can opt out of running the consumer chain -func getSoftOptOutThreshold(ctx sdk.Context, paramStore ccvtypes.LegacyParamSubspace) string { - var str string - paramStore.Get(ctx, ccvtypes.KeySoftOptOutThreshold, &str) - return str -} - func getRewardDenoms(ctx sdk.Context, paramStore ccvtypes.LegacyParamSubspace) []string { var denoms []string paramStore.Get(ctx, ccvtypes.KeyRewardDenoms, &denoms) diff --git a/x/ccv/consumer/migrations/v3/migration_test.go b/x/ccv/consumer/migrations/v3/migration_test.go index bdc3f59f70..17d36e9745 100644 --- a/x/ccv/consumer/migrations/v3/migration_test.go +++ b/x/ccv/consumer/migrations/v3/migration_test.go @@ -46,8 +46,6 @@ func (ps testLegacyParamSubspace) Get(ctx sdk.Context, key []byte, ptr interface *ptr.(*int64) = ps.HistoricalEntries case string(ccvtypes.KeyConsumerUnbondingPeriod): *ptr.(*time.Duration) = ps.UnbondingPeriod - case string(ccvtypes.KeySoftOptOutThreshold): - *ptr.(*string) = ps.SoftOptOutThreshold case string(ccvtypes.KeyRewardDenoms): *ptr.(*[]string) = ps.RewardDenoms case string(ccvtypes.KeyProviderRewardDenoms): From 43883e30defc472bd9114defa36f423988983cfc Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 16 Jul 2024 18:53:05 +0300 Subject: [PATCH 4/5] added backport link --- .../unreleased/api-breaking/1995-deprecate-soft-opt-out.md | 4 ++-- .changelog/unreleased/features/1995-deprecate-soft-opt-out.md | 4 ++-- .../unreleased/state-breaking/1995-deprecate-soft-opt-out.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md index 8b6d35982d..bf47d6e7e4 100644 --- a/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md +++ b/.changelog/unreleased/api-breaking/1995-deprecate-soft-opt-out.md @@ -1,2 +1,2 @@ -- Remove soft opt-out feature. - ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file +- Remove soft opt-out feature. ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) +Backporting of ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)). \ No newline at end of file diff --git a/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md index 8b6d35982d..6b447d3ed6 100644 --- a/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md +++ b/.changelog/unreleased/features/1995-deprecate-soft-opt-out.md @@ -1,2 +1,2 @@ -- Remove soft opt-out feature. - ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file +- Remove soft opt-out feature. ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) + Backporting of ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)). \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md b/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md index 8b6d35982d..6b447d3ed6 100644 --- a/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md +++ b/.changelog/unreleased/state-breaking/1995-deprecate-soft-opt-out.md @@ -1,2 +1,2 @@ -- Remove soft opt-out feature. - ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) \ No newline at end of file +- Remove soft opt-out feature. ([\#1995](https://github.com/cosmos/interchain-security/pull/1995)) + Backporting of ([\#1964](https://github.com/cosmos/interchain-security/pull/1964)). \ No newline at end of file From 98bcafa33a94c5a63edc8e6b50c8e3c501bc853c Mon Sep 17 00:00:00 2001 From: insumity Date: Wed, 17 Jul 2024 10:04:43 +0300 Subject: [PATCH 5/5] removed unnecessary default value --- x/ccv/types/params.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index f1098f6ee3..c5b2c800a0 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -27,9 +27,6 @@ const ( // decimal number. For example "0.75" would represent 75%. DefaultConsumerRedistributeFrac = "0.75" - // By default, the bottom 5% of the validator set can opt out of validating consumer chains - DefaultSoftOptOutThreshold = "0.05" - // Default number of historical info entries to persist in store. // We use the same default as the staking module, but use a signed integer // so that negative values can be caught during parameter validation in a readable way,