mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Fix Epoch Processing Consolidations
This commit is contained in:
@@ -359,6 +359,7 @@ pub fn process_epoch_single_pass<E: EthSpec>(
|
|||||||
state,
|
state,
|
||||||
&mut next_epoch_cache,
|
&mut next_epoch_cache,
|
||||||
effective_balances_ctxt,
|
effective_balances_ctxt,
|
||||||
|
conf.effective_balance_updates,
|
||||||
state_ctxt,
|
state_ctxt,
|
||||||
spec,
|
spec,
|
||||||
)?;
|
)?;
|
||||||
@@ -859,6 +860,7 @@ fn process_pending_consolidations<E: EthSpec>(
|
|||||||
state: &mut BeaconState<E>,
|
state: &mut BeaconState<E>,
|
||||||
next_epoch_cache: &mut PreEpochCache,
|
next_epoch_cache: &mut PreEpochCache,
|
||||||
effective_balances_ctxt: &EffectiveBalancesContext,
|
effective_balances_ctxt: &EffectiveBalancesContext,
|
||||||
|
perform_effective_balance_updates: bool,
|
||||||
state_ctxt: &StateContext,
|
state_ctxt: &StateContext,
|
||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
@@ -910,6 +912,11 @@ fn process_pending_consolidations<E: EthSpec>(
|
|||||||
)?;
|
)?;
|
||||||
*state.pending_consolidations_mut()? = new_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.
|
// Re-process effective balance updates for validators affected by consolidations.
|
||||||
let (validators, balances, _, current_epoch_participation, _, progressive_balances, _, _) =
|
let (validators, balances, _, current_epoch_participation, _, progressive_balances, _, _) =
|
||||||
state.mutable_validator_fields()?;
|
state.mutable_validator_fields()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user