From a5b7a229e54718a174f1e5a5e3c3a7f91de1fc37 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:51:50 -0500 Subject: [PATCH] Add explicit tie-breaker in pending balance deposits sort (#8772) Co-authored-by: Enrico Del Fante --- .../versions/electra/forktransition/ElectraStateUpgrade.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/forktransition/ElectraStateUpgrade.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/forktransition/ElectraStateUpgrade.java index 6cd637e4b49..a2b6795a290 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/forktransition/ElectraStateUpgrade.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/forktransition/ElectraStateUpgrade.java @@ -103,7 +103,9 @@ public BeaconStateElectra upgrade(final BeaconState preState) { .boxed() .sorted( Comparator.comparing( - index -> validators.get(index).getActivationEligibilityEpoch())) + (Integer index) -> + validators.get(index).getActivationEligibilityEpoch()) + .thenComparing(index -> index)) .forEach( index -> beaconStateMutators.queueEntireBalanceAndResetValidator(state, index));