-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add blob download endpoint (getBlobs) #286
Changes from 2 commits
5502da1
85a715d
e702695
fd02cd2
ca3dd1b
09ca1dd
709ccd6
652b865
f300afe
b1bbe28
30b2d05
1d8e599
39efcbe
1ec6931
fe595c3
27ac4b8
7f5e792
7ee3525
4ccaaa6
4ded8d7
61b4663
27e4451
e3dfda2
354ff9f
eb7bc1f
df43224
775e93c
a6d1c36
096aadc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
get: | ||
operationId: getBlobsSidecar | ||
summary: Get blobs sidecar | ||
description: | | ||
Retrieves blobs sidecar for given block id. | ||
Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ | ||
tags: | ||
- Beacon | ||
parameters: | ||
- name: block_id | ||
in: path | ||
required: true | ||
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' | ||
responses: | ||
"200": | ||
description: "Successful response" | ||
content: | ||
application/json: | ||
schema: | ||
title: GetBlobsSidecarResponse | ||
type: object | ||
properties: | ||
data: | ||
oneOf: | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/BlobsSidecar" | ||
application/octet-stream: | ||
schema: | ||
description: "SSZ serialized block bytes. Use Accept header to choose this response type" | ||
"400": | ||
description: "The block ID supplied could not be parsed" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 400 | ||
message: "Invalid block ID: current" | ||
"404": | ||
description: "Blob sidecar not found" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 404 | ||
message: "Blob sidecar not found" | ||
"500": | ||
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,8 @@ paths: | |
$ref: "./apis/beacon/blocks/root.yaml" | ||
/eth/v1/beacon/blocks/{block_id}/attestations: | ||
$ref: "./apis/beacon/blocks/attestations.yaml" | ||
/eth/v1/beacon/blobs_sidecars/{block_id}: | ||
$ref: "./apis/beacon/blobs_sidecars/blobs_sidecar.yaml" | ||
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. do both need to be plurals? is if the paths / files / object names can be consistent that'll make it easier to navigate 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. hmm I think this is on an old commit as well, I just did a global search for |
||
/eth/v1/beacon/rewards/sync_committee/{block_id}: | ||
$ref: "./apis/beacon/rewards/sync_committee.yaml" | ||
/eth/v1/beacon/deposit_snapshot: | ||
|
@@ -198,6 +200,8 @@ components: | |
$ref: './types/state.yaml#/BeaconState' | ||
BeaconBlock: | ||
$ref: './types/block.yaml#/BeaconBlock' | ||
BlobsSidecar: | ||
$ref: './types/blobs_sidecar.yaml#/BlobsSidecar' | ||
DepositSnapshotResponse: | ||
$ref: './types/api.yaml#/DepositSnapshotResponse' | ||
SignedBeaconBlock: | ||
|
@@ -311,7 +315,7 @@ components: | |
Bellatrix.SignedBlindedBeaconBlock: | ||
$ref: './types/bellatrix/block.yaml#/Bellatrix/SignedBlindedBeaconBlock' | ||
ConsensusVersion: | ||
enum: [phase0, altair, bellatrix, capella] | ||
enum: [phase0, altair, bellatrix, capella, eip4844] | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
example: "phase0" | ||
SignedValidatorRegistration: | ||
$ref: './types/registration.yaml#/SignedValidatorRegistration' | ||
|
@@ -325,6 +329,16 @@ components: | |
$ref: './types/capella/block.yaml#/Capella/BlindedBeaconBlock' | ||
Capella.SignedBlindedBeaconBlock: | ||
$ref: './types/capella/block.yaml#/Capella/SignedBlindedBeaconBlock' | ||
EIP4844.BeaconState: | ||
$ref: './types/eip4844/state.yaml#/EIP4844/BeaconState' | ||
EIP4844.BeaconBlock: | ||
$ref: './types/eip4844/block.yaml#/EIP4844/BeaconBlock' | ||
EIP4844.SignedBeaconBlock: | ||
$ref: './types/eip4844/block.yaml#/EIP4844/SignedBeaconBlock' | ||
EIP4844.BlindedBeaconBlock: | ||
$ref: './types/eip4844/block.yaml#/EIP4844/BlindedBeaconBlock' | ||
EIP4844.SignedBlindedBeaconBlock: | ||
$ref: './types/eip4844/block.yaml#/EIP4844/SignedBlindedBeaconBlock' | ||
Node: | ||
$ref: './types/fork_choice.yaml#/Node' | ||
ExtraData: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
BlobsSidecar: | ||
type: object | ||
description: "The `BlobsSidecar` object from the EIP-4844 CL spec." | ||
properties: | ||
beacon_block_root: | ||
$ref: "./primitive.yaml#/Root" | ||
beacon_block_slot: | ||
$ref: "./primitive.yaml#/Uint64" | ||
blobs: | ||
type: array | ||
maxItems: 4 | ||
minItems: 0 | ||
items: | ||
$ref: "#/Blob" | ||
kzg_aggregated_proof: | ||
$ref: "#/KZGProof" | ||
|
||
KZGProof: | ||
type: string | ||
format: hex | ||
pattern: "^0x[a-fA-F0-9]{96}$" | ||
description: "An aggregated KZG proof. Same check as `KZGCommitment`" | ||
|
||
Blob: | ||
type: string | ||
format: hex | ||
pattern: "^0x[a-fA-F0-9]{262144}$" | ||
description: "A blob is `FIELD_ELEMENTS_PER_BLOB * size_of(BLSFieldElement) = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded Blob as defined in EIP-4844" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
EIP4844: | ||
BeaconBlockBodyCommon: | ||
# An abstract object to collect the common fields between the BeaconBlockBody and the BlindedBeaconBlockBody objects | ||
type: object | ||
description: "The [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconblockbody) object from the CL EIP-4844 spec." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
properties: | ||
randao_reveal: | ||
allOf: | ||
- $ref: '../primitive.yaml#/Signature' | ||
- description: "The RanDAO reveal value provided by the validator." | ||
eth1_data: | ||
$ref: '../eth1.yaml#/Eth1Data' | ||
graffiti: | ||
$ref: '../primitive.yaml#/Graffiti' | ||
proposer_slashings: | ||
type: array | ||
items: | ||
$ref: '../proposer_slashing.yaml#/ProposerSlashing' | ||
attester_slashings: | ||
type: array | ||
items: | ||
$ref: '../attester_slashing.yaml#/AttesterSlashing' | ||
attestations: | ||
type: array | ||
items: | ||
$ref: '../attestation.yaml#/Attestation' | ||
deposits: | ||
type: array | ||
items: | ||
$ref: '../deposit.yaml#/Deposit' | ||
voluntary_exits: | ||
type: array | ||
items: | ||
$ref: '../voluntary_exit.yaml#/SignedVoluntaryExit' | ||
sync_aggregate: | ||
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate' | ||
bls_to_execution_changes: | ||
type: array | ||
items: | ||
$ref: '../bls_to_execution_change.yaml#/SignedBLSToExecutionChange' | ||
blob_kzg_commitments: | ||
type: array | ||
items: | ||
$ref: '../primitive.yaml#/KZGCommitment' | ||
|
||
BeaconBlockBody: | ||
allOf: | ||
- $ref: '#/EIP4844/BeaconBlockBodyCommon' | ||
- type: object | ||
properties: | ||
execution_payload: | ||
$ref: './execution_payload.yaml#/EIP4844/ExecutionPayload' | ||
|
||
BeaconBlock: | ||
description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/EIP4844/beacon-chain.md#beaconblock) object from the CL EIP-4844 spec." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
allOf: | ||
- $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' | ||
- type: object | ||
properties: | ||
body: | ||
$ref: '#/EIP4844/BeaconBlockBody' | ||
|
||
SignedBeaconBlock: | ||
type: object | ||
description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#signedbeaconblock) object envelope from the CL EIP-4844 spec." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
properties: | ||
message: | ||
$ref: "#/EIP4844/BeaconBlock" | ||
signature: | ||
$ref: "../primitive.yaml#/Signature" | ||
|
||
BlindedBeaconBlockBody: | ||
description: "A variant of the [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconblockbody) object from the CL EIP-4844 spec, which contains a transactions root rather than a full transactions list." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
allOf: | ||
- $ref: '#/EIP4844/BeaconBlockBodyCommon' | ||
- type: object | ||
properties: | ||
execution_payload_header: | ||
$ref: './execution_payload.yaml#/EIP4844/ExecutionPayloadHeader' | ||
|
||
BlindedBeaconBlock: | ||
description: "A variant of the the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconblock) object from the CL EIP-4844 spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
allOf: | ||
- $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' | ||
- type: object | ||
properties: | ||
body: | ||
$ref: '#/EIP4844/BlindedBeaconBlockBody' | ||
|
||
SignedBlindedBeaconBlock: | ||
type: object | ||
description: "A variant of the the the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#signedbeaconblock) object envelope from the CL EIP-4844 spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." | ||
rolfyone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
properties: | ||
message: | ||
$ref: "#/EIP4844/BlindedBeaconBlock" | ||
signature: | ||
$ref: "../primitive.yaml#/Signature" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd actually be inclined to make this the same pattern as attestations, so the path would be more like
/eth/v1/beacon/blocks/{block_id}/blobs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that imply that the blobs are part of the block structure, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to
/eth/v1/beacon/blobs/{block_id}