From 72032945d86aef98b248cd53f92363c5ed866d87 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 15 Sep 2024 18:44:20 -0700 Subject: [PATCH 1/9] update post attestation v2 endpoint --- apis/beacon/pool/attestations.v2.yaml | 7 ++----- beacon-node-oapi.yaml | 2 ++ types/attestation.yaml | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 4e6f48f3..6509ff2d 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -56,7 +56,7 @@ post: operationId: submitPoolAttestationsV2 summary: Submit Attestation objects to node description: | - Submits Attestation objects to the node. Each attestation in the request body is processed individually. + Submits SingleAttestation objects to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully, the node MUST publish that attestation on the appropriate subnet. @@ -79,10 +79,7 @@ post: anyOf: - type: array items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/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 33ebff47..dee64c78 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -259,6 +259,8 @@ 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: diff --git a/types/attestation.yaml b/types/attestation.yaml index d057f4f4..2fd46bbb 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -15,6 +15,23 @@ IndexedAttestation: $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." From c581a5185aac9f812b4ce157f26655d3680beb35 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 16 Sep 2024 12:34:41 -0700 Subject: [PATCH 2/9] remove anyOf --- apis/beacon/pool/attestations.v2.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 6509ff2d..abbe7b17 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -76,10 +76,9 @@ post: content: application/json: schema: - anyOf: - - type: array - items: - $ref: '../../../beacon-node-oapi.yaml#/components/schemas/SingleAttestation' + - type: array + items: + $ref: '../../../beacon-node-oapi.yaml#/components/schemas/SingleAttestation' responses: "200": description: Attestations are stored in pool and broadcast on the appropriate subnet From 508487a8016f5a6a3ed2cadc42b022db88ef188a Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 16 Sep 2024 13:11:18 -0700 Subject: [PATCH 3/9] add a new single_attestation event --- apis/eventstream/index.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apis/eventstream/index.yaml b/apis/eventstream/index.yaml index 4116ce6f..fd629313 100644 --- a/apis/eventstream/index.yaml +++ b/apis/eventstream/index.yaml @@ -26,6 +26,7 @@ get: - block - block_gossip - attestation + - single_attestation - voluntary_exit - bls_to_execution_change - proposer_slashing @@ -66,6 +67,11 @@ get: value: | event: attestation data: {"aggregation_bits":"0x01", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} + single_attestation: + description: The node has received a SingleAttestation (from P2P or API) that passes validation rules of the `beacon_attestation_{subnet_id}` topic + value: | + event: single_attestation + data: {"committee_index":"1", "attester_index": "1", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} voluntary_exit: description: The node has received a SignedVoluntaryExit (from P2P or API) that passes validation rules of `voluntary_exit` topic value: | From 085e16a81f1bbe2da52159a68ae9f07144188e42 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 23 Sep 2024 11:23:22 -0700 Subject: [PATCH 4/9] 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." From f2f7969a8e3b2682371fe51252f162a51c5342e5 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 8 Oct 2024 21:22:10 -0700 Subject: [PATCH 5/9] move Signature field to match spec --- apis/eventstream/index.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/eventstream/index.yaml b/apis/eventstream/index.yaml index fd629313..825a9225 100644 --- a/apis/eventstream/index.yaml +++ b/apis/eventstream/index.yaml @@ -71,7 +71,7 @@ get: description: The node has received a SingleAttestation (from P2P or API) that passes validation rules of the `beacon_attestation_{subnet_id}` topic value: | event: single_attestation - data: {"committee_index":"1", "attester_index": "1", "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}} + data: {"committee_index":"1", "attester_index": "1", "data":{"slot":"1", "index":"1", "beacon_block_root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "source":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}, "target":{"epoch":"1", "root":"0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"}}, "signature":"0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"} voluntary_exit: description: The node has received a SignedVoluntaryExit (from P2P or API) that passes validation rules of `voluntary_exit` topic value: | From 1df742332ae8567fd422a61420398d2138830672 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 9 Oct 2024 11:14:44 -0700 Subject: [PATCH 6/9] Lint --- types/electra/attestation.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/electra/attestation.yaml b/types/electra/attestation.yaml index f7294436..79889ff8 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -21,15 +21,15 @@ Electra: required: [committee_index, attester_index, data, signature] properties: committee_index: - $ref: "./primitive.yaml#/Uint64" + $ref: "../primitive.yaml#/Uint64" description: "The attestations committee index." attester_index: - $ref: "./primitive.yaml#/Uint64" + $ref: "../primitive.yaml#/Uint64" description: "The validator index that signed this attestation." data: - $ref: './attestation_data.yaml#/AttestationData' + $ref: '../attestation_data.yaml#/AttestationData' signature: - $ref: './primitive.yaml#/Signature' + $ref: '../primitive.yaml#/Signature' description: "BLS aggregate signature." Attestation: type: object From 6520c2f53d64973246ec30999351054fb6b20b40 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 5 Nov 2024 09:55:34 -0800 Subject: [PATCH 7/9] Update types/electra/attestation.yaml Co-authored-by: Nico Flaig --- 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 79889ff8..94e32852 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -17,7 +17,7 @@ Electra: 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." + description: "The [`SingleAttestation`](https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.9/specs/electra/beacon-chain.md#singleattestation) object from the CL spec." required: [committee_index, attester_index, data, signature] properties: committee_index: From cee75f936fb1c1d8b1daf68f9be8c4d463f9fde9 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 19 Nov 2024 08:51:25 +0000 Subject: [PATCH 8/9] Wording --- apis/beacon/pool/attestations.v2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/beacon/pool/attestations.v2.yaml b/apis/beacon/pool/attestations.v2.yaml index 2b816253..c5ea3e60 100644 --- a/apis/beacon/pool/attestations.v2.yaml +++ b/apis/beacon/pool/attestations.v2.yaml @@ -56,7 +56,7 @@ post: operationId: submitPoolAttestationsV2 summary: Submit Attestation objects to node description: | - Submits SingleAttestation objects to the node. Each attestation in the request body is processed individually. + Submits attestations to the node. Each attestation in the request body is processed individually. If an attestation is validated successfully, the node MUST publish that attestation on the appropriate subnet. From 45a8f2c923abb8e8784642204526c646909b0746 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Tue, 19 Nov 2024 08:53:57 +0000 Subject: [PATCH 9/9] Formatting --- types/attestation.yaml | 1 + types/electra/attestation.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/types/attestation.yaml b/types/attestation.yaml index 50711193..d057f4f4 100644 --- a/types/attestation.yaml +++ b/types/attestation.yaml @@ -14,6 +14,7 @@ IndexedAttestation: signature: $ref: './primitive.yaml#/Signature' description: "The BLS signature of the `IndexedAttestation`, created by the validator of the attestation." + 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 94e32852..05e333bc 100644 --- a/types/electra/attestation.yaml +++ b/types/electra/attestation.yaml @@ -15,6 +15,7 @@ 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.5.0-alpha.9/specs/electra/beacon-chain.md#singleattestation) object from the CL spec." @@ -31,6 +32,7 @@ Electra: 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."