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: employ one method one structure approach for V3 #418

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/engine/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ The list of error codes introduced by this specification can be found below.
| -38002 | Invalid forkchoice state | Forkchoice state is invalid / inconsistent. |
| -38003 | Invalid payload attributes | Payload attributes are invalid / inconsistent. |
| -38004 | Too large request | Number of requested entities is too large. |
| -38005 | Unsupported fork | Payload belongs to a fork that is not supported. |

Each error returns a `null` `data` value, except `-32000` which returns the `data` object with a `err` member that explains the error encountered.

Expand Down
17 changes: 8 additions & 9 deletions src/engine/experimental/blob-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ The fields are encoded as follows:

* method: `engine_newPayloadV3`
* params:
1. [`ExecutionPayloadV1`](../paris.md#ExecutionPayloadV1) | [`ExecutionPayloadV2`](../shanghai.md#ExecutionPayloadV2) | [`ExecutionPayloadV3`](#ExecutionPayloadV3), where:
- `ExecutionPayloadV1` **MUST** be used if the `timestamp` value is lower than the Shanghai timestamp,
- `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.
1. [`ExecutionPayloadV3`](#ExecutionPayloadV3).
2. `Array of DATA`, 32 Bytes - Array of blob versioned hashes to validate.

Client software **MUST** return `-32602: Invalid params` error unless all parameters and their fields are provided with non-`null` values.

#### Response

Refer to the response for `engine_newPayloadV2`.
Expand All @@ -84,6 +82,8 @@ This method follows the same specification as `engine_newPayloadV2` with the add

This validation **MUST** be instantly run in all cases even during active sync process.

2. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the payload is less than the EIP-4844 activation timestamp.

### engine_getPayloadV3

The response of this method is extended with [`BlobsBundleV1`](#blobsbundlev1) containing the blobs, their respective KZG commitments
Expand All @@ -99,10 +99,7 @@ and proofs corresponding to the `versioned_hashes` included in the blob transact
#### Response

* result: `object`
- `executionPayload`: [`ExecutionPayloadV1`](../paris.md#ExecutionPayloadV1) | [`ExecutionPayloadV2`](../shanghai.md#ExecutionPayloadV2) | [`ExecutionPayloadV3`](#ExecutionPayloadV3) where:
- `ExecutionPayloadV1` **MUST** be returned if the payload `timestamp` is lower than the Shanghai timestamp
- `ExecutionPayloadV2` **MUST** be returned if the payload `timestamp` is greater or equal to the Shanghai timestamp and lower than the EIP-4844 activation timestamp
- `ExecutionPayloadV3` **MUST** be returned if the payload `timestamp` is greater or equal to the EIP-4844 activation timestamp
- `executionPayload`: [`ExecutionPayloadV3`](#ExecutionPayloadV3)
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
- `blobsBundle`: [`BlobsBundleV1`](#BlobsBundleV1) - Bundle with data corresponding to blob transactions included into `executionPayload`
* error: code and message set in case an exception happens while getting the payload.
Expand All @@ -117,3 +114,5 @@ Refer to the specification for `engine_getPayloadV2` with addition of the follow
i.e. `assert verify_kzg_commitments_against_transactions(payload.transactions, bundle.commitments)` (see EIP-4844 consensus-specs).

3. The call **MUST** return `blobs` and `proofs` that match the `commitments` list, i.e. `assert len(commitments) == len(blobs) == len(proofs)` and `assert verify_blob_kzg_proof_batch(bundle.blobs, bundle.commitments, bundle.proofs)`.

4. Client software **MUST** return `-38005: Unsupported fork` error if the `timestamp` of the built payload is less than the EIP-4844 activation timestamp.