fix a couple of nitpicks before release

This commit is contained in:
Danny Ryan 2019-02-08 10:35:57 -07:00
parent 812792236d
commit 334d47714d
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 5 additions and 4 deletions

View File

@ -658,9 +658,10 @@ def get_previous_epoch(state: BeaconState) -> EpochNumber:
Return the previous epoch of the given ``state``.
If the current epoch is ``GENESIS_EPOCH``, return ``GENESIS_EPOCH``.
"""
if slot_to_epoch(state.slot) > GENESIS_EPOCH:
return slot_to_epoch(state.slot) - 1
return slot_to_epoch(state.slot)
current_epoch = get_current_epoch(state)
if current_epoch == GENESIS_EPOCH:
return GENESIS_EPOCH
return current_epoch - 1
```
### `get_current_epoch`

View File

@ -385,7 +385,7 @@ def get_next_epoch_committee_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