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 85a715de63134e7feaa18c83b93ec3eb0b3557fd Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Mon, 9 Jan 2023 22:28:25 +1100 Subject: [PATCH 02/15] Add getBlobsSidecar endpoint --- apis/beacon/blobs_sidecars/blobs_sidecar.yaml | 48 +++++++++++++++++++ beacon-node-oapi.yaml | 4 ++ types/blobs_sidecar.yaml | 28 +++++++++++ types/eip4844/block_and_blobs_sidecar.yaml | 29 ----------- 4 files changed, 80 insertions(+), 29 deletions(-) create mode 100644 apis/beacon/blobs_sidecars/blobs_sidecar.yaml create mode 100644 types/blobs_sidecar.yaml delete mode 100644 types/eip4844/block_and_blobs_sidecar.yaml diff --git a/apis/beacon/blobs_sidecars/blobs_sidecar.yaml b/apis/beacon/blobs_sidecars/blobs_sidecar.yaml new file mode 100644 index 00000000..acc00e8f --- /dev/null +++ b/apis/beacon/blobs_sidecars/blobs_sidecar.yaml @@ -0,0 +1,48 @@ +get: + operationId: getBlobsSidecar + summary: Get blobs sidecar + description: | + Retrieves blobs sidecar for given block id. + Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ + tags: + - Beacon + parameters: + - name: block_id + in: path + required: true + $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' + responses: + "200": + description: "Successful response" + content: + application/json: + schema: + title: GetBlobsSidecarResponse + type: object + properties: + data: + oneOf: + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/BlobsSidecar" + application/octet-stream: + schema: + description: "SSZ serialized block bytes. Use Accept header to choose this response type" + "400": + description: "The block ID supplied could not be parsed" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + example: + code: 400 + message: "Invalid block ID: current" + "404": + description: "Blob sidecar not found" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + example: + code: 404 + message: "Blob sidecar not found" + "500": + $ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 6854fa42..21783e8d 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -95,6 +95,8 @@ paths: $ref: "./apis/beacon/blocks/root.yaml" /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" + /eth/v1/beacon/blobs_sidecars/{block_id}: + $ref: "./apis/beacon/blobs_sidecars/blobs_sidecar.yaml" /eth/v1/beacon/rewards/sync_committee/{block_id}: $ref: "./apis/beacon/rewards/sync_committee.yaml" /eth/v1/beacon/deposit_snapshot: @@ -198,6 +200,8 @@ components: $ref: './types/state.yaml#/BeaconState' BeaconBlock: $ref: './types/block.yaml#/BeaconBlock' + BlobsSidecar: + $ref: './types/blobs_sidecar.yaml#/BlobsSidecar' DepositSnapshotResponse: $ref: './types/api.yaml#/DepositSnapshotResponse' SignedBeaconBlock: diff --git a/types/blobs_sidecar.yaml b/types/blobs_sidecar.yaml new file mode 100644 index 00000000..ace362d9 --- /dev/null +++ b/types/blobs_sidecar.yaml @@ -0,0 +1,28 @@ +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: "#/Blob" + kzg_aggregated_proof: + $ref: "#/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/block_and_blobs_sidecar.yaml b/types/eip4844/block_and_blobs_sidecar.yaml deleted file mode 100644 index b65d24d2..00000000 --- a/types/eip4844/block_and_blobs_sidecar.yaml +++ /dev/null @@ -1,29 +0,0 @@ -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" From fd02cd2adceecbb966b76d91cb889b4ea05a214f Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 18 Jan 2023 16:19:14 +1000 Subject: [PATCH 03/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 ca3dd1b39c3d6b57f5581ea356b035adde41905c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 19 Jan 2023 23:24:12 +1100 Subject: [PATCH 04/15] Remove `_sidecar` from blobs endpoint path. Add endpoint to CHANGES.md --- CHANGES.md | 47 ++++++++++--------- .../blobs_sidecar.yaml | 0 beacon-node-oapi.yaml | 4 +- 3 files changed, 26 insertions(+), 25 deletions(-) rename apis/beacon/{blobs_sidecars => blobs}/blobs_sidecar.yaml (100%) diff --git a/CHANGES.md b/CHANGES.md index c21f3cc8..a37d5908 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,29 +7,30 @@ These endpoints have been added or updated since the last release. There are likely to be descriptions etc outside of the list below, but new query parameters, changes to headers, new endpoints should be listed. -| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) | -|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| -| [#131](https://github.com/ethereum/beacon-APIs/pull/131) [#254](https://github.com/ethereum/beacon-APIs/pull/254) NEW `/eth/v1/validator/liveness/{epoch}` | | | | | | -| [#221](https://github.com/ethereum/beacon-APIs/pull/221) `/eth/v1/validator/blinded_blocks/{slot}` added header `ethConsensusVersion` | | | | | | -| [#232](https://github.com/ethereum/beacon-APIs/pull/232) NEW `/eth/v1/debug/fork_choice` | | | | | | -| [#241](https://github.com/ethereum/beacon-APIs/pull/241) NEW `/eth/v1/beacon/blinded_blocks/{block_id}` | | | | | | -| [#242](https://github.com/ethereum/beacon-APIs/pull/242) NEW `/eth/v1/beacon/states/{state_id}/randao` | | | | | | -| [#245](https://github.com/ethereum/beacon-APIs/pull/245) NEW `/eth/v1/beacon/deposit_snapshot` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/bootstrap/{block_root}` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/updates` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/updates` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/beacon/light_client/finality_update` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/beacon/light_client/optimistic_update` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/events:light_client_finality_update` | | | | | | -| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/events:light_client_optimistic_update` | | | | | | -| [#248](https://github.com/ethereum/beacon-APIs/pull/248) [#248](https://github.com/ethereum/beacon-APIs/pull/248) NEW `/eth/v1/beacon/pool/bls_to_execution_changes` | | | | | | -| [#248](https://github.com/ethereum/beacon-APIs/pull/248) add _Capella Types_ | | | | | | -| [#249](https://github.com/ethereum/beacon-APIs/pull/249) `/eth/v1/beacon/blinded_blocks/{block_id}` query parameter `skip_randao_verification` | | | | | | -| [#251](https://github.com/ethereum/beacon-APIs/pull/251) `/eth/v1/node/health` query parameter `syncing_status` | | | | | | -| [#254](https://github.com/ethereum/beacon-APIs/pull/254) add `finalized` to metadata for chain objects | | | | | | -| [#260](https://github.com/ethereum/beacon-APIs/pull/260) NEW `/eth/v1/beacon/rewards/blocks/{block_id}` | | | | | | -| [#260](https://github.com/ethereum/beacon-APIs/pull/260) NEW `/eth/v1/beacon/rewards/attestations/{epoch}` | | | | | | -| [#262](https://github.com/ethereum/beacon-APIs/pull/262) NEW `/eth/v1/beacon/rewards/sync_committee/{block_id}` | | | | | | +| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| +| [#131](https://github.com/ethereum/beacon-APIs/pull/131) [#254](https://github.com/ethereum/beacon-APIs/pull/254) NEW `/eth/v1/validator/liveness/{epoch}` | | | | | | +| [#221](https://github.com/ethereum/beacon-APIs/pull/221) `/eth/v1/validator/blinded_blocks/{slot}` added header `ethConsensusVersion` | | | | | | +| [#232](https://github.com/ethereum/beacon-APIs/pull/232) NEW `/eth/v1/debug/fork_choice` | | | | | | +| [#241](https://github.com/ethereum/beacon-APIs/pull/241) NEW `/eth/v1/beacon/blinded_blocks/{block_id}` | | | | | | +| [#242](https://github.com/ethereum/beacon-APIs/pull/242) NEW `/eth/v1/beacon/states/{state_id}/randao` | | | | | | +| [#245](https://github.com/ethereum/beacon-APIs/pull/245) NEW `/eth/v1/beacon/deposit_snapshot` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/bootstrap/{block_root}` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/updates` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v2/beacon/light_client/updates` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/beacon/light_client/finality_update` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/beacon/light_client/optimistic_update` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/events:light_client_finality_update` | | | | | | +| [#247](https://github.com/ethereum/beacon-APIs/pull/247) NEW `/eth/v1/events:light_client_optimistic_update` | | | | | | +| [#248](https://github.com/ethereum/beacon-APIs/pull/248) [#248](https://github.com/ethereum/beacon-APIs/pull/248) NEW `/eth/v1/beacon/pool/bls_to_execution_changes` | | | | | | +| [#248](https://github.com/ethereum/beacon-APIs/pull/248) add _Capella Types_ | | | | | | +| [#249](https://github.com/ethereum/beacon-APIs/pull/249) `/eth/v1/beacon/blinded_blocks/{block_id}` query parameter `skip_randao_verification` | | | | | | +| [#251](https://github.com/ethereum/beacon-APIs/pull/251) `/eth/v1/node/health` query parameter `syncing_status` | | | | | | +| [#254](https://github.com/ethereum/beacon-APIs/pull/254) add `finalized` to metadata for chain objects | | | | | | +| [#260](https://github.com/ethereum/beacon-APIs/pull/260) NEW `/eth/v1/beacon/rewards/blocks/{block_id}` | | | | | | +| [#260](https://github.com/ethereum/beacon-APIs/pull/260) NEW `/eth/v1/beacon/rewards/attestations/{epoch}` | | | | | | +| [#262](https://github.com/ethereum/beacon-APIs/pull/262) NEW `/eth/v1/beacon/rewards/sync_committee/{block_id}` | | | | | | +| [#286](https://github.com/ethereum/beacon-APIs/pull/286) NEW `/eth/v1/beacon/blobs/{block_id}` | | | | | | The Following are no longer in the Standard API, removed since the latest version. diff --git a/apis/beacon/blobs_sidecars/blobs_sidecar.yaml b/apis/beacon/blobs/blobs_sidecar.yaml similarity index 100% rename from apis/beacon/blobs_sidecars/blobs_sidecar.yaml rename to apis/beacon/blobs/blobs_sidecar.yaml diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 21783e8d..693387f5 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -95,8 +95,8 @@ paths: $ref: "./apis/beacon/blocks/root.yaml" /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" - /eth/v1/beacon/blobs_sidecars/{block_id}: - $ref: "./apis/beacon/blobs_sidecars/blobs_sidecar.yaml" + /eth/v1/beacon/blobs/{block_id}: + $ref: "./apis/beacon/blobs/blobs_sidecar.yaml" /eth/v1/beacon/rewards/sync_committee/{block_id}: $ref: "./apis/beacon/rewards/sync_committee.yaml" /eth/v1/beacon/deposit_snapshot: From 709ccd6592f76d3f92a0f850534a8cd54dd7adaf Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 8 Feb 2023 12:58:22 +1000 Subject: [PATCH 05/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 30b2d053cc0e4ecc7743ba81fba0be69365c0b5a Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 24 Feb 2023 23:22:47 +1100 Subject: [PATCH 06/15] Update endpoint to return `BlobSidecar` container from latest CL spec --- .../blobs/{blobs_sidecar.yaml => blobs.yaml} | 16 +++++++---- beacon-node-oapi.yaml | 6 ++-- types/blobs_sidecar.yaml | 28 ------------------- types/deneb/blob_sidecar.yaml | 21 ++++++++++++++ types/primitive.yaml | 12 ++++++++ 5 files changed, 46 insertions(+), 37 deletions(-) rename apis/beacon/blobs/{blobs_sidecar.yaml => blobs.yaml} (78%) delete mode 100644 types/blobs_sidecar.yaml create mode 100644 types/deneb/blob_sidecar.yaml diff --git a/apis/beacon/blobs/blobs_sidecar.yaml b/apis/beacon/blobs/blobs.yaml similarity index 78% rename from apis/beacon/blobs/blobs_sidecar.yaml rename to apis/beacon/blobs/blobs.yaml index acc00e8f..c6e2d0d6 100644 --- a/apis/beacon/blobs/blobs_sidecar.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -1,8 +1,8 @@ get: - operationId: getBlobsSidecar - summary: Get blobs sidecar + operationId: getBlobs + summary: Get blobs description: | - Retrieves blobs sidecar for given block id. + Retrieves blobs for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ tags: - Beacon @@ -17,12 +17,16 @@ get: content: application/json: schema: - title: GetBlobsSidecarResponse + title: GetBlobsResponse type: object properties: data: - oneOf: - - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/BlobsSidecar" + type: array + items: + oneOf: + - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlobSidecar" + minItems: 0 + maxItems: 4 application/octet-stream: schema: description: "SSZ serialized block bytes. Use Accept header to choose this response type" diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 391574ed..45166181 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -96,7 +96,7 @@ paths: /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" /eth/v1/beacon/blobs/{block_id}: - $ref: "./apis/beacon/blobs/blobs_sidecar.yaml" + $ref: "./apis/beacon/blobs/blobs.yaml" /eth/v1/beacon/rewards/sync_committee/{block_id}: $ref: "./apis/beacon/rewards/sync_committee.yaml" /eth/v1/beacon/deposit_snapshot: @@ -204,8 +204,6 @@ components: $ref: './types/state.yaml#/BeaconState' BeaconBlock: $ref: './types/block.yaml#/BeaconBlock' - BlobsSidecar: - $ref: './types/blobs_sidecar.yaml#/BlobsSidecar' DepositSnapshotResponse: $ref: './types/api.yaml#/DepositSnapshotResponse' SignedBeaconBlock: @@ -355,6 +353,8 @@ components: $ref: './types/deneb/block.yaml#/Deneb/BlindedBeaconBlock' Deneb.SignedBlindedBeaconBlock: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' + Deneb.BlobSidecar: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/blobs_sidecar.yaml b/types/blobs_sidecar.yaml deleted file mode 100644 index ace362d9..00000000 --- a/types/blobs_sidecar.yaml +++ /dev/null @@ -1,28 +0,0 @@ -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: "#/Blob" - kzg_aggregated_proof: - $ref: "#/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/deneb/blob_sidecar.yaml b/types/deneb/blob_sidecar.yaml new file mode 100644 index 00000000..f0f0a241 --- /dev/null +++ b/types/deneb/blob_sidecar.yaml @@ -0,0 +1,21 @@ +Deneb: + BlobSidecar: + type: object + description: "The `BlobSidecar` object from the Deneb CL 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' diff --git a/types/primitive.yaml b/types/primitive.yaml index 85334f5a..d3cdede3 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 1d8e59965f2a2a2c95c88113b87447ad2d680697 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 24 Feb 2023 23:28:26 +1100 Subject: [PATCH 07/15] Add recommendation to do blob retrieval by slot --- apis/beacon/blobs/blobs.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blobs/blobs.yaml index c6e2d0d6..2eefe794 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -3,7 +3,8 @@ get: summary: Get blobs description: | Retrieves blobs for a given block id. - Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ + Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. + It is recommended that blob retrieval for finalized blocks should by done by slot else the underlying index might not be available. tags: - Beacon parameters: From 27ac4b8e5486ab00efbef142b1ba3e024151d688 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 4 Apr 2023 12:58:24 +1000 Subject: [PATCH 08/15] Add blob indices query paraemter --- apis/beacon/blobs/blobs.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blobs/blobs.yaml index 2eefe794..bc907f68 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -12,6 +12,15 @@ get: in: path required: true $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' + - name: indices + in: query + description: Array of indices for blobs to request for in the specified block. Returns all blobs in the block if not speicfied. + required: false + schema: + type: array + uniqueItems: true + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64' responses: "200": description: "Successful response" From 7ee3525ed727124f939d969f52fae836c2b8bc9c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 3 May 2023 15:30:52 +1000 Subject: [PATCH 09/15] Remove old block_and_blobs_sidecar type --- types/deneb/block_and_blobs_sidecar.yaml | 29 ------------------------ 1 file changed, 29 deletions(-) delete mode 100644 types/deneb/block_and_blobs_sidecar.yaml 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" From 4ccaaa6f018c596c6ebf1227943da952ed7cf29f Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 5 May 2023 17:29:08 +1000 Subject: [PATCH 10/15] Address review comments. 1. Remove slot lookup recommendation in getBlobs 2. Update getBlobs 404 response description & message 3. Update KZGProof description --- apis/beacon/blobs/blobs.yaml | 5 ++--- types/primitive.yaml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blobs/blobs.yaml index bc907f68..4767a79d 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -4,7 +4,6 @@ get: description: | Retrieves blobs for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. - It is recommended that blob retrieval for finalized blocks should by done by slot else the underlying index might not be available. tags: - Beacon parameters: @@ -50,13 +49,13 @@ get: code: 400 message: "Invalid block ID: current" "404": - description: "Blob sidecar not found" + description: "Block not found" content: application/json: schema: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" example: code: 404 - message: "Blob sidecar not found" + message: "Block not found" "500": $ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" diff --git a/types/primitive.yaml b/types/primitive.yaml index d3cdede3..65fe7dde 100644 --- a/types/primitive.yaml +++ b/types/primitive.yaml @@ -140,4 +140,4 @@ KZGProof: type: string format: hex pattern: "^0x[a-fA-F0-9]{96}$" - description: "A KZG proof. Same check as `KZGCommitment`" + description: "A G1 curve point. Used for verifying that the `KZGCommitment` for a given `Blob` is correct." From e3dfda2125df409e1fe25fa3ef6299bd5d6a2728 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 11 May 2023 15:38:38 +1000 Subject: [PATCH 11/15] Apply review comment, change RanDAO to RANDAO --- 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 4a6bf653..bbc0f3a6 100644 --- a/types/deneb/block.yaml +++ b/types/deneb/block.yaml @@ -7,7 +7,7 @@ Deneb: randao_reveal: allOf: - $ref: '../primitive.yaml#/Signature' - - description: "The RanDAO reveal value provided by the validator." + - description: "The RANDAO reveal value provided by the validator." eth1_data: $ref: '../eth1.yaml#/Eth1Data' graffiti: From 354ff9fa9b80ff2fd68bc5bfdabe2fe3f85b25f1 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 11 May 2023 15:52:06 +1000 Subject: [PATCH 12/15] Add more details to getBlobs response --- apis/beacon/blobs/blobs.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blobs/blobs.yaml index 4767a79d..89e57943 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -4,6 +4,9 @@ get: description: | Retrieves blobs for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. + + If the `indices` paramneter is specified, only the blobs with the specified indices will be returned. There are no guarantees for the + returned blob sidecars in terms of ordering. tags: - Beacon parameters: @@ -38,7 +41,7 @@ get: maxItems: 4 application/octet-stream: schema: - description: "SSZ serialized block bytes. Use Accept header to choose this response type" + description: "SSZ serialized `BlobSidecars` bytes. Use Accept header to choose this response type" "400": description: "The block ID supplied could not be parsed" content: From df43224dc0dcb0c1547ede89cf4e3eac76a240f1 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 11 May 2023 15:55:05 +1000 Subject: [PATCH 13/15] Update spacing --- apis/beacon/blobs/blobs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blobs/blobs.yaml index 89e57943..3304ea1d 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blobs/blobs.yaml @@ -5,8 +5,8 @@ get: Retrieves blobs for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. - If the `indices` paramneter is specified, only the blobs with the specified indices will be returned. There are no guarantees for the - returned blob sidecars in terms of ordering. + If the `indices` paramneter is specified, only the blobs with the specified indices will be returned. There are no guarantees + for the returned blob sidecars in terms of ordering. tags: - Beacon parameters: From a6d1c360991676c36cc5691a17d8ac1c17813c33 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 17 May 2023 08:55:48 +0800 Subject: [PATCH 14/15] Update getBlobSidecars endpoint path --- CHANGES.md | 2 +- .../blobs.yaml => blob_sidecars/blob_sidecars.yaml} | 10 +++++----- beacon-node-oapi.yaml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) rename apis/beacon/{blobs/blobs.yaml => blob_sidecars/blob_sidecars.yaml} (82%) diff --git a/CHANGES.md b/CHANGES.md index 6a6261b4..a3cbeb8a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,7 +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 | | | | | | -| [#286](https://github.com/ethereum/beacon-APIs/pull/286) NEW `/eth/v1/beacon/blobs/{block_id}` | | | | | | +| [#286](https://github.com/ethereum/beacon-APIs/pull/286) NEW `/eth/v1/beacon/blob_sidecars/{block_id}` | | | | | | | [#319](https://github.com/ethereum/beacon-APIs/pull/319) `/eth/v1/debug/beacon/heads` removed deprecated endpoint | | | | | | | [#302](https://github.com/ethereum/beacon-APIs/pull/302) Added `BlockContents` structures for `deneb` blocks and blob_sidecars | | | | | | diff --git a/apis/beacon/blobs/blobs.yaml b/apis/beacon/blob_sidecars/blob_sidecars.yaml similarity index 82% rename from apis/beacon/blobs/blobs.yaml rename to apis/beacon/blob_sidecars/blob_sidecars.yaml index 3304ea1d..1ad5efa2 100644 --- a/apis/beacon/blobs/blobs.yaml +++ b/apis/beacon/blob_sidecars/blob_sidecars.yaml @@ -1,11 +1,11 @@ get: - operationId: getBlobs - summary: Get blobs + operationId: getBlobSidecars + summary: Get blob sidecars description: | - Retrieves blobs for a given block id. + Retrieves blob sidecars for a given block id. Depending on `Accept` header it can be returned either as json or as bytes serialized by SSZ. - If the `indices` paramneter is specified, only the blobs with the specified indices will be returned. There are no guarantees + If the `indices` paramneter is specified, only the blob sidecars with the specified indices will be returned. There are no guarantees for the returned blob sidecars in terms of ordering. tags: - Beacon @@ -16,7 +16,7 @@ get: $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' - name: indices in: query - description: Array of indices for blobs to request for in the specified block. Returns all blobs in the block if not speicfied. + description: Array of indices for blob sidecars to request for in the specified block. Returns all blob sidecars in the block if not speicfied. required: false schema: type: array diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 2f01bc3c..bdcbf7a6 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -101,8 +101,8 @@ paths: $ref: "./apis/beacon/blocks/root.yaml" /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" - /eth/v1/beacon/blobs/{block_id}: - $ref: "./apis/beacon/blobs/blobs.yaml" + /eth/v1/beacon/blob_sidecars/{block_id}: + $ref: "./apis/beacon/blob_sidecars/blob_sidecars.yaml" /eth/v1/beacon/rewards/sync_committee/{block_id}: $ref: "./apis/beacon/rewards/sync_committee.yaml" /eth/v1/beacon/deposit_snapshot: From 096aadc29ab08265d14adfa7a2f652f626194c75 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 17 May 2023 17:57:41 +0800 Subject: [PATCH 15/15] Reuse BlobSidecars type in getBlobSidecars response --- apis/beacon/blob_sidecars/blob_sidecars.yaml | 7 +------ beacon-node-oapi.yaml | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apis/beacon/blob_sidecars/blob_sidecars.yaml b/apis/beacon/blob_sidecars/blob_sidecars.yaml index 1ad5efa2..9d9b4bf3 100644 --- a/apis/beacon/blob_sidecars/blob_sidecars.yaml +++ b/apis/beacon/blob_sidecars/blob_sidecars.yaml @@ -33,12 +33,7 @@ get: type: object properties: data: - type: array - items: - oneOf: - - $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlobSidecar" - minItems: 0 - maxItems: 4 + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Deneb.BlobSidecars" application/octet-stream: schema: description: "SSZ serialized `BlobSidecars` bytes. Use Accept header to choose this response type" diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index bdcbf7a6..9e96d18b 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -374,8 +374,8 @@ components: $ref: './types/deneb/block.yaml#/Deneb/SignedBlindedBeaconBlock' Blob: $ref: './types/primitive.yaml#/Blob' - Deneb.BlobSidecar: - $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecar' + Deneb.BlobSidecars: + $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecars' Deneb.SignedBlobSidecar: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/SignedBlobSidecar' Deneb.BlindedBlobSidecar: