From 09f722c1d5e916657ca6d0027f590f58d0ee7f2b Mon Sep 17 00:00:00 2001 From: Vivek Singh Solanki Date: Fri, 3 Apr 2026 18:44:39 +0530 Subject: [PATCH] Fix engine_getPayloadV1 to return -38001 instead of -32001 for unknown payloadId The Engine API spec requires error code -38001 (Unknown payload) when engine_getPayloadV1 is called with an unrecognized payloadId. Besu was incorrectly returning -32001 (Resource not found), which is a non-standard error code that may cause interoperability issues with consensus layer clients. Fixes #10174 Signed-off-by: Vivek Singh Solanki --- .../jsonrpc/engine/paris/test-cases/08_unknown_payload.json | 4 ++-- .../ethereum/api/jsonrpc/internal/response/RpcErrorType.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acceptance-tests/tests/src/acceptanceTest/resources/jsonrpc/engine/paris/test-cases/08_unknown_payload.json b/acceptance-tests/tests/src/acceptanceTest/resources/jsonrpc/engine/paris/test-cases/08_unknown_payload.json index 21ccd28c154..de7eb865dea 100644 --- a/acceptance-tests/tests/src/acceptanceTest/resources/jsonrpc/engine/paris/test-cases/08_unknown_payload.json +++ b/acceptance-tests/tests/src/acceptanceTest/resources/jsonrpc/engine/paris/test-cases/08_unknown_payload.json @@ -11,8 +11,8 @@ "jsonrpc": "2.0", "id": 67, "error": { - "code": -32001, - "message": "Payload does not exist / is not available" + "code": -38001, + "message": "Unknown payload" } }, "statusCode": 200 diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java index d2ddb483da8..58ba18e336a 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/response/RpcErrorType.java @@ -186,7 +186,7 @@ public enum RpcErrorType implements RpcMethodError { EXECUTION_HALTED(-32000, "Transaction processing could not be completed due to an exception"), // Execution engine failures - UNKNOWN_PAYLOAD(-32001, "Payload does not exist / is not available"), + UNKNOWN_PAYLOAD(-38001, "Unknown payload"), INVALID_TERMINAL_BLOCK(-32002, "Terminal block doesn't satisfy terminal block conditions"), INVALID_FORKCHOICE_STATE(-38002, "Invalid forkchoice state"), INVALID_PAYLOAD_ATTRIBUTES(-38003, "Invalid payload attributes"),