Skip to content

Commit

Permalink
changed top_N_fraction to int
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed Jan 30, 2024
1 parent 4ccb925 commit 5ac5b12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/adrs/adr-015-partial-set-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ As a simplification and to avoid [chain id squatting](https://forum.cosmos.netwo
Consumer chains join PSS the same way chains now join Replicated Security, namely through a `ConsumerAdditionProposal` proposal.
We extend [`ConsumerAdditionProposal`](https://github.com/cosmos/interchain-security/blob/v4.0.0/proto/interchain_security/ccv/provider/v1/provider.proto#L27) with one optional field:

`string top_N_fraction`: Corresponds to the percentage of validators that join under the Top N case.
For example, `0.53` corresponds to a Top 53% chain, meaning that the top `53%` provider validators have to validate the proposed consumer chain.
`top_N_fraction` can be `0` or include any value in `[0.5, 0.95]`. A chain can join with `top_N_fraction == 0` as an Opt In, or with `top_N_fraction ∈ [0.5, 0.95]` as a Top N chain.
`uint32 top_N_fraction`: Corresponds to the percentage of validators that join under the Top N case.
For example, `53` corresponds to a Top 53% chain, meaning that the top `53%` provider validators have to validate the proposed consumer chain.
`top_N_fraction` can be `0` or include any value in `[50, 95]`. A chain can join with `top_N_fraction == 0` as an Opt In, or with `top_N_fraction ∈ [0.5, 0.95]` as a Top N chain.

In case of a Top N chain, we restrict the possible values of `top_N_fraction` from `(0, 1]` to `[0.5, 0.95]`.
By having `top_N_fraction >= 0.5` we can guarantee that we cannot have a successful invalid-execution attack, assuming that at most `1/3` of provider validators can be malicious.
In case of a Top N chain, we restrict the possible values of `top_N_fraction` from `(0, 100]` to `[50, 95]`.
By having `top_N_fraction >= 50` we can guarantee that we cannot have a successful invalid-execution attack, assuming that at most `1/3` of provider validators can be malicious.
This is because, a Top N chain with `N >= 50%` would have at least `1/3` honest validators, which is sufficient to stop invalid-execution attacks.
Additionally, by having `N >= 50%` (and hence `N > (VetoThreshold = 33.4%)`) we enable the top N validators to `Veto` any `ConsumerAdditionProposal` for consumer chains they do not want to validate.

`top_N_fraction` can be up to `0.95` (`95%`) to capture how Replicated Security is currently used, where we allow the bottom `5%` of validators to soft opt out.
`top_N_fraction` can be up to `95` (`95%`) to capture how Replicated Security is currently used, where we allow the bottom `5%` of validators to soft opt out.
Validators that belong in the bottom `5%` of validators can choose to opt in if they want to validate.

If a proposal has those arguments wrongly set, it should get rejected in [ValidateBasic](https://github.com/cosmos/interchain-security/blob/v4.0.0/x/ccv/provider/types/proposal.go#L86).
Expand Down

0 comments on commit 5ac5b12

Please sign in to comment.