Skip to content

Commit

Permalink
feat!: deprecate soft opt-out (backporting #1964) (#1995)
Browse files Browse the repository at this point in the history
* init commit

* fix changelog names

* fix tests

* added backport link

* removed unnecessary default value
  • Loading branch information
insumity authored Jul 17, 2024
1 parent eb93342 commit 9bb62ec
Show file tree
Hide file tree
Showing 35 changed files with 454 additions and 919 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- 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)).
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1995-deprecate-soft-opt-out.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- 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)).
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- 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)).
8 changes: 0 additions & 8 deletions docs/docs/features/proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ func (tr Chain) submitConsumerModificationProposal(
}

bz, err = cmd.CombinedOutput()

if err != nil {
log.Fatal(err, "\n", string(bz))
}
Expand Down
6 changes: 0 additions & 6 deletions tests/e2e/steps_active_set_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/steps_consumer_misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
57 changes: 10 additions & 47 deletions tests/e2e/steps_partial_set_security.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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
}
31 changes: 26 additions & 5 deletions tests/e2e/tracehandler_testdata/changeover.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -52,6 +53,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -99,6 +101,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -147,6 +150,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -165,7 +169,7 @@
"Deposit": 10000000,
"Status": "2"
},
"Type": "main.UpgradeProposal"
"Type": "e2e.UpgradeProposal"
}
}
}
Expand All @@ -190,6 +194,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -208,7 +213,7 @@
"Deposit": 10000000,
"Status": "3"
},
"Type": "main.UpgradeProposal"
"Type": "e2e.UpgradeProposal"
}
}
}
Expand All @@ -235,7 +240,11 @@
"revision_height": 111
},
"DistributionChannel": "channel-0",
"TopN": 100
"TopN": 100,
"ValidatorsPowerCap": 0,
"ValidatorSetCap": 0,
"Allowlist": null,
"Denylist": null
},
"State": {
"provi": {
Expand All @@ -247,6 +256,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -266,7 +276,7 @@
},
"Status": "2"
},
"Type": "main.ConsumerAdditionProposal"
"Type": "e2e.ConsumerAdditionProposal"
}
}
}
Expand Down Expand Up @@ -298,6 +308,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -317,7 +328,7 @@
},
"Status": "3"
},
"Type": "main.ConsumerAdditionProposal"
"Type": "e2e.ConsumerAdditionProposal"
}
}
}
Expand Down Expand Up @@ -358,6 +369,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -378,6 +390,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -430,6 +443,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -461,6 +475,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -481,6 +496,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -512,6 +528,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -541,6 +558,7 @@
"ValPowers": null,
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -572,6 +590,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand All @@ -592,6 +611,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down Expand Up @@ -623,6 +643,7 @@
},
"StakedTokens": null,
"IBCTransferParams": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": null,
Expand Down
Loading

0 comments on commit 9bb62ec

Please sign in to comment.