Skip to content

Commit

Permalink
Engine API: validate blob versioned hashes (hyperledger#407)
Browse files Browse the repository at this point in the history
* Validate blob versioned hashes

* Update src/engine/experimental/blob-extension.md

Co-authored-by: g11tech <develop@g11tech.io>

* Elaborate on blob hashes validation

* Rephrase the statement a bit

* Update src/engine/experimental/blob-extension.md

Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>

---------

Co-authored-by: g11tech <develop@g11tech.io>
Co-authored-by: Alex Stokes <r.alex.stokes@gmail.com>
  • Loading branch information
3 people authored May 24, 2023
1 parent 3e481a2 commit 128af69
Showing 1 changed file with 11 additions and 4 deletions.
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

0 comments on commit 128af69

Please sign in to comment.