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 execution_optimistic flag to responses #190

Merged
merged 5 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions apis/beacon/blocks/attestations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ get:
title: GetBlockAttestationsResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ get:
type: string
enum: [phase0, altair]
example: "phase0"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
oneOf:
- $ref: "../../../beacon-node-oapi.yaml#/components/schemas/SignedBeaconBlock"
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 @@ -17,6 +17,8 @@ get:
title: GetBlockHeaderResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: object
properties:
Expand Down
2 changes: 2 additions & 0 deletions apis/beacon/blocks/headers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ get:
title: GetBlockHeadersResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -17,6 +17,8 @@ get:
type: object
title: GetBlockRootResponse
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -42,6 +42,8 @@ get:
title: GetEpochCommitteesResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -19,6 +19,8 @@ get:
title: GetStateFinalityCheckpointsResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -18,6 +18,8 @@ get:
title: GetStateForkResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Fork'

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 @@ -17,6 +17,8 @@ get:
title: GetStateRootResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -26,6 +26,8 @@ get:
title: GetEpochSyncCommitteesResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -25,6 +25,8 @@ get:
title: GetStateValidatorResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -35,6 +35,8 @@ get:
title: GetStateValidatorBalancesResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
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 @@ -46,6 +46,8 @@ get:
title: GetStateValidatorsResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: array
items:
Expand Down
28 changes: 28 additions & 0 deletions apis/debug/heads.v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
get:
operationId: getDebugChainHeadsV2
summary: Get fork choice leaves
description: Retrieves all possible chain heads (leaves of fork choice tree).
tags:
- Debug
responses:
"200":
description: Success
content:
application/json:
schema:
title: GetDebugChainHeadsResponse
type: object
properties:
data:
type: array
items:
type: object
properties:
root:
$ref: "../../beacon-node-oapi.yaml#/components/schemas/Root"
slot:
$ref: "../../beacon-node-oapi.yaml#/components/schemas/Uint64"
execution_optimistic:
$ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
"500":
$ref: "../beacon-node-oapi.yaml#/components/responses/InternalError"
paulhauner marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions apis/debug/heads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ get:
operationId: getDebugChainHeads
summary: Get fork choice leaves
description: Retrieves all possible chain heads (leaves of fork choice tree).
deprecated: true
tags:
- Debug
responses:
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 @@ -27,6 +27,8 @@ get:
type: string
enum: [ phase0, altair ]
example: "phase0"
execution_optimistic:
$ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
oneOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/BeaconState'
Expand Down
4 changes: 4 additions & 0 deletions apis/eventstream/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ get:
description: The node has finished processing, resulting in a new head. previous_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)` and current_duty_dependent_root is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`. Both dependent roots use the genesis block root in the case of underflow.
value: |
event: head
execution_optimistic: false
data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91"}
block:
description: The node has received a valid block (from P2P or API)
value: |
event: block
execution_optimistic: false
data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf"}
attestation:
description: The node has received a valid attestation (from P2P or API)
Expand All @@ -62,11 +64,13 @@ get:
description: Finalized checkpoint has been updated
value: |
event: finalized_checkpoint
execution_optimistic: false
data: {"block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2" }
chain_reorg:
description: The node has reorganized its chain
value: |
event: chain_reorg
execution_optimistic: false
data: {"slot":"200", "depth":"50", "old_head_block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_block":"0x76262e91970d375a19bfe8a867288d7b9cde43c8635f598d93d39d041706fc76", "old_head_state":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "new_head_state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch":"2"}
contribution_and_proof:
description: The node has received a valid sync committee SignedContributionAndProof (from P2P or API)
Expand Down
2 changes: 1 addition & 1 deletion apis/validator/block.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ get:
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
$ref: '../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing'
$ref: '../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing'
2 changes: 2 additions & 0 deletions apis/validator/duties/attester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ post:
properties:
dependent_root:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/DependentRoot"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/validator/duties/proposer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ get:
properties:
dependent_root:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/DependentRoot"
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: array
items:
Expand Down
2 changes: 2 additions & 0 deletions apis/validator/duties/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ post:
title: GetSyncCommitteeDutiesResponse
type: object
properties:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
data:
type: array
items:
Expand Down
4 changes: 4 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ paths:
$ref: './apis/debug/state.v2.yaml'
/eth/v1/debug/beacon/heads:
$ref: './apis/debug/heads.yaml'
/eth/v2/debug/beacon/heads:
$ref: './apis/debug/heads.v2.yaml'

/eth/v1/node/identity:
$ref: "./apis/node/identity.yaml"
Expand Down Expand Up @@ -209,6 +211,8 @@ components:
$ref: './types/primitive.yaml#/ForkVersion'
DependentRoot:
$ref: './types/primitive.yaml#/DependentRoot'
ExecutionOptimistic:
$ref: './types/primitive.yaml#/ExecutionOptimistic'
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 @@ -33,6 +33,12 @@ DependentRoot:
- $ref: "./primitive.yaml#/Root"
- description: "The block root that this response is dependent on."

ExecutionOptimistic:
allOf:
- type: boolean
- 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."

Root:
type: string
example: "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
Expand Down