mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 16:05:00 -05:00
Sort attester slashing indices to avoid arbitrary ordering
Closes #1125
This commit is contained in:
committed by
Michael Sproul
parent
dd091724d0
commit
a82a6f9a1a
@@ -1707,7 +1707,7 @@ def process_attester_slashing(state: BeaconState, attester_slashing: AttesterSla
|
||||
slashed_any = False
|
||||
attesting_indices_1 = attestation_1.custody_bit_0_indices + attestation_1.custody_bit_1_indices
|
||||
attesting_indices_2 = attestation_2.custody_bit_0_indices + attestation_2.custody_bit_1_indices
|
||||
for index in set(attesting_indices_1).intersection(attesting_indices_2):
|
||||
for index in sorted(set(attesting_indices_1).intersection(attesting_indices_2)):
|
||||
if is_slashable_validator(state.validator_registry[index], get_current_epoch(state)):
|
||||
slash_validator(state, index)
|
||||
slashed_any = True
|
||||
|
||||
Reference in New Issue
Block a user