Skip to content

Commit

Permalink
reintroduce anyOf, move type def to electra
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed Sep 23, 2024
1 parent 508487a commit 085e16a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
10 changes: 7 additions & 3 deletions apis/beacon/pool/attestations.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
18 changes: 0 additions & 18 deletions types/attestation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
17 changes: 16 additions & 1 deletion types/electra/attestation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 085e16a

Please sign in to comment.