From eedb4d3c9debd09f4509ad380462234fe6a30f01 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 26 Aug 2024 15:25:15 +0100 Subject: [PATCH 1/3] Add Electra block and state objects from CL spec --- 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/electra/block.yaml | 104 ++++++++++++++++ types/electra/block_contents.yaml | 24 ++++ types/electra/consolidation.yaml | 27 +++++ types/electra/deposit.yaml | 32 +++++ types/electra/execution_payload.yaml | 79 ++++++++++++ types/electra/state.yaml | 121 +++++++++++++++++++ types/electra/withdrawal.yaml | 30 +++++ 19 files changed, 447 insertions(+), 7 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_payload.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 40321774..d572060f 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 35e89e7a..d269296c 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 9d48718d..76039513 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 1f545e57..1137dd72 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -33,6 +33,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 f1ef818d..9ba61583 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: diff --git a/apis/beacon/blocks/blocks.v2.yaml b/apis/beacon/blocks/blocks.v2.yaml index 45959301..9155bd7f 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 68be1b69..4b46d45e 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -32,6 +32,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 d58ed771..8a2868b1 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 d8a6e6a8..1ae43314 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 ff3fc8cb..74b4ad3d 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 b5f4d858..fff07d8b 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 c3608a84..deadc554 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -381,6 +381,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/electra/block.yaml b/types/electra/block.yaml new file mode 100644 index 00000000..a9cb4d78 --- /dev/null +++ b/types/electra/block.yaml @@ -0,0 +1,104 @@ +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] + properties: + execution_payload: + $ref: "./execution_payload.yaml#/Electra/ExecutionPayload" + + BeaconBlock: + description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/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/electra/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] + properties: + execution_payload_header: + $ref: "./execution_payload.yaml#/Electra/ExecutionPayloadHeader" + + BlindedBeaconBlock: + description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/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/electra/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_payload.yaml b/types/electra/execution_payload.yaml new file mode 100644 index 00000000..ddc31898 --- /dev/null +++ b/types/electra/execution_payload.yaml @@ -0,0 +1,79 @@ +Electra: + ExecutionPayloadCommon: + # An abstract object to collect the common fields between the ExecutionPayload and the ExecutionPayloadHeader objects. + type: object + description: "The [`ExecutionPayload`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#executionpayload) object from the CL Electra spec." + required: [parent_hash, fee_recipient, state_root, receipts_root, logs_bloom, prev_randao, block_number, gas_limit, gas_used, timestamp, extra_data, base_fee_per_gas, excess_blob_gas, block_hash] + properties: + parent_hash: + $ref: "../primitive.yaml#/Root" + fee_recipient: + $ref: "../primitive.yaml#/ExecutionAddress" + state_root: + $ref: "../primitive.yaml#/Root" + receipts_root: + $ref: "../primitive.yaml#/Root" + logs_bloom: + $ref: "../primitive.yaml#/LogsBloom" + prev_randao: + $ref: "../primitive.yaml#/Bytes32" + block_number: + $ref: "../primitive.yaml#/Uint64" + gas_limit: + $ref: "../primitive.yaml#/Uint64" + gas_used: + $ref: "../primitive.yaml#/Uint64" + timestamp: + $ref: "../primitive.yaml#/Uint64" + extra_data: + $ref: "../primitive.yaml#/ExtraData" + base_fee_per_gas: + $ref: "../primitive.yaml#/Uint256" + excess_blob_gas: + $ref: "../primitive.yaml#/Uint256" + block_hash: + $ref: "../primitive.yaml#/Root" + + ExecutionPayload: + allOf: + - $ref: "#/Electra/ExecutionPayloadCommon" + - type: object + required: [transactions, withdrawals, deposit_requests, withdrawal_requests, consolidation_requests] + properties: + transactions: + $ref: "../bellatrix/transactions.yaml#/Bellatrix/Transactions" + withdrawals: + $ref: "../capella/withdrawals.yaml#/Capella/Withdrawals" + deposit_requests: + type: array + items: + $ref: "./deposit.yaml#/Electra/DepositRequest" + maxItems: 8192 + withdrawal_requests: + type: array + items: + $ref: "./withdrawal.yaml#/Electra/WithdrawalRequest" + maxItems: 16 + consolidation_requests: + type: array + items: + $ref: "./consolidation.yaml#/Electra/ConsolidationRequest" + maxItems: 1 + + ExecutionPayloadHeader: + description: "The [`ExecutionPayloadHeader`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#executionpayloadheader) object from the CL Electra spec." + allOf: + - $ref: "#/Electra/ExecutionPayloadCommon" + - type: object + required: [transactions_root, withdrawals_root, deposit_requests_root, withdrawal_requests_root, consolidation_requests_root] + properties: + transactions_root: + $ref: "../primitive.yaml#/Root" + withdrawals_root: + $ref: "../primitive.yaml#/Root" + deposit_requests_root: + $ref: "../primitive.yaml#/Root" + withdrawal_requests_root: + $ref: "../primitive.yaml#/Root" + consolidation_requests_root: + $ref: "../primitive.yaml#/Root" diff --git a/types/electra/state.yaml b/types/electra/state.yaml new file mode 100644 index 00000000..99ea180b --- /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: "./execution_payload.yaml#/Electra/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." From d7b4c5d46aa94c5b053767c9da996c47db2b69ee Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 29 Aug 2024 22:55:07 +0100 Subject: [PATCH 2/3] Fix references to beacon block in CL spec --- types/deneb/block.yaml | 8 ++++---- types/electra/block.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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 index a9cb4d78..5c218288 100644 --- a/types/electra/block.yaml +++ b/types/electra/block.yaml @@ -54,7 +54,7 @@ Electra: $ref: "./execution_payload.yaml#/Electra/ExecutionPayload" BeaconBlock: - description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#beaconblock) object from the CL Electra spec." + 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 @@ -65,7 +65,7 @@ Electra: SignedBeaconBlock: type: object - description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#signedbeaconblock) object envelope from the CL Electra spec." + 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: @@ -84,7 +84,7 @@ Electra: $ref: "./execution_payload.yaml#/Electra/ExecutionPayloadHeader" BlindedBeaconBlock: - description: "A variant of the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#beaconblock) object from the CL Electra spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." + 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 @@ -95,7 +95,7 @@ Electra: SignedBlindedBeaconBlock: type: object - description: "A variant of the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#signedbeaconblock) object envelope from the CL Electra spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." + 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: From 2c262580783931d660d4c5ea871b7e7726c4c55e Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 18 Sep 2024 12:06:36 +0100 Subject: [PATCH 3/3] Move requests out of execution_payload into beacon_block.body --- types/electra/block.yaml | 12 ++-- types/electra/execution_payload.yaml | 79 --------------------------- types/electra/execution_requests.yaml | 21 +++++++ types/electra/state.yaml | 2 +- 4 files changed, 30 insertions(+), 84 deletions(-) delete mode 100644 types/electra/execution_payload.yaml create mode 100644 types/electra/execution_requests.yaml diff --git a/types/electra/block.yaml b/types/electra/block.yaml index 5c218288..db460fd3 100644 --- a/types/electra/block.yaml +++ b/types/electra/block.yaml @@ -48,10 +48,12 @@ Electra: allOf: - $ref: "#/Electra/BeaconBlockBodyCommon" - type: object - required: [execution_payload] + required: [execution_payload, execution_requests] properties: execution_payload: - $ref: "./execution_payload.yaml#/Electra/ExecutionPayload" + $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." @@ -78,10 +80,12 @@ Electra: allOf: - $ref: "#/Electra/BeaconBlockBodyCommon" - type: object - required: [execution_payload_header] + required: [execution_payload_header, execution_requests_root] properties: execution_payload_header: - $ref: "./execution_payload.yaml#/Electra/ExecutionPayloadHeader" + $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`." diff --git a/types/electra/execution_payload.yaml b/types/electra/execution_payload.yaml deleted file mode 100644 index ddc31898..00000000 --- a/types/electra/execution_payload.yaml +++ /dev/null @@ -1,79 +0,0 @@ -Electra: - ExecutionPayloadCommon: - # An abstract object to collect the common fields between the ExecutionPayload and the ExecutionPayloadHeader objects. - type: object - description: "The [`ExecutionPayload`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#executionpayload) object from the CL Electra spec." - required: [parent_hash, fee_recipient, state_root, receipts_root, logs_bloom, prev_randao, block_number, gas_limit, gas_used, timestamp, extra_data, base_fee_per_gas, excess_blob_gas, block_hash] - properties: - parent_hash: - $ref: "../primitive.yaml#/Root" - fee_recipient: - $ref: "../primitive.yaml#/ExecutionAddress" - state_root: - $ref: "../primitive.yaml#/Root" - receipts_root: - $ref: "../primitive.yaml#/Root" - logs_bloom: - $ref: "../primitive.yaml#/LogsBloom" - prev_randao: - $ref: "../primitive.yaml#/Bytes32" - block_number: - $ref: "../primitive.yaml#/Uint64" - gas_limit: - $ref: "../primitive.yaml#/Uint64" - gas_used: - $ref: "../primitive.yaml#/Uint64" - timestamp: - $ref: "../primitive.yaml#/Uint64" - extra_data: - $ref: "../primitive.yaml#/ExtraData" - base_fee_per_gas: - $ref: "../primitive.yaml#/Uint256" - excess_blob_gas: - $ref: "../primitive.yaml#/Uint256" - block_hash: - $ref: "../primitive.yaml#/Root" - - ExecutionPayload: - allOf: - - $ref: "#/Electra/ExecutionPayloadCommon" - - type: object - required: [transactions, withdrawals, deposit_requests, withdrawal_requests, consolidation_requests] - properties: - transactions: - $ref: "../bellatrix/transactions.yaml#/Bellatrix/Transactions" - withdrawals: - $ref: "../capella/withdrawals.yaml#/Capella/Withdrawals" - deposit_requests: - type: array - items: - $ref: "./deposit.yaml#/Electra/DepositRequest" - maxItems: 8192 - withdrawal_requests: - type: array - items: - $ref: "./withdrawal.yaml#/Electra/WithdrawalRequest" - maxItems: 16 - consolidation_requests: - type: array - items: - $ref: "./consolidation.yaml#/Electra/ConsolidationRequest" - maxItems: 1 - - ExecutionPayloadHeader: - description: "The [`ExecutionPayloadHeader`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.5/specs/electra/beacon-chain.md#executionpayloadheader) object from the CL Electra spec." - allOf: - - $ref: "#/Electra/ExecutionPayloadCommon" - - type: object - required: [transactions_root, withdrawals_root, deposit_requests_root, withdrawal_requests_root, consolidation_requests_root] - properties: - transactions_root: - $ref: "../primitive.yaml#/Root" - withdrawals_root: - $ref: "../primitive.yaml#/Root" - deposit_requests_root: - $ref: "../primitive.yaml#/Root" - withdrawal_requests_root: - $ref: "../primitive.yaml#/Root" - consolidation_requests_root: - $ref: "../primitive.yaml#/Root" 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 index 99ea180b..7798a372 100644 --- a/types/electra/state.yaml +++ b/types/electra/state.yaml @@ -82,7 +82,7 @@ Electra: next_sync_committee: $ref: "../altair/sync_committee.yaml#/Altair/SyncCommittee" latest_execution_payload_header: - $ref: "./execution_payload.yaml#/Electra/ExecutionPayloadHeader" + $ref: "../deneb/execution_payload.yaml#/Deneb/ExecutionPayloadHeader" next_withdrawal_index: $ref: "../primitive.yaml#/Uint64" next_withdrawal_validator_index: