From 399ad6e2bd0d16f35d9cc29283157dbd818d1be5 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sun, 19 May 2019 19:07:53 +1000 Subject: [PATCH] Add a "minimum_validator_count" to EthSpec --- eth2/types/src/beacon_state/beacon_state_types.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eth2/types/src/beacon_state/beacon_state_types.rs b/eth2/types/src/beacon_state/beacon_state_types.rs index 4957d44f7..e76ea9253 100644 --- a/eth2/types/src/beacon_state/beacon_state_types.rs +++ b/eth2/types/src/beacon_state/beacon_state_types.rs @@ -14,6 +14,15 @@ pub trait EthSpec: fn spec() -> ChainSpec; + /// Returns the minimum number of validators required for this spec. + /// + /// This is the _absolute_ minimum, the number required to make the chain operate in the most + /// basic sense. This count is not required to provide any security guarantees regarding + /// decentralization, entropy, etc. + fn minimum_validator_count() -> usize { + Self::slots_per_epoch() as usize + } + /// Returns the `SLOTS_PER_EPOCH` constant for this specification. /// /// Spec v0.6.1