Skip to content

Commit

Permalink
First cut of a v2 endpoint as described by Jim and Adrian
Browse files Browse the repository at this point in the history
  • Loading branch information
OisinKyne committed Jul 18, 2022
1 parent 5b2448e commit dab9720
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
deploy
node_modules
61 changes: 61 additions & 0 deletions apis/validator/beacon_committee_subscriptions.v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
post:
operationId: "prepareBeaconCommitteeSubnetV2"
summary: Signal beacon node to prepare for a committee subnet
description: |
After beacon node receives this request:
- Search using discv5 for peers related to this subnet and replace current peers with those ones if necessary.
- Check each provided `slot_signature`, to determine whether any validator has been [assigned the duty of aggregation](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/validator.md#aggregation-selection)
based on their slot signature.
tags:
- ValidatorRequiredApi
- Validator
requestBody:
content:
application/json:
schema:
title: SubscribeToBeaconCommitteeSubnetRequestBody
type: array
items:
type: object
properties:
validator_index:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64'
committee_index:
$ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64'
committees_at_slot:
allOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64'
- description: "Number of committees at the returned slot"
slot:
allOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/Uint64'
- description: "Should be slot at which validator is assigned to attest"
slot_signature:
allOf:
- $ref: '../../beacon-node-oapi.yaml#/components/schemas/Signature'
- description: "The slot_signature calculated by the validator for the upcoming attestation slot"
responses:
"200":
description: |
Slot signature is valid and beacon node has prepared the attestation subnet.
If any of the returned results for aggregation selection return `true`, the beacon client will begin
preparing an aggregation that the validator client must ask for
and sign at the appropriate time.
content:
application/json:
schema:
title: PrepareBeaconCommitteeV2Response
type: array
items:
type: object
properties:
is_aggregator:
type: boolean

"400":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
"500":
$ref: '../../beacon-node-oapi.yaml#/components/responses/InternalError'
"503":
$ref: '../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing'
2 changes: 2 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ paths:
$ref: "./apis/validator/aggregate_and_proofs.yaml"
/eth/v1/validator/beacon_committee_subscriptions:
$ref: "./apis/validator/beacon_committee_subscriptions.yaml"
/eth/v2/validator/beacon_committee_subscriptions:
$ref: "./apis/validator/beacon_committee_subscriptions.v2.yaml"
/eth/v1/validator/sync_committee_subscriptions:
$ref: "./apis/validator/sync_committee_subscriptions.yaml"
/eth/v1/validator/sync_committee_contribution:
Expand Down

0 comments on commit dab9720

Please sign in to comment.