From ce9248fd414e175744de8ffc8e4284abde800bbf Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 24 May 2024 16:18:05 +0200 Subject: [PATCH 01/19] update attestation APIs to support EIP-7549 --- apis/beacon/blocks/attestations.yaml | 7 ++++++- apis/beacon/pool/attestations.yaml | 7 ++++++- apis/beacon/pool/attester_slashings.yaml | 11 ++++++++-- beacon-node-oapi.yaml | 8 ++++++-- types/attestation.yaml | 25 ++++------------------- types/attestation_data.yaml | 16 +++++++++++++++ types/electra/attestation.yaml | 26 +++++++++++++++++++----- types/electra/attester_slashing.yaml | 10 +++++++++ 8 files changed, 78 insertions(+), 32 deletions(-) create mode 100644 types/attestation_data.yaml create mode 100644 types/electra/attester_slashing.yaml diff --git a/apis/beacon/blocks/attestations.yaml b/apis/beacon/blocks/attestations.yaml index 7bf1e089..ab968268 100644 --- a/apis/beacon/blocks/attestations.yaml +++ b/apis/beacon/blocks/attestations.yaml @@ -13,6 +13,9 @@ get: responses: "200": description: Success + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -27,7 +30,9 @@ get: data: type: array items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + oneOf: + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' "400": description: "The block ID supplied could not be parsed" content: diff --git a/apis/beacon/pool/attestations.yaml b/apis/beacon/pool/attestations.yaml index 1748b42f..83a37fdf 100644 --- a/apis/beacon/pool/attestations.yaml +++ b/apis/beacon/pool/attestations.yaml @@ -18,6 +18,9 @@ get: responses: "200": description: Successful response + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -28,7 +31,9 @@ get: data: type: array items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + oneOf: + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' "400": description: "The slot or committee index could not be parsed" content: diff --git a/apis/beacon/pool/attester_slashings.yaml b/apis/beacon/pool/attester_slashings.yaml index f21591c8..545d7265 100644 --- a/apis/beacon/pool/attester_slashings.yaml +++ b/apis/beacon/pool/attester_slashings.yaml @@ -7,6 +7,9 @@ get: responses: "200": description: Successful response + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -17,7 +20,9 @@ get: data: type: array items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + oneOf: + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' "500": $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' @@ -32,7 +37,9 @@ post: content: application/json: schema: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + oneOf: + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' responses: "200": description: Success diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index d7bcc56f..f6927b46 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -231,6 +231,8 @@ components: $ref: './types/api.yaml#/Committee' AttesterSlashing: $ref: './types/attester_slashing.yaml#/AttesterSlashing' + Electra.AttesterSlashing: + $ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing' ProposerSlashing: $ref: './types/proposer_slashing.yaml#/ProposerSlashing' SignedVoluntaryExit: @@ -247,8 +249,10 @@ components: $ref: './types/validator.yaml#/SignedAggregateAndProof' Attestation: $ref: './types/attestation.yaml#/Attestation' + Electra.Attestation: + $ref: './types/electra/attestation.yaml#/Electra/Attestation' AttestationData: - $ref: './types/attestation.yaml#/AttestationData' + $ref: './types/attestation_data.yaml#/AttestationData' BeaconCommitteeSelection: $ref: './types/selection.yaml#/BeaconCommitteeSelection' SyncCommitteeSelection: @@ -331,7 +335,7 @@ components: $ref: './types/bellatrix/block.yaml#/Bellatrix/SignedBlindedBeaconBlock' ConsensusVersion: type: string - enum: [phase0, altair, bellatrix, capella, deneb] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" SignedValidatorRegistration: $ref: './types/registration.yaml#/SignedValidatorRegistration' diff --git a/types/attestation.yaml b/types/attestation.yaml index 747e0e37..a71b07b6 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -12,7 +12,7 @@ IndexedAttestation: $ref: './primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." data: - $ref: './attestation.yaml#/AttestationData' + $ref: './attestation_data.yaml#/AttestationData' Attestation: type: object @@ -26,7 +26,7 @@ Attestation: $ref: './primitive.yaml#/Signature' description: "BLS aggregate signature." data: - $ref: './attestation.yaml#/AttestationData' + $ref: './attestation_data.yaml#/AttestationData' PendingAttestation: type: object @@ -37,25 +37,8 @@ PendingAttestation: $ref: "./primitive.yaml#/BitList" description: "Attester aggregation bits." data: - $ref: '#/AttestationData' + $ref: './attestation_data.yaml#/AttestationData' inclusion_delay: $ref: "./primitive.yaml#/Uint64" proposer_index: - $ref: "./primitive.yaml#/Uint64" - -AttestationData: - type: object - description: "The [`AttestationData`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#attestationdata) object from the CL spec." - required: [slot, index, beacon_block_root, source, target] - properties: - slot: - $ref: "./primitive.yaml#/Uint64" - index: - $ref: "./primitive.yaml#/Uint64" - beacon_block_root: - $ref: './primitive.yaml#/Root' - description: "LMD GHOST vote." - source: - $ref: "./misc.yaml#/Checkpoint" - target: - $ref: "./misc.yaml#/Checkpoint" + $ref: "./primitive.yaml#/Uint64" \ No newline at end of file diff --git a/types/attestation_data.yaml b/types/attestation_data.yaml new file mode 100644 index 00000000..d8e42d3f --- /dev/null +++ b/types/attestation_data.yaml @@ -0,0 +1,16 @@ +AttestationData: + type: object + description: "The [`AttestationData`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#attestationdata) object from the CL spec." + required: [slot, index, beacon_block_root, source, target] + properties: + slot: + $ref: "./primitive.yaml#/Uint64" + index: + $ref: "./primitive.yaml#/Uint64" + beacon_block_root: + $ref: './primitive.yaml#/Root' + description: "LMD GHOST vote." + source: + $ref: "./misc.yaml#/Checkpoint" + target: + $ref: "./misc.yaml#/Checkpoint" \ No newline at end of file diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 2ad061b6..c86c7fc2 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -1,18 +1,34 @@ Electra: + IndexedAttestation: + type: object + description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." + properties: + attesting_indices: + type: array + maxItems: 131072 + description: "Attesting validator indices" + items: + $ref: "../primitive.yaml#/Uint64" + signature: + $ref: '../primitive.yaml#/Signature' + description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." + data: + $ref: '../attestation_data.yaml#/AttestationData' + Attestation: type: object - description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#attestation) object from the CL spec." - required: [aggregation_bits, data, signature, committee_bits] + description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#attestation) object from the CL spec." + required: [aggregation_bits, signature, data] properties: aggregation_bits: $ref: "../primitive.yaml#/BitList" description: "Attester aggregation bits." data: - $ref: "../attestation.yaml#/AttestationData" + $ref: '../attestation_data.yaml#/AttestationData' signature: - $ref: "../primitive.yaml#/Signature" + $ref: '../primitive.yaml#/Signature' description: "BLS aggregate signature." committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." - example: "0x0000000000000000000000000000000000000000000000000000000000000001" + example: "0x000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/types/electra/attester_slashing.yaml b/types/electra/attester_slashing.yaml new file mode 100644 index 00000000..21e51b6b --- /dev/null +++ b/types/electra/attester_slashing.yaml @@ -0,0 +1,10 @@ +Electra: + AttesterSlashing: + type: object + description: "The [`AttesterSlashing`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#attesterslashing) object from the CL spec." + required: [attestation_1, attestation_2] + properties: + attestation_1: + $ref: './attestation.yaml#/Electra/IndexedAttestation' + attestation_2: + $ref: './attestation.yaml#/Electra/IndexedAttestation' From f65f53718af4e94d8922eaaa131083a70186adf7 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Mon, 27 May 2024 11:13:43 +0200 Subject: [PATCH 02/19] fix attestations array shcema --- apis/beacon/blocks/attestations.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apis/beacon/blocks/attestations.yaml b/apis/beacon/blocks/attestations.yaml index ab968268..3c26d37e 100644 --- a/apis/beacon/blocks/attestations.yaml +++ b/apis/beacon/blocks/attestations.yaml @@ -28,11 +28,13 @@ get: finalized: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" data: - type: array - items: - oneOf: - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + oneOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' "400": description: "The block ID supplied could not be parsed" content: From e48a7e7851dd3dc59f7ce0a2e73736729660f8bc Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Mon, 27 May 2024 12:36:01 +0200 Subject: [PATCH 03/19] fix one of array item schemas --- apis/beacon/pool/attestations.yaml | 12 +++++++----- apis/beacon/pool/attester_slashings.yaml | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apis/beacon/pool/attestations.yaml b/apis/beacon/pool/attestations.yaml index 83a37fdf..395dc6ed 100644 --- a/apis/beacon/pool/attestations.yaml +++ b/apis/beacon/pool/attestations.yaml @@ -29,11 +29,13 @@ get: required: [data] properties: data: - type: array - items: - oneOf: - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + oneOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' "400": description: "The slot or committee index could not be parsed" content: diff --git a/apis/beacon/pool/attester_slashings.yaml b/apis/beacon/pool/attester_slashings.yaml index 545d7265..9ccb69ae 100644 --- a/apis/beacon/pool/attester_slashings.yaml +++ b/apis/beacon/pool/attester_slashings.yaml @@ -18,11 +18,13 @@ get: required: [data] properties: data: - type: array - items: - oneOf: - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' + oneOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' "500": $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' From 24e9251dba179777f2682c547c03f5973a2fb454 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 28 May 2024 09:43:12 +0200 Subject: [PATCH 04/19] use anyOf instead of oneOf --- apis/beacon/blocks/attestations.yaml | 2 +- apis/beacon/pool/attestations.yaml | 2 +- apis/beacon/pool/attester_slashings.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apis/beacon/blocks/attestations.yaml b/apis/beacon/blocks/attestations.yaml index 3c26d37e..2833f8aa 100644 --- a/apis/beacon/blocks/attestations.yaml +++ b/apis/beacon/blocks/attestations.yaml @@ -28,7 +28,7 @@ get: finalized: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" data: - oneOf: + anyOf: - type: array items: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' diff --git a/apis/beacon/pool/attestations.yaml b/apis/beacon/pool/attestations.yaml index 395dc6ed..ce01b251 100644 --- a/apis/beacon/pool/attestations.yaml +++ b/apis/beacon/pool/attestations.yaml @@ -29,7 +29,7 @@ get: required: [data] properties: data: - oneOf: + anyOf: - type: array items: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' diff --git a/apis/beacon/pool/attester_slashings.yaml b/apis/beacon/pool/attester_slashings.yaml index 9ccb69ae..1d376250 100644 --- a/apis/beacon/pool/attester_slashings.yaml +++ b/apis/beacon/pool/attester_slashings.yaml @@ -18,7 +18,7 @@ get: required: [data] properties: data: - oneOf: + anyOf: - type: array items: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' @@ -39,7 +39,7 @@ post: content: application/json: schema: - oneOf: + anyOf: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' responses: From fd69e15892363292653e0fe8eb37f3c807f30cc3 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 28 May 2024 14:54:13 +0200 Subject: [PATCH 05/19] bump attestations apis to v2 --- apis/beacon/blocks/attestations.v2.yaml | 61 ++++++++++++++++++++ apis/beacon/blocks/attestations.yaml | 14 ++--- apis/beacon/pool/attester_slashings.yaml | 18 ++---- apis/beacon/pool/attester_slashings_v2.yaml | 62 +++++++++++++++++++++ 4 files changed, 132 insertions(+), 23 deletions(-) create mode 100644 apis/beacon/blocks/attestations.v2.yaml create mode 100644 apis/beacon/pool/attester_slashings_v2.yaml diff --git a/apis/beacon/blocks/attestations.v2.yaml b/apis/beacon/blocks/attestations.v2.yaml new file mode 100644 index 00000000..6aff70bb --- /dev/null +++ b/apis/beacon/blocks/attestations.v2.yaml @@ -0,0 +1,61 @@ +get: + operationId: getBlockAttestationsV2 + summary: Get block attestations + description: Retrieves attestation included in requested block. + tags: + - Beacon + parameters: + - name: block_id + in: path + required: true + $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' + + responses: + "200": + description: Success + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' + content: + application/json: + schema: + title: GetBlockAttestationsV2Response + type: object + required: [execution_optimistic, finalized, data] + properties: + version: + type: string + enum: [phase0, altair, bellatrix, capella, deneb, electra] + example: "phase0" + execution_optimistic: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" + finalized: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" + data: + anyOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + "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: "Block not found" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + example: + code: 404 + message: "Block not found" + "500": + $ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" diff --git a/apis/beacon/blocks/attestations.yaml b/apis/beacon/blocks/attestations.yaml index 2833f8aa..23e165f6 100644 --- a/apis/beacon/blocks/attestations.yaml +++ b/apis/beacon/blocks/attestations.yaml @@ -1,6 +1,7 @@ get: operationId: getBlockAttestations summary: Get block attestations + deprecated: true description: Retrieves attestation included in requested block. tags: - Beacon @@ -13,9 +14,6 @@ get: responses: "200": description: Success - headers: - Eth-Consensus-Version: - $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -28,13 +26,9 @@ get: finalized: $ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" data: - anyOf: - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' "400": description: "The block ID supplied could not be parsed" content: diff --git a/apis/beacon/pool/attester_slashings.yaml b/apis/beacon/pool/attester_slashings.yaml index 1d376250..fc7907ad 100644 --- a/apis/beacon/pool/attester_slashings.yaml +++ b/apis/beacon/pool/attester_slashings.yaml @@ -1,15 +1,13 @@ get: operationId: getPoolAttesterSlashings summary: Get AttesterSlashings from operations pool + deprecated: true description: Retrieves attester slashings known by the node but not necessarily incorporated into any block tags: - Beacon responses: "200": description: Successful response - headers: - Eth-Consensus-Version: - $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -18,13 +16,9 @@ get: required: [data] properties: data: - anyOf: - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' + type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' "500": $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' @@ -39,9 +33,7 @@ post: content: application/json: schema: - anyOf: - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' - - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' responses: "200": description: Success diff --git a/apis/beacon/pool/attester_slashings_v2.yaml b/apis/beacon/pool/attester_slashings_v2.yaml new file mode 100644 index 00000000..7a0cc655 --- /dev/null +++ b/apis/beacon/pool/attester_slashings_v2.yaml @@ -0,0 +1,62 @@ +get: + operationId: getPoolAttesterSlashingsV2 + summary: Get AttesterSlashings from operations pool + description: Retrieves attester slashings known by the node but not necessarily incorporated into any block + tags: + - Beacon + responses: + "200": + description: Successful response + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' + content: + application/json: + schema: + title: GetPoolAttesterSlashingsV2Response + type: object + required: [data] + properties: + version: + type: string + enum: [ phase0, altair, bellatrix, capella, deneb, electra ] + example: "phase0" + data: + anyOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' + "500": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' + +post: + operationId: submitPoolAttesterSlashings + summary: Submit AttesterSlashing object to node's pool + description: Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. + tags: + - Beacon + requestBody: + required: true + content: + application/json: + schema: + anyOf: + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' + - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' + responses: + "200": + description: Success + "400": + description: "Invalid attester slashing" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + example: + code: 400 + message: "Invalid attester slashing, it will never pass validation so it's rejected" + "500": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' From 997e21bb41b905299849b803fa4d9aa5d49d3245 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 28 May 2024 15:27:01 +0200 Subject: [PATCH 06/19] add change log entries --- CHANGES.md | 21 +++-- apis/beacon/pool/attestations.v2.yaml | 85 +++++++++++++++++++ apis/beacon/pool/attestations.yaml | 15 ++-- ...ngs_v2.yaml => attester_slashings.v2.yaml} | 2 +- apis/beacon/pool/attester_slashings.yaml | 1 + beacon-node-oapi.yaml | 6 ++ 6 files changed, 111 insertions(+), 19 deletions(-) create mode 100644 apis/beacon/pool/attestations.v2.yaml rename apis/beacon/pool/{attester_slashings_v2.yaml => attester_slashings.v2.yaml} (98%) diff --git a/CHANGES.md b/CHANGES.md index 215a347b..7ca83483 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,15 +24,20 @@ 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) | -|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| -| [#350](https://github.com/ethereum/beacon-APIs/pull/350) `blob_sidecar EVENT` added | | v1.12.0 | | | | -| [#358](https://github.com/ethereum/beacon-APIs/pull/358) `/eth/v3/validator/blocks` added `consensus_block_value` to response | | v1.13.0 | | | | -| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validators` added | | - | | | | -| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validator_balances` added | | - | | | | -| [#376](https://github.com/ethereum/beacon-APIs/pull/376) `proposer_slashing, attester_slashing EVENT` added | | v1.16.0 | | | | +| 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) | +|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| +| [#350](https://github.com/ethereum/beacon-APIs/pull/350) `blob_sidecar EVENT` added | | v1.12.0 | | | | +| [#358](https://github.com/ethereum/beacon-APIs/pull/358) `/eth/v3/validator/blocks` added `consensus_block_value` to response | | v1.13.0 | | | | +| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validators` added | | - | | | | +| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validator_balances` added | | - | | | | +| [#376](https://github.com/ethereum/beacon-APIs/pull/376) `proposer_slashing, attester_slashing EVENT` added | | v1.16.0 | | | | | [#386](https://github.com/ethereum/beacon-APIs/pull/386) `/eth/v3/validator/blocks` added `builder_boost_factor` query parameter | | v1.14.0 | | | | -| [#405](https://github.com/ethereum/beacon-APIs/pull/405) `block_gossip EVENT` added | | - | | | | +| [#405](https://github.com/ethereum/beacon-APIs/pull/405) `block_gossip EVENT` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/blocks/{block_id}/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attester_slashings` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attester_slashings` added | | - | | | | ## Version 2.4.2 diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml new file mode 100644 index 00000000..750ef7f6 --- /dev/null +++ b/apis/beacon/pool/attestations.v2.yaml @@ -0,0 +1,85 @@ +get: + operationId: getPoolAttestationsV2 + summary: Get Attestations from operations pool + description: Retrieves attestations known by the node but not necessarily incorporated into any block + parameters: + - name: slot + in: query + required: false + schema: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64' + - name: committee_index + in: query + required: false + schema: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64' + tags: + - Beacon + responses: + "200": + description: Successful response + headers: + Eth-Consensus-Version: + $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' + content: + application/json: + schema: + title: GetPoolAttestationsV2Response + type: object + required: [data] + properties: + data: + anyOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + "400": + description: "The slot or committee index could not be parsed" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" + example: + code: 400 + message: "Invalid slot: current" + "500": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' + +post: + operationId: submitPoolAttestationsV2 + summary: Submit Attestation objects to node + description: | + Submits Attestation objects to the node. Each attestation in the request body is processed individually. + + If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. + + If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. + tags: + - Beacon + - ValidatorRequiredApi + requestBody: + required: true + content: + application/json: + schema: + anyOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + responses: + "200": + description: Attestations are stored in pool and broadcast on appropriate subnet + "400": + description: "Errors with one or more attestations" + content: + application/json: + schema: + $ref: "../../../beacon-node-oapi.yaml#/components/schemas/IndexedErrorMessage" + "500": + $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' diff --git a/apis/beacon/pool/attestations.yaml b/apis/beacon/pool/attestations.yaml index ce01b251..e047670b 100644 --- a/apis/beacon/pool/attestations.yaml +++ b/apis/beacon/pool/attestations.yaml @@ -1,6 +1,7 @@ get: operationId: getPoolAttestations summary: Get Attestations from operations pool + deprecated: true description: Retrieves attestations known by the node but not necessarily incorporated into any block parameters: - name: slot @@ -18,9 +19,6 @@ get: responses: "200": description: Successful response - headers: - Eth-Consensus-Version: - $ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: @@ -29,13 +27,9 @@ get: required: [data] properties: data: - anyOf: - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' "400": description: "The slot or committee index could not be parsed" content: @@ -51,6 +45,7 @@ get: post: operationId: submitPoolAttestations summary: Submit Attestation objects to node + deprecated: true description: | Submits Attestation objects to the node. Each attestation in the request body is processed individually. diff --git a/apis/beacon/pool/attester_slashings_v2.yaml b/apis/beacon/pool/attester_slashings.v2.yaml similarity index 98% rename from apis/beacon/pool/attester_slashings_v2.yaml rename to apis/beacon/pool/attester_slashings.v2.yaml index 7a0cc655..52f5c557 100644 --- a/apis/beacon/pool/attester_slashings_v2.yaml +++ b/apis/beacon/pool/attester_slashings.v2.yaml @@ -33,7 +33,7 @@ get: $ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' post: - operationId: submitPoolAttesterSlashings + operationId: submitPoolAttesterSlashingsV2 summary: Submit AttesterSlashing object to node's pool description: Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. tags: diff --git a/apis/beacon/pool/attester_slashings.yaml b/apis/beacon/pool/attester_slashings.yaml index fc7907ad..bb0ba62b 100644 --- a/apis/beacon/pool/attester_slashings.yaml +++ b/apis/beacon/pool/attester_slashings.yaml @@ -25,6 +25,7 @@ get: post: operationId: submitPoolAttesterSlashings summary: Submit AttesterSlashing object to node's pool + deprecated: true description: Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. tags: - Beacon diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index f6927b46..c8feea51 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -99,6 +99,8 @@ paths: $ref: "./apis/beacon/blocks/root.yaml" /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" + /eth/v2/beacon/blocks/{block_id}/attestations: + $ref: "./apis/beacon/blocks/attestations.v2.yaml" /eth/v1/beacon/blob_sidecars/{block_id}: $ref: "./apis/beacon/blob_sidecars/blob_sidecars.yaml" /eth/v1/beacon/rewards/sync_committee/{block_id}: @@ -121,8 +123,12 @@ paths: $ref: "./apis/beacon/light_client/optimistic_update.yaml" /eth/v1/beacon/pool/attestations: $ref: "./apis/beacon/pool/attestations.yaml" + /eth/v2/beacon/pool/attestations: + $ref: "./apis/beacon/pool/attestations.v2.yaml" /eth/v1/beacon/pool/attester_slashings: $ref: "./apis/beacon/pool/attester_slashings.yaml" + /eth/v2/beacon/pool/attester_slashings: + $ref: "./apis/beacon/pool/attester_slashings.v2.yaml" /eth/v1/beacon/pool/proposer_slashings: $ref: "./apis/beacon/pool/proposer_slashings.yaml" /eth/v1/beacon/pool/sync_committees: From 1245eb6050a5c5ef3f981fe4f14372a452fe98dd Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 28 May 2024 16:44:07 +0200 Subject: [PATCH 07/19] refactoring --- CHANGES.md | 1 - apis/beacon/blocks/attestations.v2.yaml | 2 +- apis/beacon/pool/attestations.v2.yaml | 6 +++++- apis/beacon/pool/attester_slashings.v2.yaml | 2 +- types/electra/attestation.yaml | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7ca83483..38e5a101 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,7 +9,6 @@ There are likely to be descriptions etc outside of the list below, but new query | 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) | |---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| -| [#447](https://github.com/ethereum/beacon-APIs/pull/447) `GET /eth/v2/validator/aggregate_attestation` added | | | | | | The Following are no longer in the Standard API, removed since the latest version. diff --git a/apis/beacon/blocks/attestations.v2.yaml b/apis/beacon/blocks/attestations.v2.yaml index 6aff70bb..8727bd05 100644 --- a/apis/beacon/blocks/attestations.v2.yaml +++ b/apis/beacon/blocks/attestations.v2.yaml @@ -21,7 +21,7 @@ get: schema: title: GetBlockAttestationsV2Response type: object - required: [execution_optimistic, finalized, data] + required: [version, execution_optimistic, finalized, data] properties: version: type: string diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 750ef7f6..01967546 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -26,8 +26,12 @@ get: schema: title: GetPoolAttestationsV2Response type: object - required: [data] + required: [version, data] properties: + version: + type: string + enum: [phase0, altair, bellatrix, capella, deneb, electra] + example: "phase0" data: anyOf: - type: array diff --git a/apis/beacon/pool/attester_slashings.v2.yaml b/apis/beacon/pool/attester_slashings.v2.yaml index 52f5c557..783eee67 100644 --- a/apis/beacon/pool/attester_slashings.v2.yaml +++ b/apis/beacon/pool/attester_slashings.v2.yaml @@ -15,7 +15,7 @@ get: schema: title: GetPoolAttesterSlashingsV2Response type: object - required: [data] + required: [version, data] properties: version: type: string diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index c86c7fc2..3c77a734 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -18,7 +18,7 @@ Electra: Attestation: type: object description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#attestation) object from the CL spec." - required: [aggregation_bits, signature, data] + required: [aggregation_bits, signature, committee_bits, data] properties: aggregation_bits: $ref: "../primitive.yaml#/BitList" From f2aeebf0016290c861fe1bd21d18e8589d869c66 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 28 May 2024 18:36:34 +0200 Subject: [PATCH 08/19] add consensus version header to POST apis parameters --- apis/beacon/pool/attestations.v2.yaml | 7 +++++++ apis/beacon/pool/attester_slashings.v2.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 01967546..2ca27824 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -61,6 +61,13 @@ post: If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. + parameters: + - in: header + schema: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' + required: true + name: Eth-Consensus-Version + description: "Version of the block being submitted." tags: - Beacon - ValidatorRequiredApi diff --git a/apis/beacon/pool/attester_slashings.v2.yaml b/apis/beacon/pool/attester_slashings.v2.yaml index 783eee67..67e14aad 100644 --- a/apis/beacon/pool/attester_slashings.v2.yaml +++ b/apis/beacon/pool/attester_slashings.v2.yaml @@ -36,6 +36,13 @@ post: operationId: submitPoolAttesterSlashingsV2 summary: Submit AttesterSlashing object to node's pool description: Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. + parameters: + - in: header + schema: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' + required: true + name: Eth-Consensus-Version + description: "Version of the block being submitted." tags: - Beacon requestBody: From e815e4f4c52885ba36ca872820db660c273ebc77 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 31 May 2024 11:07:07 +0200 Subject: [PATCH 09/19] update spec version --- types/electra/attestation.yaml | 4 ++-- types/electra/attester_slashing.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 3c77a734..40377956 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -1,7 +1,7 @@ Electra: IndexedAttestation: type: object - description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." + description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." properties: attesting_indices: type: array @@ -17,7 +17,7 @@ Electra: Attestation: type: object - description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#attestation) object from the CL spec." + description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#attestation) object from the CL spec." required: [aggregation_bits, signature, committee_bits, data] properties: aggregation_bits: diff --git a/types/electra/attester_slashing.yaml b/types/electra/attester_slashing.yaml index 21e51b6b..4a5fc49f 100644 --- a/types/electra/attester_slashing.yaml +++ b/types/electra/attester_slashing.yaml @@ -1,7 +1,7 @@ Electra: AttesterSlashing: type: object - description: "The [`AttesterSlashing`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#attesterslashing) object from the CL spec." + description: "The [`AttesterSlashing`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#attesterslashing) object from the CL spec." required: [attestation_1, attestation_2] properties: attestation_1: From ea9832ecdbb065786e6a0c0b17c53163ab6f8ec2 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 5 Jun 2024 14:14:41 +0200 Subject: [PATCH 10/19] fix typos --- apis/beacon/pool/attestations.v2.yaml | 12 ++++++------ apis/beacon/pool/attester_slashings.v2.yaml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 2ca27824..e1bdbe6c 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -1,6 +1,6 @@ get: operationId: getPoolAttestationsV2 - summary: Get Attestations from operations pool + summary: Get attestations from operations pool description: Retrieves attestations known by the node but not necessarily incorporated into any block parameters: - name: slot @@ -56,18 +56,18 @@ post: operationId: submitPoolAttestationsV2 summary: Submit Attestation objects to node description: | - Submits Attestation objects to the node. Each attestation in the request body is processed individually. + Submits Attestation objects to the node. Each attestation in the request body is processed individually. - If an attestation is validated successfully the node MUST publish that attestation on the appropriate subnet. + If an attestation is validated successfully, the node MUST publish that attestation on the appropriate subnet. - If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why. + If one or more attestations fail validation, the node MUST return a 400 error with details of which attestations have failed, and why. parameters: - in: header schema: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' required: true name: Eth-Consensus-Version - description: "Version of the block being submitted." + description: "Version of the attestation being submitted." tags: - Beacon - ValidatorRequiredApi @@ -85,7 +85,7 @@ post: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' responses: "200": - description: Attestations are stored in pool and broadcast on appropriate subnet + description: Attestations are stored in pool and broadcast on the appropriate subnet "400": description: "Errors with one or more attestations" content: diff --git a/apis/beacon/pool/attester_slashings.v2.yaml b/apis/beacon/pool/attester_slashings.v2.yaml index 67e14aad..a71be1d3 100644 --- a/apis/beacon/pool/attester_slashings.v2.yaml +++ b/apis/beacon/pool/attester_slashings.v2.yaml @@ -1,6 +1,6 @@ get: operationId: getPoolAttesterSlashingsV2 - summary: Get AttesterSlashings from operations pool + summary: Get attester slashings from operations pool description: Retrieves attester slashings known by the node but not necessarily incorporated into any block tags: - Beacon @@ -35,14 +35,14 @@ get: post: operationId: submitPoolAttesterSlashingsV2 summary: Submit AttesterSlashing object to node's pool - description: Submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network. + description: Submits AttesterSlashing object to node's pool. Upon successful validation the node MUST broadcast it to network. parameters: - in: header schema: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' required: true name: Eth-Consensus-Version - description: "Version of the block being submitted." + description: "Version of the attester slashing being submitted." tags: - Beacon requestBody: From 3261557078c63f6cad9bf0071d42391136d8f46b Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 27 Jun 2024 18:14:50 +0200 Subject: [PATCH 11/19] rebase master --- apis/beacon/blocks/attestations.v2.yaml | 1 - apis/beacon/pool/attestations.v2.yaml | 2 +- beacon-node-oapi.yaml | 2 -- types/attestation.yaml | 1 + types/attestation_data.yaml | 2 +- types/electra/attestation.yaml | 7 ++++--- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apis/beacon/blocks/attestations.v2.yaml b/apis/beacon/blocks/attestations.v2.yaml index 8727bd05..785ed096 100644 --- a/apis/beacon/blocks/attestations.v2.yaml +++ b/apis/beacon/blocks/attestations.v2.yaml @@ -9,7 +9,6 @@ get: in: path required: true $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' - responses: "200": description: Success diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index e1bdbe6c..7a8be747 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -67,7 +67,7 @@ post: $ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' required: true name: Eth-Consensus-Version - description: "Version of the attestation being submitted." + description: "Version of the attestations being submitted." tags: - Beacon - ValidatorRequiredApi diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index c8feea51..8ead8a63 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -383,8 +383,6 @@ components: $ref: './types/primitive.yaml#/Blob' Deneb.BlobSidecars: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecars' - Electra.Attestation: - $ref: './types/electra/attestation.yaml#/Electra/Attestation' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/attestation.yaml b/types/attestation.yaml index a71b07b6..b31beba4 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -1,6 +1,7 @@ IndexedAttestation: type: object description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#indexedattestation) object from the CL spec." + required: [attesting_indices, signature, data] properties: attesting_indices: type: array diff --git a/types/attestation_data.yaml b/types/attestation_data.yaml index d8e42d3f..38675d97 100644 --- a/types/attestation_data.yaml +++ b/types/attestation_data.yaml @@ -13,4 +13,4 @@ AttestationData: source: $ref: "./misc.yaml#/Checkpoint" target: - $ref: "./misc.yaml#/Checkpoint" \ No newline at end of file + $ref: "./misc.yaml#/Checkpoint" diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 40377956..f5997415 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -2,6 +2,7 @@ Electra: IndexedAttestation: type: object description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." + required: [attesting_indices, signature, data] properties: attesting_indices: type: array @@ -17,8 +18,8 @@ Electra: Attestation: type: object - description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#attestation) object from the CL spec." - required: [aggregation_bits, signature, committee_bits, data] + description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#attestation) object from the CL spec." + required: [aggregation_bits, data, signature, committee_bits] properties: aggregation_bits: $ref: "../primitive.yaml#/BitList" @@ -31,4 +32,4 @@ Electra: committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." - example: "0x000000000000000000000000000000000000000000000000000 \ No newline at end of file + example: "0x000000000000000000000000000000000000000000000000000" From 757e314a37ee20607240b89683986a179c1314c7 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 27 Jun 2024 18:17:58 +0200 Subject: [PATCH 12/19] update indexed attestation spec link --- types/electra/attestation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index f5997415..0453a7c4 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -1,7 +1,7 @@ Electra: IndexedAttestation: type: object - description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." + description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." required: [attesting_indices, signature, data] properties: attesting_indices: From ed03dfdd5a9dd0d68697b69ae33c824ffa91a57c Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 27 Jun 2024 19:27:10 +0200 Subject: [PATCH 13/19] update changes log --- CHANGES.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 38e5a101..c72e2c72 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,12 @@ There are likely to be descriptions etc outside of the list below, but new query | 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) | |---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| +| [#447](https://github.com/ethereum/beacon-APIs/pull/447) `GET /eth/v2/validator/aggregate_attestation` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/blocks/{block_id}/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attestations` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attester_slashings` added | | - | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attester_slashings` added | | - | | | | The Following are no longer in the Standard API, removed since the latest version. @@ -23,20 +29,15 @@ 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) | -|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| -| [#350](https://github.com/ethereum/beacon-APIs/pull/350) `blob_sidecar EVENT` added | | v1.12.0 | | | | -| [#358](https://github.com/ethereum/beacon-APIs/pull/358) `/eth/v3/validator/blocks` added `consensus_block_value` to response | | v1.13.0 | | | | -| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validators` added | | - | | | | -| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validator_balances` added | | - | | | | -| [#376](https://github.com/ethereum/beacon-APIs/pull/376) `proposer_slashing, attester_slashing EVENT` added | | v1.16.0 | | | | +| 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) | +|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| +| [#350](https://github.com/ethereum/beacon-APIs/pull/350) `blob_sidecar EVENT` added | | v1.12.0 | | | | +| [#358](https://github.com/ethereum/beacon-APIs/pull/358) `/eth/v3/validator/blocks` added `consensus_block_value` to response | | v1.13.0 | | | | +| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validators` added | | - | | | | +| [#367](https://github.com/ethereum/beacon-APIs/pull/367) `POST /eth/v1/beacon/states/{state_id}/validator_balances` added | | - | | | | +| [#376](https://github.com/ethereum/beacon-APIs/pull/376) `proposer_slashing, attester_slashing EVENT` added | | v1.16.0 | | | | | [#386](https://github.com/ethereum/beacon-APIs/pull/386) `/eth/v3/validator/blocks` added `builder_boost_factor` query parameter | | v1.14.0 | | | | -| [#405](https://github.com/ethereum/beacon-APIs/pull/405) `block_gossip EVENT` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/blocks/{block_id}/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attester_slashings` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attester_slashings` added | | - | | | | +| [#405](https://github.com/ethereum/beacon-APIs/pull/405) `block_gossip EVENT` added | | - | | | | ## Version 2.4.2 From 79c54ae15c35d70d3360b591082ac38339fb187e Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 27 Jun 2024 19:28:16 +0200 Subject: [PATCH 14/19] add new line --- types/attestation_data.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/types/attestation_data.yaml b/types/attestation_data.yaml index 38675d97..7979ffed 100644 --- a/types/attestation_data.yaml +++ b/types/attestation_data.yaml @@ -14,3 +14,4 @@ AttestationData: $ref: "./misc.yaml#/Checkpoint" target: $ref: "./misc.yaml#/Checkpoint" + \ No newline at end of file From 6bc0ec8df728489a6a6615ed6649d1df47d69263 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 27 Jun 2024 22:26:06 +0100 Subject: [PATCH 15/19] Review PR --- CHANGES.md | 12 ++++++------ apis/beacon/pool/attester_slashings.v2.yaml | 2 +- types/attestation.yaml | 2 +- types/attestation_data.yaml | 1 - types/electra/attestation.yaml | 8 ++++---- types/electra/attester_slashing.yaml | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c72e2c72..e7639bc4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,12 +9,12 @@ There are likely to be descriptions etc outside of the list below, but new query | 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) | |---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------| -| [#447](https://github.com/ethereum/beacon-APIs/pull/447) `GET /eth/v2/validator/aggregate_attestation` added | | | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/blocks/{block_id}/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attestations` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attester_slashings` added | | - | | | | -| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attester_slashings` added | | - | | | | +| [#447](https://github.com/ethereum/beacon-APIs/pull/447) `GET /eth/v2/validator/aggregate_attestation` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/blocks/{block_id}/attestations` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attestations` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attestations` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `GET /eth/v2/beacon/pool/attester_slashings` added | | | | | | +| [#448](https://github.com/ethereum/beacon-APIs/pull/448) `POST /eth/v2/beacon/pool/attester_slashings` added | | | | | | The Following are no longer in the Standard API, removed since the latest version. diff --git a/apis/beacon/pool/attester_slashings.v2.yaml b/apis/beacon/pool/attester_slashings.v2.yaml index a71be1d3..03b44d56 100644 --- a/apis/beacon/pool/attester_slashings.v2.yaml +++ b/apis/beacon/pool/attester_slashings.v2.yaml @@ -19,7 +19,7 @@ get: properties: version: type: string - enum: [ phase0, altair, bellatrix, capella, deneb, electra ] + enum: [phase0, altair, bellatrix, capella, deneb, electra] example: "phase0" data: anyOf: diff --git a/types/attestation.yaml b/types/attestation.yaml index b31beba4..a7f78274 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -42,4 +42,4 @@ PendingAttestation: inclusion_delay: $ref: "./primitive.yaml#/Uint64" proposer_index: - $ref: "./primitive.yaml#/Uint64" \ No newline at end of file + $ref: "./primitive.yaml#/Uint64" diff --git a/types/attestation_data.yaml b/types/attestation_data.yaml index 7979ffed..38675d97 100644 --- a/types/attestation_data.yaml +++ b/types/attestation_data.yaml @@ -14,4 +14,3 @@ AttestationData: $ref: "./misc.yaml#/Checkpoint" target: $ref: "./misc.yaml#/Checkpoint" - \ No newline at end of file diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 0453a7c4..68d91501 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -10,11 +10,11 @@ Electra: description: "Attesting validator indices" items: $ref: "../primitive.yaml#/Uint64" + data: + $ref: '../attestation_data.yaml#/AttestationData' signature: $ref: '../primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." - data: - $ref: '../attestation_data.yaml#/AttestationData' Attestation: type: object @@ -25,9 +25,9 @@ Electra: $ref: "../primitive.yaml#/BitList" description: "Attester aggregation bits." data: - $ref: '../attestation_data.yaml#/AttestationData' + $ref: "../attestation_data.yaml#/AttestationData" signature: - $ref: '../primitive.yaml#/Signature' + $ref: "../primitive.yaml#/Signature" description: "BLS aggregate signature." committee_bits: $ref: "../primitive.yaml#/Bitvector" diff --git a/types/electra/attester_slashing.yaml b/types/electra/attester_slashing.yaml index 4a5fc49f..89634285 100644 --- a/types/electra/attester_slashing.yaml +++ b/types/electra/attester_slashing.yaml @@ -1,7 +1,7 @@ Electra: AttesterSlashing: type: object - description: "The [`AttesterSlashing`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.2/specs/electra/beacon-chain.md#attesterslashing) object from the CL spec." + description: "The [`AttesterSlashing`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#attesterslashing) object from the CL spec." required: [attestation_1, attestation_2] properties: attestation_1: From bb0b6ae40efd96eb573e599a5b47b8558e48162f Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 28 Jun 2024 10:58:25 +0200 Subject: [PATCH 16/19] fixing reviews --- beacon-node-oapi.yaml | 8 ++++---- types/attestation.yaml | 4 ++-- types/electra/attestation.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index 8ead8a63..f90691d1 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -237,8 +237,6 @@ components: $ref: './types/api.yaml#/Committee' AttesterSlashing: $ref: './types/attester_slashing.yaml#/AttesterSlashing' - Electra.AttesterSlashing: - $ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing' ProposerSlashing: $ref: './types/proposer_slashing.yaml#/ProposerSlashing' SignedVoluntaryExit: @@ -255,8 +253,6 @@ components: $ref: './types/validator.yaml#/SignedAggregateAndProof' Attestation: $ref: './types/attestation.yaml#/Attestation' - Electra.Attestation: - $ref: './types/electra/attestation.yaml#/Electra/Attestation' AttestationData: $ref: './types/attestation_data.yaml#/AttestationData' BeaconCommitteeSelection: @@ -383,6 +379,10 @@ components: $ref: './types/primitive.yaml#/Blob' Deneb.BlobSidecars: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecars' + Electra.Attestation: + $ref: './types/electra/attestation.yaml#/Electra/Attestation' + Electra.AttesterSlashing: + $ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/attestation.yaml b/types/attestation.yaml index a7f78274..1c93f6e1 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -9,11 +9,11 @@ IndexedAttestation: description: "Attesting validator indices" items: $ref: "./primitive.yaml#/Uint64" + data: + $ref: './attestation_data.yaml#/AttestationData' signature: $ref: './primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." - data: - $ref: './attestation_data.yaml#/AttestationData' Attestation: type: object diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 68d91501..f3976b8b 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -32,4 +32,4 @@ Electra: committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." - example: "0x000000000000000000000000000000000000000000000000000" + example: "0x0000000000000000000000000000000000000000000000000000000000000001" From b68317e40e54b28e7276c5db18ec7fd0e09696a0 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 28 Jun 2024 10:49:46 +0100 Subject: [PATCH 17/19] Fix Attestation field order --- types/attestation.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/attestation.yaml b/types/attestation.yaml index 1c93f6e1..d057f4f4 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -1,7 +1,7 @@ IndexedAttestation: type: object description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#indexedattestation) object from the CL spec." - required: [attesting_indices, signature, data] + required: [attesting_indices, data, signature] properties: attesting_indices: type: array @@ -18,16 +18,16 @@ IndexedAttestation: Attestation: type: object description: "The [`Attestation`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/phase0/beacon-chain.md#attestation) object from the CL spec." - required: [aggregation_bits, signature, data] + required: [aggregation_bits, data, signature] properties: aggregation_bits: $ref: "./primitive.yaml#/BitList" description: "Attester aggregation bits." + data: + $ref: './attestation_data.yaml#/AttestationData' signature: $ref: './primitive.yaml#/Signature' description: "BLS aggregate signature." - data: - $ref: './attestation_data.yaml#/AttestationData' PendingAttestation: type: object From 9defc482b1c9aad3ef1e8789ad44f1ec22469023 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 28 Jun 2024 10:50:27 +0100 Subject: [PATCH 18/19] Correct committee_bits example --- types/electra/attestation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index f3976b8b..3196ef75 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -32,4 +32,4 @@ Electra: committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." - example: "0x0000000000000000000000000000000000000000000000000000000000000001" + example: "0x0000000000000001" From f45461cd0803ae8288f9ccd87fd80d529cec3bae Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 28 Jun 2024 10:56:34 +0100 Subject: [PATCH 19/19] Fix required properties ordering --- types/electra/attestation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 3196ef75..60cd3bbb 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -2,7 +2,7 @@ Electra: IndexedAttestation: type: object description: "The [`IndexedAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#indexedattestation) object from the CL spec." - required: [attesting_indices, signature, data] + required: [attesting_indices, data, signature] properties: attesting_indices: type: array