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 8 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
61 changes: 61 additions & 0 deletions apis/beacon/blocks/sync_committee_rewards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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
- Rewards
parameters:
- name: block_id
in: path
required: true
example: "head"
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId'
- name: id
description: "Either hex encoded public key (any bytes48 with 0x prefix) or validator index"
in: query
required: false
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:
execution_optimistic:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
finalized:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
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"
6 changes: 6 additions & 0 deletions beacon-node-oapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ tags:
Minimal set of endpoints to enable a working validator implementation.

[Checkout validator flow](./validator-flow.md) to learn how to use this api.
- name: Rewards
description: Endpoints to query rewards and penalties for validators.
paths:

/eth/v1/beacon/genesis:
Expand Down Expand Up @@ -90,6 +92,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:
michaelsproul 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 +318,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
18 changes: 18 additions & 0 deletions types/sync_committee_rewards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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
required: ["validator_index", "reward"]
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"