From abda2dd5fa0d591efab511ce923793cb8ff79b58 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Fri, 14 May 2021 12:02:46 -0700 Subject: [PATCH] Sharding: move `get_committee_count_per_slot` to the outside --- specs/sharding/beacon-chain.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/sharding/beacon-chain.md b/specs/sharding/beacon-chain.md index b555e962f..775e1f551 100644 --- a/specs/sharding/beacon-chain.md +++ b/specs/sharding/beacon-chain.md @@ -760,8 +760,9 @@ def reset_pending_headers(state: BeaconState) -> None: # Add dummy "empty" PendingShardHeader (default vote for if no shard header available) next_epoch = get_current_epoch(state) + 1 next_epoch_start_slot = compute_start_slot_at_epoch(next_epoch) + committees_per_slot = get_committee_count_per_slot(state, next_epoch) for slot in range(next_epoch_start_slot, next_epoch_start_slot + SLOTS_PER_EPOCH): - for index in range(get_committee_count_per_slot(state, next_epoch)): + for index in range(committees_per_slot): committee_index = CommitteeIndex(index) shard = compute_shard_from_committee_index(state, slot, committee_index) committee_length = len(get_beacon_committee(state, slot, committee_index))