From d28147c0ccbb415db4b566e0b280d60a0de145f5 Mon Sep 17 00:00:00 2001 From: Navie Chan Date: Thu, 9 May 2024 16:32:01 +0300 Subject: [PATCH 1/7] getAggregatedAttestationV2 --- apis/validator/aggregate_attestation.v2.yaml | 50 ++++++++++++++++++++ beacon-node-oapi.yaml | 4 ++ types/electra/attestation.yaml | 18 +++++++ 3 files changed, 72 insertions(+) create mode 100644 apis/validator/aggregate_attestation.v2.yaml create mode 100644 types/electra/attestation.yaml diff --git a/apis/validator/aggregate_attestation.v2.yaml b/apis/validator/aggregate_attestation.v2.yaml new file mode 100644 index 00000000..b71ad32f --- /dev/null +++ b/apis/validator/aggregate_attestation.v2.yaml @@ -0,0 +1,50 @@ +get: + operationId: "getAggregatedAttestationV2" + summary: "Get aggregated attestation" + description: | + Aggregates all attestations matching given attestation data root, slot and committee index. + + A 503 error must be returned if the block identified by the response + `beacon_block_root` is optimistic (i.e. the aggregated attestation attests + to a block that has not been fully verified by an execution engine). + + A 404 error must be returned if no attestation is available for the requested + `attestation_data_root`. + tags: + - ValidatorRequiredApi + - Validator + parameters: + - name: attestation_data_root + in: query + required: true + description: "HashTreeRoot of AttestationData that validator wants aggregated" + schema: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/Root' + - name: slot + in: query + required: true + schema: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64' + - name: committee_index + in: query + required: true + schema: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64' + responses: + "200": + description: "Returns aggregated `Attestation` object with same `AttestationData` root, slot and committee index." + content: + application/json: + schema: + title: GetAggregatedAttestationV2Response + type: object + required: [data] + properties: + data: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + "400": + $ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest' + "404": + $ref: '../../beacon-node-oapi.yaml#/components/responses/NotFound' + "500": + $ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError' diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index b9640ae3..43b5f437 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -180,6 +180,8 @@ paths: $ref: "./apis/validator/attestation_data.yaml" /eth/v1/validator/aggregate_attestation: $ref: "./apis/validator/aggregate_attestation.yaml" + /eth/v2/validator/aggregate_attestation: + $ref: "./apis/validator/aggregate_attestation.v2.yaml" /eth/v1/validator/aggregate_and_proofs: $ref: "./apis/validator/aggregate_and_proofs.yaml" /eth/v1/validator/beacon_committee_subscriptions: @@ -371,6 +373,8 @@ 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/electra/attestation.yaml b/types/electra/attestation.yaml new file mode 100644 index 00000000..7e5b466f --- /dev/null +++ b/types/electra/attestation.yaml @@ -0,0 +1,18 @@ +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, data, committee_bits] + properties: + aggregation_bits: + $ref: "../primitive.yaml#/BitList" + description: "Attester aggregation bits." + signature: + $ref: '../primitive.yaml#/Signature' + description: "BLS aggregate signature." + data: + $ref: '../attestation.yaml#/AttestationData' + committee_bits: + $ref: "../primitive.yaml#/Bitvector" + description: "Committee bits." + example: "0x0000000000000000000000000000000000000000000000000000000000000001" \ No newline at end of file From c6d4425c3092ed1c42e9a53337cc68391c823695 Mon Sep 17 00:00:00 2001 From: Navie Chan Date: Thu, 23 May 2024 18:15:04 +0300 Subject: [PATCH 2/7] Address comment --- apis/validator/aggregate_attestation.v2.yaml | 8 +++++++- types/electra/attestation.yaml | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apis/validator/aggregate_attestation.v2.yaml b/apis/validator/aggregate_attestation.v2.yaml index b71ad32f..032fe1e0 100644 --- a/apis/validator/aggregate_attestation.v2.yaml +++ b/apis/validator/aggregate_attestation.v2.yaml @@ -40,8 +40,14 @@ get: type: object required: [data] properties: + version: + type: string + enum: [phase0, altair, bellatrix, capella, deneb, electra] + example: "phase0" data: - $ref: '../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + anyOf: + - $ref: '../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - $ref: '../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' "400": $ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest' "404": diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 7e5b466f..6c0fc804 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -8,11 +8,11 @@ Electra: $ref: "../primitive.yaml#/BitList" description: "Attester aggregation bits." signature: - $ref: '../primitive.yaml#/Signature' + $ref: "../primitive.yaml#/Signature" description: "BLS aggregate signature." data: - $ref: '../attestation.yaml#/AttestationData' + $ref: "../attestation.yaml#/AttestationData" committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." - example: "0x0000000000000000000000000000000000000000000000000000000000000001" \ No newline at end of file + example: "0x0000000000000000000000000000000000000000000000000000000000000001" From 8c060ffc16bfa8674df0047009125d77f1ae16b6 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 24 May 2024 09:29:40 +0200 Subject: [PATCH 3/7] Add version header to response --- apis/validator/aggregate_attestation.v2.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apis/validator/aggregate_attestation.v2.yaml b/apis/validator/aggregate_attestation.v2.yaml index 032fe1e0..63526aef 100644 --- a/apis/validator/aggregate_attestation.v2.yaml +++ b/apis/validator/aggregate_attestation.v2.yaml @@ -33,12 +33,15 @@ get: responses: "200": description: "Returns aggregated `Attestation` object with same `AttestationData` root, slot and committee index." + headers: + Eth-Consensus-Version: + $ref: '../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' content: application/json: schema: title: GetAggregatedAttestationV2Response type: object - required: [data] + required: [version, data] properties: version: type: string From 823b161d6d7f65a62ee1e314db7aa462f278f17a Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 24 May 2024 09:30:03 +0200 Subject: [PATCH 4/7] Deprecate v1 api --- apis/validator/aggregate_attestation.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/validator/aggregate_attestation.yaml b/apis/validator/aggregate_attestation.yaml index e6ee3b34..ed8b8001 100644 --- a/apis/validator/aggregate_attestation.yaml +++ b/apis/validator/aggregate_attestation.yaml @@ -1,6 +1,7 @@ get: operationId: "getAggregatedAttestation" summary: "Get aggregated attestation" + deprecated: true description: | Aggregates all attestations matching given attestation data root and slot. From 573006050a1c858c3764467e0e685ecb5a802ffa Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Fri, 24 May 2024 09:30:37 +0200 Subject: [PATCH 5/7] Update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index c66dfd44..215a347b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ 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. From 911b4b43a641ef69cc102a6e9df71b847936b23a Mon Sep 17 00:00:00 2001 From: Navie Chan Date: Tue, 18 Jun 2024 18:25:34 +0300 Subject: [PATCH 6/7] Change ordering of attestation fields --- types/electra/attestation.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 6c0fc804..52202842 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -2,16 +2,16 @@ 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, data, committee_bits] + required: [aggregation_bits, data, signature, committee_bits] properties: aggregation_bits: $ref: "../primitive.yaml#/BitList" description: "Attester aggregation bits." + data: + $ref: "../attestation.yaml#/AttestationData" signature: $ref: "../primitive.yaml#/Signature" description: "BLS aggregate signature." - data: - $ref: "../attestation.yaml#/AttestationData" committee_bits: $ref: "../primitive.yaml#/Bitvector" description: "Committee bits." From 510e0e013718324c466d45aaab297671a3d5b0c7 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 18 Jun 2024 16:38:41 +0100 Subject: [PATCH 7/7] Update spec reference --- 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 52202842..2ad061b6 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -1,7 +1,7 @@ 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." + 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: