From 86104ea361921cd6b952bd13a22c6a198648404a Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Fri, 7 May 2021 09:55:21 -0700 Subject: [PATCH] Use stable sync committee indices when processing block rewards --- specs/altair/beacon-chain.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specs/altair/beacon-chain.md b/specs/altair/beacon-chain.md index b2ee93557..59b11c8e4 100644 --- a/specs/altair/beacon-chain.md +++ b/specs/altair/beacon-chain.md @@ -571,7 +571,11 @@ def process_sync_committee(state: BeaconState, aggregate: SyncAggregate) -> None proposer_reward = Gwei(participant_reward * PROPOSER_WEIGHT // (WEIGHT_DENOMINATOR - PROPOSER_WEIGHT)) # Apply participant and proposer rewards - committee_indices = get_sync_committee_indices(state, get_current_epoch(state)) + committee_indices = [] + pubkeys = [v.pubkey for v in state.validators] + for pubkey in state.current_sync_committee.pubkeys: + index = pubkeys.index(pubkey) + committee_indices.append(ValidatorIndex(index)) participant_indices = [index for index, bit in zip(committee_indices, aggregate.sync_committee_bits) if bit] for participant_index in participant_indices: increase_balance(state, participant_index, participant_reward)