-
Notifications
You must be signed in to change notification settings - Fork 436
engine/blobs: move partial return support to mandatory engine_getBlobsV3
#674
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
base: main
Are you sure you want to change the base?
Changes from all commits
5cf47d7
1859a6e
36f2d3e
aac419d
a0e5252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ This specification is based on and extends [Engine API - Prague](./prague.md) sp | |
- [Request](#request-1) | ||
- [Response](#response-1) | ||
- [Specification](#specification-1) | ||
- [engine_getBlobsV3](#engine_getblobsv3) | ||
- [Request](#request-2) | ||
- [Response](#response-2) | ||
- [Specification](#specification-2) | ||
- [Update the methods of previous forks](#update-the-methods-of-previous-forks) | ||
- [Cancun API](#cancun-api) | ||
- [Prague API](#prague-api) | ||
|
@@ -89,7 +93,7 @@ This method follows the same specification as [`engine_getPayloadV4`](./prague.m | |
|
||
### engine_getBlobsV2 | ||
|
||
Consensus layer clients **MAY** use this method to fetch blobs from the execution layer blob pool. | ||
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`. | ||
|
||
#### Request | ||
|
||
|
@@ -105,15 +109,41 @@ Consensus layer clients **MAY** use this method to fetch blobs from the executio | |
|
||
#### Specification | ||
|
||
Refer to the specification for [`engine_getBlobsV1`](./cancun.md#engine_getblobsv1) with changes of the following: | ||
|
||
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. | ||
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]`. | ||
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]`. | ||
2. Client software **MUST** return `null` in case of any missing or older version blobs. For instance, | ||
1. 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 `null`. | ||
2. if the request is `[A_versioned_hash_for_blob_with_blob_proof]`, the response **MUST** be `null` as well. | ||
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. | ||
4. Client software **MUST** return `null` if syncing or otherwise unable to serve blob pool data. | ||
4. Client software **MUST** return `null` if syncing or otherwise unable to generally serve blob pool data. | ||
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. | ||
|
||
### engine_getBlobsV3 | ||
|
||
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`. | ||
|
||
#### Request | ||
|
||
* method: `engine_getBlobsV3` | ||
* params: | ||
1. `Array of DATA`, 32 Bytes - Array of blob versioned hashes. | ||
* timeout: 1s | ||
|
||
#### Response | ||
|
||
* result: `Array of BlobAndProofV2` - Array of [`BlobAndProofV2`](#BlobAndProofV2), inserting `null` only at the positions of the missing blobs, or a `null` literal in the designated cases specified below. | ||
* error: code and message set in case an error occurs during processing of the request. | ||
|
||
#### Specification | ||
|
||
> To assist the reader, we highlight differences against `engine_getBlobsV2` using italic. | ||
|
||
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. | ||
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]`. | ||
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._ | ||
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. | ||
5. Client software **MUST** return `null` if syncing or otherwise unable to generally serve blob pool data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This allows an EL client to still return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. V3 guarantees that partial responses will be served (unless no responses can be served at all, and this is not due to an internal error, which is what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. V3 changes the EL behavior relative to V2, no argument there.
This is my point. The CL has to handle receiving There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was a deliberate choice. V1 would return a null filled array, but it’s clearer semantics to return a single null literal that translates to an Option or pointer type in Rust and Go, given this outcome affects the whole request anyway. IMO it’s even cleaner to return an error, but I assumed there was a reason V1 didn’t from the get-go. |
||
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. | ||
|
||
### Update the methods of previous forks | ||
|
||
#### Cancun API | ||
|
Uh oh!
There was an error while loading. Please reload this page.