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 10 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
54 changes: 54 additions & 0 deletions apis/beacon/blobs/post_blobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
post:
tags:
- Beacon
- ValidatorRequiredApi
summary: "Publish a signed blob."
operationId: "publishBlob"
Copy link
Contributor

Choose a reason for hiding this comment

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

deprecated?

description: |
Instructs the beacon node to broadcast a newly signed blob to the beacon network,
to be included in the beacon chain. A success response (20x) indicates that the blob
passed gossip validation and was successfully broadcast onto the network.
The beacon node is also expected to integrate the blob into state once it receives the
Copy link
Contributor

Choose a reason for hiding this comment

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

The description here needs to be changed. Blobs are not expected to be integrated into state.

corresponding block and any other corresponding blobs, but may broadcast it
before doing so, so as to aid timely delivery of the block and blobs. Should the blob fail full
validation, a separate success response code (202) is used to indicate that the blob was
successfully broadcast but failed integration.
parameters:
- in: header
schema:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: false
name: Eth-Consensus-Version
description: "Version of the blob being submitted, if using SSZ encoding."
requestBody:
description: "A variant of `SignedBlobSidecar` object composed of a `BlindedBlobSidecar` object (produced by beacon node) and validator signature."
required: true
content:
application/json:
schema:
oneOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBlobSidecar"
application/octet-stream:
schema:
description: "SSZ serialized blob sidecar bytes. Use content type header to indicate that SSZ data is contained in the request body."
responses:
"200":
description: "The blob was validated successfully and has been broadcast. It has also been integrated into the beacon node's database."
"202":
description: "The blob could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast."
"400":
description: "The `SignedBlobSidecar` object is invalid and could not be broadcast"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't be SignedBlindedBlobSidecar instead of SignedBlobSidecar?

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess description is talking about constructed object

content:
application/json:
schema:
allOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
- example:
code: 400
message: "Invalid blob: missing signature"
"415":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
"500":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing'
3 changes: 2 additions & 1 deletion apis/beacon/blocks/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ get:
properties:
version:
type: string
enum: [phase0, altair, bellatrix, capella]
enum: [phase0, altair, bellatrix, capella, deneb]
example: "phase0"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
Expand All @@ -37,6 +37,7 @@ get:
- $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"
application/octet-stream:
schema:
description: "SSZ serialized block bytes. Use Accept header to choose this response type"
Expand Down
1 change: 1 addition & 0 deletions apis/beacon/blocks/blinded_blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,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"
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
3 changes: 2 additions & 1 deletion apis/beacon/blocks/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ get:
properties:
version:
type: string
enum: [phase0, altair, bellatrix, capella]
enum: [phase0, altair, bellatrix, capella, deneb]
example: "phase0"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
Expand All @@ -37,6 +37,7 @@ get:
- $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"
application/octet-stream:
schema:

Expand Down
1 change: 1 addition & 0 deletions apis/beacon/blocks/blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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"
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
3 changes: 2 additions & 1 deletion apis/debug/state.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ get:
properties:
version:
type: string
enum: [ phase0, altair, bellatrix, capella ]
enum: [ phase0, altair, bellatrix, capella, deneb ]
example: "phase0"
execution_optimistic:
$ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
Expand All @@ -37,6 +37,7 @@ get:
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconState"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BeaconState"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BeaconState"
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BeaconState"
application/octet-stream:
schema:
description: "SSZ serialized state bytes. Use Accept header to choose this response type"
Expand Down
3 changes: 2 additions & 1 deletion apis/validator/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ get:
properties:
version:
type: string
enum: [ phase0, altair, bellatrix, capella ]
enum: [ phase0, altair, bellatrix, capella, deneb ]
example: "bellatrix"
data:
oneOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/BeaconBlock'
- $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.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
3 changes: 2 additions & 1 deletion apis/validator/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ get:
properties:
version:
type: string
enum: [ phase0, altair, bellatrix, capella ]
enum: [ phase0, altair, bellatrix, capella, deneb ]
example: "phase0"
data:
oneOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/BeaconBlock'
- $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.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
22 changes: 21 additions & 1 deletion beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ paths:
$ref: "./apis/beacon/blocks/blinded_blocks.yaml"
/eth/v1/beacon/blocks:
$ref: "./apis/beacon/blocks/blocks.yaml"
/eth/v1/beacon/blob_sidecar:
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should make this /eth/v1/beacon/blinded_blob_sidecar?

$ref: "./apis/beacon/blobs/post_blobs.yaml"
/eth/v2/beacon/blocks/{block_id}:
$ref: "./apis/beacon/blocks/block.v2.yaml"
/eth/v1/beacon/blocks/{block_id}/root:
Expand Down Expand Up @@ -319,7 +321,7 @@ components:
Bellatrix.SignedBlindedBeaconBlock:
$ref: './types/bellatrix/block.yaml#/Bellatrix/SignedBlindedBeaconBlock'
ConsensusVersion:
enum: [phase0, altair, bellatrix, capella]
enum: [phase0, altair, bellatrix, capella, deneb]
example: "phase0"
SignedValidatorRegistration:
$ref: './types/registration.yaml#/SignedValidatorRegistration'
Expand All @@ -341,6 +343,24 @@ components:
$ref: './types/capella/light_client.yaml#/Capella/LightClientFinalityUpdate'
Capella.LightClientOptimisticUpdate:
$ref: './types/capella/light_client.yaml#/Capella/LightClientOptimisticUpdate'
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.BlindedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock'
Deneb.BlindedBlockContents:
$ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents'
Deneb.SignedBlindedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock'
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
1 change: 1 addition & 0 deletions types/bellatrix/execution_payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Bellatrix:
allOf:
- $ref: '#/Bellatrix/ExecutionPayloadCommon'
- type: object
additionalProperties: false
properties:
transactions_root:
$ref: '../primitive.yaml#/Root'
12 changes: 4 additions & 8 deletions types/capella/block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Capella:
$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'

BeaconBlockBody:
allOf:
Expand All @@ -42,10 +46,6 @@ Capella:
properties:
execution_payload:
$ref: './execution_payload.yaml#/Capella/ExecutionPayload'
bls_to_execution_changes:
type: array
items:
$ref: '../bls_to_execution_change.yaml#/SignedBLSToExecutionChange'

BeaconBlock:
description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/Capella/beacon-chain.md#beaconblock) object from the CL Capella spec."
Expand Down Expand Up @@ -73,10 +73,6 @@ Capella:
properties:
execution_payload_header:
$ref: './execution_payload.yaml#/Capella/ExecutionPayloadHeader'
bls_to_execution_changes:
type: array
items:
$ref: '../bls_to_execution_change.yaml#/SignedBLSToExecutionChange'

BlindedBeaconBlock:
description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/capella/beacon-chain.md#beaconblock) object from the CL Capella spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`."
Expand Down
1 change: 1 addition & 0 deletions types/capella/execution_payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Capella:
allOf:
- $ref: '#/Capella/ExecutionPayloadCommon'
- type: object
additionalProperties: false
properties:
transactions_root:
$ref: '../primitive.yaml#/Root'
Expand Down
39 changes: 39 additions & 0 deletions types/deneb/blob_sidecar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Deneb:
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'

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"


97 changes: 97 additions & 0 deletions types/deneb/block.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
Deneb:
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/deneb/beacon-chain.md#beaconblockbody) object from the CL Deneb spec."
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: '#/Deneb/BeaconBlockBodyCommon'
- type: object
properties:
execution_payload:
$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."
realbigsean marked this conversation as resolved.
Show resolved Hide resolved
allOf:
- $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon'
- type: object
properties:
body:
$ref: '#/Deneb/BeaconBlockBody'

SignedBeaconBlock:
type: object
description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec."
properties:
message:
$ref: "#/Deneb/BeaconBlock"
signature:
$ref: "../primitive.yaml#/Signature"

BlindedBeaconBlockBody:
description: "A variant of the [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblockbody) object from the CL Deneb spec, which contains a transactions root rather than a full transactions list."
allOf:
- $ref: '#/Deneb/BeaconBlockBodyCommon'
- type: object
properties:
execution_payload_header:
$ref: './execution_payload.yaml#/Deneb/ExecutionPayloadHeader'

BlindedBeaconBlock:
description: "A variant of the the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`."
allOf:
- $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon'
- type: object
properties:
body:
$ref: '#/Deneb/BlindedBeaconBlockBody'

SignedBlindedBeaconBlock:
type: object
description: "A variant of the the the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`."
properties:
message:
$ref: "#/Deneb/BlindedBeaconBlock"
signature:
$ref: "../primitive.yaml#/Signature"
Loading