From 085e16a81f1bbe2da52159a68ae9f07144188e42 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 23 Sep 2024 11:23:22 -0700 Subject: [PATCH] reintroduce anyOf, move type def to electra --- apis/beacon/pool/attestations.v2.yaml | 10 +++++++--- beacon-node-oapi.yaml | 4 ++-- types/attestation.yaml | 18 ------------------ types/electra/attestation.yaml | 17 ++++++++++++++++- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index abbe7b17..2b816253 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -76,9 +76,13 @@ post: content: application/json: schema: - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/SingleAttestation' + anyOf: + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.SingleAttestation' responses: "200": description: Attestations are stored in pool and broadcast on the appropriate subnet diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index dee64c78..f0d81ce4 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -259,8 +259,6 @@ components: $ref: './types/validator.yaml#/Altair/SyncDuty' SignedAggregateAndProof: $ref: './types/validator.yaml#/SignedAggregateAndProof' - SingleAttestation: - $ref: './types/attestation.yaml#/SingleAttestation' Attestation: $ref: './types/attestation.yaml#/Attestation' AttestationData: @@ -399,6 +397,8 @@ components: $ref: './types/deneb/blob_sidecar.yaml#/Deneb/BlobSidecars' Electra.Attestation: $ref: './types/electra/attestation.yaml#/Electra/Attestation' + Electra.SingleAttestation: + $ref: './types/electra/attestation.yaml#/Electra/SingleAttestation' Electra.AttesterSlashing: $ref: './types/electra/attester_slashing.yaml#/Electra/AttesterSlashing' Electra.SignedAggregateAndProof: diff --git a/types/attestation.yaml b/types/attestation.yaml index 2fd46bbb..50711193 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -14,24 +14,6 @@ IndexedAttestation: signature: $ref: './primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." - -SingleAttestation: - type: object - description: "The [`SingleAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/electra/beacon-chain.md#singleattestation) object from the CL spec." - required: [committee_index, attester_index, data, signature] - properties: - committee_index: - $ref: "./primitive.yaml#/Uint64" - description: "The attestations committee index." - attester_index: - $ref: "./primitive.yaml#/Uint64" - description: "The validator index that signed this attestation." - data: - $ref: './attestation_data.yaml#/AttestationData' - signature: - $ref: './primitive.yaml#/Signature' - description: "BLS aggregate signature." - 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." diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index 60cd3bbb..f7294436 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -15,7 +15,22 @@ Electra: signature: $ref: '../primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." - + SingleAttestation: + type: object + description: "The [`SingleAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/electra/beacon-chain.md#singleattestation) object from the CL spec." + required: [committee_index, attester_index, data, signature] + properties: + committee_index: + $ref: "./primitive.yaml#/Uint64" + description: "The attestations committee index." + attester_index: + $ref: "./primitive.yaml#/Uint64" + description: "The validator index that signed this attestation." + data: + $ref: './attestation_data.yaml#/AttestationData' + signature: + $ref: './primitive.yaml#/Signature' + description: "BLS aggregate signature." 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."