From 5ac5b122446e8b09344f2fb0c889eada6e4a4116 Mon Sep 17 00:00:00 2001 From: insumity Date: Tue, 30 Jan 2024 15:55:41 +0100 Subject: [PATCH] changed top_N_fraction to int --- docs/docs/adrs/adr-015-partial-set-security.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/adrs/adr-015-partial-set-security.md b/docs/docs/adrs/adr-015-partial-set-security.md index a2fe345be6..9e863763ae 100644 --- a/docs/docs/adrs/adr-015-partial-set-security.md +++ b/docs/docs/adrs/adr-015-partial-set-security.md @@ -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).