Skip to content

Commit f892849

Browse files
committed
Implement "Add missed exit checks to consolidation processing"
1 parent 9d5a3af commit f892849

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

consensus/state_processing/src/per_block_processing/process_operations.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,18 @@ pub fn process_consolidation_request<E: EthSpec>(
764764
{
765765
return Ok(());
766766
}
767+
// Verify the source has been active long enough
768+
if current_epoch
769+
< source_validator
770+
.activation_epoch
771+
.safe_add(spec.shard_committee_period)?
772+
{
773+
return Ok(());
774+
}
775+
// Verify the source has no pending withdrawals in the queue
776+
if state.get_pending_balance_to_withdraw(source_index)? > 0 {
777+
return Ok(());
778+
}
767779

768780
// Initiate source validator exit and append pending consolidation
769781
let source_exit_epoch = state

0 commit comments

Comments
 (0)