diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index 3cba3188d..f31be03a2 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -47,7 +47,7 @@ - [`compute_updated_gasprice`](#compute_updated_gasprice) - [`compute_committee_source_epoch`](#compute_committee_source_epoch) - [Beacon state accessors](#beacon-state-accessors) - - [New `get_committee_count_per_slot`](#new-get_committee_count_per_slot) + - [Updated `get_committee_count_per_slot`](#updated-get_committee_count_per_slot) - [`get_active_shard_count`](#get_active_shard_count) - [`get_online_validator_indices`](#get_online_validator_indices) - [`get_shard_committee`](#get_shard_committee) @@ -522,7 +522,7 @@ def compute_committee_source_epoch(epoch: Epoch, period: uint64) -> Epoch: ### Beacon state accessors -#### New `get_committee_count_per_slot` +#### Updated `get_committee_count_per_slot` ```python def get_committee_count_per_slot(state: BeaconState, epoch: Epoch) -> uint64: @@ -539,6 +539,10 @@ def get_committee_count_per_slot(state: BeaconState, epoch: Epoch) -> uint64: ```python def get_active_shard_count(state: BeaconState) -> uint64: + """ + Return the number of active shards. + Note that this puts an upper bound on the number of committees per slot. + """ return INITIAL_ACTIVE_SHARDS ``` diff --git a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py index 3ec76e8b8..fa4e690af 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks.py @@ -76,6 +76,9 @@ def test_empty_block_transition(spec, state): yield 'pre', state + # Ensure pre-state has default randao + assert spec.get_randao_mix(state, spec.get_current_epoch(state)) == spec.Bytes32() + block = build_empty_block_for_next_slot(spec, state) signed_block = state_transition_and_sign_block(spec, state, block) @@ -98,6 +101,9 @@ def test_empty_block_transition_large_validator_set(spec, state): yield 'pre', state + # Ensure pre-state has default randao + assert spec.get_randao_mix(state, spec.get_current_epoch(state)) == spec.Bytes32() + block = build_empty_block_for_next_slot(spec, state) signed_block = state_transition_and_sign_block(spec, state, block)