From f0027b7b3f2b7e6557295cfe9f28f33b9eb52427 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Mon, 1 Jul 2019 10:05:38 +0800 Subject: [PATCH 1/2] Use `VALIDATOR_REGISTRY_LIMIT` in `compute_shuffled_index` --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 799fa7a3ad..a439858a0f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -19,7 +19,7 @@ - [State list lengths](#state-list-lengths) - [Rewards and penalties](#rewards-and-penalties) - [Max operations per block](#max-operations-per-block) - - [Signature domains](#signature-domains) + - [Signature domain types](#signature-domain-types) - [Containers](#containers) - [Misc dependencies](#misc-dependencies) - [`Fork`](#fork) @@ -715,7 +715,7 @@ def compute_shuffled_index(index: ValidatorIndex, index_count: uint64, seed: Has Return the shuffled validator index corresponding to ``seed`` (and ``index_count``). """ assert index < index_count - assert index_count <= 2**40 + assert index_count <= VALIDATOR_REGISTRY_LIMIT # Swap or not (https://link.springer.com/content/pdf/10.1007%2F978-3-642-32009-5_1.pdf) # See the 'generalized domain' algorithm on page 3 From aba7ee66f2bf1ce8e9580040afd6210b761aa10e Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Sun, 30 Jun 2019 22:20:41 -0500 Subject: [PATCH 2/2] remove length check in compute shuffled index --- specs/core/0_beacon-chain.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index a439858a0f..fe2f93760b 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -715,7 +715,6 @@ def compute_shuffled_index(index: ValidatorIndex, index_count: uint64, seed: Has Return the shuffled validator index corresponding to ``seed`` (and ``index_count``). """ assert index < index_count - assert index_count <= VALIDATOR_REGISTRY_LIMIT # Swap or not (https://link.springer.com/content/pdf/10.1007%2F978-3-642-32009-5_1.pdf) # See the 'generalized domain' algorithm on page 3