You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADING.md
+48-2Lines changed: 48 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,46 @@
1
-
# Upgrading Replicated Security
1
+
# Upgrading Interchain Security
2
2
3
3
## Unreleased
4
4
5
+
### Provider
6
+
7
+
Upgrading a provider from v6.2.0 requires state migrations. The following migrators should be added to the upgrade handler of the provider chain:
8
+
9
+
```golang
10
+
// Initializes infraction parameters for each active consumer. During slashing and jailing of validators for misbehavior on the consumer chain, the parameters defined for that specific consumer will be used. Initially, default values are set, which can later be customized for each consumer as needed.
SlashFraction: math.LegacyNewDec(0), // no slashing for downtime on the consumer
33
+
},
34
+
}
35
+
}
36
+
```
37
+
38
+
## v6.3.x
39
+
40
+
Upgrading from `v6.2.0` will not require state migration. To upgrade from lower versions, please check the sections below.
41
+
42
+
## v6.2.x
43
+
5
44
### Consumer
6
45
7
46
Upgrading a consumer from v4.4.x to v4.5.x and from v5.x or v6.1.x to v6.2.x requires state migrations. The following migrators should be added to the upgrade handler of the consumer chain:
`MsgCreateConsumer` enables a user to create a consumer chain.
483
483
484
484
Both the `chain_id` and `metadata` fields are mandatory.
485
-
The `initialization_parameters`, `power_shaping_parameters`, and `allowlisted_reward_denoms` fields are optional.
486
-
The parameters not provided are set to their zero value.
485
+
The `initialization_parameters`, `power_shaping_parameters`, `infraction_parameters`and `allowlisted_reward_denoms` fields are optional.
486
+
The parameters not provided are set to their zero value. If `infraction_parameters` are not set, the default values currently configured on the provider are used.
487
487
488
488
The owner of the created consumer chain is the submitter of the message.
489
489
This message cannot be submitted as part of a governance proposal, i.e., the submitter cannot be the gov module account address.
@@ -516,6 +516,9 @@ message MsgCreateConsumer {
516
516
517
517
// allowlisted reward denoms by the consumer chain
@@ -528,7 +531,7 @@ The others fields are optional. Not providing one of them will leave the existin
528
531
Providing one of `metadata`, `initialization_parameters`, `power_shaping_parameters`, or `allowlisted_reward_denoms`
529
532
will update all the containing fields.
530
533
If one of the containing fields is missing, it will be set to its zero value.
531
-
For example, updating the `initialization_parameters` without specifying the `spawn_time`, will set the `spawn_time` to zero.
534
+
For example, updating the `initialization_parameters` without specifying the `spawn_time`, will set the `spawn_time` to zero.
532
535
533
536
If the `initialization_parameters` field is set and `initialization_parameters.spawn_time > 0`, then the consumer chain will be scheduled to launch at `spawn_time`.
534
537
Updating the `spawn_time` from a positive value to zero will remove the consumer chain from the list of scheduled to launch chains.
@@ -568,6 +571,9 @@ message MsgUpdateConsumer {
568
571
569
572
// to update the chain id of the chain (can only be updated if the chain has not yet launched)
570
573
string new_chain_id = 8;
574
+
575
+
// infraction parameters for slashing and jailing
576
+
InfractionParameters infraction_parameters = 9;
571
577
}
572
578
```
573
579
@@ -829,6 +835,7 @@ In the `BeginBlock` of the provider module the following actions are performed:
829
835
- Remove every stopped consumer chain for which the removal time has passed.
830
836
- Replenish the throttling meter if necessary.
831
837
- Distribute ICS rewards to the opted in validators.
838
+
- Update consumer infraction parameters with the queued infraction parameters that were added to the queue before a time period greater than the unbonding time.
832
839
833
840
Note that for every consumer chain, the computation of its initial validator set is based on the consumer's [power shaping parameters](../../features/power-shaping.md)
834
841
and the [validators that opted in on that consumer](../../features/partial-set-security.md).
Copy file name to clipboardExpand all lines: docs/docs/features/slashing.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ The ICS protocol differentiates between downtime and equivocation infractions.
14
14
## Downtime Infractions
15
15
16
16
Downtime infractions are reported by consumer chains and are acted upon on the provider as soon as they are received.
17
-
Instead of slashing, the provider will **_only jail_**offending validator for the duration of time established by the provider chain parameters.
18
-
Note that validators are only jailed for downtime on consumer chains that they opted in to validate on,
17
+
The provider will jail and slash the offending validator. The jailing duration and slashing fraction are determined by the consumer's downtime infraction parameters on the provider chain.
18
+
By default, validators are **_only jailed_** for downtime on consumer chains that they opted in to validate on,
19
19
or in the case of Top N chains, where they are automatically opted in by being in the Top N% of the validator set on the provider.
20
20
21
21
For preventing malicious consumer chains from harming the provider, [slash throttling](../adrs/adr-002-throttle.md) (also known as _jail throttling_) ensures that only a fraction of the provider validator set can be jailed at any given time.
@@ -24,7 +24,7 @@ For preventing malicious consumer chains from harming the provider, [slash throt
24
24
25
25
Equivocation infractions are reported by external agents (e.g., relayers) that can submit to the provider evidence of light client or double signing attacks observed on a consumer chain.
26
26
The evidence is submitted by sending `MsgSubmitConsumerMisbehaviour` or `MsgSubmitConsumerDoubleVoting` messages to the provider.
27
-
When valid evidence is received, the malicious validators are slashed, jailed, and tombstoned on the provider.
27
+
When valid evidence is received, the malicious validators are slashed, jailed, and tombstoned on the provider. The jailing duration and slashing fraction are determined by the consumer's double sign infraction parameters on the provider chain.
28
28
This is enabled through the _cryptographic verification of equivocation_ feature.
29
29
For more details, see [ADR-005](../adrs/adr-005-cryptographic-equivocation-verification.md) and [ADR-013](../adrs/adr-013-equivocation-slashing.md).
30
30
@@ -597,3 +597,7 @@ The following command demonstrates how to run a Hermes instance in _evidence mod
597
597
hermes evidence --chain <CONSUMER-CHAIN-ID>
598
598
```
599
599
Note that `hermes evidence` takes a `--check-past-blocks` option giving the possibility to look for older evidence (default is 100).
600
+
601
+
### Infraction parameters
602
+
603
+
Jailing and slashing for misbehavior on a consumer chain are governed by parameters defined on the provider chain for that specific consumer chain. To create or update these infraction parameters, use the MsgCreateConsumer or MsgUpdateConsumer messages. When creating a consumer chain, if custom infraction parameters are not specified, default values from the provider are applied. For updates, parameters can be modified immediately if the chain is in the pre-launch phase. If the chain has already launched, the update will be scheduled to take effect after the unbonding period expires. This ensures that changes are applied seamlessly based on the chain's lifecycle.
Copy file name to clipboardExpand all lines: scripts/test_doc/test_documentation.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,8 +65,8 @@
65
65
| Function | Short Description |
66
66
|----------|-------------------|
67
67
[TestHandleConsumerMisbehaviour](../../tests/integration/misbehaviour.go#L25) | TestHandleConsumerMisbehaviour tests the handling of consumer misbehavior.<details><summary>Details</summary>* Set up a CCV channel and send an empty VSC packet to ensure that the consumer client revision height is greater than 0.<br>* Construct a Misbehaviour object with two conflicting headers and process the equivocation evidence.<br>* Verify that the provider chain correctly processes this misbehavior.<br>* Ensure that all involved validators are jailed, tombstoned, and slashed according to the expected outcomes.<br>* Assert that their tokens are adjusted based on the slashing fraction.</details> |
68
-
[TestGetByzantineValidators](../../tests/integration/misbehaviour.go#L101) | TestGetByzantineValidators checks the GetByzantineValidators function on various instances of misbehaviour.<details><summary>Details</summary>* Set up a provider and consumer chain.<br>* Create a header with a subset of the validators on the consumer chain, then create a second header (in a variety of different ways),<br>and check which validators are considered Byzantine by calling the GetByzantineValidators function.<br>* The test scenarios are:<br>- when one of the headers is empty, the function should return an error<br>- when one of the headers has a corrupted validator set (e.g. by a validator having a different public key), the function should return an error<br>- when the signatures in one of the headers are corrupted, the function should return an error<br>- when the attack is an amnesia attack (i.e. the headers have different block IDs), no validator is considered byzantine<br>- for non-amnesia misbehaviour, all validators that signed both headers are considered byzantine</details> |
69
-
[TestCheckMisbehaviour](../../tests/integration/misbehaviour.go#L399) | TestCheckMisbehaviour tests that the CheckMisbehaviour function correctly checks for misbehaviour.<details><summary>Details</summary>* Set up a provider and consumer chain.<br>* Create a valid client header and then create a misbehaviour by creating a second header in a variety of different ways.<br>* Check that the CheckMisbehaviour function correctly checks for misbehaviour by verifying that<br>it returns an error when the misbehaviour is invalid and no error when the misbehaviour is valid.<br>* The test scenarios are:<br> - both headers are identical (returns an error)<br> - the misbehaviour is not for the consumer chain (returns an error)<br> - passing an invalid client id (returns an error)<br> - passing a misbehaviour with different header height (returns an error)<br> - passing a misbehaviour older than the min equivocation evidence height (returns an error)<br> - one header of the misbehaviour has insufficient voting power (returns an error)<br> - passing a valid misbehaviour (no error)<br><br>* Test does not test actually submitting the misbehaviour to the chain or freezing the client.</details> |
68
+
[TestGetByzantineValidators](../../tests/integration/misbehaviour.go#L102) | TestGetByzantineValidators checks the GetByzantineValidators function on various instances of misbehaviour.<details><summary>Details</summary>* Set up a provider and consumer chain.<br>* Create a header with a subset of the validators on the consumer chain, then create a second header (in a variety of different ways),<br>and check which validators are considered Byzantine by calling the GetByzantineValidators function.<br>* The test scenarios are:<br>- when one of the headers is empty, the function should return an error<br>- when one of the headers has a corrupted validator set (e.g. by a validator having a different public key), the function should return an error<br>- when the signatures in one of the headers are corrupted, the function should return an error<br>- when the attack is an amnesia attack (i.e. the headers have different block IDs), no validator is considered byzantine<br>- for non-amnesia misbehaviour, all validators that signed both headers are considered byzantine</details> |
69
+
[TestCheckMisbehaviour](../../tests/integration/misbehaviour.go#L400) | TestCheckMisbehaviour tests that the CheckMisbehaviour function correctly checks for misbehaviour.<details><summary>Details</summary>* Set up a provider and consumer chain.<br>* Create a valid client header and then create a misbehaviour by creating a second header in a variety of different ways.<br>* Check that the CheckMisbehaviour function correctly checks for misbehaviour by verifying that<br>it returns an error when the misbehaviour is invalid and no error when the misbehaviour is valid.<br>* The test scenarios are:<br> - both headers are identical (returns an error)<br> - the misbehaviour is not for the consumer chain (returns an error)<br> - passing an invalid client id (returns an error)<br> - passing a misbehaviour with different header height (returns an error)<br> - passing a misbehaviour older than the min equivocation evidence height (returns an error)<br> - one header of the misbehaviour has insufficient voting power (returns an error)<br> - passing a valid misbehaviour (no error)<br><br>* Test does not test actually submitting the misbehaviour to the chain or freezing the client.</details> |
0 commit comments