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

Define engine_getBlobsV1 #559

Merged
merged 6 commits into from
Oct 2, 2024
Merged
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
37 changes: 37 additions & 0 deletions src/engine/cancun.md
mkalinin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ The fields are encoded as follows:

All of the above three arrays **MUST** be of same length.

### BlobAndProofV1

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).
- `proof`: `DATA` - `KZGProof` as defined in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844), 48 bytes (`DATA`).

### PayloadAttributesV3

This structure has the syntax of [`PayloadAttributesV2`](./shanghai.md#payloadattributesv2) and appends a single field: `parentBeaconBlockRoot`.
Expand Down Expand Up @@ -170,6 +177,36 @@ Refer to the specification for [`engine_getPayloadV2`](./shanghai.md#engine_getp

5. Client software **MAY** use any heuristics to decide whether to set `shouldOverrideBuilder` flag or not. If client software does not implement any heuristic this flag **SHOULD** be set to `false`.

### engine_getBlobsV1

Consensus layer clients MAY use this method to fetch blobs from the execution layer blob pool.
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved

This is a new optional method introduced after Cancun. It is defined here because it is backwards-compatible with Cancun.
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved

#### Request

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

#### Response

* result: `Array of BlobAndProofV1` - Array of [`BlobAndProofV1`](#BlobAndProofV1) which may be `null`.
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved
* error: code and message set in case an error occurs during processing of the request.

#### Specification

1. Given an array of blob versioned hashes client software **MUST** respond with an array of `BlobAndProofV1` objects with matching versioned hashes, respecting the order of versioned hashes in the input array.

1. Client software **MUST** place responses in the order given in the request, using `null` for any 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]`.
mkalinin marked this conversation as resolved.
Show resolved Hide resolved

1. 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.

1. Client software **MAY** return an array of all `null` entries if syncing or otherwise unable to serve blob pool data.

1. 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.
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved

### Deprecate `engine_exchangeTransitionConfigurationV1`

This document introduces deprecation of [`engine_exchangeTransitionConfigurationV1`](./paris.md#engine_exchangetransitionconfigurationv1). The deprecation is specified as follows:
Expand Down
29 changes: 29 additions & 0 deletions src/engine/openrpc/methods/blob.yaml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/engine/openrpc/schemas/blob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BlobAndProofV1:
title: Blob and proof object V1
type: object
required:
- blob
- proof
properties:
blob:
title: Blob
$ref: '#/components/schemas/bytes'
proof:
title: proof
$ref: '#/components/schemas/bytes48'

2 changes: 2 additions & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ethereum
ethereumjs
erigon
getclientversionv
getblobsv
interop
json
mempool
Expand Down Expand Up @@ -50,6 +51,7 @@ ipc
cli
blobsbundlev
getblobsbundlev
blobandproofv
ssz
kzg
besu
Expand Down
Loading