Skip to content

Commit

Permalink
Merge pull request #472 from eserilev/post_attestation_v2
Browse files Browse the repository at this point in the history
Update submitPoolAttestationsV2 endpoint
  • Loading branch information
ralexstokes authored Nov 26, 2024
2 parents 2e7c4aa + 45a8f2c commit 14ddc04
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis/beacon/pool/attestations.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
Expand All @@ -82,7 +82,7 @@ post:
$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/Electra.SingleAttestation'
responses:
"200":
description: Attestations are stored in pool and broadcast on the appropriate subnet
Expand Down
6 changes: 6 additions & 0 deletions apis/eventstream/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ get:
- block
- block_gossip
- attestation
- single_attestation
- voluntary_exit
- bls_to_execution_change
- proposer_slashing
Expand Down Expand Up @@ -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", "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: |
Expand Down
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ components:
$ref: './types/electra/block.yaml#/Electra/SignedBlindedBeaconBlock'
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
17 changes: 17 additions & 0 deletions types/electra/attestation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ Electra:
$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."
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 14ddc04

Please sign in to comment.