diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExpectedWithdrawals.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExpectedWithdrawals.java index 8c46bc6de7a..128c4e76bbf 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExpectedWithdrawals.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/ExpectedWithdrawals.java @@ -269,7 +269,7 @@ public void processWithdrawals( final SszList expectedWithdrawals = getExpectedWithdrawalsSszList(schemaDefinitionsCapella); - // EIP7732 TODO: hacky (requires refactor) + // no verification against a header required in ePBS if (genericState.toVersionEip7732().isEmpty()) { assertWithdrawalsInExecutionPayloadMatchExpected(payloadSummary, expectedWithdrawals); } diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java index 6ccf2933b2d..e83608ebc54 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/eip7732/block/BlockProcessorEip7732.java @@ -35,6 +35,7 @@ import tech.pegasys.teku.spec.datastructures.blocks.blockbody.versions.eip7732.BeaconBlockBodyEip7732; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; +import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadSummary; import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadHeader; import tech.pegasys.teku.spec.datastructures.execution.versions.eip7732.ExecutionPayloadHeaderEip7732; import tech.pegasys.teku.spec.datastructures.operations.IndexedPayloadAttestation; @@ -44,7 +45,6 @@ import tech.pegasys.teku.spec.datastructures.state.beaconstate.MutableBeaconState; import tech.pegasys.teku.spec.datastructures.state.beaconstate.versions.eip7732.MutableBeaconStateEip7732; import tech.pegasys.teku.spec.logic.common.helpers.BeaconStateMutators.ValidatorExitContext; -import tech.pegasys.teku.spec.logic.common.helpers.Predicates; import tech.pegasys.teku.spec.logic.common.operations.OperationSignatureVerifier; import tech.pegasys.teku.spec.logic.common.operations.validation.OperationValidator; import tech.pegasys.teku.spec.logic.common.statetransition.exceptions.BlockProcessingException; @@ -54,6 +54,7 @@ import tech.pegasys.teku.spec.logic.versions.bellatrix.block.OptimisticExecutionPayloadExecutor; import tech.pegasys.teku.spec.logic.versions.eip7732.helpers.BeaconStateAccessorsEip7732; import tech.pegasys.teku.spec.logic.versions.eip7732.helpers.MiscHelpersEip7732; +import tech.pegasys.teku.spec.logic.versions.eip7732.helpers.PredicatesEip7732; import tech.pegasys.teku.spec.logic.versions.eip7732.util.AttestationUtilEip7732; import tech.pegasys.teku.spec.logic.versions.electra.block.BlockProcessorElectra; import tech.pegasys.teku.spec.logic.versions.electra.helpers.BeaconStateMutatorsElectra; @@ -63,11 +64,12 @@ public class BlockProcessorEip7732 extends BlockProcessorElectra { private final MiscHelpersEip7732 miscHelpersEip7732; private final BeaconStateAccessorsEip7732 beaconStateAccessorsEip7732; + private final PredicatesEip7732 predicatesEip7732; private final AttestationUtilEip7732 attestationUtilEip7732; public BlockProcessorEip7732( final SpecConfigEip7732 specConfig, - final Predicates predicates, + final PredicatesEip7732 predicates, final MiscHelpersEip7732 miscHelpers, final SyncCommitteeUtil syncCommitteeUtil, final BeaconStateAccessorsEip7732 beaconStateAccessors, @@ -93,6 +95,7 @@ public BlockProcessorEip7732( schemaDefinitions); this.miscHelpersEip7732 = miscHelpers; this.beaconStateAccessorsEip7732 = beaconStateAccessors; + this.predicatesEip7732 = predicates; this.attestationUtilEip7732 = attestationUtil; } @@ -285,6 +288,17 @@ public void processExecutionPayload( // Removed in EIP-7732 } + @Override + public void processWithdrawals( + final MutableBeaconState genericState, final ExecutionPayloadSummary payloadSummary) + throws BlockProcessingException { + // return early if the parent block was empty + if (!predicatesEip7732.isParentBlockFull(genericState)) { + return; + } + super.processWithdrawals(genericState, payloadSummary); + } + @Override public ExecutionPayloadHeader extractExecutionPayloadHeader(final BeaconBlockBody beaconBlockBody) throws BlockProcessingException {