From 334d47714df2b3f41b82ad2adea2aa6636369c3e Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Fri, 8 Feb 2019 10:35:57 -0700 Subject: [PATCH] fix a couple of nitpicks before release --- specs/core/0_beacon-chain.md | 7 ++++--- specs/validator/0_beacon-chain-validator.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 21a991c42..ebc12324c 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -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` diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index d1246c6fa..5b8a93af9 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -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