fix a couple of nitpicks before release
This commit is contained in:
parent
812792236d
commit
334d47714d
|
@ -658,9 +658,10 @@ def get_previous_epoch(state: BeaconState) -> EpochNumber:
|
||||||
Return the previous epoch of the given ``state``.
|
Return the previous epoch of the given ``state``.
|
||||||
If the current epoch is ``GENESIS_EPOCH``, return ``GENESIS_EPOCH``.
|
If the current epoch is ``GENESIS_EPOCH``, return ``GENESIS_EPOCH``.
|
||||||
"""
|
"""
|
||||||
if slot_to_epoch(state.slot) > GENESIS_EPOCH:
|
current_epoch = get_current_epoch(state)
|
||||||
return slot_to_epoch(state.slot) - 1
|
if current_epoch == GENESIS_EPOCH:
|
||||||
return slot_to_epoch(state.slot)
|
return GENESIS_EPOCH
|
||||||
|
return current_epoch - 1
|
||||||
```
|
```
|
||||||
|
|
||||||
### `get_current_epoch`
|
### `get_current_epoch`
|
||||||
|
|
|
@ -385,7 +385,7 @@ def get_next_epoch_committee_assignments(
|
||||||
return potential_assignments
|
return potential_assignments
|
||||||
```
|
```
|
||||||
|
|
||||||
`get_next_epoch_committee_assignments` should be called at the beginning of each epoch to plan for the next epoch. A validator should always plan for both values of `registry_change` as a possibility unless the validator can concretely eliminate one of the options. Planning for a future shuffling involves noting at which slot one might have to attest and propose and also which shard one should begin syncing (in phase 1+).
|
`get_next_epoch_committee_assignments` should be called at the start of each epoch to get potential assignments for the next epoch (slots during `current_epoch + 1`). A validator should always plan for both values of `registry_change` as a possibility unless the validator can concretely eliminate one of the options. Planning for future assignments involves noting at which future slot one might have to attest and propose and also which shard one should begin syncing (in phase 1+).
|
||||||
|
|
||||||
## How to avoid slashing
|
## How to avoid slashing
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue