Skip to content

Commit

Permalink
Add Deneb and Electra light client spec (#468)
Browse files Browse the repository at this point in the history
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: Paul Harris <paul.harris@consensys.net>
  • Loading branch information
3 people authored Sep 12, 2024
1 parent 78380ff commit 6f55437
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 1 deletion.
2 changes: 2 additions & 0 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 Down
2 changes: 2 additions & 0 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 Down
2 changes: 2 additions & 0 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 Down
6 changes: 5 additions & 1 deletion 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 Down
16 changes: 16 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,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 @@ -393,6 +401,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 Down
64 changes: 64 additions & 0 deletions types/deneb/light_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Deneb:
LightClientHeader:
type: object
required: [beacon, execution, execution_branch]
properties:
beacon:
$ref: '../block.yaml#/BeaconBlockHeader'
execution:
$ref: './execution_payload.yaml#/Deneb/ExecutionPayloadHeader'
execution_branch:
$ref: '../capella/light_client.yaml#/Capella/ExecutionBranch'

LightClientBootstrap:
type: object
required: [header, current_sync_committee, current_sync_committee_branch]
properties:
header:
$ref: '#/Deneb/LightClientHeader'
current_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
current_sync_committee_branch:
$ref: '../altair/light_client.yaml#/Altair/CurrentSyncCommitteeBranch'
LightClientUpdate:
type: object
required: [attested_header, next_sync_committee, next_sync_committee_branch, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
next_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
next_sync_committee_branch:
$ref: '../altair/light_client.yaml#/Altair/NextSyncCommitteeBranch'
finalized_header:
$ref: '#/Deneb/LightClientHeader'
finality_branch:
$ref: '../altair/light_client.yaml#/Altair/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientFinalityUpdate:
type: object
required: [attested_header, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
finalized_header:
$ref: '#/Deneb/LightClientHeader'
finality_branch:
$ref: '../altair/light_client.yaml#/Altair/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientOptimisticUpdate:
type: object
required: [attested_header, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '#/Deneb/LightClientHeader'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
75 changes: 75 additions & 0 deletions types/electra/light_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Electra:
FinalityBranch:
type: array
items:
$ref: '../primitive.yaml#/Root'
description: "Merkle proof consisting of [`log2trunc(FINALIZED_ROOT_GINDEX_ELECTRA])`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/light-client/sync-protocol.md#constants) roots"
minItems: 7
maxItems: 7
CurrentSyncCommitteeBranch:
type: array
items:
$ref: '../primitive.yaml#/Root'
description: "Merkle proof consisting of [`log2trunc(CURRENT_SYNC_COMMITTEE_GINDEX_ELECTRA])`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/light-client/sync-protocol.md#constants) roots"
minItems: 6
maxItems: 6
NextSyncCommitteeBranch:
type: array
items:
$ref: '../primitive.yaml#/Root'
description: "Merkle proof consisting of [`log2trunc(NEXT_SYNC_COMMITTEE_GINDEX_ELECTRA])`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/electra/light-client/sync-protocol.md#constants) roots"
minItems: 6
maxItems: 6

LightClientBootstrap:
type: object
required: [header, current_sync_committee, current_sync_committee_branch]
properties:
header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
current_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
current_sync_committee_branch:
$ref: '#/Electra/CurrentSyncCommitteeBranch'
LightClientUpdate:
type: object
required: [attested_header, next_sync_committee, next_sync_committee_branch, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
next_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
next_sync_committee_branch:
$ref: '#/Electra/NextSyncCommitteeBranch'
finalized_header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
finality_branch:
$ref: '#/Electra/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientFinalityUpdate:
type: object
required: [attested_header, finalized_header, finality_branch, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
finalized_header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
finality_branch:
$ref: '#/Electra/FinalityBranch'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'
LightClientOptimisticUpdate:
type: object
required: [attested_header, sync_aggregate, signature_slot]
properties:
attested_header:
$ref: '../deneb/light_client.yaml#/Deneb/LightClientHeader'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'

0 comments on commit 6f55437

Please sign in to comment.