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 b9640ae3..d4480008 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -229,6 +229,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: @@ -245,8 +247,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: @@ -329,7 +333,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 new file mode 100644 index 00000000..492fb182 --- /dev/null +++ b/types/electra/attestation.yaml @@ -0,0 +1,33 @@ +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/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_data.yaml#/AttestationData' + committee_bits: + $ref: "../primitive.yaml#/Bitvector" + description: "Attester aggregation bits." + signature: + $ref: '../primitive.yaml#/Signature' + description: "BLS aggregate signature." \ 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'