-
Notifications
You must be signed in to change notification settings - Fork 169
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
Checkpoint Sync API #226
Closed
Closed
Checkpoint Sync API #226
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2077214
Add /eth/v1/beacon/finalized_blocks/{slot}/root
mkalinin 654fcca
Define Checkpoint namespace
mkalinin 7b13ea7
Be more specific on the finalized state to return
mkalinin a987a9d
Update apis/checkpoint/finalized_blocks/root.yaml
mkalinin 499c8c5
Address Adrian's feedback fromt the review
mkalinin ea05ebc
Merge branch 'master' into finalized-block-root
rolfyone 051b25c
Merge branch 'master' into finalized-block-root
rolfyone 451f286
Merge branch 'master' into finalized-block-root
rolfyone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
get: | ||
operationId: getFinalizedBlockRoot | ||
summary: Get finalized block root | ||
description: Retrieves hashTreeRoot of finalized BeaconBlock/BeaconBlockHeader. | | ||
Responds with 404 if block at a slot is either unavailable or not yet finalized. | ||
tags: | ||
- Checkpoint | ||
parameters: | ||
- name: slot | ||
in: path | ||
required: true | ||
example: "1" | ||
schema: | ||
type: string | ||
description: | | ||
Slot number. | ||
|
||
responses: | ||
"200": | ||
description: Success | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: GetBlockRootResponse | ||
properties: | ||
execution_optimistic: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" | ||
data: | ||
type: object | ||
properties: | ||
root: | ||
allOf: | ||
- description: HashTreeRoot of BeaconBlock/BeaconBlockHeader object | ||
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Root' | ||
"400": | ||
description: "The slot number supplied could not be parsed" | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
- example: | ||
code: 400 | ||
message: "Invalid slot number: current" | ||
"404": | ||
description: "Block not found" | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
- example: | ||
code: 404 | ||
message: "Block not found" | ||
"500": | ||
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
get: | ||
operationId: "getFinalizedCheckpointState" | ||
summary: "Get full BeaconState object for finalized checkpoint state" | ||
description: | | ||
Returns full BeaconState object for a finalized checkpoint from the WS period. | ||
Returned state object MUST NOT be from an empty slot, i.e. it MUST be the post state of | ||
a finalized block. | ||
Returns 404 if the node is not yet fully synced, e.g. if it is tracking head optimistically. | ||
tags: | ||
- Checkpoint | ||
responses: | ||
"200": | ||
description: Success | ||
headers: | ||
Eth-Consensus-Version: | ||
$ref: '../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' | ||
content: | ||
application/octet-stream: | ||
schema: | ||
description: "SSZ serialized state bytes. Use Accept header to choose this response type" | ||
"404": | ||
description: "State not found" | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
- example: | ||
code: 404 | ||
message: "State not found" | ||
"500": | ||
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should be returned if the specified slot is an empty slot? Should it return the last block before that slot or 404?
I don't think it overly matters because you can't calculate the correct block root from a state if it's had empty slots applied, so if you have a usable state it will be from a slot that contains a block. It's probably worth returning 404 for empty slots though just to be consistent with the
/eth/v1/beacon/blocks/{blockId}/root
API.