Skip to content

Commit a1d3acc

Browse files
committed
new epbs ptc assignment POST
1 parent 953fd29 commit a1d3acc

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ There are likely to be descriptions etc outside of the list below, but new query
1414
| [#546](https://github.com/ethereum/beacon-APIs/pull/546) `GET /eth/v1/beacon/blobs/{block_id}` added | | | | | |
1515
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `GET /eth/v1/validator/execution_payload_bid/{slot}/{builder_index}` added | | | | | |
1616
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `GET /eth/v1/validator/execution_payload_envelope/{slot}/{builder_index}` added | | | | | |
17+
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `POST /eth/v1/validator/duties/ptc/{epoch}` added | | | | | |
1718
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `POST /eth/v1/beacon/execution_payload_bid` added | | | | | |
1819
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `POST /eth/v1/beacon/execution_payload_envelope` added | | | | | |
1920
| [#552](https://github.com/ethereum/beacon-APIs/pull/552) `GET /eth/v3/validator/blocks/{slot}` updated | | | | | |

apis/validator/duties/ptc.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
post:
2+
tags:
3+
- Validator
4+
summary: "Get PTC duties"
5+
operationId: "getPtcDuties"
6+
description: "Requests the beacon node to provide a set of Payload Timeliness Committee (PTC) duties,
7+
which should be performed by validators, for a particular epoch.
8+
9+
Duties should only need to be checked once per epoch,
10+
however a chain reorganization (of > MIN_SEED_LOOKAHEAD epochs) could occur, resulting in a change of duties. For full safety,
11+
you should monitor head events and confirm the dependent root in this response matches:
12+
13+
- event.previous_duty_dependent_root when `compute_epoch_at_slot(event.slot) == epoch`
14+
15+
- event.current_duty_dependent_root when `compute_epoch_at_slot(event.slot) + 1 == epoch`
16+
17+
- event.block otherwise
18+
19+
20+
The dependent_root value is `get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1)`
21+
or the genesis block root in the case of underflow."
22+
parameters:
23+
- name: epoch
24+
description: "Should only be allowed 1 epoch ahead"
25+
in: path
26+
required: true
27+
schema:
28+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Uint64"
29+
requestBody:
30+
description: "An array of the validator indices for which to obtain the duties."
31+
required: true
32+
content:
33+
application/json:
34+
schema:
35+
title: GetPtcDutiesBody
36+
type: array
37+
minItems: 1
38+
uniqueItems: true
39+
items:
40+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Uint64"
41+
responses:
42+
"200":
43+
description: Success response
44+
content:
45+
application/json:
46+
schema:
47+
title: GetPtcDutiesResponse
48+
type: object
49+
required: [dependent_root, execution_optimistic, data]
50+
properties:
51+
dependent_root:
52+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/DependentRoot"
53+
execution_optimistic:
54+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
55+
data:
56+
type: array
57+
items:
58+
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/PtcDuty'
59+
"400":
60+
description: "Invalid epoch or index"
61+
content:
62+
application/json:
63+
schema:
64+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
65+
example:
66+
code: 400
67+
message: "Invalid epoch: -2"
68+
"500":
69+
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"
70+
"503":
71+
$ref: "../../../beacon-node-oapi.yaml#/components/responses/CurrentlySyncing"

beacon-node-oapi.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ paths:
184184
$ref: "./apis/validator/duties/proposer.yaml"
185185
/eth/v1/validator/duties/sync/{epoch}:
186186
$ref: "./apis/validator/duties/sync.yaml"
187+
/eth/v1/validator/duties/ptc/{epoch}:
188+
$ref: "./apis/validator/duties/ptc.yaml"
187189
/eth/v3/validator/blocks/{slot}:
188190
$ref: "./apis/validator/block.v3.yaml"
189191
/eth/v1/validator/attestation_data:
@@ -237,6 +239,8 @@ components:
237239
$ref: './types/duty.yaml#/AttesterDuty'
238240
ProposerDuty:
239241
$ref: './types/duty.yaml#/ProposerDuty'
242+
PtcDuty:
243+
$ref: './types/duty.yaml#/PtcDuty'
240244
Altair.SyncDuty:
241245
$ref: './types/duty.yaml#/Altair/SyncDuty'
242246
BeaconCommitteeSelection:

types/duty.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@ Altair:
5252
minItems: 1
5353
items:
5454
$ref: './primitive.yaml#/Uint64'
55+
56+
PtcDuty:
57+
type: object
58+
required: [pubkey, validator_index, slot]
59+
properties:
60+
pubkey:
61+
$ref: './primitive.yaml#/Pubkey'
62+
validator_index:
63+
$ref: "./primitive.yaml#/Uint64"
64+
description: "Index of validator in validator registry."
65+
slot:
66+
$ref: "./primitive.yaml#/Uint64"
67+
description: "The slot at which the validator must perform PTC duties."

0 commit comments

Comments
 (0)