PR feedback

This commit is contained in:
Danny Ryan 2020-08-10 13:02:22 -06:00
parent 76c96782e2
commit 8b39d41145
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 12 additions and 2 deletions

View File

@ -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
```

View File

@ -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)