Skip to content

Commit

Permalink
Add missed exit checks to consolidation processing
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha committed Dec 5, 2024
1 parent 410b739 commit afe7063
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,20 @@ private void processConsolidationRequest(
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 =
beaconStateMutatorsElectra.computeConsolidationEpochAndUpdateChurn(
Expand Down

0 comments on commit afe7063

Please sign in to comment.