Skip to content

Commit

Permalink
EIP-7251 Add missed exit checks to consolidation processing
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Nov 29, 2024
1 parent 49d8d48 commit aea5014
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,19 @@ private void processConsolidationRequest(
"process_consolidation_request: target validator {} is exiting", targetValidatorIndex);
return;
}
// Verify the source has been active long enough
if (currentEpoch.isLessThan(
sourceValidator.getActivationEpoch().plus(specConfig.getShardCommitteePeriod()))) {
LOG.debug("process_consolidation_request: source has not been active long enough");
return;
}
// Verify the source has no pending withdrawals in the queue
if (beaconStateAccessorsElectra
.getPendingBalanceToWithdraw(state, sourceValidatorIndex)
.isGreaterThan(ZERO)) {
LOG.debug("process_consolidation_request: source has pending withdrawals in the queue");
return;
}

// Initiate source validator exit and append pending consolidation
final UInt64 exitEpoch =
Expand Down

0 comments on commit aea5014

Please sign in to comment.