From f0ca69c20d0c3924f1cd3cdf6cc266c6b007e222 Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Wed, 2 Oct 2024 17:11:46 +0800 Subject: [PATCH] Fix build --- .../spec/executionlayer/ExecutionLayerChannel.java | 3 +-- .../teku/statetransition/forkchoice/ForkChoice.java | 2 +- .../forkchoice/ForkChoicePayloadExecutorEip7732.java | 12 ++++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannel.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannel.java index 5daaceb026e..2c86cc3e801 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannel.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/executionlayer/ExecutionLayerChannel.java @@ -111,8 +111,7 @@ SafeFuture engineForkChoiceUpdated( ForkChoiceState forkChoiceState, Optional payloadBuildingAttributes); - SafeFuture engineNewPayload( - NewPayloadRequest newPayloadRequest, final UInt64 slot); + SafeFuture engineNewPayload(NewPayloadRequest newPayloadRequest, UInt64 slot); SafeFuture> engineGetClientVersion(ClientVersion clientVersion); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java index edeaea13fa9..cb07cb356de 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoice.java @@ -553,7 +553,7 @@ private SafeFuture onExecutionPayload( final SignedExecutionPayloadEnvelope signedEnvelope, final ExecutionLayerChannel executionLayer) { final ForkChoicePayloadExecutorEip7732 payloadExecutor = - ForkChoicePayloadExecutorEip7732.create(executionLayer); + ForkChoicePayloadExecutorEip7732.create(executionLayer, block.getSlot()); final BlobSidecarsAvailabilityChecker blobSidecarsAvailabilityChecker = blobSidecarManager.createAvailabilityChecker(block); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoicePayloadExecutorEip7732.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoicePayloadExecutorEip7732.java index 021f7e49264..91ff6b590cf 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoicePayloadExecutorEip7732.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/forkchoice/ForkChoicePayloadExecutorEip7732.java @@ -17,6 +17,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import tech.pegasys.teku.infrastructure.async.SafeFuture; +import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayload; import tech.pegasys.teku.spec.datastructures.execution.ExecutionPayloadHeader; import tech.pegasys.teku.spec.datastructures.execution.NewPayloadRequest; @@ -28,15 +29,18 @@ class ForkChoicePayloadExecutorEip7732 implements OptimisticExecutionPayloadExec private static final Logger LOG = LogManager.getLogger(); private final ExecutionLayerChannel executionLayer; + private final UInt64 slot; + private Optional> result = Optional.empty(); - ForkChoicePayloadExecutorEip7732(final ExecutionLayerChannel executionLayer) { + ForkChoicePayloadExecutorEip7732(final ExecutionLayerChannel executionLayer, final UInt64 slot) { this.executionLayer = executionLayer; + this.slot = slot; } public static ForkChoicePayloadExecutorEip7732 create( - final ExecutionLayerChannel executionLayer) { - return new ForkChoicePayloadExecutorEip7732(executionLayer); + final ExecutionLayerChannel executionLayer, final UInt64 slot) { + return new ForkChoicePayloadExecutorEip7732(executionLayer, slot); } public SafeFuture getExecutionResult() { @@ -59,7 +63,7 @@ public boolean optimisticallyExecute( result = Optional.of( executionLayer - .engineNewPayload(payloadToExecute) + .engineNewPayload(payloadToExecute, slot) .thenCompose( result -> SafeFuture.completedFuture(new PayloadValidationResult(result))) .exceptionally(