From 6f55437b6cf4afdc2041b88b14f85f4f94023dff Mon Sep 17 00:00:00 2001 From: NC <17676176+ensi321@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:10:21 -0700 Subject: [PATCH] Add Deneb and Electra light client spec (#468) Co-authored-by: Nico Flaig Co-authored-by: Paul Harris --- apis/beacon/light_client/bootstrap.yaml | 2 + apis/beacon/light_client/finality_update.yaml | 2 + .../light_client/optimistic_update.yaml | 2 + apis/beacon/light_client/updates.yaml | 6 +- beacon-node-oapi.yaml | 16 ++++ types/deneb/light_client.yaml | 64 ++++++++++++++++ types/electra/light_client.yaml | 75 +++++++++++++++++++ 7 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 types/deneb/light_client.yaml create mode 100644 types/electra/light_client.yaml diff --git a/apis/beacon/light_client/bootstrap.yaml b/apis/beacon/light_client/bootstrap.yaml index b535f088..6e3c9544 100644 --- a/apis/beacon/light_client/bootstrap.yaml +++ b/apis/beacon/light_client/bootstrap.yaml @@ -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" diff --git a/apis/beacon/light_client/finality_update.yaml b/apis/beacon/light_client/finality_update.yaml index 298480d7..3b2015ca 100644 --- a/apis/beacon/light_client/finality_update.yaml +++ b/apis/beacon/light_client/finality_update.yaml @@ -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" diff --git a/apis/beacon/light_client/optimistic_update.yaml b/apis/beacon/light_client/optimistic_update.yaml index 16cb2208..599b104b 100644 --- a/apis/beacon/light_client/optimistic_update.yaml +++ b/apis/beacon/light_client/optimistic_update.yaml @@ -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" diff --git a/apis/beacon/light_client/updates.yaml b/apis/beacon/light_client/updates.yaml index ec40d0d7..d00b667c 100644 --- a/apis/beacon/light_client/updates.yaml +++ b/apis/beacon/light_client/updates.yaml @@ -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: | @@ -60,7 +62,9 @@ get: | ------------------------------------------------------------------- | ------------------------------------- | | `GENESIS_FORK_VERSION` | n/a | | `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientUpdate` | - | `CAPELLA_FORK_VERSION` and later | `capella.LightClientUpdate` | + | `CAPELLA_FORK_VERSION` | `capella.LightClientUpdate` | + | `DENEB_FORK_VERSION` | `deneb.LightClientUpdate` | + | `ELECTRA_FORK_VERSION` and later | `electra.LightClientUpdate` | "400": description: Malformed or missing request parameter content: diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 3068d98d..cc82777f 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -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: @@ -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: diff --git a/types/deneb/light_client.yaml b/types/deneb/light_client.yaml new file mode 100644 index 00000000..64e01d1b --- /dev/null +++ b/types/deneb/light_client.yaml @@ -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' diff --git a/types/electra/light_client.yaml b/types/electra/light_client.yaml new file mode 100644 index 00000000..01187cc9 --- /dev/null +++ b/types/electra/light_client.yaml @@ -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'