diff --git a/apis/beacon/blocks/blinded_block.yaml b/apis/beacon/blocks/blinded_block.yaml index 3690557e..7b321476 100644 --- a/apis/beacon/blocks/blinded_block.yaml +++ b/apis/beacon/blocks/blinded_block.yaml @@ -25,7 +25,7 @@ get: properties: version: type: string - enum: [phase0, altair, bellatrix, capella] + enum: [phase0, altair, bellatrix, capella, eip4844] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,6 +37,7 @@ get: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock" - $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/EIP4844.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.yaml b/apis/beacon/blocks/blinded_blocks.yaml index 22f5e431..7636f0a3 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -32,6 +32,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock" - $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/EIP4844.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 e0a57b2b..a0d03478 100644 --- a/apis/beacon/blocks/block.v2.yaml +++ b/apis/beacon/blocks/block.v2.yaml @@ -25,7 +25,7 @@ get: properties: version: type: string - enum: [phase0, altair, bellatrix, capella] + enum: [phase0, altair, bellatrix, capella, eip4844] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,6 +37,7 @@ get: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock" - $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/EIP4844.SignedBeaconBlock" application/octet-stream: schema: diff --git a/apis/beacon/blocks/blocks.yaml b/apis/beacon/blocks/blocks.yaml index d19f359b..dc84fa94 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -30,6 +30,7 @@ post: - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedBeaconBlock" - $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/EIP4844.SignedBeaconBlock" 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 417af137..ecfad36e 100644 --- a/apis/debug/state.v2.yaml +++ b/apis/debug/state.v2.yaml @@ -25,7 +25,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella ] + enum: [ phase0, altair, bellatrix, capella, eip4844 ] example: "phase0" execution_optimistic: $ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,6 +37,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconState" - $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/EIP4844.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 bf546844..d846e499 100644 --- a/apis/validator/blinded_block.yaml +++ b/apis/validator/blinded_block.yaml @@ -54,7 +54,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella ] + enum: [ phase0, altair, bellatrix, capella, eip4844 ] example: "bellatrix" data: oneOf: @@ -62,6 +62,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconBlock" - $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/EIP4844.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 abcb1976..91bf14a8 100644 --- a/apis/validator/block.v2.yaml +++ b/apis/validator/block.v2.yaml @@ -51,7 +51,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella ] + enum: [ phase0, altair, bellatrix, capella, eip4844 ] example: "phase0" data: oneOf: @@ -59,6 +59,7 @@ get: - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Altair.BeaconBlock" - $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/EIP4844.BeaconBlock" 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/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index e0812350..6854fa42 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -311,7 +311,7 @@ components: Bellatrix.SignedBlindedBeaconBlock: $ref: './types/bellatrix/block.yaml#/Bellatrix/SignedBlindedBeaconBlock' ConsensusVersion: - enum: [phase0, altair, bellatrix, capella] + enum: [phase0, altair, bellatrix, capella, eip4844] example: "phase0" SignedValidatorRegistration: $ref: './types/registration.yaml#/SignedValidatorRegistration' @@ -325,6 +325,16 @@ components: $ref: './types/capella/block.yaml#/Capella/BlindedBeaconBlock' Capella.SignedBlindedBeaconBlock: $ref: './types/capella/block.yaml#/Capella/SignedBlindedBeaconBlock' + EIP4844.BeaconState: + $ref: './types/eip4844/state.yaml#/EIP4844/BeaconState' + EIP4844.BeaconBlock: + $ref: './types/eip4844/block.yaml#/EIP4844/BeaconBlock' + EIP4844.SignedBeaconBlock: + $ref: './types/eip4844/block.yaml#/EIP4844/SignedBeaconBlock' + EIP4844.BlindedBeaconBlock: + $ref: './types/eip4844/block.yaml#/EIP4844/BlindedBeaconBlock' + EIP4844.SignedBlindedBeaconBlock: + $ref: './types/eip4844/block.yaml#/EIP4844/SignedBlindedBeaconBlock' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/bellatrix/execution_payload.yaml b/types/bellatrix/execution_payload.yaml index 1ed63ac6..f182a0c0 100644 --- a/types/bellatrix/execution_payload.yaml +++ b/types/bellatrix/execution_payload.yaml @@ -45,6 +45,7 @@ Bellatrix: allOf: - $ref: '#/Bellatrix/ExecutionPayloadCommon' - type: object + additionalProperties: false properties: transactions_root: $ref: '../primitive.yaml#/Root' diff --git a/types/capella/block.yaml b/types/capella/block.yaml index d872b828..127f0de7 100644 --- a/types/capella/block.yaml +++ b/types/capella/block.yaml @@ -34,6 +34,10 @@ Capella: $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' BeaconBlockBody: allOf: @@ -42,10 +46,6 @@ Capella: properties: execution_payload: $ref: './execution_payload.yaml#/Capella/ExecutionPayload' - bls_to_execution_changes: - type: array - items: - $ref: '../bls_to_execution_change.yaml#/SignedBLSToExecutionChange' BeaconBlock: description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/Capella/beacon-chain.md#beaconblock) object from the CL Capella spec." @@ -73,10 +73,6 @@ Capella: properties: execution_payload_header: $ref: './execution_payload.yaml#/Capella/ExecutionPayloadHeader' - bls_to_execution_changes: - type: array - items: - $ref: '../bls_to_execution_change.yaml#/SignedBLSToExecutionChange' BlindedBeaconBlock: description: "A variant of the the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/capella/beacon-chain.md#beaconblock) object from the CL Capella spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." diff --git a/types/capella/execution_payload.yaml b/types/capella/execution_payload.yaml index 3f543156..0fc85465 100644 --- a/types/capella/execution_payload.yaml +++ b/types/capella/execution_payload.yaml @@ -47,6 +47,7 @@ Capella: allOf: - $ref: '#/Capella/ExecutionPayloadCommon' - type: object + additionalProperties: false properties: transactions_root: $ref: '../primitive.yaml#/Root' diff --git a/types/eip4844/block.yaml b/types/eip4844/block.yaml new file mode 100644 index 00000000..e6d1c33d --- /dev/null +++ b/types/eip4844/block.yaml @@ -0,0 +1,97 @@ +EIP4844: + 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/master/specs/eip4844/beacon-chain.md#beaconblockbody) object from the CL EIP-4844 spec." + 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#/AttesterSlashing' + attestations: + type: array + items: + $ref: '../attestation.yaml#/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: '#/EIP4844/BeaconBlockBodyCommon' + - type: object + properties: + execution_payload: + $ref: './execution_payload.yaml#/EIP4844/ExecutionPayload' + + BeaconBlock: + description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/EIP4844/beacon-chain.md#beaconblock) object from the CL EIP-4844 spec." + allOf: + - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' + - type: object + properties: + body: + $ref: '#/EIP4844/BeaconBlockBody' + + SignedBeaconBlock: + type: object + description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#signedbeaconblock) object envelope from the CL EIP-4844 spec." + properties: + message: + $ref: "#/EIP4844/BeaconBlock" + signature: + $ref: "../primitive.yaml#/Signature" + + BlindedBeaconBlockBody: + description: "A variant of the [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconblockbody) object from the CL EIP-4844 spec, which contains a transactions root rather than a full transactions list." + allOf: + - $ref: '#/EIP4844/BeaconBlockBodyCommon' + - type: object + properties: + execution_payload_header: + $ref: './execution_payload.yaml#/EIP4844/ExecutionPayloadHeader' + + BlindedBeaconBlock: + description: "A variant of the the [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconblock) object from the CL EIP-4844 spec, which contains a `BlindedBeaconBlockBody` rather than a `BeaconBlockBody`." + allOf: + - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' + - type: object + properties: + body: + $ref: '#/EIP4844/BlindedBeaconBlockBody' + + SignedBlindedBeaconBlock: + type: object + description: "A variant of the the the [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#signedbeaconblock) object envelope from the CL EIP-4844 spec, which contains a `BlindedBeaconBlock` rather than a `BeaconBlock`." + properties: + message: + $ref: "#/EIP4844/BlindedBeaconBlock" + signature: + $ref: "../primitive.yaml#/Signature" diff --git a/types/eip4844/block_and_blobs_sidecar.yaml b/types/eip4844/block_and_blobs_sidecar.yaml new file mode 100644 index 00000000..b65d24d2 --- /dev/null +++ b/types/eip4844/block_and_blobs_sidecar.yaml @@ -0,0 +1,29 @@ +EIP4844: + BlobsSidecar: + type: object + description: "The `BlobsSidecar` object from the EIP-4844 CL spec." + properties: + beacon_block_root: + $ref: "../primitive.yaml#/Root" + beacon_block_slot: + $ref: "../primitive.yaml#/Uint64" + blobs: + type: array + maxItems: 4 + minItems: 0 + items: + $ref: "#/EIP4844/Blob" + kzg_aggregated_proof: + $ref: "#/EIP4844/KZGProof" + + KZGProof: + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{96}$" + description: "An aggregated KZG proof. Same check as `KZGCommitment`" + + Blob: + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{262144}$" + description: "A blob is `FIELD_ELEMENTS_PER_BLOB * size_of(BLSFieldElement) = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded Blob as defined in EIP-4844" diff --git a/types/eip4844/execution_payload.yaml b/types/eip4844/execution_payload.yaml new file mode 100644 index 00000000..8489d14c --- /dev/null +++ b/types/eip4844/execution_payload.yaml @@ -0,0 +1,56 @@ +EIP4844: + 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/master/specs/eip4844/beacon-chain.md#executionpayload) object from the CL EIP-4844 spec." + 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_data_gas: + $ref: '../primitive.yaml#/Uint256' + block_hash: + $ref: '../primitive.yaml#/Root' + + + ExecutionPayload: + allOf: + - $ref: '#/EIP4844/ExecutionPayloadCommon' + - type: object + properties: + transactions: + $ref: '../capella/transactions.yaml#/Capella/Transactions' + withdrawals: + $ref: '../capella/withdrawals.yaml#/Capella/Withdrawals' + + ExecutionPayloadHeader: + description: "The [`ExecutionPayloadHeader`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#executionpayloadheader) object from the CL EIP-4844 spec." + allOf: + - $ref: '#/EIP4844/ExecutionPayloadCommon' + - type: object + properties: + transactions_root: + $ref: '../primitive.yaml#/Root' + withdrawals_root: + $ref: '../primitive.yaml#/Root' diff --git a/types/eip4844/state.yaml b/types/eip4844/state.yaml new file mode 100644 index 00000000..67d263f3 --- /dev/null +++ b/types/eip4844/state.yaml @@ -0,0 +1,88 @@ +EIP4844: + BeaconState: + type: object + description: "The [`BeaconState`](https://github.com/ethereum/consensus-specs/blob/master/specs/eip4844/beacon-chain.md#beaconstate) object from the Eth2.0 EIP-4844 spec." + 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" + 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#/EIP4844/ExecutionPayloadHeader' + next_withdrawal_index: + $ref: "../primitive.yaml#/Uint64" + next_withdrawal_validator_index: + $ref: "../primitive.yaml#/Uint64" diff --git a/types/primitive.yaml b/types/primitive.yaml index 1dc9f876..85334f5a 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -122,3 +122,10 @@ LogsBloom: format: hex example: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" pattern: "^0x[a-fA-F0-9]{512}$" + +KZGCommitment: + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{96}$" + description: "A G1 curve point. Same as BLS standard \"is valid pubkey\" check but also allows `0x00..00` for point-at-infinity" + example: "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"