Merge branch 'dev' into altair-pass
This commit is contained in:
commit
80df9e6b0b
|
@ -276,7 +276,8 @@ def has_flag(flags: ParticipationFlags, flag_index: int) -> bool:
|
||||||
```python
|
```python
|
||||||
def get_sync_committee_indices(state: BeaconState, epoch: Epoch) -> Sequence[ValidatorIndex]:
|
def get_sync_committee_indices(state: BeaconState, epoch: Epoch) -> Sequence[ValidatorIndex]:
|
||||||
"""
|
"""
|
||||||
Return the sequence of sync committee indices (which may include duplicate indices) for a given state and epoch.
|
Return the sequence of sync committee indices (which may include duplicate indices)
|
||||||
|
for a given ``state`` and ``epoch``.
|
||||||
"""
|
"""
|
||||||
MAX_RANDOM_BYTE = 2**8 - 1
|
MAX_RANDOM_BYTE = 2**8 - 1
|
||||||
base_epoch = Epoch((max(epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD, 1) - 1) * EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
|
base_epoch = Epoch((max(epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD, 1) - 1) * EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
|
||||||
|
@ -301,7 +302,7 @@ def get_sync_committee_indices(state: BeaconState, epoch: Epoch) -> Sequence[Val
|
||||||
```python
|
```python
|
||||||
def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee:
|
def get_sync_committee(state: BeaconState, epoch: Epoch) -> SyncCommittee:
|
||||||
"""
|
"""
|
||||||
Return the sync committee for a given state and epoch.
|
Return the sync committee for a given ``state`` and ``epoch``.
|
||||||
"""
|
"""
|
||||||
indices = get_sync_committee_indices(state, epoch)
|
indices = get_sync_committee_indices(state, epoch)
|
||||||
pubkeys = [state.validators[index].pubkey for index in indices]
|
pubkeys = [state.validators[index].pubkey for index in indices]
|
||||||
|
|
|
@ -166,7 +166,7 @@ class BeaconBlockBody(merge.BeaconBlockBody): # [extends The Merge block body]
|
||||||
### `BeaconState`
|
### `BeaconState`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
class BeaconState(merge.BeaconState): # [extends The Merge block body]
|
class BeaconState(merge.BeaconState): # [extends The Merge state]
|
||||||
# [Updated fields]
|
# [Updated fields]
|
||||||
previous_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
previous_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
||||||
current_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
current_epoch_attestations: List[PendingAttestation, MAX_ATTESTATIONS * SLOTS_PER_EPOCH]
|
||||||
|
|
Loading…
Reference in New Issue