From 54ad03f8cb96ac9be8f632213096a860e6e8c190 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Fri, 22 Mar 2024 10:25:10 +1300 Subject: [PATCH 1/5] Moved engine_newPayload6110 and engine_getPayload6110 to V4 Signed-off-by: Lucas Saldanha --- CHANGELOG.md | 3 ++- .../besu/ethereum/api/jsonrpc/RpcMethod.java | 4 ++-- .../engine/EngineExchangeCapabilities.java | 1 - ...yloadV6110.java => EngineGetPayloadV4.java} | 18 +++++++++--------- ...yloadV6110.java => EngineNewPayloadV4.java} | 17 ++++++++--------- .../internal/results/BlockResultFactory.java | 4 ++-- ...6110.java => EngineGetPayloadResultV4.java} | 4 ++-- .../methods/ExecutionEngineJsonRpcMethods.java | 10 +++++----- ...10Test.java => EngineGetPayloadV4Test.java} | 18 +++++++++--------- ...10Test.java => EngineNewPayloadV4Test.java} | 4 ++-- 10 files changed, 41 insertions(+), 42 deletions(-) rename ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/{EngineGetPayloadV6110.java => EngineGetPayloadV4.java} (82%) rename ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/{EngineNewPayloadV6110.java => EngineNewPayloadV4.java} (85%) rename ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/{EngineGetPayloadResultV6110.java => EngineGetPayloadResultV4.java} (98%) rename ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/{EngineGetPayloadV6110Test.java => EngineGetPayloadV4Test.java} (92%) rename ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/{EngineNewPayloadV6110Test.java => EngineNewPayloadV4Test.java} (98%) diff --git a/CHANGELOG.md b/CHANGELOG.md index eefdbec72e6..b2bcbc6ab30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -442,7 +442,8 @@ https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.4.4/besu-23.4.4.z - Early access - layered transaction pool implementation [#5290](https://github.com/hyperledger/besu/pull/5290) - New RPC method `debug_getRawReceipts` [#5476](https://github.com/hyperledger/besu/pull/5476) - Add TrieLogFactory plugin support [#5440](https://github.com/hyperledger/besu/pull/5440) -- Ignore `min-block-occupancy-ratio` option when on PoS networks, since in some cases, it prevents to have full blocks even if enough transactions are present [#5491](https://github.com/hyperledger/besu/pull/5491) +- Ignore `min-block-occupancy-ratio` option when on PoS networks, since in some cases, it prevents to have full blocks even if enough transactions are present [#5491](https://github.com/hyperledger/besu/pull/5491) +- Added engine_newPayloadV4 and engine_getPayloadV4 methods ### Bug Fixes - Fix eth_feeHistory response for the case in which blockCount is higher than highestBlock requested. [#5397](https://github.com/hyperledger/besu/pull/5397) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java index eb18f1379c1..7b528ebd452 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java @@ -54,11 +54,11 @@ public enum RpcMethod { ENGINE_GET_PAYLOAD_V1("engine_getPayloadV1"), ENGINE_GET_PAYLOAD_V2("engine_getPayloadV2"), ENGINE_GET_PAYLOAD_V3("engine_getPayloadV3"), - ENGINE_GET_PAYLOAD_V6110("engine_getPayloadV6110"), + ENGINE_GET_PAYLOAD_V4("engine_getPayloadV4"), ENGINE_NEW_PAYLOAD_V1("engine_newPayloadV1"), ENGINE_NEW_PAYLOAD_V2("engine_newPayloadV2"), ENGINE_NEW_PAYLOAD_V3("engine_newPayloadV3"), - ENGINE_NEW_PAYLOAD_V6110("engine_newPayloadV6110"), + ENGINE_NEW_PAYLOAD_V4("engine_newPayloadV4"), ENGINE_FORKCHOICE_UPDATED_V1("engine_forkchoiceUpdatedV1"), ENGINE_FORKCHOICE_UPDATED_V2("engine_forkchoiceUpdatedV2"), ENGINE_FORKCHOICE_UPDATED_V3("engine_forkchoiceUpdatedV3"), diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java index fcc26cad641..f59681a3854 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineExchangeCapabilities.java @@ -63,7 +63,6 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) .filter(e -> e.getMethodName().startsWith("engine_")) .filter(e -> !e.equals(ENGINE_EXCHANGE_CAPABILITIES)) .filter(e -> !e.equals(ENGINE_PREPARE_PAYLOAD_DEBUG)) - .filter(e -> !e.getMethodName().endsWith("6110")) .map(RpcMethod::getMethodName) .collect(Collectors.toList()); diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java similarity index 82% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java index c9a9737a90a..feebfebd3d7 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4.java @@ -32,11 +32,11 @@ import io.vertx.core.Vertx; -public class EngineGetPayloadV6110 extends AbstractEngineGetPayload { +public class EngineGetPayloadV4 extends AbstractEngineGetPayload { - private final Optional eip6110; + private final Optional prague; - public EngineGetPayloadV6110( + public EngineGetPayloadV4( final Vertx vertx, final ProtocolContext protocolContext, final MergeMiningCoordinator mergeMiningCoordinator, @@ -50,12 +50,12 @@ public EngineGetPayloadV6110( mergeMiningCoordinator, blockResultFactory, engineCallListener); - this.eip6110 = schedule.hardforkFor(s -> s.fork().name().equalsIgnoreCase("ExperimentalEips")); + this.prague = schedule.hardforkFor(s -> s.fork().name().equalsIgnoreCase("Prague")); } @Override public String getName() { - return RpcMethod.ENGINE_GET_PAYLOAD_V6110.getMethodName(); + return RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(); } @Override @@ -66,22 +66,22 @@ protected JsonRpcResponse createResponse( return new JsonRpcSuccessResponse( request.getRequest().getId(), - blockResultFactory.payloadTransactionCompleteV6110(blockWithReceipts)); + blockResultFactory.payloadTransactionCompleteV4(blockWithReceipts)); } @Override protected ValidationResult validateForkSupported(final long blockTimestamp) { if (protocolSchedule.isPresent()) { - if (eip6110.isPresent() && blockTimestamp >= eip6110.get().milestone()) { + if (prague.isPresent() && blockTimestamp >= prague.get().milestone()) { return ValidationResult.valid(); } else { return ValidationResult.invalid( RpcErrorType.UNSUPPORTED_FORK, - "EIP-6110 configured to start at timestamp: " + eip6110.get().milestone()); + "Prague configured to start at timestamp: " + prague.get().milestone()); } } else { return ValidationResult.invalid( - RpcErrorType.UNSUPPORTED_FORK, "Configuration error, no schedule for EIP-6110 fork set"); + RpcErrorType.UNSUPPORTED_FORK, "Configuration error, no schedule for Prague fork set"); } } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java similarity index 85% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java index 84f203c3a73..07315535c2d 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4.java @@ -29,11 +29,11 @@ import io.vertx.core.Vertx; -public class EngineNewPayloadV6110 extends AbstractEngineNewPayload { +public class EngineNewPayloadV4 extends AbstractEngineNewPayload { - private final Optional eip6110; + private final Optional prague; - public EngineNewPayloadV6110( + public EngineNewPayloadV4( final Vertx vertx, final ProtocolSchedule timestampSchedule, final ProtocolContext protocolContext, @@ -42,13 +42,12 @@ public EngineNewPayloadV6110( final EngineCallListener engineCallListener) { super( vertx, timestampSchedule, protocolContext, mergeCoordinator, ethPeers, engineCallListener); - this.eip6110 = - timestampSchedule.hardforkFor(s -> s.fork().name().equalsIgnoreCase("ExperimentalEips")); + this.prague = timestampSchedule.hardforkFor(s -> s.fork().name().equalsIgnoreCase("prague")); } @Override public String getName() { - return RpcMethod.ENGINE_NEW_PAYLOAD_V6110.getMethodName(); + return RpcMethod.ENGINE_NEW_PAYLOAD_V4.getMethodName(); } @Override @@ -74,16 +73,16 @@ protected ValidationResult validateParameters( @Override protected ValidationResult validateForkSupported(final long blockTimestamp) { if (protocolSchedule.isPresent()) { - if (eip6110.isPresent() && blockTimestamp >= eip6110.get().milestone()) { + if (prague.isPresent() && blockTimestamp >= prague.get().milestone()) { return ValidationResult.valid(); } else { return ValidationResult.invalid( RpcErrorType.UNSUPPORTED_FORK, - "EIP-6110 configured to start at timestamp: " + eip6110.get().milestone()); + "Prague configured to start at timestamp: " + prague.get().milestone()); } } else { return ValidationResult.invalid( - RpcErrorType.UNSUPPORTED_FORK, "Configuration error, no schedule for EIP-6110 fork set"); + RpcErrorType.UNSUPPORTED_FORK, "Configuration error, no schedule for Prague fork set"); } } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java index 9596151bdfe..4bb3add6ac4 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/BlockResultFactory.java @@ -154,7 +154,7 @@ public EngineGetPayloadResultV3 payloadTransactionCompleteV3( blobsBundleV1); } - public EngineGetPayloadResultV6110 payloadTransactionCompleteV6110( + public EngineGetPayloadResultV4 payloadTransactionCompleteV4( final BlockWithReceipts blockWithReceipts) { final List txs = blockWithReceipts.getBlock().getBody().getTransactions().stream() @@ -168,7 +168,7 @@ public EngineGetPayloadResultV6110 payloadTransactionCompleteV6110( final BlobsBundleV1 blobsBundleV1 = new BlobsBundleV1(blockWithReceipts.getBlock().getBody().getTransactions()); - return new EngineGetPayloadResultV6110( + return new EngineGetPayloadResultV4( blockWithReceipts.getHeader(), txs, blockWithReceipts.getBlock().getBody().getWithdrawals(), diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV6110.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java similarity index 98% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV6110.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java index 4b47101fb64..721438a8746 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV6110.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/EngineGetPayloadResultV4.java @@ -30,13 +30,13 @@ import org.apache.tuweni.bytes.Bytes32; @JsonPropertyOrder({"executionPayload", "blockValue", "blobsBundle", "shouldOverrideBuilder"}) -public class EngineGetPayloadResultV6110 { +public class EngineGetPayloadResultV4 { protected final PayloadResult executionPayload; private final String blockValue; private final BlobsBundleV1 blobsBundle; private final boolean shouldOverrideBuilder; - public EngineGetPayloadResultV6110( + public EngineGetPayloadResultV4( final BlockHeader header, final List transactions, final Optional> withdrawals, diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java index 9f4480b82be..0c090419cb1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/ExecutionEngineJsonRpcMethods.java @@ -28,11 +28,11 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineGetPayloadV1; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineGetPayloadV2; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineGetPayloadV3; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineGetPayloadV6110; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineGetPayloadV4; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineNewPayloadV1; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineNewPayloadV2; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineNewPayloadV3; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineNewPayloadV6110; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineNewPayloadV4; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EnginePreparePayloadDebug; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.engine.EngineQosTimer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.BlockResultFactory; @@ -160,9 +160,9 @@ protected Map create() { protocolSchedule)); } - if (protocolSchedule.anyMatch(p -> p.spec().getName().equalsIgnoreCase("ExperimentalEips"))) { + if (protocolSchedule.anyMatch(p -> p.spec().getName().equalsIgnoreCase("prague"))) { executionEngineApisSupported.add( - new EngineGetPayloadV6110( + new EngineGetPayloadV4( consensusEngineServer, protocolContext, mergeCoordinator.get(), @@ -171,7 +171,7 @@ protected Map create() { protocolSchedule)); executionEngineApisSupported.add( - new EngineNewPayloadV6110( + new EngineNewPayloadV4( consensusEngineServer, protocolSchedule, protocolContext, diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java similarity index 92% rename from ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110Test.java rename to ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java index 879f11e724c..377341c20ba 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV6110Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java @@ -32,7 +32,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcErrorResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.EngineGetPayloadResultV6110; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.EngineGetPayloadResultV4; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.results.Quantity; import org.hyperledger.besu.ethereum.core.BlobTestFixture; import org.hyperledger.besu.ethereum.core.Block; @@ -59,9 +59,9 @@ @ExtendWith( MockitoExtension.class) // mocks in parent class may not be used, throwing unnecessary stubbing -public class EngineGetPayloadV6110Test extends AbstractEngineGetPayloadTest { +public class EngineGetPayloadV4Test extends AbstractEngineGetPayloadTest { - public EngineGetPayloadV6110Test() { + public EngineGetPayloadV4Test() { super(); } @@ -74,7 +74,7 @@ public void before() { .thenReturn(Optional.of(mockBlockWithReceiptsAndDeposits)); when(protocolContext.safeConsensusContext(Mockito.any())).thenReturn(Optional.of(mergeContext)); this.method = - new EngineGetPayloadV6110( + new EngineGetPayloadV4( vertx, protocolContext, mergeMiningCoordinator, @@ -137,14 +137,14 @@ public void shouldReturnBlockForKnownPayloadId() { when(mergeContext.retrieveBlockById(postEip6110Pid)).thenReturn(Optional.of(postEip6110Block)); - final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V6110.getMethodName(), postEip6110Pid); + final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(), postEip6110Pid); assertThat(resp).isInstanceOf(JsonRpcSuccessResponse.class); Optional.of(resp) .map(JsonRpcSuccessResponse.class::cast) .ifPresent( r -> { - assertThat(r.getResult()).isInstanceOf(EngineGetPayloadResultV6110.class); - final EngineGetPayloadResultV6110 res = (EngineGetPayloadResultV6110) r.getResult(); + assertThat(r.getResult()).isInstanceOf(EngineGetPayloadResultV4.class); + final EngineGetPayloadResultV4 res = (EngineGetPayloadResultV4) r.getResult(); assertThat(res.getExecutionPayload().getWithdrawals()).isNotNull(); assertThat(res.getExecutionPayload().getDeposits()).isNotNull(); assertThat(res.getExecutionPayload().getHash()) @@ -163,7 +163,7 @@ public void shouldReturnBlockForKnownPayloadId() { @Test public void shouldReturnUnsupportedFork() { - final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V6110.getMethodName(), mockPid); + final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(), mockPid); assertThat(resp).isInstanceOf(JsonRpcErrorResponse.class); assertThat(((JsonRpcErrorResponse) resp).getErrorType()) @@ -172,6 +172,6 @@ public void shouldReturnUnsupportedFork() { @Override protected String getMethodName() { - return RpcMethod.ENGINE_GET_PAYLOAD_V6110.getMethodName(); + return RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java similarity index 98% rename from ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110Test.java rename to ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index 6390b8716c6..0def47f5e05 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV6110Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -54,11 +54,11 @@ import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -public class EngineNewPayloadV6110Test extends EngineNewPayloadV3Test { +public class EngineNewPayloadV4Test extends EngineNewPayloadV3Test { private static final Address depositContractAddress = Address.fromHexString("0x00000000219ab540356cbb839cbe05303d7705fa"); - public EngineNewPayloadV6110Test() {} + public EngineNewPayloadV4Test() {} @BeforeEach @Override From b1392f6261119554a275fb56e76947c308fd74b5 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Fri, 22 Mar 2024 16:20:07 +1300 Subject: [PATCH 2/5] Fix ATs Signed-off-by: Lucas Saldanha --- CHANGELOG.md | 2 +- ...Test.java => ExecutionEnginePragueAcceptanceTest.java} | 8 ++++---- .../jsonrpc/engine/{eip6110 => prague}/genesis.json | 2 +- .../test-cases/01_cancun_prepare_payload.json | 0 .../test-cases/02_cancun_getPayloadV3.json | 0 .../test-cases/03_cancun_newPayloadV3.json | 0 .../test-cases/04_cancun_forkchoiceUpdatedV3.json | 0 .../test-cases/05_prague_forkchoiceUpdatedV3.json} | 0 .../test-cases/06_prague_getPayloadV4.json} | 2 +- .../test-cases/07_prague_send_raw_transaction.json} | 0 .../08_prague_invalid_null_deposits_execute_payload.json} | 2 +- .../test-cases/09_prague_newPayloadV4.json} | 2 +- .../test-cases/10_prague_forkchoiceUpdatedV3.json} | 0 .../test-cases/11_prague_getPayloadV4.json} | 2 +- .../besu/ethereum/mainnet/MainnetProtocolSpecs.java | 4 ++++ 15 files changed, 14 insertions(+), 10 deletions(-) rename acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/{ExecutionEngineEip6110AcceptanceTest.java => ExecutionEnginePragueAcceptanceTest.java} (85%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110 => prague}/genesis.json (99%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110 => prague}/test-cases/01_cancun_prepare_payload.json (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110 => prague}/test-cases/02_cancun_getPayloadV3.json (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110 => prague}/test-cases/03_cancun_newPayloadV3.json (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110 => prague}/test-cases/04_cancun_forkchoiceUpdatedV3.json (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/05_eip6110_forkchoiceUpdatedV3.json => prague/test-cases/05_prague_forkchoiceUpdatedV3.json} (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/06_eip6110_getPayloadV6110.json => prague/test-cases/06_prague_getPayloadV4.json} (97%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/07_eip6110_send_raw_transaction.json => prague/test-cases/07_prague_send_raw_transaction.json} (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/08_eip6110_invalid_null_deposits_execute_payload.json => prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json} (97%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/09_eip6110_newPayloadV6110.json => prague/test-cases/09_prague_newPayloadV4.json} (98%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/10_eip6110_forkchoiceUpdatedV3.json => prague/test-cases/10_prague_forkchoiceUpdatedV3.json} (100%) rename acceptance-tests/tests/src/test/resources/jsonrpc/engine/{eip6110/test-cases/11_eip6110_getPayloadV6110.json => prague/test-cases/11_prague_getPayloadV4.json} (97%) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2bcbc6ab30..48955bf2b0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Transaction call object to accept both `input` and `data` field simultaneously if they are set to equal values [#6702](https://github.com/hyperledger/besu/pull/6702) - `eth_call` for blob tx allows for empty `maxFeePerBlobGas` [#6731](https://github.com/hyperledger/besu/pull/6731) - Extend error handling of plugin RPC methods [#6759](https://github.com/hyperledger/besu/pull/6759) +- Added engine_newPayloadV4 and engine_getPayloadV4 methods [#6783](https://github.com/hyperledger/besu/pull/6783) ### Bug fixes - Fix txpool dump/restore race condition [#6665](https://github.com/hyperledger/besu/pull/6665) @@ -443,7 +444,6 @@ https://hyperledger.jfrog.io/artifactory/besu-binaries/besu/23.4.4/besu-23.4.4.z - New RPC method `debug_getRawReceipts` [#5476](https://github.com/hyperledger/besu/pull/5476) - Add TrieLogFactory plugin support [#5440](https://github.com/hyperledger/besu/pull/5440) - Ignore `min-block-occupancy-ratio` option when on PoS networks, since in some cases, it prevents to have full blocks even if enough transactions are present [#5491](https://github.com/hyperledger/besu/pull/5491) -- Added engine_newPayloadV4 and engine_getPayloadV4 methods ### Bug Fixes - Fix eth_feeHistory response for the case in which blockCount is higher than highestBlock requested. [#5397](https://github.com/hyperledger/besu/pull/5397) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEngineEip6110AcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEnginePragueAcceptanceTest.java similarity index 85% rename from acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEngineEip6110AcceptanceTest.java rename to acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEnginePragueAcceptanceTest.java index e77f011d9b4..966c02bebde 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEngineEip6110AcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/jsonrpc/ExecutionEnginePragueAcceptanceTest.java @@ -22,13 +22,13 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.provider.Arguments; -public class ExecutionEngineEip6110AcceptanceTest extends AbstractJsonRpcTest { - private static final String GENESIS_FILE = "/jsonrpc/engine/eip6110/genesis.json"; - private static final String TEST_CASE_PATH = "/jsonrpc/engine/eip6110/test-cases/"; +public class ExecutionEnginePragueAcceptanceTest extends AbstractJsonRpcTest { + private static final String GENESIS_FILE = "/jsonrpc/engine/prague/genesis.json"; + private static final String TEST_CASE_PATH = "/jsonrpc/engine/prague/test-cases/"; private static JsonRpcTestsContext testsContext; - public ExecutionEngineEip6110AcceptanceTest() { + public ExecutionEnginePragueAcceptanceTest() { super(testsContext); } diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/genesis.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json similarity index 99% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/genesis.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json index 232c577f6c8..98d388cc0f7 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/genesis.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/genesis.json @@ -14,7 +14,7 @@ "londonBlock":0, "terminalTotalDifficulty":0, "cancunTime":0, - "experimentalEipsTime":20, + "pragueTime":20, "clique": { "period": 5, "epoch": 30000 diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/01_cancun_prepare_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/01_cancun_prepare_payload.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/01_cancun_prepare_payload.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/02_cancun_getPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/02_cancun_getPayloadV3.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/02_cancun_getPayloadV3.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/03_cancun_newPayloadV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/03_cancun_newPayloadV3.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/03_cancun_newPayloadV3.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/04_cancun_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/04_cancun_forkchoiceUpdatedV3.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/04_cancun_forkchoiceUpdatedV3.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/05_eip6110_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/05_eip6110_forkchoiceUpdatedV3.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/05_prague_forkchoiceUpdatedV3.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/06_eip6110_getPayloadV6110.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json similarity index 97% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/06_eip6110_getPayloadV6110.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json index e31b2f8f8a9..74e9347df47 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/06_eip6110_getPayloadV6110.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/06_prague_getPayloadV4.json @@ -1,7 +1,7 @@ { "request": { "jsonrpc": "2.0", - "method": "engine_getPayloadV6110", + "method": "engine_getPayloadV4", "params": [ "0x282643b909febddf" ], diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/07_eip6110_send_raw_transaction.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/07_prague_send_raw_transaction.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/07_eip6110_send_raw_transaction.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/07_prague_send_raw_transaction.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/08_eip6110_invalid_null_deposits_execute_payload.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json similarity index 97% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/08_eip6110_invalid_null_deposits_execute_payload.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json index ebf5de77500..0294c6b8f21 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/08_eip6110_invalid_null_deposits_execute_payload.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/08_prague_invalid_null_deposits_execute_payload.json @@ -1,7 +1,7 @@ { "request": { "jsonrpc": "2.0", - "method": "engine_newPayloadV6110", + "method": "engine_newPayloadV4", "params": [ { "parentHash": "0x45811fa27a100ce9035e5e086b9669275041a4ec0ebbd920be028fd7b0aa2356", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/09_eip6110_newPayloadV6110.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json similarity index 98% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/09_eip6110_newPayloadV6110.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json index 760b9481295..b3b8166af22 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/09_eip6110_newPayloadV6110.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/09_prague_newPayloadV4.json @@ -1,7 +1,7 @@ { "request": { "jsonrpc": "2.0", - "method": "engine_newPayloadV6110", + "method": "engine_newPayloadV4", "params": [ { "parentHash": "0x1dd4f141551d53ce393845e2873754e43396101a8ebc0fd0eeb2e6798a591315", diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/10_eip6110_forkchoiceUpdatedV3.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json similarity index 100% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/10_eip6110_forkchoiceUpdatedV3.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/10_prague_forkchoiceUpdatedV3.json diff --git a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/11_eip6110_getPayloadV6110.json b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json similarity index 97% rename from acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/11_eip6110_getPayloadV6110.json rename to acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json index 5214ee7cd5a..7a251d599af 100644 --- a/acceptance-tests/tests/src/test/resources/jsonrpc/engine/eip6110/test-cases/11_eip6110_getPayloadV6110.json +++ b/acceptance-tests/tests/src/test/resources/jsonrpc/engine/prague/test-cases/11_prague_getPayloadV4.json @@ -1,7 +1,7 @@ { "request": { "jsonrpc": "2.0", - "method": "engine_getPayloadV6110", + "method": "engine_getPayloadV4", "params": [ "0x282643db882670cf" ], diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java index ca226484112..cf63c8ce175 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java @@ -733,6 +733,9 @@ static ProtocolSpecBuilder pragueDefinition( final int contractSizeLimit = configContractSizeLimit.orElse(SPURIOUS_DRAGON_CONTRACT_SIZE_LIMIT); + final Address depositContractAddress = + genesisConfigOptions.getDepositContractAddress().orElse(DEFAULT_DEPOSIT_CONTRACT_ADDRESS); + return cancunDefinition( chainId, configContractSizeLimit, @@ -760,6 +763,7 @@ static ProtocolSpecBuilder pragueDefinition( SPURIOUS_DRAGON_FORCE_DELETE_WHEN_EMPTY_ADDRESSES)) // use prague precompiled contracts .precompileContractRegistryBuilder(MainnetPrecompiledContractRegistries::prague) + .depositsValidator(new DepositsValidator.AllowedDeposits(depositContractAddress)) .name("Prague"); } From 32814ece18cc5ceab05ae8aef688acb4558a04a9 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Fri, 22 Mar 2024 17:00:55 +1300 Subject: [PATCH 3/5] Fix EngineGetPayloadV4Test Signed-off-by: Lucas Saldanha --- .../engine/AbstractScheduledApiTest.java | 7 +++++- .../engine/EngineGetPayloadV4Test.java | 22 +++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java index 6d71932ff96..9fd546dca5b 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/AbstractScheduledApiTest.java @@ -39,8 +39,10 @@ public class AbstractScheduledApiTest { new ScheduledProtocolSpec.Hardfork("Shanghai", 20); protected final ScheduledProtocolSpec.Hardfork cancunHardfork = new ScheduledProtocolSpec.Hardfork("Cancun", 30); + protected final ScheduledProtocolSpec.Hardfork pragueHardfork = + new ScheduledProtocolSpec.Hardfork("Prague", 40); protected final ScheduledProtocolSpec.Hardfork experimentalHardfork = - new ScheduledProtocolSpec.Hardfork("ExperimentalEips", 40); + new ScheduledProtocolSpec.Hardfork("ExperimentalEips", 50); @Mock protected DefaultProtocolSchedule protocolSchedule; @@ -74,6 +76,9 @@ public void before() { lenient() .when(protocolSchedule.hardforkFor(argThat(new HardforkMatcher(cancunHardfork)))) .thenReturn(Optional.of(cancunHardfork)); + lenient() + .when(protocolSchedule.hardforkFor(argThat(new HardforkMatcher(pragueHardfork)))) + .thenReturn(Optional.of(pragueHardfork)); lenient() .when(protocolSchedule.hardforkFor(argThat(new HardforkMatcher(shanghaiHardfork)))) .thenReturn(Optional.of(shanghaiHardfork)); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java index 377341c20ba..3a0ee35e4d2 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineGetPayloadV4Test.java @@ -86,24 +86,24 @@ public void before() { @Override @Test public void shouldReturnExpectedMethodName() { - assertThat(method.getName()).isEqualTo("engine_getPayloadV6110"); + assertThat(method.getName()).isEqualTo("engine_getPayloadV4"); } @Override @Test public void shouldReturnBlockForKnownPayloadId() { - BlockHeader eip6110Header = + BlockHeader header = new BlockHeaderTestFixture() .prevRandao(Bytes32.random()) - .timestamp(experimentalHardfork.milestone() + 1) + .timestamp(pragueHardfork.milestone() + 1) .excessBlobGas(BlobGas.of(10L)) .buildHeader(); // should return withdrawals, deposits and excessGas for a post-6110 block - PayloadIdentifier postEip6110Pid = + PayloadIdentifier payloadIdentifier = PayloadIdentifier.forPayloadParams( Hash.ZERO, - experimentalHardfork.milestone(), + pragueHardfork.milestone(), Bytes32.random(), Address.fromHexString("0x42"), Optional.empty(), @@ -124,10 +124,10 @@ public void shouldReturnBlockForKnownPayloadId() { .createTransaction(senderKeys); TransactionReceipt blobReceipt = mock(TransactionReceipt.class); when(blobReceipt.getCumulativeGasUsed()).thenReturn(100L); - BlockWithReceipts postEip6110Block = + BlockWithReceipts block = new BlockWithReceipts( new Block( - eip6110Header, + header, new BlockBody( List.of(blobTx), Collections.emptyList(), @@ -135,9 +135,9 @@ public void shouldReturnBlockForKnownPayloadId() { Optional.of(Collections.emptyList()))), List.of(blobReceipt)); - when(mergeContext.retrieveBlockById(postEip6110Pid)).thenReturn(Optional.of(postEip6110Block)); + when(mergeContext.retrieveBlockById(payloadIdentifier)).thenReturn(Optional.of(block)); - final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(), postEip6110Pid); + final var resp = resp(RpcMethod.ENGINE_GET_PAYLOAD_V4.getMethodName(), payloadIdentifier); assertThat(resp).isInstanceOf(JsonRpcSuccessResponse.class); Optional.of(resp) .map(JsonRpcSuccessResponse.class::cast) @@ -148,10 +148,10 @@ public void shouldReturnBlockForKnownPayloadId() { assertThat(res.getExecutionPayload().getWithdrawals()).isNotNull(); assertThat(res.getExecutionPayload().getDeposits()).isNotNull(); assertThat(res.getExecutionPayload().getHash()) - .isEqualTo(eip6110Header.getHash().toString()); + .isEqualTo(header.getHash().toString()); assertThat(res.getBlockValue()).isEqualTo(Quantity.create(0)); assertThat(res.getExecutionPayload().getPrevRandao()) - .isEqualTo(eip6110Header.getPrevRandao().map(Bytes32::toString).orElse("")); + .isEqualTo(header.getPrevRandao().map(Bytes32::toString).orElse("")); // excessBlobGas: QUANTITY, 256 bits String expectedQuantityOf10 = Bytes32.leftPad(Bytes.of(10)).toQuantityHexString(); assertThat(res.getExecutionPayload().getExcessBlobGas()).isNotEmpty(); From 01944bbe0f255c54a668a7600c91cb23f58fb112 Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Sun, 24 Mar 2024 11:10:34 +1300 Subject: [PATCH 4/5] Adding comment to broken test Signed-off-by: Lucas Saldanha --- .../methods/engine/EngineNewPayloadV4Test.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index 0def47f5e05..6cf362e8ec7 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -41,7 +41,7 @@ import org.hyperledger.besu.ethereum.core.Withdrawal; import org.hyperledger.besu.ethereum.mainnet.BodyValidation; import org.hyperledger.besu.ethereum.mainnet.DepositsValidator; -import org.hyperledger.besu.evm.gascalculator.CancunGasCalculator; +import org.hyperledger.besu.evm.gascalculator.PragueGasCalculator; import java.util.Collections; import java.util.List; @@ -65,6 +65,7 @@ public EngineNewPayloadV4Test() {} public void before() { super.before(); maybeParentBeaconBlockRoot = Optional.of(Bytes32.ZERO); + //TODO this should be using NewPayloadV4 this.method = new EngineNewPayloadV3( vertx, @@ -73,10 +74,8 @@ public void before() { mergeCoordinator, ethPeers, engineCallListener); - lenient() - .when(protocolSchedule.hardforkFor(any())) - .thenReturn(Optional.of(super.cancunHardfork)); - lenient().when(protocolSpec.getGasCalculator()).thenReturn(new CancunGasCalculator()); + lenient().when(protocolSchedule.hardforkFor(any())).thenReturn(Optional.of(pragueHardfork)); + lenient().when(protocolSpec.getGasCalculator()).thenReturn(new PragueGasCalculator()); } @Override @@ -171,7 +170,7 @@ protected BlockHeader createBlockHeader( BlockHeader parentBlockHeader = new BlockHeaderTestFixture() .baseFeePerGas(Wei.ONE) - .timestamp(super.experimentalHardfork.milestone()) + .timestamp(pragueHardfork.milestone()) .excessBlobGas(BlobGas.ZERO) .blobGasUsed(0L) .buildHeader(); From efc35bb1f28c0c304c79af2eb44362ffedb1cd0b Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Sun, 24 Mar 2024 11:11:34 +1300 Subject: [PATCH 5/5] Spotless Signed-off-by: Lucas Saldanha --- .../jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java index 6cf362e8ec7..9943a10ba99 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV4Test.java @@ -65,7 +65,7 @@ public EngineNewPayloadV4Test() {} public void before() { super.before(); maybeParentBeaconBlockRoot = Optional.of(Bytes32.ZERO); - //TODO this should be using NewPayloadV4 + // TODO this should be using NewPayloadV4 this.method = new EngineNewPayloadV3( vertx,