Skip to content

Commit

Permalink
Merge pull request #136 from rolfyone/sync_committee_subscriptions
Browse files Browse the repository at this point in the history
add POST /eth/v1/validator/sync_committee_subscriptions
  • Loading branch information
mpetrunic authored Apr 29, 2021
2 parents 46d2b82 + 1a14612 commit 06df9bf
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/validator/beacon_committee_subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ post:
- description: "Should be slot at which validator is assigned to attest"
is_aggregator:
type: boolean
description: "Signals to BN that a validator on the VC has been chosed for aggregator role."
description: "Signals to BN that a validator on the VC has been chosen for aggregator role."

responses:
"200":
Expand Down
27 changes: 27 additions & 0 deletions apis/validator/sync_committee_subscriptions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
post:
operationId: "prepareSyncCommitteeSubnets"
summary: "Subscribe to sync committee subnets"
description: |
Subscribe to a number of sync committee subnets
Sync committees are not present in phase0, but are required for Altair networks.
Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks, and only required if the VC has an active validator in an active sync committee.
tags:
- ValidatorRequiredApi
- Validator
requestBody:
content:
application/json:
schema:
type: array
items:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Altair.SyncCommitteeSubscription'
responses:
"200":
description: "Successful response"
"400":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
4 changes: 4 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ paths:
$ref: "./apis/validator/aggregate_and_proofs.yaml"
/eth/v1/validator/beacon_committee_subscriptions:
$ref: "./apis/validator/beacon_committee_subscriptions.yaml"
/eth/v1/validator/sync_committee_subscriptions:
$ref: "./apis/validator/sync_committee_subscriptions.yaml"

/eth/v1/events:
$ref: "./apis/eventstream/index.yaml"
Expand Down Expand Up @@ -207,6 +209,8 @@ components:
$ref: './types/altair/block.yaml#/Altair/SignedBeaconBlock'
Altair.BeaconState:
$ref: './types/altair/state.yaml#/Altair/BeaconState'
Altair.SyncCommitteeSubscription:
$ref: './types/altair/sync_committee.yaml#/Altair/SyncCommitteeSubscription'

parameters:
StateId:
Expand Down
14 changes: 13 additions & 1 deletion types/altair/sync_committee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,16 @@ Altair:
allOf:
- $ref: '../primitive.yaml#/Pubkey'
minItems: 16
maxItems: 16
maxItems: 16
SyncCommitteeSubscription:
type: object
properties:
validator_index:
$ref: '../primitive.yaml#/Uint64'
sync_committee_indices:
type: array
items:
allOf:
- $ref: '../primitive.yaml#/Uint64'
until_epoch:
$ref: '../primitive.yaml#/Uint64'

0 comments on commit 06df9bf

Please sign in to comment.