Skip to content

Commit

Permalink
Merge pull request #137 from rolfyone/multiple-contributions
Browse files Browse the repository at this point in the history
POST `/eth/v1/validator/contribution_and_proofs`
  • Loading branch information
mpetrunic authored May 17, 2021
2 parents dc2d0a1 + d1614eb commit 57c32e7
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
21 changes: 21 additions & 0 deletions apis/validator/sync_committee_contribution_and_proof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
post:
operationId: "publishContributionAndProofs"
summary: "Publish multiple contribution and proofs"
description: "Publish multiple signed sync committee contribution and proofs"
tags:
- ValidatorRequiredApi
- Validator
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Altair.SignedContributionAndProof'
responses:
"200":
description: "Successful response"
"400":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
8 changes: 8 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ paths:
$ref: "./apis/validator/beacon_committee_subscriptions.yaml"
/eth/v1/validator/sync_committee_subscriptions:
$ref: "./apis/validator/sync_committee_subscriptions.yaml"
/eth/v1/validator/contribution_and_proofs:
$ref: "./apis/validator/sync_committee_contribution_and_proof.yaml"

/eth/v1/events:
$ref: "./apis/eventstream/index.yaml"
Expand Down Expand Up @@ -217,6 +219,12 @@ components:
$ref: './types/altair/state.yaml#/Altair/BeaconState'
Altair.SyncCommitteeSubscription:
$ref: './types/altair/sync_committee.yaml#/Altair/SyncCommitteeSubscription'
Altair.ContributionAndProof:
$ref: './types/altair/sync_committee.yaml#/Altair/ContributionAndProof'
Altair.SignedContributionAndProof:
$ref: './types/altair/sync_committee.yaml#/Altair/SignedContributionAndProof'
Altair.SyncCommitteeContribution:
$ref: './types/altair/sync_committee.yaml#/Altair/SyncCommitteeContribution'
Altair.SyncCommittee:
$ref: './types/altair/sync_committee.yaml#/Altair/SyncCommitteeByValidatorIndices'

Expand Down
47 changes: 47 additions & 0 deletions types/altair/sync_committee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,52 @@ Altair:
- $ref: '../primitive.yaml#/Uint64'
until_epoch:
$ref: '../primitive.yaml#/Uint64'

SignedContributionAndProof:
type: object
properties:
message:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Altair.ContributionAndProof'
signature:
$ref: '../primitive.yaml#/Signature'

ContributionAndProof:
type: object
properties:
aggregator_index:
allOf:
- $ref: "../primitive.yaml#/Uint64"
- description: "Index of validator in validator registry."
selection_proof:
$ref: '../primitive.yaml#/Signature'
contribution:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Altair.SyncCommitteeContribution'

SyncCommitteeContribution:
type: object
properties:
slot:
allOf:
- $ref: "../primitive.yaml#/Uint64"
- description: "The slot at which the validator is providing a sync committee contribution."
beacon_block_root:
allOf:
- $ref: '../primitive.yaml#/Root'
- description: "Block root for this contribution."
subcommittee_index:
allOf:
- $ref: '../primitive.yaml#/Uint64'
- description: 'The index of the subcommittee that the contribution pertains to.'
aggregation_bits:
allOf:
- description: 'A bit is set if a signature from the validator at the corresponding index in the subcommittee is present in the aggregate `signature`.'
- $ref: "../primitive.yaml#/Hex"
- example: "0x01"
signature:
allOf:
- $ref: '../primitive.yaml#/Signature'
- description: 'Signature by the validator(s) over the block root of `slot`'

ValidatorsByIndex:
type: array
items:
Expand All @@ -46,3 +92,4 @@ Altair:
allOf:
- $ref: '#/Altair/ValidatorsByIndex'
- description: 'Subcommittee slices of the current sync committee'

0 comments on commit 57c32e7

Please sign in to comment.