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 signing endpoints #302

Merged
merged 22 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5502da1
Update types to support EIP-4844 (#271)
jimmygchen Dec 25, 2022
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
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
a213e30
update necessary types
realbigsean Feb 13, 2023
cec2c91
add/update blob signing related endpoints
realbigsean Feb 13, 2023
af17213
bug fixes
realbigsean Feb 13, 2023
bb8b8ae
fix lints
realbigsean Feb 13, 2023
b14c00c
KZG proof whitespace fix
realbigsean Feb 13, 2023
066ed57
Merge branch 'master' into add-blob-signing-endpoints
realbigsean Feb 16, 2023
0efc637
more descriptive blob sidecar name
realbigsean Mar 7, 2023
9d08f11
Combine signed block and blob publishing
realbigsean Mar 8, 2023
a630ac8
Fix references to block contents and add to description in the block …
realbigsean Mar 8, 2023
eb5d7d1
Merge branch 'master' of https://github.com/ethereum/beacon-APIs into…
realbigsean Mar 8, 2023
1a9034c
Unblind blobs in default flow
realbigsean Mar 8, 2023
2627727
Merge branch 'master' of https://github.com/ethereum/beacon-APIs into…
realbigsean Mar 8, 2023
1b08ee4
Merge branch 'master' of https://github.com/ethereum/beacon-APIs into…
realbigsean May 12, 2023
605dd84
Update types/deneb/block.yaml
realbigsean May 12, 2023
23b236a
remove duplicates in beacon-node-oapi.yaml
realbigsean May 12, 2023
32f5c39
Merge branch 'add-blob-signing-endpoints' of https://github.com/realb…
realbigsean May 12, 2023
f7b11f6
added changelog entry.
rolfyone May 16, 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
5 changes: 3 additions & 2 deletions apis/beacon/blocks/blinded_blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ post:
successful. The beacon node is expected to integrate the new block into its state, and
therefore validate the block internally, however blocks which fail the validation are still
broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept
a `SignedBeaconBlock`.
a `SignedBeaconBlock`. After Deneb, this additionally instructs the beacon node to broadcast all given
signed blobs.
parameters:
- in: header
schema:
Expand All @@ -32,7 +33,7 @@ post:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBlindedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBlockContents"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body."
Expand Down
5 changes: 3 additions & 2 deletions apis/beacon/blocks/blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ post:
The beacon node is also expected to integrate the block into state, but may broadcast it
before doing so, so as to aid timely delivery of the block. Should the block fail full
validation, a separate success response code (202) is used to indicate that the block was
successfully broadcast but failed integration.
successfully broadcast but failed integration. After Deneb, this additionally instructs
the beacon node to broadcast all given signed blobs.
parameters:
- in: header
schema:
Expand All @@ -30,7 +31,7 @@ post:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBeaconBlock"
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlockContents"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body."
Expand Down
2 changes: 1 addition & 1 deletion apis/validator/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ get:
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BlindedBeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BlindedBeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlindedBeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlindedBlockContents"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use Accept header to choose this response type, version string is sent in header `Eth-Consensus-Version`."
Expand Down
2 changes: 1 addition & 1 deletion apis/validator/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ get:
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BeaconBlock"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlockContents"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use Accept header to choose this response type, version string is sent in header `Eth-Consensus-Version`."
Expand Down
28 changes: 28 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,34 @@ components:
$ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock'
Capella.Withdrawal:
$ref: './types/withdrawal.yaml#/Withdrawal'
Deneb.BeaconState:
$ref: './types/deneb/state.yaml#/Deneb/BeaconState'
Deneb.BeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/BeaconBlock'
Deneb.BlockContents:
$ref: './types/deneb/block_contents.yaml#/Deneb/BlockContents'
Deneb.SignedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/SignedBeaconBlock'
Deneb.SignedBlockContents:
$ref: './types/deneb/block_contents.yaml#/Deneb/SignedBlockContents'
Deneb.BlindedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock'
Deneb.SignedBlindedBlockContents:
$ref: './types/deneb/block_contents.yaml#/Deneb/SignedBlindedBlockContents'
Deneb.BlindedBlockContents:
$ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents'
Deneb.SignedBlindedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock'
Blob:
$ref: './types/primitive.yaml#/Blob'
Deneb.BlobSidecar:
$ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar'
Deneb.SignedBlobSidecar:
$ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlobSidecar'
Deneb.BlindedBlobSidecar:
$ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlindedBlobSidecar'
Deneb.SignedBlindedBlobSidecar:
$ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecar'
Node:
$ref: './types/fork_choice.yaml#/Node'
ExtraData:
Expand Down
90 changes: 90 additions & 0 deletions types/deneb/blob_sidecar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Deneb:
BlobSidecars:
type: array
items:
$ref: '#/Deneb/BlobSidecar'
minItems: 0
maxItems: 4

BlobSidecar:
type: object
description: "A blob sidecar as defined in the Deneb consensus spec."
properties:
block_root:
$ref: "../primitive.yaml#/Root"
index:
$ref: "../primitive.yaml#/Uint64"
slot:
$ref: "../primitive.yaml#/Uint64"
block_parent_root:
$ref: "../primitive.yaml#/Root"
proposer_index:
$ref: "../primitive.yaml#/Uint64"
blob:
$ref: "../primitive.yaml#/Blob"
kzg_commitment:
$ref: '../primitive.yaml#/KZGCommitment'
kzg_proof:
$ref: '../primitive.yaml#/KZGProof'

SignedBlobSidecars:
type: array
items:
$ref: '#/Deneb/SignedBlobSidecar'
minItems: 0
maxItems: 4

SignedBlobSidecar:
type: object
description: "The `SignedBlobSidecar` object envelope from the CL Deneb spec."
properties:
message:
$ref: "#/Deneb/BlobSidecar"
signature:
$ref: "../primitive.yaml#/Signature"

BlindedBlobSidecars:
type: array
items:
$ref: '#/Deneb/BlindedBlobSidecar'
minItems: 0
maxItems: 4

BlindedBlobSidecar:
type: object
description: "A blob sidecar with the SSZ root of the blob rather than the full blob."
properties:
block_root:
$ref: "../primitive.yaml#/Root"
index:
$ref: "../primitive.yaml#/Uint64"
slot:
$ref: "../primitive.yaml#/Uint64"
block_parent_root:
$ref: "../primitive.yaml#/Root"
proposer_index:
$ref: "../primitive.yaml#/Uint64"
blob_root:
$ref: "../primitive.yaml#/Root"
kzg_commitment:
$ref: '../primitive.yaml#/KZGCommitment'
kzg_proof:
$ref: '../primitive.yaml#/KZGProof'

SignedBlindedBlobSidecars:
type: array
items:
$ref: '#/Deneb/SignedBlindedBlobSidecar'
minItems: 0
maxItems: 4

SignedBlindedBlobSidecar:
type: object
description: "A variant of the `SignedBlobSidecar` object envelope from the CL Deneb spec, which contains a `BlindedBlobSidecar` rather than a `BlobSidecar`."
properties:
message:
$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 @@ -52,7 +52,7 @@ Deneb:
$ref: './execution_payload.yaml#/Deneb/ExecutionPayload'

BeaconBlock:
description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec."
description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/Deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec."
realbigsean marked this conversation as resolved.
Show resolved Hide resolved
allOf:
- $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon'
- type: object
Expand Down
37 changes: 37 additions & 0 deletions types/deneb/block_contents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Deneb:
BlockContents:
type: object
description: "The required object for block production according to the Deneb CL spec."
properties:
block:
$ref: "./block.yaml#/Deneb/BeaconBlock"
blob_sidecars:
rkapka marked this conversation as resolved.
Show resolved Hide resolved
$ref: "./blob_sidecar.yaml#/Deneb/BlobSidecars"

BlindedBlockContents:
type: object
description: "The required object for blinded block production according to the Deneb CL spec."
properties:
blinded_block:
$ref: "./block.yaml#/Deneb/BlindedBeaconBlock"
blinded_blob_sidecars:
$ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars"

SignedBlockContents:
type: object
description: "The required signed components of block production according to the Deneb CL spec."
properties:
signed_block:
$ref: "./block.yaml#/Deneb/SignedBeaconBlock"
signed_blob_sidecars:
$ref: "./blob_sidecar.yaml#/Deneb/SignedBlobSidecars"

SignedBlindedBlockContents:
type: object
description: "The required signed components of block production according to the Deneb CL spec."
properties:
signed_blinded_block:
$ref: "./block.yaml#/Deneb/SignedBlindedBeaconBlock"
signed_blinded_blob_sidecars:
$ref: "./blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecars"

12 changes: 12 additions & 0 deletions types/primitive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,21 @@ LogsBloom:
example: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
pattern: "^0x[a-fA-F0-9]{512}$"

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 Deneb"

KZGCommitment:
type: string
format: hex
pattern: "^0x[a-fA-F0-9]{96}$"
description: "A G1 curve point. Same as BLS standard \"is valid pubkey\" check but also allows `0x00..00` for point-at-infinity"
example: "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"

KZGProof:
type: string
format: hex
pattern: "^0x[a-fA-F0-9]{96}$"
description: "A KZG proof. Same check as `KZGCommitment`"