Skip to content

Commit 39de89b

Browse files
authored
Merge pull request #214 from mkalinin/error-code-fix
Engine API: adjust error codes with JSON-RPC 2.0 spec
2 parents 05b5db8 + 6e1f881 commit 39de89b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/engine/specification.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ The list of error codes introduced by this specification can be found below.
109109
| -32602 | Invalid params | Invalid method parameter(s). |
110110
| -32603 | Internal error | Internal JSON-RPC error. |
111111
| -32000 | Server error | Generic client error while processing request. |
112-
| -32001 | Unknown payload | Payload does not exist / is not available. |
113-
| -31002 | Invalid payload attributes | Payload attributes are invalid / inconsistent. |
112+
| -38001 | Unknown payload | Payload does not exist / is not available. |
113+
| -38002 | Invalid payload attributes | Payload attributes are invalid / inconsistent. |
114114

115115
Each error returns a `null` `data` value, except `-32000` which returns the `data` object with a `err` member that explains the error encountered.
116116

@@ -311,7 +311,7 @@ The payload build process is specified as follows:
311311
* The values `(forkchoiceState.headBlockHash, forkchoiceState.finalizedBlockHash)` of this method call map on the `POS_FORKCHOICE_UPDATED` event of [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675#block-validity) and **MUST** be processed according to the specification defined in the EIP
312312
* All updates to the forkchoice state resulting from this call **MUST** be made atomically.
313313

314-
6. Client software **MUST** ensure that `payloadAttributes.timestamp` is greater than `timestamp` of a block referenced by `forkchoiceState.headBlockHash`. If this condition isn't held client software **MUST** respond with `-31002: Invalid payload attributes` and **MUST NOT** begin a payload build process. In such an event, the `forkchoiceState` update **MUST NOT** be rolled back.
314+
6. Client software **MUST** ensure that `payloadAttributes.timestamp` is greater than `timestamp` of a block referenced by `forkchoiceState.headBlockHash`. If this condition isn't held client software **MUST** respond with `-38002: Invalid payload attributes` and **MUST NOT** begin a payload build process. In such an event, the `forkchoiceState` update **MUST NOT** be rolled back.
315315

316316
7. Client software **MUST** begin a payload build process building on top of `forkchoiceState.headBlockHash` and identified via `buildProcessId` value if `payloadAttributes` is not `null` and the forkchoice state has been updated successfully. The build process is specified in the [Payload building](#payload-building) section.
317317

@@ -321,7 +321,7 @@ The payload build process is specified as follows:
321321
* `{payloadStatus: {status: INVALID_TERMINAL_BLOCK, latestValidHash: null, validationError: errorMessage | null}, payloadId: null}` obtained either from the [Payload validation](#payload-validation) process or as a result of validating a PoW block referenced by `forkchoiceState.headBlockHash`
322322
* `{payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: null}` if the payload is deemed `VALID` and a build process hasn't been started
323323
* `{payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: buildProcessId}` if the payload is deemed `VALID` and the build process has begun
324-
* `{error: {code: -31002, message: "Invalid payload attributes"}}` if the payload is deemed `VALID` and `forkchoiceState` has been applied successfully, but no build process has been started due to invalid `payloadAttributes`.
324+
* `{error: {code: -38002, message: "Invalid payload attributes"}}` if the payload is deemed `VALID` and `forkchoiceState` has been applied successfully, but no build process has been started due to invalid `payloadAttributes`.
325325

326326
9. If any of the above fails due to errors unrelated to the normal processing flow of the method, client software **MUST** respond with an error object.
327327

@@ -343,7 +343,7 @@ The payload build process is specified as follows:
343343

344344
1. Given the `payloadId` client software **MUST** return the most recent version of the payload that is available in the corresponding build process at the time of receiving the call.
345345

346-
2. The call **MUST** return `-32001: Unknown payload` error if the build process identified by the `payloadId` does not exist.
346+
2. The call **MUST** return `-38001: Unknown payload` error if the build process identified by the `payloadId` does not exist.
347347

348348
3. Client software **MAY** stop the corresponding build process after serving this call.
349349

0 commit comments

Comments
 (0)