From 806e44d872dfe2526301a75ad34e00cc85e35fac Mon Sep 17 00:00:00 2001 From: Alexey Osipov Date: Thu, 3 Aug 2023 18:45:03 +0300 Subject: [PATCH] Move timestamp validation down to ease validation --- src/engine/cancun.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/cancun.md b/src/engine/cancun.md index 9a4123802..4bbec1178 100644 --- a/src/engine/cancun.md +++ b/src/engine/cancun.md @@ -94,9 +94,9 @@ Refer to the response for [`engine_newPayloadV2`](./shanghai.md#engine_newpayloa This method follows the same specification as [`engine_newPayloadV2`](./shanghai.md#engine_newpayloadv2) with the addition of the following: -1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the Cancun fork. +1. Client software **MUST** check that provided set of parameters and their fields strictly matches the expected one and return `-32602: Invalid params` error if this check fails. Any field having `null` value **MUST** be considered as not provided. -2. Client software **MUST** check that provided set of parameters and their fields strictly matches the expected one and return `-32602: Invalid params` error if this check fails. Any field having `null` value **MUST** be considered as not provided. +2. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload does not fall within the time frame of the Cancun fork. 3. Given the expected array of blob versioned hashes client software **MUST** run its validation by taking the following steps: 1. Obtain the 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 `[]`. @@ -122,9 +122,9 @@ Refer to the response for [`engine_forkchoiceUpdatedV2`](./shanghai.md#engine_fo This method follows the same specification as [`engine_forkchoiceUpdatedV2`](./shanghai.md#engine_forkchoiceupdatedv2) with addition of the following: -1. Client software **MUST** return `-38005: Unsupported fork` error if the `payloadAttributes.timestamp` does not fall within the time frame of the Cancun fork. +1. Client software **MUST** check that provided set of parameters and their fields strictly matches the expected one and return `-32602: Invalid params` error if this check fails. Any field having `null` value **MUST** be considered as not provided. -2. Client software **MUST** check that provided set of parameters and their fields strictly matches the expected one and return `-32602: Invalid params` error if this check fails. Any field having `null` value **MUST** be considered as not provided. +2. Client software **MUST** return `-38005: Unsupported fork` error if the `payloadAttributes.timestamp` does not fall within the time frame of the Cancun fork. ### engine_getPayloadV3 @@ -179,6 +179,6 @@ For the following methods: - [`engine_newPayloadV2`](./shanghai.md#engine_newpayloadV2) - [`engine_getPayloadV2`](./shanghai.md#engine_getpayloadv2) -an early validation **MUST** be added: +a validation **MUST** be added: 1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload or payloadAttributes greater or equal to the Cancun activation timestamp. \ No newline at end of file