From b0398cc3ad80b07eeb5a9fff2624a556f6627e26 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Mon, 15 May 2023 16:21:26 +0600 Subject: [PATCH 1/5] Validate blob versioned hashes --- src/engine/experimental/blob-extension.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/experimental/blob-extension.md b/src/engine/experimental/blob-extension.md index cec6a2d0f..1f6237345 100644 --- a/src/engine/experimental/blob-extension.md +++ b/src/engine/experimental/blob-extension.md @@ -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) @@ -67,15 +67,18 @@ 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. - -#### Specification - -Refer to the specification for `engine_newPayloadV2`. + 2. `Array of DATA`, 32 Bytes - Array of blob versioned hashes to validate. #### Response Refer to the response for `engine_newPayloadV2`. +#### Specification + +This method follows the same specification as `engine_newPayloadV2` with the addition of the following: + +1. Client software **MUST** validate blob versioned hashes array as being equal to the corresponding array obtained from transactions of the [`BLOB_TX_TYPE`](https://eips.ethereum.org/EIPS/eip-4844#new-transaction-type) type contained by the payload respecting the order of their inclusion. Client software **MUST** run this validation in all cases even if this branch or any other branches of the block tree are in an active sync process and return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if it fails. + ### engine_getPayloadV3 The response of this method is extended with [`BlobsBundleV1`](#blobsbundlev1) containing the blobs, their respective KZG commitments From c55aac04b15828156555ecaec8ca0bdc533815d9 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Mon, 15 May 2023 19:10:56 +0600 Subject: [PATCH 2/5] Update src/engine/experimental/blob-extension.md Co-authored-by: g11tech --- src/engine/experimental/blob-extension.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/experimental/blob-extension.md b/src/engine/experimental/blob-extension.md index 1f6237345..1c36491a6 100644 --- a/src/engine/experimental/blob-extension.md +++ b/src/engine/experimental/blob-extension.md @@ -77,7 +77,7 @@ Refer to the response for `engine_newPayloadV2`. This method follows the same specification as `engine_newPayloadV2` with the addition of the following: -1. Client software **MUST** validate blob versioned hashes array as being equal to the corresponding array obtained from transactions of the [`BLOB_TX_TYPE`](https://eips.ethereum.org/EIPS/eip-4844#new-transaction-type) type contained by the payload respecting the order of their inclusion. Client software **MUST** run this validation in all cases even if this branch or any other branches of the block tree are in an active sync process and return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if it fails. +1. Client software **MUST** validate blob versioned hashes array as being equal to the corresponding array obtained by concatenating versioned hashes from transactions of the [`BLOB_TX_TYPE`](https://eips.ethereum.org/EIPS/eip-4844#new-transaction-type) type contained by the payload respecting the order of their block and transaction inclusion. Client software **MUST** run this validation in all cases even if this branch or any other branches of the block tree are in an active sync process and return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if it fails. ### engine_getPayloadV3 From 3a2479d0861e222d602d6048cef0b45e38e68ace Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Wed, 17 May 2023 17:53:18 +0600 Subject: [PATCH 3/5] Elaborate on blob hashes validation --- src/engine/experimental/blob-extension.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/experimental/blob-extension.md b/src/engine/experimental/blob-extension.md index 1c36491a6..2428865dc 100644 --- a/src/engine/experimental/blob-extension.md +++ b/src/engine/experimental/blob-extension.md @@ -77,7 +77,11 @@ Refer to the response for `engine_newPayloadV2`. This method follows the same specification as `engine_newPayloadV2` with the addition of the following: -1. Client software **MUST** validate blob versioned hashes array as being equal to the corresponding array obtained by concatenating versioned hashes from transactions of the [`BLOB_TX_TYPE`](https://eips.ethereum.org/EIPS/eip-4844#new-transaction-type) type contained by the payload respecting the order of their block and transaction inclusion. Client software **MUST** run this validation in all cases even if this branch or any other branches of the block tree are in an active sync process and return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if it fails. +1. Given array of blob versioned hashes client software **MUST** run its validation by taking the following steps: + 1. Obtain an expected 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 `[]`. + 1. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the given and the expected arrays don't match. + + This validation **MUST** be instantly run in all cases even during active sync process. ### engine_getPayloadV3 From 1762b47af6bba3ec41d634b8789f81005ba05a01 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Wed, 17 May 2023 18:04:56 +0600 Subject: [PATCH 4/5] Rephrase the statement a bit --- src/engine/experimental/blob-extension.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/experimental/blob-extension.md b/src/engine/experimental/blob-extension.md index 2428865dc..66279902a 100644 --- a/src/engine/experimental/blob-extension.md +++ b/src/engine/experimental/blob-extension.md @@ -77,9 +77,9 @@ Refer to the response for `engine_newPayloadV2`. This method follows the same specification as `engine_newPayloadV2` with the addition of the following: -1. Given array of blob versioned hashes client software **MUST** run its validation by taking the following steps: - 1. Obtain an expected 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 `[]`. - 1. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the given and the expected arrays don't match. +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 `[]`. + 1. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the expected and the actual arrays don't match. This validation **MUST** be instantly run in all cases even during active sync process. From 106e2077cb30406cbc422cb5ffd8308a2632aab2 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Thu, 18 May 2023 15:49:51 +0600 Subject: [PATCH 5/5] Update src/engine/experimental/blob-extension.md Co-authored-by: Alex Stokes --- src/engine/experimental/blob-extension.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/experimental/blob-extension.md b/src/engine/experimental/blob-extension.md index 66279902a..0f23c57e8 100644 --- a/src/engine/experimental/blob-extension.md +++ b/src/engine/experimental/blob-extension.md @@ -79,7 +79,7 @@ This method follows the same specification as `engine_newPayloadV2` with the add 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 `[]`. - 1. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the expected and the actual arrays don't match. + 2. Return `{status: INVALID, latestValidHash: null, validationError: errorMessage | null}` if the expected and the actual arrays don't match. This validation **MUST** be instantly run in all cases even during active sync process.