From 8da467df7ca72aef010f3130d3bf2f03e2b5ae01 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Sat, 26 Jan 2019 15:39:57 -0700 Subject: [PATCH] pr feedback --- specs/core/0_beacon-chain.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index d919ff824..3344d295d 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -937,11 +937,14 @@ def get_crosslink_committees_at_slot(state: BeaconState, """ Returns the list of ``(committee, shard)`` tuples for the ``slot``. """ - current_epoch_slot = get_current_epoch(state) * EPOCH_LENGTH - assert current_epoch_slot <= slot + EPOCH_LENGTH - assert slot < current_epoch_slot + EPOCH_LENGTH + epoch = slot_to_epoch(slot) + current_epoch = get_current_epoch(state) + previous_epoch = current_epoch - 1 if epoch > GENESIS_EPOCH else current_epoch + next_epoch = current_epoch + 1 - if slot < current_epoch_slot: + assert previous_epoch <= epoch < next_epoch + + if epoch < current_epoch: committees_per_slot = get_previous_epoch_committee_count_per_slot(state) seed = state.previous_epoch_seed shuffling_epoch = state.previous_calculation_epoch