Skip to content

Commit

Permalink
Move state endpoint to beacon namespace (#353)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Harris <paul.harris@consensys.net>
  • Loading branch information
rkapka and rolfyone authored Sep 18, 2023
1 parent 8b52d94 commit 4cc8484
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ These endpoints have been added or updated since the last release.

There are likely to be descriptions etc outside of the list below, but new query parameters, changes to headers, new endpoints should be listed.

| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
| [#353](https://github.com/ethereum/beacon-APIs/pull/353) `/eth/v1/beacon/states/{state_id}` added | | | | | |
| [#339](https://github.com/ethereum/beacon-APIs/pull/339) `POST /eth/v3/beacon/blocks` added | | | | | |


The Following are no longer in the Standard API, removed since the latest version.

| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
|--------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
| [#353](https://github.com/ethereum/beacon-APIs/pull/353) `/eth/v1/debug/beacon/states/{state_id}` deprecated | | | | | |
| [#339](https://github.com/ethereum/beacon-APIs/pull/339) `POST /eth/v2/beacon/*blocks` deprecated | | | | | |

## Version 2.4.1

Expand Down
64 changes: 64 additions & 0 deletions apis/beacon/states/state.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
get:
operationId: "getState"
summary: "Get full BeaconState object"
description: |
Returns full BeaconState object for given stateId.
Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ
tags:
- Beacon
parameters:
- name: state_id
in: path
required: true
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId'
responses:
"200":
description: Success
headers:
Eth-Consensus-Version:
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
content:
application/json:
schema:
title: GetStateV2Response
type: object
properties:
version:
type: string
enum: [ phase0, altair, bellatrix, capella, deneb ]
example: "phase0"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
oneOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/BeaconState'
- $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"
"400":
description: "Invalid state ID"
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 400
message: "Invalid state ID: current"
"404":
description: "State not found"
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 404
message: "State not found"
"500":
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'

1 change: 1 addition & 0 deletions apis/debug/state.v2.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
get:
operationId: "getStateV2"
summary: "Get full BeaconState object"
deprecated: true
description: |
Returns full BeaconState object for given stateId.
Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ
Expand Down
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ paths:

/eth/v1/beacon/genesis:
$ref: "./apis/beacon/genesis.yaml"
/eth/v1/beacon/states/{state_id}:
$ref: "./apis/beacon/states/state.yaml"
/eth/v1/beacon/states/{state_id}/root:
$ref: "./apis/beacon/states/root.yaml"
/eth/v1/beacon/states/{state_id}/fork:
Expand Down

0 comments on commit 4cc8484

Please sign in to comment.