Skip to content

Commit e446c0e

Browse files
rolfyonenflaig
andauthored
added pending deposits and pending partial withdrawals accessors (ethereum#500)
Co-authored-by: Nico Flaig <[email protected]>
1 parent e45bcd0 commit e446c0e

File tree

4 files changed

+109
-1
lines changed

4 files changed

+109
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ There are likely to be descriptions etc outside of the list below, but new query
2121
| [#472](https://github.com/ethereum/beacon-APIs/pull/472) `single_attestation EVENT` added | | | | | |
2222
| [#494](https://github.com/ethereum/beacon-APIs/pull/494) `GET /eth/v1/beacon/deposit_snapshot` deprecated | | | | | |
2323
| [#498](https://github.com/ethereum/beacon-APIs/pull/498) `GET /eth/v1/builder/states/{state_id}/expected_withdrawals` deprecated | | | | | |
24-
24+
| [#500](https://github.com/ethereum/beacon-APIs/pull/500) `GET /eth/v1/beacon/states/{state_id}/pending_deposits` added | | | | | |
25+
| [#500](https://github.com/ethereum/beacon-APIs/pull/500) `GET /eth/v1/beacon/states/{state_id}/pending_partial_withdrawals` added | | | | | |
2526

2627
The Following are no longer in the Standard API, removed since the latest version.
2728

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
get:
2+
operationId: "getPendingDeposits"
3+
summary: "Get State Pending Deposits"
4+
description: |
5+
Returns pending deposits for state with given 'stateId'. Should return 400 if the state retrieved is prior to Electra.
6+
tags:
7+
- Beacon
8+
parameters:
9+
- name: state_id
10+
in: path
11+
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId'
12+
responses:
13+
"200":
14+
description: Success
15+
headers:
16+
Eth-Consensus-Version:
17+
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
18+
description: "The active consensus version to which the pending deposits belong."
19+
content:
20+
application/json:
21+
schema:
22+
title: GetPendingDepositsResponse
23+
type: object
24+
required: [version, execution_optimistic, finalized, data]
25+
properties:
26+
version:
27+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion"
28+
example: "electra"
29+
execution_optimistic:
30+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
31+
finalized:
32+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
33+
data:
34+
type: array
35+
items:
36+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.PendingDeposit"
37+
maxItems: 134217728
38+
application/octet-stream:
39+
schema:
40+
description: "SSZ serialized `List[PendingDeposit, PENDING_DEPOSITS_LIMIT]` bytes. Use Accept header to choose this response type"
41+
"400":
42+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
43+
"404":
44+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/NotFound'
45+
"415":
46+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
47+
"500":
48+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
49+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
get:
2+
operationId: "getPendingPartialWithdrawals"
3+
summary: "Get State Pending Partial Withdrawals"
4+
description: |
5+
Returns pending partial withdrawals for state with given 'stateId'. Should return 400 if the state retrieved is prior to Electra.
6+
tags:
7+
- Beacon
8+
parameters:
9+
- name: state_id
10+
in: path
11+
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/StateId'
12+
responses:
13+
"200":
14+
description: Success
15+
headers:
16+
Eth-Consensus-Version:
17+
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version'
18+
description: "The active consensus version to which the pending partial withdrawals belong."
19+
content:
20+
application/json:
21+
schema:
22+
title: GetPendingPartialWithdrawalsResponse
23+
type: object
24+
required: [version, execution_optimistic, finalized, data]
25+
properties:
26+
version:
27+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion"
28+
example: "electra"
29+
execution_optimistic:
30+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic"
31+
finalized:
32+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized"
33+
data:
34+
type: array
35+
items:
36+
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Electra.PendingPartialWithdrawal"
37+
maxItems: 134217728
38+
application/octet-stream:
39+
schema:
40+
description: "SSZ serialized `List[PendingPartialWithdrawals, PENDING_PARTIAL_WITHDRAWALS_LIMIT]` bytes. Use Accept header to choose this response type"
41+
"400":
42+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InvalidRequest'
43+
"404":
44+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/NotFound'
45+
"415":
46+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/UnsupportedMediaType'
47+
"500":
48+
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError'
49+

beacon-node-oapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ paths:
8989
$ref: "./apis/beacon/states/sync_committees.yaml"
9090
/eth/v1/beacon/states/{state_id}/randao:
9191
$ref: "./apis/beacon/states/randao.yaml"
92+
/eth/v1/beacon/states/{state_id}/pending_deposits:
93+
$ref: "./apis/beacon/states/pending_deposits.yaml"
94+
/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals:
95+
$ref: "./apis/beacon/states/pending_partial_withdrawals.yaml"
96+
9297
/eth/v1/beacon/headers:
9398
$ref: "./apis/beacon/blocks/headers.yaml"
9499
/eth/v1/beacon/headers/{block_id}:
@@ -425,6 +430,10 @@ components:
425430
$ref: './types/electra/light_client.yaml#/Electra/LightClientOptimisticUpdate'
426431
Electra.BlobSidecars:
427432
$ref: './types/electra/blob_sidecar.yaml#/Electra/BlobSidecars'
433+
Electra.PendingDeposit:
434+
$ref: './types/electra/deposit.yaml#/Electra/PendingDeposit'
435+
Electra.PendingPartialWithdrawal:
436+
$ref: './types/electra/withdrawal.yaml#/Electra/PendingPartialWithdrawal'
428437
Node:
429438
$ref: './types/fork_choice.yaml#/Node'
430439
ExtraData:

0 commit comments

Comments
 (0)