From c08698bffeebf2d2e96a643bbfb14292394c6edd Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Thu, 14 Nov 2019 18:37:51 +0100 Subject: [PATCH] scaffolding to remove last vestiges of get_committee_count(...), SHARD_COUNT, and rest of that 0.8.x infrastructure; this demonstrates equivalence between two, before discarding old code --- beacon_chain/beacon_node.nim | 20 ++++++++++++++------ beacon_chain/spec/beaconstate.nim | 9 +++++---- tests/simulation/run_node.sh | 2 ++ tests/simulation/start.sh | 2 ++ tests/spec_block_processing/test_genesis.nim | 6 +++--- tests/testutil.nim | 19 ++++++++++--------- 6 files changed, 36 insertions(+), 22 deletions(-) diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index 77b573dd6..c3a9dce73 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -547,20 +547,28 @@ proc handleAttestations(node: BeaconNode, head: BlockRef, slot: Slot) = let epoch = compute_epoch_at_slot(slot) committees_per_slot = + # get_committee_count_at_slot(state, slot) get_committee_count_at_slot(state, epoch.compute_start_slot_at_epoch) offset = committees_per_slot * (slot mod SLOTS_PER_EPOCH) slot_start_shard = (get_start_shard(state, epoch) + offset) mod SHARD_COUNT - for i in 0'u64..