From 2f75716aa5f0bd72661a980a0c76c9e68af3d545 Mon Sep 17 00:00:00 2001 From: lightclient Date: Mon, 16 Oct 2023 09:05:18 -0600 Subject: [PATCH 1/3] engine: clarify order of operation for fcu v3 --- src/engine/cancun.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/engine/cancun.md b/src/engine/cancun.md index b9431c76..83017447 100644 --- a/src/engine/cancun.md +++ b/src/engine/cancun.md @@ -122,9 +122,11 @@ 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** 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. +1. Client software **MUST** validate and apply the forkchoice state before validating `payloadAttributes`. If `forkchoiceState` does not match the expected fields, clients must return `-32602: Invalid params`. + +2. Client software **MUST** check that `payloadAttributes` strictly matches the expected fields and return `-38003: Invalid payload attributes` 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` is set and the `payloadAttributes.timestamp` does not fall within the time frame of the Cancun fork. +3. Client software **MUST** return `-38005: Unsupported fork` error if the `payloadAttributes` is set and the `payloadAttributes.timestamp` does not fall within the time frame of the Cancun fork. ### engine_getPayloadV3 @@ -184,4 +186,4 @@ For the following methods: 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 +1. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of payload or payloadAttributes greater or equal to the Cancun activation timestamp. From 471f13020239bc06320b20237cddedfc962cb3f7 Mon Sep 17 00:00:00 2001 From: lightclient Date: Tue, 17 Oct 2023 14:31:19 -0600 Subject: [PATCH 2/3] engine: skip payload attr validation if syncing --- src/engine/cancun.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/cancun.md b/src/engine/cancun.md index 83017447..1caad7e0 100644 --- a/src/engine/cancun.md +++ b/src/engine/cancun.md @@ -122,7 +122,7 @@ 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** validate and apply the forkchoice state before validating `payloadAttributes`. If `forkchoiceState` does not match the expected fields, clients must return `-32602: Invalid params`. +1. Client software **MUST** validate and apply the forkchoice state before validating `payloadAttributes`. If `forkchoiceState` does not match the expected fields, clients must return `-32602: Invalid params`. If the client is `SYNCING` it **MUST** skip the validation of `payloadAttributes`. 2. Client software **MUST** check that `payloadAttributes` strictly matches the expected fields and return `-38003: Invalid payload attributes` error if this check fails. Any field having `null` value **MUST** be considered as not provided. From 73ca41045ad642c0bfec416c2f095612bbb55590 Mon Sep 17 00:00:00 2001 From: lightclient Date: Tue, 17 Oct 2023 14:32:58 -0600 Subject: [PATCH 3/3] engine: verify payload timestamp is not less than or equal to current head Co-authored-by: lightclient Co-authored-by: Mikhail Kalinin --- src/engine/cancun.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/cancun.md b/src/engine/cancun.md index 1caad7e0..dc68bc81 100644 --- a/src/engine/cancun.md +++ b/src/engine/cancun.md @@ -128,6 +128,8 @@ This method follows the same specification as [`engine_forkchoiceUpdatedV2`](./s 3. Client software **MUST** return `-38005: Unsupported fork` error if the `payloadAttributes` is set and the `payloadAttributes.timestamp` does not fall within the time frame of the Cancun fork. +4. Client software **MUST** return `-38003: Invalid payload attributes` if the `payloadAttributes.timestamp` is less or equal to the timestamp of a block referenced by `forkchoiceState.headBlockHash`. + ### engine_getPayloadV3 The response of this method is extended with [`BlobsBundleV1`](#blobsbundlev1) containing the blobs, their respective KZG commitments