From 5502da15c9522ff70573614a6185f96868b34788 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Sun, 25 Dec 2022 19:04:14 +1100 Subject: [PATCH 01/15] Update types to support EIP-4844 (#271) Co-authored-by: 0xGabi Co-authored-by: Paul Harris --- apis/beacon/blocks/blinded_block.yaml | 3 +- apis/beacon/blocks/blinded_blocks.yaml | 1 + apis/beacon/blocks/block.v2.yaml | 3 +- apis/beacon/blocks/blocks.yaml | 1 + apis/debug/state.v2.yaml | 3 +- apis/validator/blinded_block.yaml | 3 +- apis/validator/block.v2.yaml | 3 +- beacon-node-oapi.yaml | 12 ++- types/bellatrix/execution_payload.yaml | 1 + types/capella/block.yaml | 12 +-- types/capella/execution_payload.yaml | 1 + types/eip4844/block.yaml | 97 ++++++++++++++++++++++ types/eip4844/block_and_blobs_sidecar.yaml | 29 +++++++ types/eip4844/execution_payload.yaml | 56 +++++++++++++ types/eip4844/state.yaml | 88 ++++++++++++++++++++ types/primitive.yaml | 7 ++ 16 files changed, 306 insertions(+), 14 deletions(-) create mode 100644 types/eip4844/block.yaml create mode 100644 types/eip4844/block_and_blobs_sidecar.yaml create mode 100644 types/eip4844/execution_payload.yaml create mode 100644 types/eip4844/state.yaml 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" From fd02cd2adceecbb966b76d91cb889b4ea05a214f Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 18 Jan 2023 16:19:14 +1000 Subject: [PATCH 02/15] Introduce Deneb to remove EIP-4844 references Consensus-spec references may need to be fixed once deneb is renamed in that project. related to https://github.com/ethereum/consensus-specs/issues/3207 --- apis/beacon/blocks/blinded_block.yaml | 4 +-- apis/beacon/blocks/blinded_blocks.yaml | 2 +- apis/beacon/blocks/block.v2.yaml | 4 +-- apis/beacon/blocks/blocks.yaml | 2 +- apis/debug/state.v2.yaml | 4 +-- apis/validator/blinded_block.yaml | 4 +-- apis/validator/block.v2.yaml | 4 +-- beacon-node-oapi.yaml | 22 +++++++------- types/{eip4844 => deneb}/block.yaml | 30 +++++++++---------- .../block_and_blobs_sidecar.yaml | 10 +++---- .../{eip4844 => deneb}/execution_payload.yaml | 10 +++---- types/{eip4844 => deneb}/state.yaml | 6 ++-- 12 files changed, 51 insertions(+), 51 deletions(-) rename types/{eip4844 => deneb}/block.yaml (64%) rename types/{eip4844 => deneb}/block_and_blobs_sidecar.yaml (77%) rename types/{eip4844 => deneb}/execution_payload.yaml (82%) rename types/{eip4844 => deneb}/state.yaml (94%) diff --git a/apis/beacon/blocks/blinded_block.yaml b/apis/beacon/blocks/blinded_block.yaml index 7b321476..1bdfae9f 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, eip4844] + enum: [phase0, altair, bellatrix, capella, deneb] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,7 +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" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 7636f0a3..75253448 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -32,7 +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" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 a0d03478..a6aec89d 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, eip4844] + enum: [phase0, altair, bellatrix, capella, deneb] example: "phase0" execution_optimistic: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,7 +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" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBeaconBlock" application/octet-stream: schema: diff --git a/apis/beacon/blocks/blocks.yaml b/apis/beacon/blocks/blocks.yaml index dc84fa94..a7cd3b96 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -30,7 +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" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 ecfad36e..8fd2058b 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, eip4844 ] + enum: [ phase0, altair, bellatrix, capella, deneb ] example: "phase0" execution_optimistic: $ref: "../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" @@ -37,7 +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" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 d846e499..d879919e 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, eip4844 ] + enum: [ phase0, altair, bellatrix, capella, deneb ] example: "bellatrix" data: oneOf: @@ -62,7 +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" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 91bf14a8..ce30e427 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, eip4844 ] + enum: [ phase0, altair, bellatrix, capella, deneb ] example: "phase0" data: oneOf: @@ -59,7 +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" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.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 6854fa42..20851c02 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, eip4844] + enum: [phase0, altair, bellatrix, capella, deneb] example: "phase0" SignedValidatorRegistration: $ref: './types/registration.yaml#/SignedValidatorRegistration' @@ -325,16 +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' + Deneb.BeaconState: + $ref: './types/deneb/state.yaml#/Deneb/BeaconState' + Deneb.BeaconBlock: + $ref: './types/deneb/block.yaml#/Deneb/BeaconBlock' + Deneb.SignedBeaconBlock: + $ref: './types/deneb/block.yaml#/Deneb/SignedBeaconBlock' + Deneb.BlindedBeaconBlock: + $ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock' + Deneb.SignedBlindedBeaconBlock: + $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/eip4844/block.yaml b/types/deneb/block.yaml similarity index 64% rename from types/eip4844/block.yaml rename to types/deneb/block.yaml index e6d1c33d..68adab3c 100644 --- a/types/eip4844/block.yaml +++ b/types/deneb/block.yaml @@ -1,8 +1,8 @@ -EIP4844: +Deneb: 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." + description: "The [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblockbody) object from the CL Deneb spec." properties: randao_reveal: allOf: @@ -45,53 +45,53 @@ EIP4844: BeaconBlockBody: allOf: - - $ref: '#/EIP4844/BeaconBlockBodyCommon' + - $ref: '#/Deneb/BeaconBlockBodyCommon' - type: object properties: execution_payload: - $ref: './execution_payload.yaml#/EIP4844/ExecutionPayload' + $ref: './execution_payload.yaml#/Deneb/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." + description: "The [`BeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/Deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec." allOf: - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' - type: object properties: body: - $ref: '#/EIP4844/BeaconBlockBody' + $ref: '#/Deneb/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." + description: "The [`SignedBeaconBlock`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#signedbeaconblock) object envelope from the CL Deneb spec." properties: message: - $ref: "#/EIP4844/BeaconBlock" + $ref: "#/Deneb/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." + description: "A variant of the [`BeaconBlockBody`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconblockbody) object from the CL Deneb spec, which contains a transactions root rather than a full transactions list." allOf: - - $ref: '#/EIP4844/BeaconBlockBodyCommon' + - $ref: '#/Deneb/BeaconBlockBodyCommon' - type: object properties: execution_payload_header: - $ref: './execution_payload.yaml#/EIP4844/ExecutionPayloadHeader' + $ref: './execution_payload.yaml#/Deneb/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`." + description: "A variant of the 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`." allOf: - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' - type: object properties: body: - $ref: '#/EIP4844/BlindedBeaconBlockBody' + $ref: '#/Deneb/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`." + description: "A variant of the the 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`." properties: message: - $ref: "#/EIP4844/BlindedBeaconBlock" + $ref: "#/Deneb/BlindedBeaconBlock" signature: $ref: "../primitive.yaml#/Signature" diff --git a/types/eip4844/block_and_blobs_sidecar.yaml b/types/deneb/block_and_blobs_sidecar.yaml similarity index 77% rename from types/eip4844/block_and_blobs_sidecar.yaml rename to types/deneb/block_and_blobs_sidecar.yaml index b65d24d2..8cce35f1 100644 --- a/types/eip4844/block_and_blobs_sidecar.yaml +++ b/types/deneb/block_and_blobs_sidecar.yaml @@ -1,7 +1,7 @@ -EIP4844: +Deneb: BlobsSidecar: type: object - description: "The `BlobsSidecar` object from the EIP-4844 CL spec." + description: "The `BlobsSidecar` object from the Deneb CL spec." properties: beacon_block_root: $ref: "../primitive.yaml#/Root" @@ -12,9 +12,9 @@ EIP4844: maxItems: 4 minItems: 0 items: - $ref: "#/EIP4844/Blob" + $ref: "#/Deneb/Blob" kzg_aggregated_proof: - $ref: "#/EIP4844/KZGProof" + $ref: "#/Deneb/KZGProof" KZGProof: type: string @@ -26,4 +26,4 @@ EIP4844: 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" + description: "A blob is `FIELD_ELEMENTS_PER_BLOB * size_of(BLSFieldElement) = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded Blob as defined in Deneb" diff --git a/types/eip4844/execution_payload.yaml b/types/deneb/execution_payload.yaml similarity index 82% rename from types/eip4844/execution_payload.yaml rename to types/deneb/execution_payload.yaml index 8489d14c..ed2b771b 100644 --- a/types/eip4844/execution_payload.yaml +++ b/types/deneb/execution_payload.yaml @@ -1,8 +1,8 @@ -EIP4844: +Deneb: 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." + description: "The [`ExecutionPayload`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#executionpayload) object from the CL Deneb spec." properties: parent_hash: $ref: '../primitive.yaml#/Root' @@ -36,7 +36,7 @@ EIP4844: ExecutionPayload: allOf: - - $ref: '#/EIP4844/ExecutionPayloadCommon' + - $ref: '#/Deneb/ExecutionPayloadCommon' - type: object properties: transactions: @@ -45,9 +45,9 @@ EIP4844: $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." + description: "The [`ExecutionPayloadHeader`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#executionpayloadheader) object from the CL Deneb spec." allOf: - - $ref: '#/EIP4844/ExecutionPayloadCommon' + - $ref: '#/Deneb/ExecutionPayloadCommon' - type: object properties: transactions_root: diff --git a/types/eip4844/state.yaml b/types/deneb/state.yaml similarity index 94% rename from types/eip4844/state.yaml rename to types/deneb/state.yaml index 67d263f3..23135172 100644 --- a/types/eip4844/state.yaml +++ b/types/deneb/state.yaml @@ -1,7 +1,7 @@ -EIP4844: +Deneb: 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." + description: "The [`BeaconState`](https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/beacon-chain.md#beaconstate) object from the Eth2.0 Deneb spec." properties: genesis_time: $ref: "../primitive.yaml#/Uint64" @@ -81,7 +81,7 @@ EIP4844: next_sync_committee: $ref: '../altair/sync_committee.yaml#/Altair/SyncCommittee' latest_execution_payload_header: - $ref: './execution_payload.yaml#/EIP4844/ExecutionPayloadHeader' + $ref: './execution_payload.yaml#/Deneb/ExecutionPayloadHeader' next_withdrawal_index: $ref: "../primitive.yaml#/Uint64" next_withdrawal_validator_index: From 709ccd6592f76d3f92a0f850534a8cd54dd7adaf Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 8 Feb 2023 12:58:22 +1000 Subject: [PATCH 03/15] fix lint - couldnt find any evidence of capella transactions, so put this back to bellatrix transactions like the other similar references. --- types/deneb/execution_payload.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/deneb/execution_payload.yaml b/types/deneb/execution_payload.yaml index ed2b771b..54322f51 100644 --- a/types/deneb/execution_payload.yaml +++ b/types/deneb/execution_payload.yaml @@ -40,7 +40,7 @@ Deneb: - type: object properties: transactions: - $ref: '../capella/transactions.yaml#/Capella/Transactions' + $ref: '../bellatrix/transactions.yaml#/Bellatrix/Transactions' withdrawals: $ref: '../capella/withdrawals.yaml#/Capella/Withdrawals' From a213e30af7e3fb3d3377b4a1fbbb04d3637d50f0 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 13 Feb 2023 11:38:48 -0500 Subject: [PATCH 04/15] update necessary types --- types/deneb/blob_sidecar.yaml | 39 ++++++++++++++++++++++++ types/deneb/block_and_blobs_sidecar.yaml | 29 ------------------ types/deneb/block_contents.yaml | 18 +++++++++++ types/primitive.yaml | 12 ++++++++ 4 files changed, 69 insertions(+), 29 deletions(-) create mode 100644 types/deneb/blob_sidecar.yaml delete mode 100644 types/deneb/block_and_blobs_sidecar.yaml create mode 100644 types/deneb/block_contents.yaml diff --git a/types/deneb/blob_sidecar.yaml b/types/deneb/blob_sidecar.yaml new file mode 100644 index 00000000..9926c9d6 --- /dev/null +++ b/types/deneb/blob_sidecar.yaml @@ -0,0 +1,39 @@ +Deneb: + BlindedBlobSidecars: + type: array + items: + $ref: '#/Deneb/BlindedBlobSidecar' + minItems: 0 + maxItems: 4 + + BlindedBlobSidecar: + type: object + description: "A blob sidecar with the SSZ root of the blob rather than the full blob." + properties: + block_root: + $ref: "../primitive.yaml#/Root" + index: + $ref: "../primitive.yaml#/Uint64" + slot: + $ref: "../primitive.yaml#/Uint64" + block_parent_root: + $ref: "../primitive.yaml#/Root" + proposer_index: + $ref: "../primitive.yaml#/Uint64" + blob_root: + $ref: "../primitive.yaml#/Root" + kzg_commitment: + $ref: '../primitive.yaml#/KZGCommitment' + kzg_proof: + $ref: '../primitive.yaml#/KZGProof' + + SignedBlindedBlobSidecar: + type: object + description: "A variant of the `SignedBlobSidecar` object envelope from the CL Deneb spec, which contains a `BlindedBlobSidecar` rather than a `BlobSidecar`." + properties: + message: + $ref: "#/Deneb/BlindedBlobSidcar" + signature: + $ref: "../primitive.yaml#/Signature" + + diff --git a/types/deneb/block_and_blobs_sidecar.yaml b/types/deneb/block_and_blobs_sidecar.yaml deleted file mode 100644 index 8cce35f1..00000000 --- a/types/deneb/block_and_blobs_sidecar.yaml +++ /dev/null @@ -1,29 +0,0 @@ -Deneb: - BlobsSidecar: - type: object - description: "The `BlobsSidecar` object from the Deneb 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: "#/Deneb/Blob" - kzg_aggregated_proof: - $ref: "#/Deneb/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 Deneb" diff --git a/types/deneb/block_contents.yaml b/types/deneb/block_contents.yaml new file mode 100644 index 00000000..ddd081b9 --- /dev/null +++ b/types/deneb/block_contents.yaml @@ -0,0 +1,18 @@ +Deneb: + BlockContents: + type: object + description: "The required object for block production according to the Deneb CL spec." + properties: + block: + $ref: "./block.yaml#/Deneb/BeaconBlock" + blob_sidecars: + $ref: "./blob_sidecar.yaml/#Deneb/BlindedBlobSidecars" + + BlindedBlockContents: + type: object + description: "The required object for blinded block production according to the Deneb CL spec." + properties: + block: + $ref: "./block.yaml#/Deneb/BlindedBeaconBlock" + blob_sidecars: + $ref: "./blob_sidecar.yaml/#Deneb/BlindedBlobSidecars" diff --git a/types/primitive.yaml b/types/primitive.yaml index 85334f5a..0b70477e 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -123,9 +123,21 @@ LogsBloom: example: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" pattern: "^0x[a-fA-F0-9]{512}$" + 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 Deneb" + 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" + +KZGProof: + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{96}$" + description: "A KZG proof. Same check as `KZGCommitment`" From cec2c918f6ef484feaa86de1c007fc65a39a6862 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 13 Feb 2023 12:07:53 -0500 Subject: [PATCH 05/15] add/update blob signing related endpoints --- apis/beacon/blobs/post_blobs.yaml | 54 +++++++++++++++++++++++++++++++ apis/validator/blinded_block.yaml | 2 +- apis/validator/block.v2.yaml | 2 +- beacon-node-oapi.yaml | 8 +++++ 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 apis/beacon/blobs/post_blobs.yaml diff --git a/apis/beacon/blobs/post_blobs.yaml b/apis/beacon/blobs/post_blobs.yaml new file mode 100644 index 00000000..ae568f30 --- /dev/null +++ b/apis/beacon/blobs/post_blobs.yaml @@ -0,0 +1,54 @@ +post: + tags: + - Beacon + - ValidatorRequiredApi + summary: "Publish a signed blob." + operationId: "publishBlob" + description: | + Instructs the beacon node to broadcast a newly signed blob to the beacon network, + to be included in the beacon chain. A success response (20x) indicates that the blob + passed gossip validation and was successfully broadcast onto the network. + The beacon node is also expected to integrate the blob into state once it receives the + corresponding block and any other corresponding blobs, but may broadcast it + before doing so, so as to aid timely delivery of the block and blobs. Should the blob fail full + validation, a separate success response code (202) is used to indicate that the blob was + successfully broadcast but failed integration. + parameters: + - in: header + schema: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' + required: false + name: Eth-Consensus-Version + description: "Version of the blob being submitted, if using SSZ encoding." + requestBody: + description: "A variant of `SignedBlobSidecar` object composed of a `BlindedBlobSidecar` object (produced by beacon node) and validator signature." + required: true + content: + application/json: + schema: + oneOf: + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBlobSidecar" + application/octet-stream: + schema: + description: "SSZ serialized blob sidecar bytes. Use content type header to indicate that SSZ data is contained in the request body." + responses: + "200": + description: "The blob was validated successfully and has been broadcast. It has also been integrated into the beacon node's database." + "202": + description: "The blob could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast." + "400": + description: "The `SignedBlobSidecar` object is invalid and could not be broadcast" + content: + application/json: + schema: + allOf: + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + - example: + code: 400 + message: "Invalid blob: missing signature" + "415": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType' + "500": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' + "503": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing' diff --git a/apis/validator/blinded_block.yaml b/apis/validator/blinded_block.yaml index d879919e..52edf072 100644 --- a/apis/validator/blinded_block.yaml +++ b/apis/validator/blinded_block.yaml @@ -62,7 +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/Deneb.BlindedBeaconBlock" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlindedBlockContents" 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 ce30e427..403d4ffb 100644 --- a/apis/validator/block.v2.yaml +++ b/apis/validator/block.v2.yaml @@ -59,7 +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/Deneb.BeaconBlock" + - $ref: "../../beacon-node-oapi.yaml#/components/schemas/Deneb.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/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 8ee671dd..064ff603 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -89,6 +89,8 @@ paths: $ref: "./apis/beacon/blocks/blinded_blocks.yaml" /eth/v1/beacon/blocks: $ref: "./apis/beacon/blocks/blocks.yaml" + /eth/v1/beacon/blob_sidecar: + $ref: "./apis/beacon/blobs/post_blobs.yaml" /eth/v2/beacon/blocks/{block_id}: $ref: "./apis/beacon/blocks/block.v2.yaml" /eth/v1/beacon/blocks/{block_id}/root: @@ -345,12 +347,18 @@ components: $ref: './types/deneb/state.yaml#/Deneb/BeaconState' Deneb.BeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/BeaconBlock' + Deneb.BlockContents: + $ref: './types/deneb/block_contents.yaml#/Deneb/BlockContents' Deneb.SignedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBeaconBlock' Deneb.BlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock' + Deneb.BlindedBlockContents: + $ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents' Deneb.SignedBlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' + Deneb.SignedBlindedBlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecar' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: From af1721356d810f93b65affeed4341decd77f8636 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 13 Feb 2023 13:29:12 -0500 Subject: [PATCH 06/15] bug fixes --- beacon-node-oapi.yaml | 4 ++++ types/deneb/blob_sidecar.yaml | 2 +- types/deneb/block_contents.yaml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 064ff603..aace5c7b 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -357,6 +357,10 @@ components: $ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents' Deneb.SignedBlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' + Deneb.BlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar' + Deneb.BlindedBlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlindedBlobSidecar' Deneb.SignedBlindedBlobSidecar: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecar' Node: diff --git a/types/deneb/blob_sidecar.yaml b/types/deneb/blob_sidecar.yaml index 9926c9d6..46283d0b 100644 --- a/types/deneb/blob_sidecar.yaml +++ b/types/deneb/blob_sidecar.yaml @@ -32,7 +32,7 @@ Deneb: description: "A variant of the `SignedBlobSidecar` object envelope from the CL Deneb spec, which contains a `BlindedBlobSidecar` rather than a `BlobSidecar`." properties: message: - $ref: "#/Deneb/BlindedBlobSidcar" + $ref: "#/Deneb/BlindedBlobSidecar" signature: $ref: "../primitive.yaml#/Signature" diff --git a/types/deneb/block_contents.yaml b/types/deneb/block_contents.yaml index ddd081b9..3f2e0eba 100644 --- a/types/deneb/block_contents.yaml +++ b/types/deneb/block_contents.yaml @@ -6,7 +6,7 @@ Deneb: block: $ref: "./block.yaml#/Deneb/BeaconBlock" blob_sidecars: - $ref: "./blob_sidecar.yaml/#Deneb/BlindedBlobSidecars" + $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" BlindedBlockContents: type: object @@ -15,4 +15,4 @@ Deneb: block: $ref: "./block.yaml#/Deneb/BlindedBeaconBlock" blob_sidecars: - $ref: "./blob_sidecar.yaml/#Deneb/BlindedBlobSidecars" + $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" From bb8b8aeb964546fdc6a7e02ada2b4243c73078a0 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 13 Feb 2023 13:52:41 -0500 Subject: [PATCH 07/15] fix lints --- beacon-node-oapi.yaml | 2 -- types/primitive.yaml | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index aace5c7b..3cd77624 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -357,8 +357,6 @@ components: $ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents' Deneb.SignedBlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' - Deneb.BlobSidecar: - $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar' Deneb.BlindedBlobSidecar: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlindedBlobSidecar' Deneb.SignedBlindedBlobSidecar: diff --git a/types/primitive.yaml b/types/primitive.yaml index 0b70477e..ff842d91 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -123,11 +123,11 @@ LogsBloom: example: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" pattern: "^0x[a-fA-F0-9]{512}$" - 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 Deneb" +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 Deneb" KZGCommitment: type: string From b14c00c09e21e5ebfbd84f7e9fe52dfb99c2441e Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 13 Feb 2023 14:02:47 -0500 Subject: [PATCH 08/15] KZG proof whitespace fix --- types/primitive.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/primitive.yaml b/types/primitive.yaml index ff842d91..d3cdede3 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -137,7 +137,7 @@ KZGCommitment: example: "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" KZGProof: - type: string - format: hex - pattern: "^0x[a-fA-F0-9]{96}$" - description: "A KZG proof. Same check as `KZGCommitment`" + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{96}$" + description: "A KZG proof. Same check as `KZGCommitment`" From 0efc637e19887fd3529fad1125bb0f194ad54c51 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 7 Mar 2023 18:23:08 -0500 Subject: [PATCH 09/15] more descriptive blob sidecar name --- types/deneb/block_contents.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/deneb/block_contents.yaml b/types/deneb/block_contents.yaml index 3f2e0eba..df69a99b 100644 --- a/types/deneb/block_contents.yaml +++ b/types/deneb/block_contents.yaml @@ -5,7 +5,7 @@ Deneb: properties: block: $ref: "./block.yaml#/Deneb/BeaconBlock" - blob_sidecars: + blinded_blob_sidecars: $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" BlindedBlockContents: @@ -14,5 +14,5 @@ Deneb: properties: block: $ref: "./block.yaml#/Deneb/BlindedBeaconBlock" - blob_sidecars: + blinded_blob_sidecars: $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" From 9d08f1181be33268b7a41b568df3072734564d66 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 7 Mar 2023 20:22:32 -0500 Subject: [PATCH 10/15] Combine signed block and blob publishing --- apis/beacon/blocks/blinded_blocks.yaml | 2 +- apis/beacon/blocks/blocks.yaml | 2 +- beacon-node-oapi.yaml | 2 -- types/deneb/blob_sidecar.yaml | 7 +++++++ types/deneb/block_contents.yaml | 21 ++++++++++++++++++++- 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/apis/beacon/blocks/blinded_blocks.yaml b/apis/beacon/blocks/blinded_blocks.yaml index 75253448..feeb8038 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -32,7 +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/Deneb.SignedBlindedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBlockContents" 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 a7cd3b96..77095ad7 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -30,7 +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/Deneb.SignedBeaconBlock" + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.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/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 3cd77624..26b1605a 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -89,8 +89,6 @@ paths: $ref: "./apis/beacon/blocks/blinded_blocks.yaml" /eth/v1/beacon/blocks: $ref: "./apis/beacon/blocks/blocks.yaml" - /eth/v1/beacon/blob_sidecar: - $ref: "./apis/beacon/blobs/post_blobs.yaml" /eth/v2/beacon/blocks/{block_id}: $ref: "./apis/beacon/blocks/block.v2.yaml" /eth/v1/beacon/blocks/{block_id}/root: diff --git a/types/deneb/blob_sidecar.yaml b/types/deneb/blob_sidecar.yaml index 46283d0b..b6ea9741 100644 --- a/types/deneb/blob_sidecar.yaml +++ b/types/deneb/blob_sidecar.yaml @@ -27,6 +27,13 @@ Deneb: kzg_proof: $ref: '../primitive.yaml#/KZGProof' + SignedBlindedBlobSidecars: + type: array + items: + $ref: '#/Deneb/SignedBlindedBlobSidecar' + minItems: 0 + maxItems: 4 + SignedBlindedBlobSidecar: type: object description: "A variant of the `SignedBlobSidecar` object envelope from the CL Deneb spec, which contains a `BlindedBlobSidecar` rather than a `BlobSidecar`." diff --git a/types/deneb/block_contents.yaml b/types/deneb/block_contents.yaml index df69a99b..059a659b 100644 --- a/types/deneb/block_contents.yaml +++ b/types/deneb/block_contents.yaml @@ -12,7 +12,26 @@ Deneb: type: object description: "The required object for blinded block production according to the Deneb CL spec." properties: - block: + blinded_block: $ref: "./block.yaml#/Deneb/BlindedBeaconBlock" blinded_blob_sidecars: $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" + + SignedBlockContents: + type: object + description: "The required signed components of block production according to the Deneb CL spec." + properties: + signed_block: + $ref: "./block.yaml#/Deneb/SignedBeaconBlock" + signed_blinded_blob_sidecars: + $ref: "./blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecars" + + SignedBlindedBlockContents: + type: object + description: "The required signed components of block production according to the Deneb CL spec." + properties: + signed_blinded_block: + $ref: "./block.yaml#/Deneb/SignedBlindedBeaconBlock" + signed_blinded_blob_sidecars: + $ref: "./blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecars" + \ No newline at end of file From a630ac87df9de4fbe62d783d0084776970a1cf0e Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 7 Mar 2023 20:42:12 -0500 Subject: [PATCH 11/15] Fix references to block contents and add to description in the block publish endpoint --- apis/beacon/blocks/blinded_blocks.yaml | 3 ++- apis/beacon/blocks/blocks.yaml | 3 ++- beacon-node-oapi.yaml | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apis/beacon/blocks/blinded_blocks.yaml b/apis/beacon/blocks/blinded_blocks.yaml index feeb8038..23748c99 100644 --- a/apis/beacon/blocks/blinded_blocks.yaml +++ b/apis/beacon/blocks/blinded_blocks.yaml @@ -13,7 +13,8 @@ post: successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept - a `SignedBeaconBlock`. + a `SignedBeaconBlock`. After Deneb, this additionally instructs the beacon node to broadcast all given + signed blobs. parameters: - in: header schema: diff --git a/apis/beacon/blocks/blocks.yaml b/apis/beacon/blocks/blocks.yaml index 77095ad7..18be883f 100644 --- a/apis/beacon/blocks/blocks.yaml +++ b/apis/beacon/blocks/blocks.yaml @@ -11,7 +11,8 @@ post: The beacon node is also expected to integrate the block into state, but may broadcast it before doing so, so as to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was - successfully broadcast but failed integration. + successfully broadcast but failed integration. After Deneb, this additionally instructs + the beacon node to broadcast all given signed blobs. parameters: - in: header schema: diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 26b1605a..7b17cbb7 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -349,8 +349,12 @@ components: $ref: './types/deneb/block_contents.yaml#/Deneb/BlockContents' Deneb.SignedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBeaconBlock' + Deneb.SignedBlockContents: + $ref: './types/deneb/block_contents.yaml#/Deneb/SignedBlockContents' Deneb.BlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock' + Deneb.SignedBlindedBlockContents: + $ref: './types/deneb/block_contents.yaml#/Deneb/SignedBlindedBlockContents' Deneb.BlindedBlockContents: $ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents' Deneb.SignedBlindedBeaconBlock: From 1a9034c002d9a8fab3050f419022afe60fb90a4c Mon Sep 17 00:00:00 2001 From: realbigsean Date: Wed, 8 Mar 2023 18:03:44 -0500 Subject: [PATCH 12/15] Unblind blobs in default flow --- apis/beacon/blobs/post_blobs.yaml | 54 ------------------------------- beacon-node-oapi.yaml | 6 ++++ types/deneb/blob_sidecar.yaml | 46 +++++++++++++++++++++++++- types/deneb/block_contents.yaml | 8 ++--- 4 files changed, 55 insertions(+), 59 deletions(-) delete mode 100644 apis/beacon/blobs/post_blobs.yaml diff --git a/apis/beacon/blobs/post_blobs.yaml b/apis/beacon/blobs/post_blobs.yaml deleted file mode 100644 index ae568f30..00000000 --- a/apis/beacon/blobs/post_blobs.yaml +++ /dev/null @@ -1,54 +0,0 @@ -post: - tags: - - Beacon - - ValidatorRequiredApi - summary: "Publish a signed blob." - operationId: "publishBlob" - description: | - Instructs the beacon node to broadcast a newly signed blob to the beacon network, - to be included in the beacon chain. A success response (20x) indicates that the blob - passed gossip validation and was successfully broadcast onto the network. - The beacon node is also expected to integrate the blob into state once it receives the - corresponding block and any other corresponding blobs, but may broadcast it - before doing so, so as to aid timely delivery of the block and blobs. Should the blob fail full - validation, a separate success response code (202) is used to indicate that the blob was - successfully broadcast but failed integration. - parameters: - - in: header - schema: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' - required: false - name: Eth-Consensus-Version - description: "Version of the blob being submitted, if using SSZ encoding." - requestBody: - description: "A variant of `SignedBlobSidecar` object composed of a `BlindedBlobSidecar` object (produced by beacon node) and validator signature." - required: true - content: - application/json: - schema: - oneOf: - - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.SignedBlindedBlobSidecar" - application/octet-stream: - schema: - description: "SSZ serialized blob sidecar bytes. Use content type header to indicate that SSZ data is contained in the request body." - responses: - "200": - description: "The blob was validated successfully and has been broadcast. It has also been integrated into the beacon node's database." - "202": - description: "The blob could not be integrated into the beacon node's database as it failed validation, but was successfully broadcast." - "400": - description: "The `SignedBlobSidecar` object is invalid and could not be broadcast" - content: - application/json: - schema: - allOf: - - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" - - example: - code: 400 - message: "Invalid blob: missing signature" - "415": - $ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType' - "500": - $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' - "503": - $ref: '../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing' diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 24102490..62ee52b6 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -366,6 +366,12 @@ components: $ref: './types/deneb/block_contents.yaml#/Deneb/BlindedBlockContents' Deneb.SignedBlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' + Blob: + $ref: './types/primitive.yaml#/Blob' + Deneb.BlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar' + Deneb.SignedBlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlobSidecar' Deneb.BlindedBlobSidecar: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlindedBlobSidecar' Deneb.SignedBlindedBlobSidecar: diff --git a/types/deneb/blob_sidecar.yaml b/types/deneb/blob_sidecar.yaml index b6ea9741..9fd0e511 100644 --- a/types/deneb/blob_sidecar.yaml +++ b/types/deneb/blob_sidecar.yaml @@ -1,4 +1,48 @@ Deneb: + BlobSidecars: + type: array + items: + $ref: '#/Deneb/BlobSidecar' + minItems: 0 + maxItems: 4 + + BlobSidecar: + type: object + description: "A blob sidecar as defined in the Deneb consensus spec." + properties: + block_root: + $ref: "../primitive.yaml#/Root" + index: + $ref: "../primitive.yaml#/Uint64" + slot: + $ref: "../primitive.yaml#/Uint64" + block_parent_root: + $ref: "../primitive.yaml#/Root" + proposer_index: + $ref: "../primitive.yaml#/Uint64" + blob: + $ref: "../primitive.yaml#/Blob" + kzg_commitment: + $ref: '../primitive.yaml#/KZGCommitment' + kzg_proof: + $ref: '../primitive.yaml#/KZGProof' + + SignedBlobSidecars: + type: array + items: + $ref: '#/Deneb/SignedBlobSidecar' + minItems: 0 + maxItems: 4 + + SignedBlobSidecar: + type: object + description: "The `SignedBlobSidecar` object envelope from the CL Deneb spec." + properties: + message: + $ref: "#/Deneb/BlobSidecar" + signature: + $ref: "../primitive.yaml#/Signature" + BlindedBlobSidecars: type: array items: @@ -24,7 +68,7 @@ Deneb: $ref: "../primitive.yaml#/Root" kzg_commitment: $ref: '../primitive.yaml#/KZGCommitment' - kzg_proof: + kzg_proof: $ref: '../primitive.yaml#/KZGProof' SignedBlindedBlobSidecars: diff --git a/types/deneb/block_contents.yaml b/types/deneb/block_contents.yaml index 059a659b..1fa4fddf 100644 --- a/types/deneb/block_contents.yaml +++ b/types/deneb/block_contents.yaml @@ -5,8 +5,8 @@ Deneb: properties: block: $ref: "./block.yaml#/Deneb/BeaconBlock" - blinded_blob_sidecars: - $ref: "./blob_sidecar.yaml#/Deneb/BlindedBlobSidecars" + blob_sidecars: + $ref: "./blob_sidecar.yaml#/Deneb/BlobSidecars" BlindedBlockContents: type: object @@ -23,8 +23,8 @@ Deneb: properties: signed_block: $ref: "./block.yaml#/Deneb/SignedBeaconBlock" - signed_blinded_blob_sidecars: - $ref: "./blob_sidecar.yaml#/Deneb/SignedBlindedBlobSidecars" + signed_blob_sidecars: + $ref: "./blob_sidecar.yaml#/Deneb/SignedBlobSidecars" SignedBlindedBlockContents: type: object From 605dd8406742d7cef45a8095035f6c8671f0d63a Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 12 May 2023 10:19:32 -0400 Subject: [PATCH 13/15] Update types/deneb/block.yaml --- types/deneb/block.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/deneb/block.yaml b/types/deneb/block.yaml index 68adab3c..4a6bf653 100644 --- a/types/deneb/block.yaml +++ b/types/deneb/block.yaml @@ -52,7 +52,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/deneb/beacon-chain.md#beaconblock) object from the CL Deneb spec." allOf: - $ref: '../altair/block.yaml#/Altair/BeaconBlockCommon' - type: object From 23b236af1e99ba90ca339a7ab8076dbb2a5724a7 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 12 May 2023 10:23:51 -0400 Subject: [PATCH 14/15] remove duplicates in beacon-node-oapi.yaml --- beacon-node-oapi.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 9faec17f..a046dc02 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -352,16 +352,6 @@ components: $ref: './types/capella/light_client.yaml#/Capella/LightClientFinalityUpdate' Capella.LightClientOptimisticUpdate: $ref: './types/capella/light_client.yaml#/Capella/LightClientOptimisticUpdate' - Deneb.BeaconState: - $ref: './types/deneb/state.yaml#/Deneb/BeaconState' - Deneb.BeaconBlock: - $ref: './types/deneb/block.yaml#/Deneb/BeaconBlock' - Deneb.SignedBeaconBlock: - $ref: './types/deneb/block.yaml#/Deneb/SignedBeaconBlock' - Deneb.BlindedBeaconBlock: - $ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock' - Deneb.SignedBlindedBeaconBlock: - $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' Capella.Withdrawal: $ref: './types/withdrawal.yaml#/Withdrawal' Deneb.BeaconState: From f7b11f6532c58418e0078f997c5e36c6c62cbe6e Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 17 May 2023 07:38:17 +1000 Subject: [PATCH 15/15] added changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 7266ce9e..bee60b95 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ There are likely to be descriptions etc outside of the list below, but new query | [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v2/beacon/blocks/{block_id}` added `deneb` block to response | | | | | | | [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v1/validator/blinded_blocks/{slot}` added `deneb` blinded block | | | | | | | [#289](https://github.com/ethereum/beacon-APIs/pull/289) `/eth/v1/validator/blocks/{slot}` added `deneb` block | | | | | | +| [#302](https://github.com/ethereum/beacon-APIs/pull/302) Added `BlockContents` structures for `deneb` blocks and blob_sidecars | | | | | | The Following are no longer in the Standard API, removed since the latest version.