Skip to content

execution-apis: Add EIP-7594 (PeerDAS) related changes #630

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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
22 changes: 22 additions & 0 deletions src/engine/openrpc/methods/blob.yaml

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions src/engine/openrpc/schemas/blob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@ BlobAndProofV1:
- blob
- proof
properties:
blob:
blob:
title: Blob
$ref: '#/components/schemas/bytes'
proof:
title: proof
$ref: '#/components/schemas/bytes48'


BlobAndProofV2:
title: Blob and proof object V2
type: object
required:
- blob
- cell_proof
properties:
blob:
title: Blob
$ref: '#/components/schemas/bytes'
cell_proof:
title: cell_proof
$ref: '#/components/schemas/bytes48'
103 changes: 103 additions & 0 deletions src/engine/osaka.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Engine API -- Osaka

Engine API changes introduced in Osaka.

This specification is based on and extends [Engine API - Prague](./prague.md) specification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When new versions of methods are introduced there is usually a statement on how to limit the scope of the previous versions. I think this doc should at least add modification to engine_getPayloadV4 while engine_getBlobsV2 is a bit more tricky in that regard, see https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#update-the-methods-of-previous-forks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great callout, added update-the-methods-of-previous-forks section for engine_getblobsv1.

As for getPayloadV4, previous section already specifies the validation should reject anything that's older than Prague, so it covers Osaka.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for getPayloadV4, previous section already specifies the validation should reject anything that's older than Prague, so it covers Osaka.

getPayloadV4 is introduced in Prague and it should also be mentioned that it must not be used for Osaka payloads as it is usually done


<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Structures](#structures)
- [BlobsBundleV2](#blobsbundlev2)
- [BlobAndProofV2](#blobandproofv2)
- [Methods](#methods)
- [engine_getPayloadV5](#engine_getpayloadv5)
- [Request](#request)
- [Response](#response)
- [Specification](#specification)
- [engine_getBlobsV2](#engine_getblobsv2)
- [Request](#request-1)
- [Response](#response-1)
- [Specification](#specification-1)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Structures

### BlobsBundleV2

The fields are encoded as follows:

- `blobs`: `Array of DATA` - Array of blobs, each blob is `FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded `Blob` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844)
- `commitments`: `Array of DATA` - Array of `KZGCommitment` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), 48 bytes each (`DATA`).
- `cell_proofs`: `Array of DATA` - Array of `KZGProof` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), 48 bytes each (`DATA`).

`blobs` and `commitments` arrays **MUST** be of same length, `cell_proofs` contains exactly `CELLS_PER_EXT_BLOB` * `len(blobs)` cell proofs.

### BlobAndProofV2

The fields are encoded as follows:

- `blob`: `DATA` - `FIELD_ELEMENTS_PER_BLOB * BYTES_PER_FIELD_ELEMENT = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded `Blob` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844).
- `cell_proofs`: `Array of DATA` - Array of `KZGProof` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), 48 bytes each (`DATA`).

`cell_proofs` contains exactly `CELLS_PER_EXT_BLOB` * `len(blobs)` cell proofs.

## Methods

### engine_getPayloadV5

This method is updated in a backward incompatible way. Instead of returning `BlobBundleV1`, it returns `BlobsBundleV2`.

#### Request

* method: `engine_getPayloadV5`
* params:
1. `payloadId`: `DATA`, 8 Bytes - Identifier of the payload build process
* timeout: 1s

#### Response

* result: `object`
- `executionPayload`: [`ExecutionPayloadV3`](#ExecutionPayloadV3)
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei
- `blobsBundle`: [`BlobsBundleV2`](#BlobsBundleV2) - Bundle with data corresponding to blob transactions included into `executionPayload`
- `shouldOverrideBuilder` : `BOOLEAN` - Suggestion from the execution layer to use this `executionPayload` instead of an externally provided one
- `executionRequests`: `Array of DATA` - Execution layer triggered requests obtained from the `executionPayload` transaction execution.
* error: code and message set in case an exception happens while getting the payload.

#### Specification

This method follows the same specification as [`engine_getPayloadV4`](./prague.md#engine_getpayloadv4) with changes of the following:

1. The call **MUST** return `BlobsBundleV2` with empty `blobs`, `commitments` and `cell_proofs` if the payload doesn't contain any blob transactions.

2. The call **MUST** return `blobs` and `cell_proofs` that match the `commitments` list, i.e.
1. `assert len(blobsBundle.commitments) == len(blobsBundle.blobs)` and
2. `assert len(blobsBundle.cell_proofs) == len(blobsBundle.blobs) * CELLS_PER_EXT_BLOB` and
3. `assert verify_cell_kzg_proof_batch(blobsBundle.commitments, cell_indices, cells, blobsBundle.cell_proofs)`.

### engine_getBlobsV2

Consensus layer clients **MAY** use this method to fetch blobs from the execution layer blob pool.

*Note*: This is a new optional method introduced after Pectra.

#### Request

* method: `engine_getBlobsV2`
* params:
1. `Array of DATA`, 32 Bytes - Array of blob versioned hashes.
* timeout: 1s

#### Response

* result: `Array of BlobAndProofV2` - Array of [`BlobAndProofV2`](#BlobAndProofV2), items of which may be `null`.
* error: code and message set in case an error occurs during processing of the request.

#### Specification

Refer to the specification for [`engine_getBlobsV1`](./cancun.md#engine_getblobsv1) with changes of the following:

1. return `BlobAndProofV2` instead of `BlobAndProofV1`
3 changes: 3 additions & 0 deletions src/eth/submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
[EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) transactions, the raw
form must be the network form. This means it includes the blobs, KZG
commitments, and KZG proofs.
For [EIP-7594](https://eips.ethereum.org/EIPS/eip-7594) transactions, the raw format
must be the network form. This means it includes the blobs, KZG commitments, and cell proofs.
Please note that at the Fusaka upgrade time, [EIP-4844] transactions will be rejected.
params:
- name: Transaction
required: true
Expand Down