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

Add blob download endpoint (getBlobs) #286

Merged
merged 29 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5502da1
Update types to support EIP-4844 (#271)
jimmygchen Dec 25, 2022
85a715d
Add getBlobsSidecar endpoint
jimmygchen Jan 9, 2023
e702695
Merge remote-tracking branch 'upstream/master' into EIP4844
rolfyone Jan 18, 2023
fd02cd2
Introduce Deneb to remove EIP-4844 references
rolfyone Jan 18, 2023
ca3dd1b
Remove `_sidecar` from blobs endpoint path. Add endpoint to CHANGES.md
jimmygchen Jan 19, 2023
09ca1dd
Merge remote-tracking branch 'upstream/master' into eip_rename
rolfyone Feb 8, 2023
709ccd6
fix lint - couldnt find any evidence of capella transactions, so put …
rolfyone Feb 8, 2023
652b865
Merge branch 'eip_rename' into download-blob-api
jimmygchen Feb 14, 2023
f300afe
Merge branch 'master' into eip_rename
rolfyone Feb 15, 2023
b1bbe28
Merge branch 'master' into download-blob-api
jimmygchen Feb 20, 2023
30b2d05
Update endpoint to return `BlobSidecar` container from latest CL spec
jimmygchen Feb 24, 2023
1d8e599
Add recommendation to do blob retrieval by slot
jimmygchen Feb 24, 2023
39efcbe
Merge branch 'eip_rename' into download-blob-api
jimmygchen Feb 24, 2023
1ec6931
Merge branch 'master' into download-blob-api
jimmygchen Feb 27, 2023
fe595c3
Merge branch 'master' into download-blob-api
jimmygchen Mar 12, 2023
27ac4b8
Add blob indices query paraemter
jimmygchen Apr 4, 2023
7f5e792
Merge branch 'master' into download-blob-api
jimmygchen May 3, 2023
7ee3525
Remove old block_and_blobs_sidecar type
jimmygchen May 3, 2023
4ccaaa6
Address review comments.
jimmygchen May 5, 2023
4ded8d7
Merge branch 'master' into download-blob-api
rolfyone May 9, 2023
61b4663
Merge branch 'master' into download-blob-api
rolfyone May 10, 2023
27e4451
Merge branch 'master' into download-blob-api
jimmygchen May 11, 2023
e3dfda2
Apply review comment, change RanDAO to RANDAO
jimmygchen May 11, 2023
354ff9f
Add more details to getBlobs response
jimmygchen May 11, 2023
eb7bc1f
Merge branch 'download-blob-api' of github.com:jimmygchen/beacon-APIs…
jimmygchen May 11, 2023
df43224
Update spacing
jimmygchen May 11, 2023
775e93c
Merge branch 'master' into download-blob-api
jimmygchen May 17, 2023
a6d1c36
Update getBlobSidecars endpoint path
jimmygchen May 17, 2023
096aadc
Reuse BlobSidecars type in getBlobSidecars response
jimmygchen May 17, 2023
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ There are likely to be descriptions etc outside of the list below, but new query
| [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v2/beacon/blocks/{block_id}` added `deneb` block to response | | | | | |
| [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v1/validator/blinded_blocks/{slot}` added `deneb` blinded block | | | | | |
| [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v1/validator/blocks/{slot}` added `deneb` block | | | | | |
| [#286](https://github.com/ethereum/beacon-APIs/pull/286) NEW `/eth/v1/beacon/blob_sidecars/{block_id}` | | | | | |
| [#319](https://github.com/ethereum/beacon-APIs/pull/319) `/eth/v1/debug/beacon/heads` removed deprecated endpoint | | | | | |
| [#302](https://github.com/ethereum/beacon-APIs/pull/302) Added `BlockContents` structures for `deneb` blocks and blob_sidecars | | | | | |

Expand Down
64 changes: 64 additions & 0 deletions apis/beacon/blob_sidecars/blob_sidecars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
get:
operationId: getBlobSidecars
summary: Get blob sidecars
description: |
Retrieves blob sidecars for a given block id.
Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ.

If the `indices` paramneter is specified, only the blob sidecars with the specified indices will be returned. There are no guarantees
for the returned blob sidecars in terms of ordering.
tags:
- Beacon
parameters:
- name: block_id
in: path
required: true
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId'
- name: indices
in: query
description: Array of indices for blob sidecars to request for in the specified block. Returns all blob sidecars in the block if not speicfied.
required: false
schema:
type: array
uniqueItems: true
items:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64'
responses:
"200":
description: "Successful response"
content:
application/json:
schema:
title: GetBlobsResponse
type: object
properties:
data:
type: array
Copy link
Contributor

Choose a reason for hiding this comment

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

We appear to have the type BlobSidecars that is an array of blob sidecars with the same parameters as this. Should that be used in place of redefining the array here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Updated in 096aadc, thanks!

items:
oneOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlobSidecar"
minItems: 0
maxItems: 4
application/octet-stream:
schema:
description: "SSZ serialized `BlobSidecars` 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: "Block not found"
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 404
message: "Block not found"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ paths:
$ref: "./apis/beacon/blocks/root.yaml"
/eth/v1/beacon/blocks/{block_id}/attestations:
$ref: "./apis/beacon/blocks/attestations.yaml"
/eth/v1/beacon/blob_sidecars/{block_id}:
$ref: "./apis/beacon/blob_sidecars/blob_sidecars.yaml"
/eth/v1/beacon/rewards/sync_committee/{block_id}:
$ref: "./apis/beacon/rewards/sync_committee.yaml"
/eth/v1/beacon/deposit_snapshot:
Expand Down
2 changes: 0 additions & 2 deletions types/deneb/blob_sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,3 @@ Deneb:
$ref: "#/Deneb/BlindedBlobSidecar"
signature:
$ref: "../primitive.yaml#/Signature"


2 changes: 1 addition & 1 deletion types/deneb/block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deneb:
randao_reveal:
allOf:
- $ref: '../primitive.yaml#/Signature'
- description: "The RanDAO reveal value provided by the validator."
- description: "The RANDAO reveal value provided by the validator."
eth1_data:
$ref: '../eth1.yaml#/Eth1Data'
graffiti:
Expand Down
29 changes: 0 additions & 29 deletions types/deneb/block_and_blobs_sidecar.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion types/primitive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ KZGProof:
type: string
format: hex
pattern: "^0x[a-fA-F0-9]{96}$"
description: "A KZG proof. Same check as `KZGCommitment`"
description: "A G1 curve point. Used for verifying that the `KZGCommitment` for a given `Blob` is correct."