Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust error code with JSON-RPC spec
  • Loading branch information
mkalinin committed May 3, 2022
commit e9053b6306d1bf4fe7c89a4bc451b2b3ef8ea5ca
6 changes: 3 additions & 3 deletions src/engine/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The list of error codes introduced by this specification can be found below.
| -32603 | Internal error | Internal JSON-RPC error. |
| -32000 | Server error | Generic client error while processing request. |
| -32001 | Unknown payload | Payload does not exist / is not available. |
| -32003 | Invalid forkchoice state | Forkchoice state is invalid / inconsistent. |
| -31003 | Invalid forkchoice state | Forkchoice state is invalid / inconsistent. |

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

Expand Down Expand Up @@ -302,7 +302,7 @@ The payload build process is specified as follows:
* 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
* All updates to the forkchoice state resulting from this call **MUST** be made atomically.

6. Client software **MUST** return `-32003: Invalid forkchoice state` error if the payload referenced by `forkchoiceState.headBlockHash` is `VALID` and a payload referenced by either `forkchoiceState.finalizedBlockHash` or `forkchoiceState.safeBlockHash` does not exist.
6. Client software **MUST** return `-31003: Invalid forkchoice state` error if the payload referenced by `forkchoiceState.headBlockHash` is `VALID` and a payload referenced by either `forkchoiceState.finalizedBlockHash` or `forkchoiceState.safeBlockHash` does not exist.

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.

Expand All @@ -312,7 +312,7 @@ The payload build process is specified as follows:
* `{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`
* `{payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: null}` if the payload is deemed `VALID` and a build process hasn't been started
* `{payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: buildProcessId}` if the payload is deemed `VALID` and the build process has begun
* `{error: {code: -32003, message: "Invalid forkchoice state"}}` if `forkchoiceState` is either invalid or inconsistent.
* `{error: {code: -31003, message: "Invalid forkchoice state"}}` if `forkchoiceState` is either invalid or inconsistent.

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.

Expand Down