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 finalized flag to chain data requests #254

Merged
merged 6 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion apis/beacon/blocks/attestations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ get:
in: path
required: true
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId'

responses:
"200":
description: Success
Expand All @@ -21,6 +21,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: array
items:
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 @@ -29,6 +29,8 @@ get:
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/SignedBeaconBlock"
Expand Down
4 changes: 3 additions & 1 deletion apis/beacon/blocks/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ get:
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/SignedBeaconBlock"
Expand All @@ -37,7 +39,7 @@ get:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.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 Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/header.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: object
properties:
Expand Down
4 changes: 3 additions & 1 deletion apis/beacon/blocks/headers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ get:
allOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Root"
- example: ""

responses:
"200":
description: Success
Expand All @@ -31,6 +31,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/committee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/finality_checkpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Fork'

Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/randao.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/sync_committees.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.SyncCommittee'

Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ValidatorResponse'
"400":
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/validator_balances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/states/validators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ get:
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/debug/state.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ get:
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'
Expand Down
2 changes: 1 addition & 1 deletion apis/validator/duties/attester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ post:

- event.block otherwise


The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)`
or the genesis block root in the case of underflow."
parameters:
Expand Down
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ components:
$ref: './types/primitive.yaml#/DependentRoot'
ExecutionOptimistic:
$ref: './types/primitive.yaml#/ExecutionOptimistic'
Finalized:
$ref: './types/primitive.yaml#/Finalized'
Root:
$ref: './types/primitive.yaml#/Root'
Hex:
Expand Down
6 changes: 6 additions & 0 deletions types/primitive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ ExecutionOptimistic:
- example: false
- description: "True if the response references an unverified execution payload. Optimistic information may be invalidated at a later time. If the field is not present, assume the False value."

Finalized:
allOf:
- type: boolean
- example: false
- description: "True if the response references the finalized history of the chain, as determined by fork choice. If the field is not present, additional calls are necessary to compare the epoch of the requested information with the finalized checkpoint."

Root:
type: string
format: hex
Expand Down