Skip to content

Commit

Permalink
EIP7251: Add missed exit checks to consolidation processing
Browse files Browse the repository at this point in the history
  • Loading branch information
hangleang committed Dec 21, 2024
1 parent 0a58908 commit 79f487b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions transition_functions/src/electra/block_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,16 @@ pub fn process_consolidation_request<P: Preset>(
return Ok(());
}

// > Verify the source has been active long enough
if current_epoch < source_validator.activation_epoch + config.shard_committee_period {
return Ok(());
}

// > Verify the source has no pending withdrawals in the queue
if get_pending_balance_to_withdraw(state, source_index) > 0 {
return Ok(());
}

// > Initiate source validator exit and append pending consolidation
let exit_epoch = compute_consolidation_epoch_and_update_churn(
config,
Expand Down

0 comments on commit 79f487b

Please sign in to comment.