From acbaad9b3aa4f9890ea3e4a3dba9155f893359a7 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Mon, 16 Oct 2023 21:34:03 -0400 Subject: [PATCH 1/7] lots of places an unsigned timestamp is a problem Signed-off-by: Justin Florentine --- .../consensus/merge/blockcreation/MergeCoordinator.java | 3 ++- .../internal/methods/engine/AbstractEngineNewPayload.java | 3 ++- .../internal/methods/engine/EngineNewPayloadV3.java | 3 ++- .../internal/parameters/UnsignedLongParameter.java | 8 +++++--- .../besu/ethereum/core/BlockHeaderBuilder.java | 3 +-- .../ethereum/mainnet/ParentBeaconBlockRootHelper.java | 7 +++++-- .../besu/ethereum/mainnet/ScheduledProtocolSpec.java | 3 ++- .../headervalidationrules/IncrementalTimestampRule.java | 2 +- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java index d7e2856941f..ffd57c4b27e 100644 --- a/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java +++ b/consensus/merge/src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeCoordinator.java @@ -594,7 +594,8 @@ && isDescendantOf(newHead, blockchain.getChainHeadHeader())) { Optional parentOfNewHead = blockchain.getBlockHeader(newHead.getParentHash()); if (parentOfNewHead.isPresent() - && parentOfNewHead.get().getTimestamp() >= newHead.getTimestamp()) { + && Long.compareUnsigned(newHead.getTimestamp(), parentOfNewHead.get().getTimestamp()) + <= 0) { return ForkchoiceResult.withFailure( INVALID, "new head timestamp not greater than parent", latestValid); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java index c8263450e72..a5b8acfc056 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineNewPayload.java @@ -267,7 +267,8 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) } if (maybeParentHeader.isPresent() - && (blockParam.getTimestamp() <= maybeParentHeader.get().getTimestamp())) { + && (Long.compareUnsigned(maybeParentHeader.get().getTimestamp(), blockParam.getTimestamp()) + >= 0)) { return respondWithInvalid( reqId, blockParam, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java index c7d8a10a4a1..dff7174b49d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV3.java @@ -71,7 +71,8 @@ protected ValidationResult validateParameters( @Override protected ValidationResult validateForkSupported(final long blockTimestamp) { if (protocolSchedule.isPresent()) { - if (cancun.isPresent() && blockTimestamp >= cancun.get().milestone()) { + if (cancun.isPresent() + && Long.compareUnsigned(blockTimestamp, cancun.get().milestone()) >= 0) { return ValidationResult.valid(); } else { return ValidationResult.invalid( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java index 039592d28c2..4a73b70c929 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java @@ -25,14 +25,16 @@ public class UnsignedLongParameter { @JsonCreator public UnsignedLongParameter(final String value) { checkArgument(value != null); - this.value = Long.decode(value); - checkArgument(this.value >= 0); + if (value.startsWith("0x")) { + this.value = Long.parseUnsignedLong(value.substring(2), 16); + } else { + this.value = Long.parseUnsignedLong(value, 16); + } } @JsonCreator public UnsignedLongParameter(final long value) { this.value = value; - checkArgument(this.value >= 0); } public long getValue() { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java index e218bf1d25b..335068e3bc1 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java @@ -238,7 +238,7 @@ private void validateProcessableBlockHeader() { checkState(this.difficulty != null, "Missing block difficulty"); checkState(this.number > -1L, "Missing block number"); checkState(this.gasLimit > -1L, "Missing gas limit"); - checkState(this.timestamp > -1L, "Missing timestamp"); + // checkState(this.timestamp > -1L, "Missing timestamp"); } private void validateSealableBlockHeader() { @@ -360,7 +360,6 @@ public BlockHeaderBuilder gasUsed(final long gasUsed) { } public BlockHeaderBuilder timestamp(final long timestamp) { - checkArgument(timestamp >= 0); this.timestamp = timestamp; return this; } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java index 80eb7a19e9f..2c863add026 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java @@ -18,6 +18,8 @@ import org.hyperledger.besu.evm.account.MutableAccount; import org.hyperledger.besu.evm.worldstate.WorldUpdater; +import com.google.common.primitives.Longs; +import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; import org.apache.tuweni.units.bigints.UInt256; @@ -34,14 +36,15 @@ static void storeParentBeaconBlockRoot( /* see EIP-4788: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4788.md */ - final long timestampReduced = timestamp % HISTORY_BUFFER_LENGTH; + final long timestampReduced = Long.remainderUnsigned(timestamp, HISTORY_BUFFER_LENGTH); final long timestampExtended = timestampReduced + HISTORY_BUFFER_LENGTH; final UInt256 timestampIndex = UInt256.valueOf(timestampReduced); final UInt256 rootIndex = UInt256.valueOf(timestampExtended); final MutableAccount account = worldUpdater.getOrCreate(BEACON_ROOTS_ADDRESS); - account.setStorageValue(timestampIndex, UInt256.valueOf(timestamp)); + account.setStorageValue( + timestampIndex, UInt256.fromBytes(Bytes.of(Longs.toByteArray(timestamp)))); account.setStorageValue(rootIndex, UInt256.fromBytes(root)); worldUpdater.commit(); } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java index 012bb469c6a..d79120d43b6 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java @@ -62,7 +62,8 @@ private TimestampProtocolSpec(final long timestamp, final ProtocolSpec protocolS @Override public boolean isOnOrAfterMilestoneBoundary(final ProcessableBlockHeader header) { - return header.getTimestamp() >= timestamp; + return Long.compareUnsigned(header.getTimestamp(), timestamp) >= 0; + // return header.getTimestamp() >= timestamp; } @Override diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java index bc29e0db9f2..813c1a28b4b 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java @@ -28,6 +28,6 @@ public boolean validate( final long blockTimestamp = header.getTimestamp(); final long parentTimestamp = parent.getTimestamp(); - return blockTimestamp > parentTimestamp; + return Long.compareUnsigned(blockTimestamp, parentTimestamp) >= 0; } } From 19ee8849315a396267bbf9652acf2538c2318c11 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Tue, 17 Oct 2023 14:21:36 -0400 Subject: [PATCH 2/7] removed commented code Signed-off-by: Justin Florentine --- .../org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java | 1 - .../hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java | 1 - 2 files changed, 2 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java index 335068e3bc1..fc38b663ea9 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/BlockHeaderBuilder.java @@ -238,7 +238,6 @@ private void validateProcessableBlockHeader() { checkState(this.difficulty != null, "Missing block difficulty"); checkState(this.number > -1L, "Missing block number"); checkState(this.gasLimit > -1L, "Missing gas limit"); - // checkState(this.timestamp > -1L, "Missing timestamp"); } private void validateSealableBlockHeader() { diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java index d79120d43b6..d03a3fe90ef 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ScheduledProtocolSpec.java @@ -63,7 +63,6 @@ private TimestampProtocolSpec(final long timestamp, final ProtocolSpec protocolS @Override public boolean isOnOrAfterMilestoneBoundary(final ProcessableBlockHeader header) { return Long.compareUnsigned(header.getTimestamp(), timestamp) >= 0; - // return header.getTimestamp() >= timestamp; } @Override From 541429ef6d6b81af0b634bfb65a894b79d65f531 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Tue, 17 Oct 2023 14:54:19 -0400 Subject: [PATCH 3/7] unchecked annotations Signed-off-by: Justin Florentine --- .../jsonrpc/internal/parameters/UnsignedLongParameter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java index 4a73b70c929..eed2857239d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java @@ -17,9 +17,11 @@ import static com.google.common.base.Preconditions.checkArgument; import com.fasterxml.jackson.annotation.JsonCreator; +import org.checkerframework.checker.signedness.qual.Unsigned; public class UnsignedLongParameter { + @Unsigned private final long value; @JsonCreator @@ -33,11 +35,11 @@ public UnsignedLongParameter(final String value) { } @JsonCreator - public UnsignedLongParameter(final long value) { + public UnsignedLongParameter(final @Unsigned long value) { this.value = value; } - public long getValue() { + public @Unsigned long getValue() { return value; } } From 8652dcee337ffab0e8895a04e3c5827b7de2c251 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Tue, 17 Oct 2023 21:02:31 -0400 Subject: [PATCH 4/7] spotless Signed-off-by: Justin Florentine --- build.gradle | 16 ++++++++++++++++ .../parameters/UnsignedLongParameter.java | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index a1950eb65db..03bffe1d676 100644 --- a/build.gradle +++ b/build.gradle @@ -1093,6 +1093,22 @@ distributions { } } +configurations.all { + resolutionStrategy { + dependencySubstitution { + def os = System.getProperty("os.name").toLowerCase() + if (os.contains("windows")) { + substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.win32.win32.x86_64:3.124.0") + } + else if (os.contains("linux")) { + substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64:3.124.0") + } + else if (os.contains("mac")) { + substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.cocoa.macosx.x86_64:3.124.0") + } + } + } +} check.dependsOn checkSpdxHeader build.dependsOn verifyDistributions artifactoryPublish.dependsOn verifyDistributions diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java index eed2857239d..2e9ae8087ec 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/UnsignedLongParameter.java @@ -21,8 +21,7 @@ public class UnsignedLongParameter { - @Unsigned - private final long value; + @Unsigned private final long value; @JsonCreator public UnsignedLongParameter(final String value) { From f61f8f434544fb57d5102eeb35565bad9d883f5d Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Wed, 18 Oct 2023 10:04:22 -0400 Subject: [PATCH 5/7] didn't mean to commit that Signed-off-by: Justin Florentine --- build.gradle | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/build.gradle b/build.gradle index 03bffe1d676..a1950eb65db 100644 --- a/build.gradle +++ b/build.gradle @@ -1093,22 +1093,6 @@ distributions { } } -configurations.all { - resolutionStrategy { - dependencySubstitution { - def os = System.getProperty("os.name").toLowerCase() - if (os.contains("windows")) { - substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.win32.win32.x86_64:3.124.0") - } - else if (os.contains("linux")) { - substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64:3.124.0") - } - else if (os.contains("mac")) { - substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.cocoa.macosx.x86_64:3.124.0") - } - } - } -} check.dependsOn checkSpdxHeader build.dependsOn verifyDistributions artifactoryPublish.dependsOn verifyDistributions From b5592437ae960c58b3638302abf610716d9f02a4 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Wed, 18 Oct 2023 13:18:50 -0400 Subject: [PATCH 6/7] child block must not equal parent timestamp either Signed-off-by: Justin Florentine --- .../mainnet/headervalidationrules/IncrementalTimestampRule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java index 813c1a28b4b..72b5161a775 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/headervalidationrules/IncrementalTimestampRule.java @@ -28,6 +28,6 @@ public boolean validate( final long blockTimestamp = header.getTimestamp(); final long parentTimestamp = parent.getTimestamp(); - return Long.compareUnsigned(blockTimestamp, parentTimestamp) >= 0; + return Long.compareUnsigned(blockTimestamp, parentTimestamp) > 0; } } From de6dd912730a9badddf9898967afa43aa2014703 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Wed, 18 Oct 2023 15:29:16 -0400 Subject: [PATCH 7/7] removed unused withdrawals params Signed-off-by: Justin Florentine --- .../methods/engine/AbstractEngineForkchoiceUpdated.java | 6 ++---- .../internal/methods/engine/EngineForkchoiceUpdatedV1.java | 6 +----- .../internal/methods/engine/EngineForkchoiceUpdatedV2.java | 6 +----- .../internal/methods/engine/EngineForkchoiceUpdatedV3.java | 6 +----- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java index 6f65dc5bd3d..b5c38c1e682 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractEngineForkchoiceUpdated.java @@ -140,7 +140,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) .map(WithdrawalParameter::toWithdrawal) .collect(toList()))); Optional maybeError = - isPayloadAttributesValid(requestId, payloadAttributes, withdrawals); + isPayloadAttributesValid(requestId, payloadAttributes); if (maybeError.isPresent()) { LOG.atWarn() .setMessage("RpcError {}: {}") @@ -229,9 +229,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) } protected abstract Optional isPayloadAttributesValid( - final Object requestId, - final EnginePayloadAttributesParameter payloadAttributes, - final Optional> maybeWithdrawals); + final Object requestId, final EnginePayloadAttributesParameter payloadAttribute); protected Optional isPayloadAttributeRelevantToNewHead( final Object requestId, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java index 24d63fbd434..6aa5f0964b2 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV1.java @@ -20,10 +20,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadAttributesParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; -import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; -import java.util.List; import java.util.Optional; import io.vertx.core.Vertx; @@ -41,9 +39,7 @@ public EngineForkchoiceUpdatedV1( @Override protected Optional isPayloadAttributesValid( - final Object requestId, - final EnginePayloadAttributesParameter payloadAttributes, - final Optional> maybeWithdrawals) { + final Object requestId, final EnginePayloadAttributesParameter payloadAttributes) { return Optional.empty(); } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java index c4daa688d47..b6406a3e662 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV2.java @@ -20,10 +20,8 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadAttributesParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; -import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; -import java.util.List; import java.util.Optional; import io.vertx.core.Vertx; @@ -52,9 +50,7 @@ public String getName() { @Override protected Optional isPayloadAttributesValid( - final Object requestId, - final EnginePayloadAttributesParameter payloadAttributes, - final Optional> maybeWithdrawals) { + final Object requestId, final EnginePayloadAttributesParameter payloadAttributes) { if (payloadAttributes.getTimestamp() >= cancunTimestamp) { if (payloadAttributes.getParentBeaconBlockRoot() == null || payloadAttributes.getParentBeaconBlockRoot().isEmpty()) { diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java index 5b33f653fb3..c070d220854 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineForkchoiceUpdatedV3.java @@ -21,12 +21,10 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadAttributesParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; -import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ScheduledProtocolSpec; import org.hyperledger.besu.ethereum.mainnet.ValidationResult; -import java.util.List; import java.util.Optional; import io.vertx.core.Vertx; @@ -91,9 +89,7 @@ protected ValidationResult validateForkSupported(final long blockT @Override protected Optional isPayloadAttributesValid( - final Object requestId, - final EnginePayloadAttributesParameter payloadAttributes, - final Optional> maybeWithdrawals) { + final Object requestId, final EnginePayloadAttributesParameter payloadAttributes) { if (payloadAttributes.getParentBeaconBlockRoot() == null) { LOG.error( "Parent beacon block root hash not present in payload attributes after cancun hardfork");