Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine API: validate blob versioned hashes #407

Merged
merged 5 commits into from
May 24, 2023
Merged
Changes from all commits
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
15 changes: 11 additions & 4 deletions src/engine/experimental/blob-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
- [Methods](#methods)
- [engine_newPayloadV3](#engine_newpayloadv3)
- [Request](#request)
- [Specification](#specification)
- [Response](#response)
- [Specification](#specification)
- [engine_getPayloadV3](#engine_getpayloadv3)
- [Request](#request-1)
- [Response](#response-1)
Expand Down Expand Up @@ -67,14 +67,21 @@ The fields are encoded as follows:
- `ExecutionPayloadV2` **MUST** be used if the `timestamp` value is greater or equal to the Shanghai and lower than the EIP-4844 activation timestamp,
- `ExecutionPayloadV3` **MUST** be used if the `timestamp` value is greater or equal to the EIP-4844 activation timestamp,
- Client software **MUST** return `-32602: Invalid params` error if the wrong version of the structure is used in the method call.
2. `Array of DATA`, 32 Bytes - Array of blob versioned hashes to validate.

#### Response

Refer to the response for `engine_newPayloadV2`.

#### Specification

Refer to the specification for `engine_newPayloadV2`.
This method follows the same specification as `engine_newPayloadV2` with the addition of the following:

#### Response
1. Given the expected array of blob versioned hashes client software **MUST** run its validation by taking the following steps:
1. Obtain an actual array by concatenating blob versioned hashes lists (`tx.blob_versioned_hashes`) of each [blob transaction](https://eips.ethereum.org/EIPS/eip-4844#new-transaction-type) included in the payload, respecting the order of inclusion. If the payload has no blob transactions the expected array **MUST** be `[]`.
2. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the expected and the actual arrays don't match.

Refer to the response for `engine_newPayloadV2`.
This validation **MUST** be instantly run in all cases even during active sync process.

### engine_getPayloadV3

Expand Down