From 203410d04697520abb83b1c7e8a396e1b7878b1c Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 23 Sep 2024 03:38:41 +0100 Subject: [PATCH] Add Electra block and state objects from CL spec (#469) --- apis/beacon/blob_sidecars/blob_sidecars.yaml | 2 +- apis/beacon/blocks/blinded_block.yaml | 3 +- apis/beacon/blocks/blinded_blocks.v2.yaml | 1 + apis/beacon/blocks/blinded_blocks.yaml | 1 + apis/beacon/blocks/block.v2.yaml | 3 +- apis/beacon/blocks/blocks.v2.yaml | 1 + apis/beacon/blocks/blocks.yaml | 1 + apis/debug/state.v2.yaml | 3 +- apis/validator/blinded_block.yaml | 3 +- apis/validator/block.v2.yaml | 3 +- apis/validator/block.v3.yaml | 4 +- beacon-node-oapi.yaml | 12 ++ types/deneb/block.yaml | 8 +- types/electra/block.yaml | 108 +++++++++++++++++ types/electra/block_contents.yaml | 24 ++++ types/electra/consolidation.yaml | 27 +++++ types/electra/deposit.yaml | 32 +++++ types/electra/execution_requests.yaml | 21 ++++ types/electra/state.yaml | 121 +++++++++++++++++++ types/electra/withdrawal.yaml | 30 +++++ 20 files changed, 397 insertions(+), 11 deletions(-) create mode 100644 types/electra/block.yaml create mode 100644 types/electra/block_contents.yaml create mode 100644 types/electra/consolidation.yaml create mode 100644 types/electra/deposit.yaml create mode 100644 types/electra/execution_requests.yaml create mode 100644 types/electra/state.yaml create mode 100644 types/electra/withdrawal.yaml diff --git a/apis/beacon/blob_sidecars/blob_sidecars.yaml b/apis/beacon/blob_sidecars/blob_sidecars.yaml index 92b4e853..e65b4810 100644 --- a/apis/beacon/blob_sidecars/blob_sidecars.yaml +++ b/apis/beacon/blob_sidecars/blob_sidecars.yaml @@ -39,7 +39,7 @@ get: properties: version: type: string - enum: [phase0, altair, bellatrix, capella, deneb] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "deneb" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" diff --git a/apis/beacon/blocks/blinded_block.yaml b/apis/beacon/blocks/blinded_block.yaml index d85bce32..8c5f25c7 100644 --- a/apis/beacon/blocks/blinded_block.yaml +++ b/apis/beacon/blocks/blinded_block.yaml @@ -26,7 +26,7 @@ get: properties: version: type: string - enum: [phase0, altair, bellatrix, capella, deneb] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -39,6 +39,7 @@ get: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBlindedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block bytes. Use Accept header to choose this response type" diff --git a/apis/beacon/blocks/blinded_blocks.v2.yaml b/apis/beacon/blocks/blinded_blocks.v2.yaml index 93e3b568..24f0d091 100644 --- a/apis/beacon/blocks/blinded_blocks.v2.yaml +++ b/apis/beacon/blocks/blinded_blocks.v2.yaml @@ -55,6 +55,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBlindedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body." diff --git a/apis/beacon/blocks/blinded_blocks.yaml b/apis/beacon/blocks/blinded_blocks.yaml index 73704485..b5b70fe5 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -34,6 +34,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBlindedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBlindedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body." diff --git a/apis/beacon/blocks/block.v2.yaml b/apis/beacon/blocks/block.v2.yaml index 9f2322de..05a41595 100644 --- a/apis/beacon/blocks/block.v2.yaml +++ b/apis/beacon/blocks/block.v2.yaml @@ -26,7 +26,7 @@ get: properties: version: type: string - enum: [phase0, altair, bellatrix, capella, deneb] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -39,6 +39,7 @@ get: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block bytes. Use Accept header to choose this response type" diff --git a/apis/beacon/blocks/blocks.v2.yaml b/apis/beacon/blocks/blocks.v2.yaml index 97e83766..ec5a19ee 100644 --- a/apis/beacon/blocks/blocks.v2.yaml +++ b/apis/beacon/blocks/blocks.v2.yaml @@ -54,6 +54,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlockContents" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBlockContents" application/octet-stream: schema: description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body." diff --git a/apis/beacon/blocks/blocks.yaml b/apis/beacon/blocks/blocks.yaml index e5813c29..c28fc714 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -33,6 +33,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Capella.SignedBeaconBlock" - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlockContents" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedBlockContents" application/octet-stream: schema: description: "SSZ serialized block bytes. Use content type header to indicate that SSZ data is contained in the request body." diff --git a/apis/debug/state.v2.yaml b/apis/debug/state.v2.yaml index d413af1c..cdfa17a7 100644 --- a/apis/debug/state.v2.yaml +++ b/apis/debug/state.v2.yaml @@ -26,7 +26,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella, deneb ] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" execution_optimistic: $ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -39,6 +39,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BeaconState" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BeaconState" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BeaconState" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Electra.BeaconState" application/octet-stream: schema: description: "SSZ serialized state bytes. Use Accept header to choose this response type" diff --git a/apis/validator/blinded_block.yaml b/apis/validator/blinded_block.yaml index 90ca5659..72c60519 100644 --- a/apis/validator/blinded_block.yaml +++ b/apis/validator/blinded_block.yaml @@ -49,7 +49,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella, deneb ] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "bellatrix" data: anyOf: @@ -58,6 +58,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BlindedBeaconBlock" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BlindedBeaconBlock" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlindedBeaconBlock" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Electra.BlindedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block bytes. Use Accept header to choose this response type, version string is sent in header `Eth-Consensus-Version`." diff --git a/apis/validator/block.v2.yaml b/apis/validator/block.v2.yaml index 00ad2fc8..4ee38d0f 100644 --- a/apis/validator/block.v2.yaml +++ b/apis/validator/block.v2.yaml @@ -46,7 +46,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella, deneb ] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" data: anyOf: @@ -55,6 +55,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Bellatrix.BeaconBlock" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BeaconBlock" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlockContents" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Electra.BlockContents" application/octet-stream: schema: description: "SSZ serialized block bytes. Use Accept header to choose this response type, version string is sent in header `Eth-Consensus-Version`." diff --git a/apis/validator/block.v3.yaml b/apis/validator/block.v3.yaml index f2adf9fe..3788717d 100644 --- a/apis/validator/block.v3.yaml +++ b/apis/validator/block.v3.yaml @@ -90,7 +90,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella, deneb ] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" execution_payload_blinded: type: boolean @@ -111,6 +111,8 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Capella.BlindedBeaconBlock" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlockContents" - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlindedBeaconBlock" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Electra.BlockContents" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Electra.BlindedBeaconBlock" application/octet-stream: schema: description: "SSZ serialized block or blinded block bytes. Use Accept header to choose this response type, version string is sent in header `Eth-Consensus-Version` and block type in `Eth-Blinded-Payload`." diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 33ebff47..59d1aefd 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -395,6 +395,18 @@ components: $ref: './types/primitive.yaml#/Blob' Deneb.BlobSidecars: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecars' + Electra.BeaconState: + $ref: './types/electra/state.yaml#/Electra/BeaconState' + Electra.BlockContents: + $ref: './types/electra/block_contents.yaml#/Electra/BlockContents' + Electra.SignedBeaconBlock: + $ref: './types/electra/block.yaml#/Electra/SignedBeaconBlock' + Electra.SignedBlockContents: + $ref: './types/electra/block_contents.yaml#/Electra/SignedBlockContents' + Electra.BlindedBeaconBlock: + $ref: './types/electra/block.yaml#/Electra/BlindedBeaconBlock' + Electra.SignedBlindedBeaconBlock: + $ref: './types/electra/block.yaml#/Electra/SignedBlindedBeaconBlock' Electra.Attestation: $ref: './types/electra/attestation.yaml#/Electra/Attestation' Electra.AttesterSlashing: diff --git a/types/deneb/block.yaml b/types/deneb/block.yaml index 4891c25f..d58607a5 100644 --- a/types/deneb/block.yaml +++ b/types/deneb/block.yaml @@ -54,7 +54,7 @@ Deneb: $ref: './execution_payload.yaml#/Deneb/ExecutionPayload' BeaconBlock: - description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec." + description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#beaconblock) object from the CL Deneb spec." allOf: - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' - type: object @@ -65,7 +65,7 @@ Deneb: SignedBeaconBlock: type: object - description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec." + description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec." required: [message, signature] properties: message: @@ -84,7 +84,7 @@ Deneb: $ref: './execution_payload.yaml#/Deneb/ExecutionPayloadHeader' BlindedBeaconBlock: - description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." + description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#beaconblock) object from the CL Deneb spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." allOf: - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' - type: object @@ -95,7 +95,7 @@ Deneb: SignedBlindedBeaconBlock: type: object - description: "A variant of the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." + description: "A variant of the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." required: [message, signature] properties: message: diff --git a/types/electra/block.yaml b/types/electra/block.yaml new file mode 100644 index 00000000..db460fd3 --- /dev/null +++ b/types/electra/block.yaml @@ -0,0 +1,108 @@ +Electra: + BeaconBlockBodyCommon: + # An abstract object to collect the common fields between the BeaconBlockBody and the BlindedBeaconBlockBody objects + type: object + description: "The [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#beaconblockbody) object from the CL Electra spec." + required: [randao_reveal, eth1_data, graffiti, proposer_slashings, attester_slashings, attestations, deposits, voluntary_exits, sync_aggregate, bls_to_execution_changes, blob_kzg_commitments] + properties: + randao_reveal: + allOf: + - $ref: "../primitive.yaml#/Signature" + - description: "The RANDAO reveal value provided by the validator." + eth1_data: + $ref: "../eth1.yaml#/Eth1Data" + graffiti: + $ref: "../primitive.yaml#/Graffiti" + proposer_slashings: + type: array + items: + $ref: "../proposer_slashing.yaml#/ProposerSlashing" + attester_slashings: + type: array + items: + $ref: "./attester_slashing.yaml#/Electra/AttesterSlashing" + attestations: + type: array + items: + $ref: "./attestation.yaml#/Electra/Attestation" + deposits: + type: array + items: + $ref: "../deposit.yaml#/Deposit" + voluntary_exits: + type: array + items: + $ref: "../voluntary_exit.yaml#/SignedVoluntaryExit" + sync_aggregate: + $ref: "../altair/sync_aggregate.yaml#/Altair/SyncAggregate" + bls_to_execution_changes: + type: array + items: + $ref: "../bls_to_execution_change.yaml#/SignedBLSToExecutionChange" + blob_kzg_commitments: + type: array + items: + $ref: "../primitive.yaml#/KZGCommitment" + + BeaconBlockBody: + allOf: + - $ref: "#/Electra/BeaconBlockBodyCommon" + - type: object + required: [execution_payload, execution_requests] + properties: + execution_payload: + $ref: "../deneb/execution_payload.yaml#/Deneb/ExecutionPayload" + execution_requests: + $ref: "./execution_requests.yaml#/Electra/ExecutionRequests" + + BeaconBlock: + description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/phase0/beacon-chain.md#beaconblock) object from the CL Electra spec." + allOf: + - $ref: "../altair/block.yaml#/Altair/BeaconBlockCommon" + - type: object + required: [body] + properties: + body: + $ref: "#/Electra/BeaconBlockBody" + + SignedBeaconBlock: + type: object + description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the CL Electra spec." + required: [message, signature] + properties: + message: + $ref: "#/Electra/BeaconBlock" + signature: + $ref: "../primitive.yaml#/Signature" + + BlindedBeaconBlockBody: + description: "A variant of the [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#beaconblockbody) object from the CL Electra spec, which contains a transactions root rather than a full transactions list." + allOf: + - $ref: "#/Electra/BeaconBlockBodyCommon" + - type: object + required: [execution_payload_header, execution_requests_root] + properties: + execution_payload_header: + $ref: "../deneb/execution_payload.yaml#/Deneb/ExecutionPayloadHeader" + execution_requests_root: + $ref: "../primitive.yaml#/Root" + + BlindedBeaconBlock: + description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/phase0/beacon-chain.md#beaconblock) object from the CL Electra spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." + allOf: + - $ref: "../altair/block.yaml#/Altair/BeaconBlockCommon" + - type: object + required: [body] + properties: + body: + $ref: "#/Electra/BlindedBeaconBlockBody" + + SignedBlindedBeaconBlock: + type: object + description: "A variant of the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/phase0/beacon-chain.md#signedbeaconblock) object envelope from the CL Electra spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." + required: [message, signature] + properties: + message: + $ref: "#/Electra/BlindedBeaconBlock" + signature: + $ref: "../primitive.yaml#/Signature" diff --git a/types/electra/block_contents.yaml b/types/electra/block_contents.yaml new file mode 100644 index 00000000..d4a38519 --- /dev/null +++ b/types/electra/block_contents.yaml @@ -0,0 +1,24 @@ +Electra: + BlockContents: + type: object + description: "The required object for block production according to the Electra CL spec." + required: [block, kzg_proofs, blobs] + properties: + block: + $ref: "./block.yaml#/Electra/BeaconBlock" + kzg_proofs: + $ref: "../deneb/block_contents.yaml#/Deneb/KZGProofs" + blobs: + $ref: "../deneb/block_contents.yaml#/Deneb/Blobs" + + SignedBlockContents: + type: object + description: "The required signed components of block production according to the Electra CL spec." + required: [signed_block, kzg_proofs, blobs] + properties: + signed_block: + $ref: "./block.yaml#/Electra/SignedBeaconBlock" + kzg_proofs: + $ref: "../deneb/block_contents.yaml#/Deneb/KZGProofs" + blobs: + $ref: "../deneb/block_contents.yaml#/Deneb/Blobs" diff --git a/types/electra/consolidation.yaml b/types/electra/consolidation.yaml new file mode 100644 index 00000000..94b9a75e --- /dev/null +++ b/types/electra/consolidation.yaml @@ -0,0 +1,27 @@ +Electra: + ConsolidationRequest: + type: object + description: "The [`ConsolidationRequest`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#consolidationrequest) object from the CL Electra spec." + required: [source_address, source_pubkey, target_pubkey] + properties: + source_address: + $ref: "../primitive.yaml#/ExecutionAddress" + description: "Execution address which sent the request." + source_pubkey: + $ref: "../primitive.yaml#/Pubkey" + description: "BLS public key of validator to consolidate from." + target_pubkey: + $ref: "../primitive.yaml#/Pubkey" + description: "BLS public key of validator to consolidate to." + + PendingConsolidation: + type: object + description: "The [`PendingConsolidation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#pendingconsolidation) object from the CL Electra spec." + required: [source_index, target_index] + properties: + source_index: + $ref: "../primitive.yaml#/Uint64" + description: "Index of validator to consolidate from." + target_index: + $ref: "../primitive.yaml#/Uint64" + description: "Index of validator to consolidate to." diff --git a/types/electra/deposit.yaml b/types/electra/deposit.yaml new file mode 100644 index 00000000..e124df7c --- /dev/null +++ b/types/electra/deposit.yaml @@ -0,0 +1,32 @@ +Electra: + DepositRequest: + type: object + description: "The [`DepositRequest`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#depositrequest) object from the CL Electra spec." + required: [pubkey, withdrawal_credentials, amount, signature, index] + properties: + pubkey: + $ref: "../primitive.yaml#/Pubkey" + description: "BLS public key of validator." + withdrawal_credentials: + $ref: "../primitive.yaml#/Root" + description: "The withdrawal credentials." + amount: + $ref: "../primitive.yaml#/Gwei" + description: "The value to be deposited (gwei)." + signature: + $ref: "../primitive.yaml#/Signature" + index: + $ref: "../primitive.yaml#/Uint64" + description: "The index of the deposit request." + + PendingBalanceDeposit: + type: object + description: "The [`PendingBalanceDeposit`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#pendingbalancedeposit) object from the CL Electra spec." + required: [index, amount] + properties: + index: + $ref: "../primitive.yaml#/Uint64" + description: "Index of validator in validator registry." + amount: + $ref: "../primitive.yaml#/Gwei" + description: "The value to be deposited (gwei)." diff --git a/types/electra/execution_requests.yaml b/types/electra/execution_requests.yaml new file mode 100644 index 00000000..1851c89b --- /dev/null +++ b/types/electra/execution_requests.yaml @@ -0,0 +1,21 @@ +Electra: + ExecutionRequests: + type: object + description: "The [`ExecutionRequests`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.6/specs/electra/beacon-chain.md#executionrequests) object from the CL Electra spec." + required: [deposits, withdrawals, consolidations] + properties: + deposits: + type: array + items: + $ref: "./deposit.yaml#/Electra/DepositRequest" + maxItems: 8192 + withdrawals: + type: array + items: + $ref: "./withdrawal.yaml#/Electra/WithdrawalRequest" + maxItems: 16 + consolidations: + type: array + items: + $ref: "./consolidation.yaml#/Electra/ConsolidationRequest" + maxItems: 1 diff --git a/types/electra/state.yaml b/types/electra/state.yaml new file mode 100644 index 00000000..7798a372 --- /dev/null +++ b/types/electra/state.yaml @@ -0,0 +1,121 @@ +Electra: + BeaconState: + type: object + description: "The [`BeaconState`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#beaconstate) object from the CL Electra spec." + required: [genesis_time, genesis_validators_root, slot, fork, latest_block_header, block_roots, state_roots, historical_roots, eth1_data, eth1_data_votes, eth1_deposit_index, validators, balances, randao_mixes, slashings, previous_epoch_participation, current_epoch_participation, justification_bits, previous_justified_checkpoint, current_justified_checkpoint, finalized_checkpoint, inactivity_scores, current_sync_committee, next_sync_committee, latest_execution_payload_header, next_withdrawal_index, next_withdrawal_validator_index, historical_summaries, deposit_requests_start_index, deposit_balance_to_consume, exit_balance_to_consume, earliest_exit_epoch, consolidation_balance_to_consume, earliest_consolidation_epoch, pending_balance_deposits, pending_partial_withdrawals, pending_consolidations] + properties: + genesis_time: + $ref: "../primitive.yaml#/Uint64" + genesis_validators_root: + $ref: "../primitive.yaml#/Root" + slot: + $ref: "../primitive.yaml#/Uint64" + fork: + $ref: "../misc.yaml#/Fork" + latest_block_header: + $ref: "../block.yaml#/BeaconBlockHeader" + block_roots: + type: array + description: "Fixed length of 8192 items" + items: + $ref: "../primitive.yaml#/Root" + state_roots: + type: array + description: "Fixed length of 8192 items" + items: + $ref: "../primitive.yaml#/Root" + historical_roots: + type: array + description: "Variable length list, maximum 16777216 items. Frozen in Capella, replaced by historical_summaries." + items: + $ref: "../primitive.yaml#/Root" + eth1_data: + $ref: "../eth1.yaml#/Eth1Data" + eth1_data_votes: + type: array + description: "Fixed length of 1024 items" + items: + $ref: "../eth1.yaml#/Eth1Data" + maxItems: 1024 + eth1_deposit_index: + $ref: "../primitive.yaml#/Uint64" + validators: + type: array + description: "Variable length list, maximum 1099511627776 items" + items: + $ref: "../validator.yaml#/Validator" + balances: + type: array + description: "Validator balances in gwei. Variable length list, maximum 1099511627776 items" + items: + $ref: '../primitive.yaml#/Uint64' + randao_mixes: + type: array + description: "Fixed length of 65536 items" + items: + $ref: "../primitive.yaml#/Bytes32" + slashings: + type: array + description: "Per-epoch sums of slashed effective balances. Fixed length of 8192 items" + items: + $ref: "../primitive.yaml#/Uint64" + previous_epoch_participation: + $ref: "../altair/epoch_participation.yaml#/Altair/EpochParticipation" + current_epoch_participation: + $ref: "../altair/epoch_participation.yaml#/Altair/EpochParticipation" + justification_bits: + $ref: "../primitive.yaml#/BitList" + description: "Bit set for every recent justified epoch" + previous_justified_checkpoint: + $ref: "../misc.yaml#/Checkpoint" + current_justified_checkpoint: + $ref: "../misc.yaml#/Checkpoint" + finalized_checkpoint: + $ref: "../misc.yaml#/Checkpoint" + inactivity_scores: + description: "Per-validator inactivity scores. Introduced in Altair. Variable length list, maximum 1099511627776 items" + type: array + items: + $ref: "../primitive.yaml#/Uint64" + current_sync_committee: + $ref: "../altair/sync_committee.yaml#/Altair/SyncCommittee" + next_sync_committee: + $ref: "../altair/sync_committee.yaml#/Altair/SyncCommittee" + latest_execution_payload_header: + $ref: "../deneb/execution_payload.yaml#/Deneb/ExecutionPayloadHeader" + next_withdrawal_index: + $ref: "../primitive.yaml#/Uint64" + next_withdrawal_validator_index: + $ref: "../primitive.yaml#/Uint64" + historical_summaries: + type: array + items: + $ref: "../capella/historical_summary.yaml#/Capella/HistoricalSummary" + description: "Variable length list, maximum 16777216 items" + deposit_requests_start_index: + $ref: "../primitive.yaml#/Uint64" + deposit_balance_to_consume: + $ref: "../primitive.yaml#/Gwei" + exit_balance_to_consume: + $ref: "../primitive.yaml#/Gwei" + earliest_exit_epoch: + $ref: "../primitive.yaml#/Uint64" + consolidation_balance_to_consume: + $ref: "../primitive.yaml#/Gwei" + earliest_consolidation_epoch: + $ref: "../primitive.yaml#/Uint64" + pending_balance_deposits: + type: array + items: + $ref: "./deposit.yaml#/Electra/PendingBalanceDeposit" + maxItems: 134217728 + pending_partial_withdrawals: + type: array + items: + $ref: "./withdrawal.yaml#/Electra/PendingPartialWithdrawal" + maxItems: 134217728 + pending_consolidations: + type: array + items: + $ref: "./consolidation.yaml#/Electra/PendingConsolidation" + maxItems: 262144 diff --git a/types/electra/withdrawal.yaml b/types/electra/withdrawal.yaml new file mode 100644 index 00000000..bca58715 --- /dev/null +++ b/types/electra/withdrawal.yaml @@ -0,0 +1,30 @@ +Electra: + WithdrawalRequest: + type: object + description: "The [`WithdrawalRequest`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#withdrawalrequest) object from the CL Electra spec." + required: [source_address, validator_pubkey, amount] + properties: + source_address: + $ref: "../primitive.yaml#/ExecutionAddress" + description: "Execution address which sent the request." + validator_pubkey: + $ref: "../primitive.yaml#/Pubkey" + description: "BLS public key of validator." + amount: + $ref: "../primitive.yaml#/Gwei" + description: "The value to be withdrawn (gwei)." + + PendingPartialWithdrawal: + type: object + description: "The [`PendingPartialWithdrawal`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#pendingpartialwithdrawal) object from the CL Electra spec." + required: [index, amount, withdrawable_epoch] + properties: + index: + $ref: "../primitive.yaml#/Uint64" + description: "Index of validator in validator registry." + amount: + $ref: "../primitive.yaml#/Uint64" + description: "The value to be withdrawn (gwei)." + withdrawable_epoch: + $ref: "../primitive.yaml#/Uint64" + description: "The epoch when the amount is withdrawable."