From d7c276bcd58e854ad22377914b337e748a0d9cdb Mon Sep 17 00:00:00 2001 From: Anton Nashatyrev Date: Thu, 22 Apr 2021 22:06:24 +0300 Subject: [PATCH 1/2] Remove obsolete var and calculation --- specs/sharding/beacon-chain.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specs/sharding/beacon-chain.md b/specs/sharding/beacon-chain.md index 55a47a09e..bd3871c6a 100644 --- a/specs/sharding/beacon-chain.md +++ b/specs/sharding/beacon-chain.md @@ -679,7 +679,6 @@ def process_pending_headers(state: BeaconState) -> None: ] # The entire committee (and its balance) full_committee = get_beacon_committee(state, slot, shard) - full_committee_balance = get_total_balance(state, full_committee) # If any candidates already confirmed, skip if True in [c.confirmed for c in candidates]: continue From 8f371f56277dbb81a4f8f0350004390cde25cbd9 Mon Sep 17 00:00:00 2001 From: Anton Nashatyrev Date: Thu, 22 Apr 2021 22:08:44 +0300 Subject: [PATCH 2/2] Cleanup: move var calculation down right before its usage --- specs/sharding/beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/sharding/beacon-chain.md b/specs/sharding/beacon-chain.md index bd3871c6a..3cd262ed6 100644 --- a/specs/sharding/beacon-chain.md +++ b/specs/sharding/beacon-chain.md @@ -677,12 +677,12 @@ def process_pending_headers(state: BeaconState) -> None: c for c in state.previous_epoch_pending_shard_headers if (c.slot, c.shard) == (slot, shard) ] - # The entire committee (and its balance) - full_committee = get_beacon_committee(state, slot, shard) # If any candidates already confirmed, skip if True in [c.confirmed for c in candidates]: continue + # The entire committee (and its balance) + full_committee = get_beacon_committee(state, slot, shard) # The set of voters who voted for each header (and their total balances) voting_sets = [ [v for i, v in enumerate(full_committee) if c.votes[i]]