Skip to content

Commit 5cf47d7

Browse files
committed
add engine_getBlobsV3 method and BlobAndProofV3 type alias.
- Introduce mandatory `engine_getBlobsV3` method to support partial responses when fetching blobs from the EL blob pool. - Add associated BlobAndProofV3 alias for BlobAndProofV2. - Restore `engine_getBlobsV2` to all-or-nothing. This mandates partial blob return support in Osaka, but avoids extra serde in V2 while unutilized by the CL. The CL can switch to V3 when p2p optimizations ship, without having to coordinate with EL devs.
1 parent d41fdf1 commit 5cf47d7

File tree

3 files changed

+228
-9
lines changed

3 files changed

+228
-9
lines changed

src/engine/openrpc/methods/blob.yaml

Lines changed: 184 additions & 5 deletions
Large diffs are not rendered by default.

src/engine/openrpc/schemas/blob.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ BlobAndProofV2:
2727
type: array
2828
items:
2929
$ref: "#/components/schemas/bytes48"
30+
31+
BlobAndProofV3:
32+
title: Blob and proof object V3
33+
$ref: '#/components/schemas/BlobAndProofV2'

src/engine/osaka.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This specification is based on and extends [Engine API - Prague](./prague.md) sp
1111
- [Structures](#structures)
1212
- [BlobsBundleV2](#blobsbundlev2)
1313
- [BlobAndProofV2](#blobandproofv2)
14+
- [BlobAndProofV3](#blobandproofv3)
1415
- [Methods](#methods)
1516
- [engine_getPayloadV5](#engine_getpayloadv5)
1617
- [Request](#request)
@@ -20,6 +21,10 @@ This specification is based on and extends [Engine API - Prague](./prague.md) sp
2021
- [Request](#request-1)
2122
- [Response](#response-1)
2223
- [Specification](#specification-1)
24+
- [engine_getBlobsV3](#engine_getblobsv3)
25+
- [Request](#request-2)
26+
- [Response](#response-2)
27+
- [Specification](#specification-2)
2328
- [Update the methods of previous forks](#update-the-methods-of-previous-forks)
2429
- [Cancun API](#cancun-api)
2530
- [Prague API](#prague-api)
@@ -47,6 +52,10 @@ The fields are encoded as follows:
4752

4853
`proofs` **MUST** contain exactly `CELLS_PER_EXT_BLOB` cell proofs.
4954

55+
### BlobAndProofV3
56+
57+
Alias for `BlobAndProofV2`.
58+
5059
## Methods
5160

5261
### engine_getPayloadV5
@@ -89,7 +98,7 @@ This method follows the same specification as [`engine_getPayloadV4`](./prague.m
8998

9099
### engine_getBlobsV2
91100

92-
Consensus layer clients **MAY** use this method to fetch blobs from the execution layer blob pool.
101+
Consensus layer clients **MAY** use this method to fetch blobs from the execution layer blob pool, in a all-or-nothing fashion. For partial response support, refer to `engine_getBlobsV3`.
93102

94103
#### Request
95104

@@ -108,12 +117,39 @@ Consensus layer clients **MAY** use this method to fetch blobs from the executio
108117
Refer to the specification for [`engine_getBlobsV1`](./cancun.md#engine_getblobsv1) with changes of the following:
109118

110119
1. Given an array of blob versioned hashes client software **MUST** respond with an array of `BlobAndProofV2` objects with matching versioned hashes, respecting the order of versioned hashes in the input array.
111-
1. Given an array of blob versioned hashes, if client software has every one of the requested blobs, it **MUST** return an array of `BlobAndProofV2` objects whose order exactly matches the input array. For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has `A`, `B` and `C` available, the response **MUST** be `[A, B, C]`.
112-
2. If one or more of the requested blobs are unavailable, the client **MUST** return either `null` or an array of the same length and order, inserting `null` only at the positions of the missing blobs. For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has data for blobs `A` and `C`, but doesn't have data for `B`, the response **MUST** be either `null` or `[A, null, C]`.
120+
2. Given an array of blob versioned hashes, if client software has every one of the requested blobs, it **MUST** return an array of `BlobAndProofV2` objects whose order exactly matches the input array. For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has `A`, `B` and `C` available, the response **MUST** be `[A, B, C]`.
121+
3. If one or more of the requested blobs are unavailable, the client **MUST** return `null` or an array of the same length and order, inserting `null` only at the positions of the missing blobs. For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has data for blobs `A` and `C`, but doesn't have data for `B`, the response **MUST** be either `null` or `[A, null, C]`.
113122
3. Client software **MUST** support request sizes of at least 128 blob versioned hashes. The client **MUST** return `-38004: Too large request` error if the number of requested blobs is too large.
114-
4. Client software **MUST** return `null` if syncing or otherwise unable to serve blob pool data.
123+
4. Client software **MUST** return `null` if syncing or otherwise unable to generally serve blob pool data.
115124
5. Callers **MUST** consider that execution layer clients may prune old blobs from their pool, and will respond with `null` if a blob has been pruned.
116125

126+
### engine_getBlobsV3
127+
128+
Consensus layer clients **MAY** use this method to fetch blobs from the execution layer blob pool, with support for partial responses. For an all-or-nothing query style, refer to `engine_getBlobsV2`.
129+
130+
#### Request
131+
132+
* method: `engine_getBlobsV3`
133+
* params:
134+
1. `Array of DATA`, 32 Bytes - Array of blob versioned hashes.
135+
* timeout: 1s
136+
137+
#### Response
138+
139+
* result: `Array of BlobAndProofV3` - Array of [`BlobAndProofV3`](#BlobAndProofV2), inserting `null` only at the positions of the missing blobs, or a `null` literal in the designated cases specified below.
140+
* error: code and message set in case an error occurs during processing of the request.
141+
142+
#### Specification
143+
144+
> To assist the reader, we highlight differences against `engine_getBlobsV2` using italic.
145+
146+
1. Given an array of blob versioned hashes client software **MUST** respond with an array of _`BlobAndProofV3`_ objects with matching versioned hashes, respecting the order of versioned hashes in the input array.
147+
2. Given an array of blob versioned hashes, if client software has every one of the requested blobs, it **MUST** return an array of _`BlobAndProofV3`_ objects whose order exactly matches the input array. For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has `A`, `B` and `C` available, the response **MUST** be `[A, B, C]`.
148+
3. If one or more of the requested blobs are unavailable, _the client **MUST** return an array of the same length and order, inserting `null` only at the positions of the missing blobs._ For instance, if the request is `[A_versioned_hash, B_versioned_hash, C_versioned_hash]` and client software has data for blobs `A` and `C`, but doesn't have data for `B`, _the response **MUST** be `[A, null, C]`. If all blobs are missing, the client software must return an array of matching length, filled with `null` at all positions._
149+
4. Client software **MUST** support request sizes of at least 128 blob versioned hashes. The client **MUST** return `-38004: Too large request` error if the number of requested blobs is too large.
150+
5. Client software **MUST** return `null` if syncing or otherwise unable to generally serve blob pool data.
151+
6. Callers **MUST** consider that execution layer clients may prune old blobs from their pool, and will respond with `null` at the corresponding position if a blob has been pruned.
152+
117153
### Update the methods of previous forks
118154

119155
#### Cancun API

0 commit comments

Comments
 (0)