From 059a94c6751b2002b13fcf204598160edf859344 Mon Sep 17 00:00:00 2001 From: Gabriel-Trintinalia Date: Thu, 24 Aug 2023 16:07:54 +1000 Subject: [PATCH] Validate parameters before fork (#5792) Signed-off-by: Gabriel-Trintinalia --- .../methods/engine/AbstractEngineNewPayload.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 ad237d3590e..553fa07fc76 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 @@ -113,18 +113,18 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) final Optional maybeParentBeaconBlockRoot = maybeParentBeaconBlockRootParam.map(Bytes32::fromHexString); - final ValidationResult forkValidationResult = - validateForkSupported(blockParam.getTimestamp()); - if (!forkValidationResult.isValid()) { - return new JsonRpcErrorResponse(reqId, forkValidationResult); - } - final ValidationResult parameterValidationResult = validateParameters(blockParam, maybeVersionedHashParam, maybeParentBeaconBlockRootParam); if (!parameterValidationResult.isValid()) { return new JsonRpcErrorResponse(reqId, parameterValidationResult); } + final ValidationResult forkValidationResult = + validateForkSupported(blockParam.getTimestamp()); + if (!forkValidationResult.isValid()) { + return new JsonRpcErrorResponse(reqId, forkValidationResult); + } + final Optional> maybeVersionedHashes; try { maybeVersionedHashes = extractVersionedHashes(maybeVersionedHashParam);