Skip to content

Commit

Permalink
feat: electra light client
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Aug 21, 2024
1 parent 5f7dd7b commit 8153414
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 1 deletion.
1 change: 1 addition & 0 deletions apis/beacon/light_client/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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/Electra.LightClientBootstrap'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientBootstrap` bytes. Use Accept header to choose this response type"
Expand Down
1 change: 1 addition & 0 deletions apis/beacon/light_client/finality_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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/Electra.LightClientFinalityUpdate'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientFinalityUpdate` bytes. Use Accept header to choose this response type"
Expand Down
1 change: 1 addition & 0 deletions apis/beacon/light_client/optimistic_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ 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/Electra.LightClientOptimisticUpdate'
application/octet-stream:
schema:
description: "SSZ serialized `LightClientOptimisticUpdate` bytes. Use Accept header to choose this response type"
Expand Down
4 changes: 3 additions & 1 deletion apis/beacon/light_client/updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ 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/Electra.LightClientUpdate'
application/octet-stream:
schema:
description: |
Expand All @@ -60,7 +61,8 @@ 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` through `DENEB_FORK_VERSION`</nobr> | `capella.LightClientUpdate` |
| <nobr>`ELECTRA_FORK_VERSION` and later</nobr> | `electra.LightClientUpdate` |
"400":
description: Malformed or missing request parameter
content:
Expand Down
8 changes: 8 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,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
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.3/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.3/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.3/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: '../capella/light_client.yaml#/Capella/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: '../capella/light_client.yaml#/Capella/LightClientHeader'
next_sync_committee:
$ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee'
next_sync_committee_branch:
$ref: '#/Electra/NextSyncCommitteeBranch'
finalized_header:
$ref: '../capella/light_client.yaml#/Capella/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: '../capella/light_client.yaml#/Capella/LightClientHeader'
finalized_header:
$ref: '../capella/light_client.yaml#/Capella/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: '../capella/light_client.yaml#/Capella/LightClientHeader'
sync_aggregate:
$ref: '../altair/sync_aggregate.yaml#/Altair/SyncAggregate'
signature_slot:
$ref: '../primitive.yaml#/Uint64'

0 comments on commit 8153414

Please sign in to comment.