add comment about activation queue sort order

Co-Authored-By: Hsiao-Wei Wang <hwwang156@gmail.com>
This commit is contained in:
Danny Ryan 2019-12-12 06:43:37 -07:00 committed by GitHub
parent 45620e345d
commit 19ec01e4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1341,7 +1341,8 @@ def process_registry_updates(state: BeaconState) -> None:
activation_queue = sorted([
index for index, validator in enumerate(state.validators)
if is_eligible_for_activation(state, validator)
], key=lambda index: state.validators[index].activation_eligibility_epoch)
# Order by the sequence of activation_eligibility_epoch setting and then index.
], key=lambda index: (state.validators[index].activation_eligibility_epoch, index))
# Dequeued validators for activation up to churn limit
for index in activation_queue[:get_validator_churn_limit(state)]:
validator = state.validators[index]