Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sync_committee_rewards #262

Merged
merged 17 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions apis/beacon/blocks/sync_committee_rewards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
get:
operationId: getSyncCommitteeRewards
summary: Get sync committee rewards
description: Retrieves rewards info for sync committee members.
tags:
- Beacon
kevinbogner marked this conversation as resolved.
Show resolved Hide resolved
parameters:
- name: block_id
in: path
required: true
example: "head"
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId'
description: |
kevinbogner marked this conversation as resolved.
Show resolved Hide resolved
Block identifier.
Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \<slot\>, \<hex encoded blockRoot with 0x prefix\>.
- name: id
description: "Either hex encoded public key (any bytes48 with 0x prefix) or validator index"
in: query
required: false #true or false?
kevinbogner marked this conversation as resolved.
Show resolved Hide resolved
schema:
type: array
maxItems: 30
uniqueItems: true
items:
description: "Either hex encoded public key (any bytes48 with 0x prefix) or validator index"
type: string
responses:
"200":
description: "Success"
content:
application/json:
schema:
title: GetSyncCommitteeRewardsResponse
type: object
properties:
data:
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/SyncCommitteeRewards'
"400":
description: "Invalid get sync committee rewards request"
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
examples:
InvalidRequest:
value:
code: 400
message: "Invalid request to retrieve sync committee rewards info"
"404":
description: "Block not found"
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 404
message: "Block not found"
"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 @@ -90,6 +90,8 @@ paths:
$ref: "./apis/beacon/blocks/root.yaml"
/eth/v1/beacon/blocks/{block_id}/attestations:
$ref: "./apis/beacon/blocks/attestations.yaml"
/eth/v1/beacon/blocks/{block_id}/sync_committee_rewards: #or /eth/v1/beacon/blocks/{block_id}/sync_committee_rewards?id=...?
kevinbogner marked this conversation as resolved.
Show resolved Hide resolved
$ref: "./apis/beacon/blocks/sync_committee_rewards.yaml"
/eth/v1/beacon/blinded_blocks/{block_id}:
$ref: "./apis/beacon/blocks/blinded_block.yaml"
/eth/v1/beacon/light_client/bootstrap/{block_root}:
Expand Down Expand Up @@ -314,6 +316,8 @@ components:
$ref: './types/fork_choice.yaml#/Node'
ExtraData:
$ref: './types/fork_choice.yaml#/ExtraData'
SyncCommitteeRewards:
$ref: './types/sync_committee_rewards.yaml#/SyncCommitteeRewards'

parameters:
StateId:
Expand Down
4 changes: 4 additions & 0 deletions types/primitive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Uint256:
type: string
example: "1"

Int64:
type: string
example: "1"

DependentRoot:
allOf:
- $ref: "./primitive.yaml#/Root"
Expand Down
17 changes: 17 additions & 0 deletions types/sync_committee_rewards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SyncCommitteeRewards:
description: "Rewards info for sync committee members"
type: array
items:
type: object
description: "Rewards info for a single sync committee member"
michaelsproul marked this conversation as resolved.
Show resolved Hide resolved
properties:
validator_index:
allOf:
- $ref: "./primitive.yaml#/Uint64"
- example: 0
- description: "one entry for every validator participating in the sync committee"
reward:
allOf:
- $ref: "./primitive.yaml#/Int64"
- example: 2000
- description: "sync committee reward in gwei for the validator"