Skip to content

Commit

Permalink
Merge branch 'master' into consensus-header
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi authored Sep 12, 2024
2 parents 5602b6b + 6f55437 commit 5f0d67f
Show file tree
Hide file tree
Showing 19 changed files with 227 additions and 40 deletions.
2 changes: 2 additions & 0 deletions apis/beacon/blob_sidecars/blob_sidecars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,7 @@ get:
example:
code: 404
message: "Block not found"
"406":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
2 changes: 2 additions & 0 deletions apis/beacon/blocks/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,7 @@ get:
example:
code: 404
message: "Block not found"
"406":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
1 change: 1 addition & 0 deletions apis/beacon/blocks/blinded_blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Beacon
- ValidatorRequiredApi
summary: "Publish a signed block."
deprecated: true
operationId: "publishBlindedBlock"
description: |
Instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a
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 @@ -41,7 +41,6 @@ get:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBeaconBlock"
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"
Expand All @@ -61,5 +60,7 @@ get:
example:
code: 404
message: "Block not found"
"406":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
1 change: 1 addition & 0 deletions apis/beacon/blocks/blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Beacon
- ValidatorRequiredApi
summary: "Publish a signed block."
deprecated: true
operationId: "publishBlock"
description: |
Instructs the beacon node to broadcast a newly signed beacon block to the beacon network,
Expand Down
4 changes: 3 additions & 1 deletion apis/beacon/deposit_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
summary: "Get Deposit Tree Snapshot"
description: |
Retrieve [EIP-4881](https://eips.ethereum.org/EIPS/eip-4881) Deposit Tree Snapshot.
Depending on `Accept` header it can be returned either as json or as bytes serialzed by SSZ
Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ
tags:
- Beacon
responses:
Expand All @@ -30,5 +30,7 @@
example:
code: 404
message: "No Finalized Snapshot Available"
"406":
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
11 changes: 3 additions & 8 deletions apis/beacon/light_client/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ get:
anyOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.LightClientBootstrap'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Capella.LightClientBootstrap'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Deneb.LightClientBootstrap'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.LightClientBootstrap'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientBootstrap` bytes. Use Accept header to choose this response type"
Expand All @@ -54,13 +56,6 @@ get:
code: 404
message: "LC bootstrap unavailable"
"406":
description: Unacceptable media type
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 406
message: "Accepted media type not supported"
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
11 changes: 3 additions & 8 deletions apis/beacon/light_client/finality_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ get:
anyOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.LightClientFinalityUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Capella.LightClientFinalityUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Deneb.LightClientFinalityUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.LightClientFinalityUpdate'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientFinalityUpdate` bytes. Use Accept header to choose this response type"
Expand All @@ -40,13 +42,6 @@ get:
code: 404
message: "LC finality update unavailable"
"406":
description: Unacceptable media type
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 406
message: "Accepted media type not supported"
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
11 changes: 3 additions & 8 deletions apis/beacon/light_client/optimistic_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ get:
anyOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.LightClientOptimisticUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Capella.LightClientOptimisticUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Deneb.LightClientOptimisticUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.LightClientOptimisticUpdate'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientOptimisticUpdate` bytes. Use Accept header to choose this response type"
Expand All @@ -40,13 +42,6 @@ get:
code: 404
message: "LC optimistic update unavailable"
"406":
description: Unacceptable media type
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 406
message: "Accepted media type not supported"
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
15 changes: 6 additions & 9 deletions apis/beacon/light_client/updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ get:
anyOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.LightClientUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Capella.LightClientUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Deneb.LightClientUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.LightClientUpdate'
application/octet-stream:
schema:
description: |
Expand All @@ -60,7 +62,9 @@ get:
| ------------------------------------------------------------------- | ------------------------------------- |
| `GENESIS_FORK_VERSION` | n/a |
| <nobr>`ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION`</nobr> | `altair.LightClientUpdate` |
| <nobr>`CAPELLA_FORK_VERSION` and later</nobr> | `capella.LightClientUpdate` |
| <nobr>`CAPELLA_FORK_VERSION` </nobr> | `capella.LightClientUpdate` |
| <nobr>`DENEB_FORK_VERSION` </nobr> | `deneb.LightClientUpdate` |
| <nobr>`ELECTRA_FORK_VERSION` and later</nobr> | `electra.LightClientUpdate` |
"400":
description: Malformed or missing request parameter
content:
Expand All @@ -85,13 +89,6 @@ get:
code: 400
message: "Missing `count` value"
"406":
description: Unacceptable media type
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 406
message: "Accepted media type not supported"
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
2 changes: 2 additions & 0 deletions apis/builder/states/expected_withdrawals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ get:
example:
code: 404
message: "State not found"
"406":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
2 changes: 2 additions & 0 deletions apis/debug/state.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ get:
example:
code: 404
message: "State not found"
"406":
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'

2 changes: 2 additions & 0 deletions apis/validator/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ get:
value:
code: 400
message: "Invalid request to produce a block"
"406":
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
Expand Down
2 changes: 2 additions & 0 deletions apis/validator/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ get:
value:
code: 400
message: "Invalid request to produce a block"
"406":
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
Expand Down
2 changes: 2 additions & 0 deletions apis/validator/block.v3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ get:
value:
code: 400
message: "Invalid request to produce a block"
"406":
$ref: "../../beacon-node-oapi.yaml#/components/responses/NotAcceptable"
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
Expand Down
30 changes: 27 additions & 3 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ info:
API specification for the beacon node, which enables users to query and participate in Ethereum 2.0 phase 0 beacon chain.
All requests by default send and receive JSON, and as such should have either or both of the "Content-Type: application/json"
and "Accept: application/json" headers. In addition, some requests can return data in the SSZ format. To indicate that SSZ
data is required in response to a request the header "Accept: application/octet-stream" should be sent. Note that only a subset
of requests can respond with data in SSZ format; these are noted in each individual request.
and "Accept: application/json" headers. In addition, some requests can send and receive data in the SSZ format. The header
"Content-Type: application/octet-stream" should be set in requests that contain SSZ data; a preference to receive SSZ data in
response can be indicated by setting the "Accept: application/octet-stream;q=1.0,application/json;q=0.9" header. Note that
only a subset of requests can respond with data in SSZ format; these are noted in each individual request.
When handling requests, the server should return a 415 status code if the "Content-Type" header in the request specifies a format
that is not supported. Similarly, it should return a 406 status code if it cannot produce a response in the format accepted by
the client as specified in the "Accept" header; if no "Accept" header is provided then it is assumed to be "application/json".
In any case, the server should indicate the format of the response by setting the corresponding "Content-Type" header.
API endpoints are individually versioned. As such, there is no direct relationship between all v1 endpoints, all v2 endpoints,
_etc._ and no such relationship should be inferred. All JSON responses return the requested data under a `data` key in the top
Expand Down Expand Up @@ -377,6 +383,14 @@ components:
$ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock'
Deneb.SignedBlindedBeaconBlock:
$ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock'
Deneb.LightClientBootstrap:
$ref: './types/deneb/light_client.yaml#/Deneb/LightClientBootstrap'
Deneb.LightClientUpdate:
$ref: './types/deneb/light_client.yaml#/Deneb/LightClientUpdate'
Deneb.LightClientFinalityUpdate:
$ref: './types/deneb/light_client.yaml#/Deneb/LightClientFinalityUpdate'
Deneb.LightClientOptimisticUpdate:
$ref: './types/deneb/light_client.yaml#/Deneb/LightClientOptimisticUpdate'
Blob:
$ref: './types/primitive.yaml#/Blob'
Deneb.BlobSidecars:
Expand All @@ -387,6 +401,14 @@ components:
$ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing'
Electra.SignedAggregateAndProof:
$ref: './types/electra/validator.yaml#/Electra/SignedAggregateAndProof'
Electra.LightClientBootstrap:
$ref: './types/electra/light_client.yaml#/Electra/LightClientBootstrap'
Electra.LightClientUpdate:
$ref: './types/electra/light_client.yaml#/Electra/LightClientUpdate'
Electra.LightClientFinalityUpdate:
$ref: './types/electra/light_client.yaml#/Electra/LightClientFinalityUpdate'
Electra.LightClientOptimisticUpdate:
$ref: './types/electra/light_client.yaml#/Electra/LightClientOptimisticUpdate'
Node:
$ref: './types/fork_choice.yaml#/Node'
ExtraData:
Expand All @@ -413,6 +435,8 @@ components:
$ref: './types/http.yaml#/InvalidRequest'
NotFound:
$ref: './types/http.yaml#/NotFound'
NotAcceptable:
$ref: './types/http.yaml#/NotAcceptable'
UnsupportedMediaType:
$ref: './types/http.yaml#/UnsupportedMediaType'
InternalError:
Expand Down
64 changes: 64 additions & 0 deletions types/deneb/light_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Deneb:
LightClientHeader:
type: object
required: [beacon, execution, execution_branch]
properties:
beacon:
$ref: '../block.yaml#/BeaconBlockHeader'
execution:
$ref: './execution_payload.yaml#/Deneb/ExecutionPayloadHeader'
execution_branch:
$ref: '../capella/light_client.yaml#/Capella/ExecutionBranch'

LightClientBootstrap:
type: object
required: [header, current_sync_committee, current_sync_committee_branch]
properties:
header:
$ref: '#/Deneb/LightClientHeader'
current_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
current_sync_committee_branch:
$ref: '../altair/light_client.yaml#/Altair/CurrentSyncCommitteeBranch'
LightClientUpdate:
type: object
required: [attested_header, next_sync_committee, next_sync_committee_branch, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
next_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
next_sync_committee_branch:
$ref: '../altair/light_client.yaml#/Altair/NextSyncCommitteeBranch'
finalized_header:
$ref: '#/Deneb/LightClientHeader'
finality_branch:
$ref: '../altair/light_client.yaml#/Altair/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientFinalityUpdate:
type: object
required: [attested_header, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
finalized_header:
$ref: '#/Deneb/LightClientHeader'
finality_branch:
$ref: '../altair/light_client.yaml#/Altair/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientOptimisticUpdate:
type: object
required: [attested_header, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
Loading

0 comments on commit 5f0d67f

Please sign in to comment.