diff --git a/build.gradle b/build.gradle index d6df0daff8e..0026ef99893 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,10 @@ import com.github.jk1.license.filter.LicenseBundleNormalizer +import groovy.json.JsonSlurper import tech.pegasys.internal.license.reporter.GroupedLicenseHtmlRenderer import tech.pegasys.teku.depcheck.DepCheckPlugin import java.text.SimpleDateFormat -import groovy.json.JsonSlurper - import static tech.pegasys.teku.repackage.Repackage.repackage buildscript { @@ -325,7 +324,7 @@ allprojects { } def nightly = System.getenv("NIGHTLY") != null -def refTestVersion = nightly ? "nightly" : "v1.5.0-alpha.8" +def refTestVersion = nightly ? "nightly" : "v1.5.0-alpha.9" def blsRefTestVersion = 'v0.1.2' def slashingProtectionInterchangeRefTestVersion = 'v5.3.0' def refTestBaseUrl = 'https://github.com/ethereum/consensus-spec-tests/releases/download' diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java index 49493302242..09fe4b3af4b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra/block/BlockProcessorElectra.java @@ -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 =