From 50034e56ee967d163519fba42a9c5f856533c293 Mon Sep 17 00:00:00 2001 From: Gabriel-Trintinalia Date: Fri, 22 Sep 2023 22:56:22 +1000 Subject: [PATCH] [4844] Fix some Devnet9 Hive tests (#5929) * Return latest valid hash for blob validation * Fix invalid hash * Fix null hash * Change HISTORY_BUFFER_LENGTH --------- Signed-off-by: Gabriel-Trintinalia --- .../methods/engine/AbstractEngineNewPayload.java | 9 +++++++-- .../ethereum/mainnet/ParentBeaconBlockRootHelper.java | 2 +- 2 files changed, 8 insertions(+), 3 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 7b5d6f852ad..60abf0aa039 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 @@ -130,7 +130,12 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) try { maybeVersionedHashes = extractVersionedHashes(maybeVersionedHashParam); } catch (RuntimeException ex) { - return respondWithInvalid(reqId, blockParam, null, INVALID, "Invalid versionedHash"); + return respondWithInvalid( + reqId, + blockParam, + mergeCoordinator.getLatestValidAncestor(blockParam.getParentHash()).orElse(null), + INVALID, + "Invalid versionedHash"); } final Optional maybeParentHeader = @@ -240,7 +245,7 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext) return respondWithInvalid( reqId, blockParam, - null, + mergeCoordinator.getLatestValidAncestor(blockParam.getParentHash()).orElse(null), getInvalidBlockHashStatus(), blobValidationResult.getErrorMessage()); } 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 d5252a06728..5bae221bcfd 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 @@ -25,7 +25,7 @@ public interface ParentBeaconBlockRootHelper { // Modulus to use for the timestamp to store the root - public static final long HISTORICAL_ROOTS_MODULUS = 8191; + public static final long HISTORICAL_ROOTS_MODULUS = 98304; public static final Address BEACON_ROOTS_ADDRESS = Address.fromHexString("0xbEAC020008aFF7331c0A389CB2AAb67597567d7a");