From 5abe624f441dbd24edc29cc7cff7597125d80593 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Thu, 25 Apr 2024 17:14:45 -0400 Subject: [PATCH] always initialize balances cache if necessary in electra upgrade --- consensus/state_processing/src/upgrade/electra.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus/state_processing/src/upgrade/electra.rs b/consensus/state_processing/src/upgrade/electra.rs index f988b7abd67..7fe243eee3f 100644 --- a/consensus/state_processing/src/upgrade/electra.rs +++ b/consensus/state_processing/src/upgrade/electra.rs @@ -22,6 +22,9 @@ pub fn upgrade_to_electra( .unwrap_or(epoch) .safe_add(1)?; + // The total active balance cache must be built before the consolidation churn limit + // is calculated. + pre_state.build_total_active_balance_cache(spec)?; let consolidation_balance_to_consume = pre_state.get_consolidation_churn_limit(spec)?; let earliest_consolidation_epoch = spec.compute_activation_exit_epoch(epoch)?;