diff --git a/consensus/state_processing/src/per_epoch_processing/single_pass.rs b/consensus/state_processing/src/per_epoch_processing/single_pass.rs index f5d3f974a6..4ab756b561 100644 --- a/consensus/state_processing/src/per_epoch_processing/single_pass.rs +++ b/consensus/state_processing/src/per_epoch_processing/single_pass.rs @@ -359,6 +359,7 @@ pub fn process_epoch_single_pass( state, &mut next_epoch_cache, effective_balances_ctxt, + conf.effective_balance_updates, state_ctxt, spec, )?; @@ -859,6 +860,7 @@ fn process_pending_consolidations( state: &mut BeaconState, next_epoch_cache: &mut PreEpochCache, effective_balances_ctxt: &EffectiveBalancesContext, + perform_effective_balance_updates: bool, state_ctxt: &StateContext, spec: &ChainSpec, ) -> Result<(), Error> { @@ -910,6 +912,11 @@ fn process_pending_consolidations( )?; *state.pending_consolidations_mut()? = new_pending_consolidations; + // the spec tests require we don't perform effective balance updates when testing pending_consolidations + if !perform_effective_balance_updates { + return Ok(()); + } + // Re-process effective balance updates for validators affected by consolidations. let (validators, balances, _, current_epoch_participation, _, progressive_balances, _, _) = state.mutable_validator_fields()?;