From 860584e71109cc9dc34ab6b67c646ae9a818c07e Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 15 Jul 2024 14:27:40 +0100 Subject: [PATCH] Add publishAggregateAndProofsV2 to support EIP-7549 (#456) --- CHANGES.md | 1 + apis/validator/aggregate_and_proofs.v2.yaml | 33 +++++++++++++++++++++ apis/validator/aggregate_and_proofs.yaml | 1 + beacon-node-oapi.yaml | 4 +++ types/electra/validator.yaml | 29 ++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 apis/validator/aggregate_and_proofs.v2.yaml create mode 100644 types/electra/validator.yaml diff --git a/CHANGES.md b/CHANGES.md index e7639bc4..b54ebc18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ There are likely to be descriptions etc outside of the list below, but new query | [#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 | | | | | | +| [#456](https://github.com/ethereum/beacon-APIs/pull/456) `POST /eth/v2/validator/aggregate_and_proofs` added | | | | | | The Following are no longer in the Standard API, removed since the latest version. diff --git a/apis/validator/aggregate_and_proofs.v2.yaml b/apis/validator/aggregate_and_proofs.v2.yaml new file mode 100644 index 00000000..9d46f7e5 --- /dev/null +++ b/apis/validator/aggregate_and_proofs.v2.yaml @@ -0,0 +1,33 @@ +post: + operationId: "publishAggregateAndProofsV2" + summary: "Publish multiple aggregate and proofs" + description: "Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic." + tags: + - ValidatorRequiredApi + - Validator + parameters: + - in: header + schema: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' + required: true + name: Eth-Consensus-Version + description: "Version of the aggregate and proofs being submitted." + requestBody: + required: true + content: + application/json: + schema: + anyOf: + - type: array + items: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/SignedAggregateAndProof' + - type: array + items: + $ref: '../../beacon-node-oapi.yaml#/components/schemas/Electra.SignedAggregateAndProof' + responses: + "200": + description: "Successful response" + "400": + $ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest' + "500": + $ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError' diff --git a/apis/validator/aggregate_and_proofs.yaml b/apis/validator/aggregate_and_proofs.yaml index e919dac5..29f960fe 100644 --- a/apis/validator/aggregate_and_proofs.yaml +++ b/apis/validator/aggregate_and_proofs.yaml @@ -1,6 +1,7 @@ post: operationId: "publishAggregateAndProofs" summary: "Publish multiple aggregate and proofs" + deprecated: true description: "Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic." tags: - ValidatorRequiredApi diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index f90691d1..c3608a84 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -190,6 +190,8 @@ paths: $ref: "./apis/validator/aggregate_attestation.v2.yaml" /eth/v1/validator/aggregate_and_proofs: $ref: "./apis/validator/aggregate_and_proofs.yaml" + /eth/v2/validator/aggregate_and_proofs: + $ref: "./apis/validator/aggregate_and_proofs.v2.yaml" /eth/v1/validator/beacon_committee_subscriptions: $ref: "./apis/validator/beacon_committee_subscriptions.yaml" /eth/v1/validator/sync_committee_subscriptions: @@ -383,6 +385,8 @@ components: $ref: './types/electra/attestation.yaml#/Electra/Attestation' Electra.AttesterSlashing: $ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing' + Electra.SignedAggregateAndProof: + $ref: './types/electra/validator.yaml#/Electra/SignedAggregateAndProof' Node: $ref: './types/fork_choice.yaml#/Node' ExtraData: diff --git a/types/electra/validator.yaml b/types/electra/validator.yaml new file mode 100644 index 00000000..f7fc95a1 --- /dev/null +++ b/types/electra/validator.yaml @@ -0,0 +1,29 @@ +Electra: + AggregateAndProof: + allOf: + - $ref: '#/Electra/Aggregate' + - type: object + required: [selection_proof] + properties: + selection_proof: + $ref: '../primitive.yaml#/Signature' + + Aggregate: + type: object + description: "The [`AggregateAndProof`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/validator.md#aggregateandproof) without selection_proof" + required: [aggregator_index, aggregate] + properties: + aggregator_index: + $ref: '../primitive.yaml#/Uint64' + aggregate: + $ref: './attestation.yaml#/Electra/Attestation' + + SignedAggregateAndProof: + type: object + description: "The [`SignedAggregateAndProof`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/validator.md#signedaggregateandproof) object" + required: [message, signature] + properties: + message: + $ref: "#/Electra/AggregateAndProof" + signature: + $ref: "../primitive.yaml#/Signature"