Skip to content

Commit

Permalink
spec change
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Sep 10, 2024
1 parent 6800e92 commit 8bf741d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void processWithdrawals(
final SszList<Withdrawal> expectedWithdrawals =
getExpectedWithdrawalsSszList(schemaDefinitionsCapella);

// EIP7732 TODO: hacky (requires refactor)
// no verification against a header required in ePBS
if (genericState.toVersionEip7732().isEmpty()) {
assertWithdrawalsInExecutionPayloadMatchExpected(payloadSummary, expectedWithdrawals);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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,
Expand All @@ -93,6 +95,7 @@ public BlockProcessorEip7732(
schemaDefinitions);
this.miscHelpersEip7732 = miscHelpers;
this.beaconStateAccessorsEip7732 = beaconStateAccessors;
this.predicatesEip7732 = predicates;
this.attestationUtilEip7732 = attestationUtil;
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8bf741d

Please sign in to comment.