diff --git a/apis/beacon/rewards/sync_committee.yaml b/apis/beacon/rewards/sync_committee.yaml new file mode 100644 index 00000000..006da8f5 --- /dev/null +++ b/apis/beacon/rewards/sync_committee.yaml @@ -0,0 +1,62 @@ +post: + operationId: getSyncCommitteeRewards + summary: Get sync committee rewards + description: Retrieves rewards info for sync committee members specified by array of public keys or validator index. If no array is provided, return reward info for every committee member. + tags: + - Beacon + - Rewards + - Experimental + parameters: + - name: block_id + in: path + required: true + example: "head" + $ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' + requestBody: + description: "An array of either hex encoded public key (any bytes48 with 0x prefix) or validator index" + required: false + content: + application/json: + schema: + type: array + 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: + $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" diff --git a/beacon-node-oapi.yaml b/beacon-node-oapi.yaml index d70dc886..e0812350 100644 --- a/beacon-node-oapi.yaml +++ b/beacon-node-oapi.yaml @@ -58,6 +58,7 @@ tags: description: Endpoints to query rewards and penalties for validators. - name: Experimental description: Endpoints that are not stable or fully implemented by each client. + paths: /eth/v1/beacon/genesis: @@ -94,6 +95,8 @@ paths: $ref: "./apis/beacon/blocks/root.yaml" /eth/v1/beacon/blocks/{block_id}/attestations: $ref: "./apis/beacon/blocks/attestations.yaml" + /eth/v1/beacon/rewards/sync_committee/{block_id}: + $ref: "./apis/beacon/rewards/sync_committee.yaml" /eth/v1/beacon/deposit_snapshot: $ref: "./apis/beacon/deposit_snapshot.yaml" /eth/v1/beacon/rewards/blocks/{block_id}: @@ -326,6 +329,8 @@ components: $ref: './types/fork_choice.yaml#/Node' ExtraData: $ref: './types/fork_choice.yaml#/ExtraData' + SyncCommitteeRewards: + $ref: './types/rewards.yaml#/SyncCommitteeRewards' BlockRewards: $ref: './types/rewards.yaml#/BlockRewards' AttestationsRewards: diff --git a/types/rewards.yaml b/types/rewards.yaml index dbb56271..c091d75a 100644 --- a/types/rewards.yaml +++ b/types/rewards.yaml @@ -1,3 +1,22 @@ +SyncCommitteeRewards: + description: "Rewards info for sync committee members" + type: array + items: + type: object + description: "Rewards info for a single sync committee member" + 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" + AttestationsRewards: description: "Rewards info for attestations" type: array @@ -102,4 +121,4 @@ BlockRewards: allOf: - $ref: "./primitive.yaml#/Uint64" - example: 123 - - description: "block reward component due to included attester_slashings in gwei" \ No newline at end of file + - description: "block reward component due to included attester_slashings in gwei"