From f892849263c84bcb9e145f57662df01936b9669d Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 19 Dec 2024 18:15:28 +1100 Subject: [PATCH] Implement "Add missed exit checks to consolidation processing" --- .../src/per_block_processing/process_operations.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/consensus/state_processing/src/per_block_processing/process_operations.rs b/consensus/state_processing/src/per_block_processing/process_operations.rs index 22d8592364..5432d8b3b6 100644 --- a/consensus/state_processing/src/per_block_processing/process_operations.rs +++ b/consensus/state_processing/src/per_block_processing/process_operations.rs @@ -764,6 +764,18 @@ pub fn process_consolidation_request( { return Ok(()); } + // Verify the source has been active long enough + if current_epoch + < source_validator + .activation_epoch + .safe_add(spec.shard_committee_period)? + { + return Ok(()); + } + // Verify the source has no pending withdrawals in the queue + if state.get_pending_balance_to_withdraw(source_index)? > 0 { + return Ok(()); + } // Initiate source validator exit and append pending consolidation let source_exit_epoch = state