Skip to content

Commit

Permalink
Merge branch 'master' into nflaig/electra-spec-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Sep 16, 2024
2 parents d7b4c5d + ca2f9a8 commit e45482f
Show file tree
Hide file tree
Showing 25 changed files with 238 additions and 48 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"
1 change: 1 addition & 0 deletions apis/beacon/blocks/attestations.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ get:
headers:
Eth-Consensus-Version:
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
description: "The active consensus version to which the attestations belong."
content:
application/json:
schema:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,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: 1 addition & 1 deletion apis/beacon/blocks/blinded_blocks.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: true
name: Eth-Consensus-Version
description: "Version of the block being submitted."
description: "The active consensus version to which the block being submitted belongs."
requestBody:
description: "The `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature."
required: true
Expand Down
3 changes: 2 additions & 1 deletion 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 All @@ -20,7 +21,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: false
name: Eth-Consensus-Version
description: "Version of the block being submitted, if using SSZ encoding."
description: "The active consensus version to which the block being submitted belongs."
requestBody:
description: "The `SignedBlindedBeaconBlock` object composed of `BlindedBeaconBlock` object (produced by beacon node) and validator signature."
required: true
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 @@ -42,7 +42,6 @@ get:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.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 @@ -62,5 +61,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: 1 addition & 1 deletion apis/beacon/blocks/blocks.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: true
name: Eth-Consensus-Version
description: "Version of the block being submitted."
description: "The active consensus version to which the block being submitted belongs."
requestBody:
description: "The `SignedBeaconBlock` object composed of `BeaconBlock` object (produced by beacon node) and validator signature."
required: true
Expand Down
3 changes: 2 additions & 1 deletion 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 All @@ -19,7 +20,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: false
name: Eth-Consensus-Version
description: "Version of the block being submitted, if using SSZ encoding."
description: "The active consensus version to which the block being submitted belongs."
requestBody:
description: "The `SignedBeaconBlock` object composed of `BeaconBlock` object (produced by beacon node) and validator signature."
required: true
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: 1 addition & 1 deletion apis/beacon/pool/attestations.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: true
name: Eth-Consensus-Version
description: "Version of the attestations being submitted."
description: "The consensus version to which the attestations being submitted belong."
tags:
- Beacon
- ValidatorRequiredApi
Expand Down
2 changes: 1 addition & 1 deletion apis/beacon/pool/attester_slashings.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ post:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: true
name: Eth-Consensus-Version
description: "Version of the attester slashing being submitted."
description: "The active consensus version to which the attester slashing being submitted belongs."
tags:
- Beacon
requestBody:
Expand Down
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 @@ -61,6 +61,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: 1 addition & 1 deletion apis/validator/aggregate_and_proofs.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ post:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
required: true
name: Eth-Consensus-Version
description: "Version of the aggregate and proofs being submitted."
description: "The active consensus version to which the aggregate and proofs being submitted belong."
requestBody:
required: true
content:
Expand Down
2 changes: 2 additions & 0 deletions apis/validator/blinded_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,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 @@ -70,6 +70,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 @@ -127,6 +127,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
34 changes: 30 additions & 4 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 @@ -399,6 +413,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 @@ -425,6 +447,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 All @@ -436,7 +460,9 @@ components:

headers:
Eth-Consensus-Version:
description: Required in response so client can deserialize returned json or ssz data more effectively.
description: |
The active consensus version to which the data belongs. Required in response so client can deserialize returned json or ssz data
more effectively.
required: true
schema:
$ref: '#/components/schemas/ConsensusVersion'
Expand Down
Loading

0 comments on commit e45482f

Please sign in to comment.