Skip to content

Commit c39ee0b

Browse files
committed
Add proposer duties v2 endpoint
1 parent 8abac03 commit c39ee0b

File tree

4 files changed

+75
-0
lines changed

4 files changed

+75
-0
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ There are likely to be descriptions etc outside of the list below, but new query
88

99
| Endpoint | [Lighthouse](https://github.com/sigp/lighthouse) | [Lodestar](https://github.com/ChainSafe/lodestar) | [Nimbus](https://github.com/status-im/nimbus-eth2) | [Prysm](https://github.com/prysmaticlabs/prysm) | [Teku](https://github.com/ConsenSys/teku) |
1010
|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|---------------------------------------------------|----------------------------------------------------|-------------------------------------------------|-------------------------------------------|
11+
| [#562](https://github.com/ethereum/beacon-APIs/pull/562) `GET /eth/v2/validator/duties/proposer/{epoch}` added | | | | | |
12+
| [#562](https://github.com/ethereum/beacon-APIs/pull/562) `GET /eth/v1/validator/duties/proposer/{epoch}` deprecated | | | | | |
1113

1214
The Following are no longer in the Standard API, removed since the latest version.
1315

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
get:
2+
tags:
3+
- ValidatorRequiredApi
4+
- Validator
5+
summary: "Get block proposers duties"
6+
operationId: "getProposerDutiesV2"
7+
description: "Request beacon node to provide all validators that are scheduled to propose a block in the given epoch.
8+
9+
Duties should only need to be checked once per epoch,
10+
however a chain reorganization could occur that results in a change of duties. For full safety,
11+
you should monitor head events and confirm the dependent root in this response matches. After Fulu,
12+
different checks need to be performed as the dependent root changes due to deterministic proposer lookahead.
13+
14+
15+
Before Fulu:
16+
17+
- event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch`
18+
19+
- event.block otherwise
20+
21+
- dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1)`
22+
23+
24+
After Fulu:
25+
26+
- event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch`
27+
28+
- event.block otherwise
29+
30+
- dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)`
31+
32+
33+
The dependent_root value is the genesis block root in the case of underflow."
34+
parameters:
35+
- name: epoch
36+
in: path
37+
required: true
38+
schema:
39+
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64'
40+
responses:
41+
"200":
42+
description: Success response
43+
content:
44+
application/json:
45+
schema:
46+
title: GetProposerDutiesResponse
47+
type: object
48+
required: [dependent_root, execution_optimistic, data]
49+
properties:
50+
dependent_root:
51+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/DependentRoot"
52+
execution_optimistic:
53+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
54+
data:
55+
type: array
56+
items:
57+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ProposerDuty"
58+
"400":
59+
description: "Invalid epoch"
60+
content:
61+
application/json:
62+
schema:
63+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
64+
example:
65+
code: 400
66+
message: "Invalid epoch: -2"
67+
"500":
68+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
69+
"503":
70+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing'

apis/validator/duties/proposer.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ get:
33
- ValidatorRequiredApi
44
- Validator
55
summary: "Get block proposers duties"
6+
deprecated: true
67
operationId: "getProposerDuties"
78
description: "Request beacon node to provide all validators that are scheduled to propose a block in the given epoch.
89

beacon-node-oapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ paths:
178178
$ref: "./apis/validator/duties/attester.yaml"
179179
/eth/v1/validator/duties/proposer/{epoch}:
180180
$ref: "./apis/validator/duties/proposer.yaml"
181+
/eth/v2/validator/duties/proposer/{epoch}:
182+
$ref: "./apis/validator/duties/proposer.v2.yaml"
181183
/eth/v1/validator/duties/sync/{epoch}:
182184
$ref: "./apis/validator/duties/sync.yaml"
183185
/eth/v3/validator/blocks/{slot}:

0 commit comments

Comments
 (0)