From 19ec01e4e919252108876168b116f3e511784854 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 12 Dec 2019 06:43:37 -0700 Subject: [PATCH] add comment about activation queue sort order Co-Authored-By: Hsiao-Wei Wang --- specs/core/0_beacon-chain.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 210e1797f..ff0d42634 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -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]