-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathupdates.yaml
97 lines (93 loc) · 4.86 KB
/
updates.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
get:
operationId: getLightClientUpdatesByRange
summary: Get `LightClientUpdate` instances in a requested sync committee period range
description: |
Requests the [`LightClientUpdate`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/sync-protocol.md#lightclientupdate) instances in the sync committee period range `[start_period, start_period + count)`, leading up to the current head sync committee period as selected by fork choice.
Depending on the `Accept` header they can be returned either as JSON or SSZ-serialized bytes.
Servers SHOULD provide results as defined in [`create_light_client_update`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/full-node.md#create_light_client_update). They MUST respond with at least the earliest known result within the requested range, and MUST send results in consecutive order (by period). The response MUST NOT contain more than [`min(MAX_REQUEST_LIGHT_CLIENT_UPDATES, count)`](https://github.com/ethereum/consensus-specs/blob/v1.3.0/specs/altair/light-client/p2p-interface.md#configuration) results.
tags:
- Beacon
parameters:
- name: start_period
in: query
required: true
schema:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64'
- name: count
in: query
required: true
schema:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64'
responses:
"200":
description: Success
content:
application/json:
schema:
title: GetLightClientUpdatesByRangeResponse
type: array
items:
type: object
required: [version, data]
properties:
version:
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion'
data:
anyOf:
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Altair.LightClientUpdate'
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Capella.LightClientUpdate'
application/octet-stream:
schema:
description: |
Sequence of zero or more `response_chunk`. Each _successful_ `response_chunk` MUST contain a single `LightClientUpdate` payload:
```
(
response_chunk_len: Little-endian Uint64 byte length of `response_chunk`
response_chunk: (
context: 4 byte `ForkDigest`
payload: SSZ serialized payload bytes
)
)
```
Use Accept header to choose this response type
For each `response_chunk`, a `ForkDigest`-context based on `compute_fork_version(compute_epoch_at_slot(update.attested_header.beacon.slot))` is used to select the fork namespace of the Response type. Note that this `fork_version` may be different from the one used to verify the `update.sync_aggregate`, which is based on `update.signature_slot`.
Per `context = compute_fork_digest(fork_version, genesis_validators_root)`:
| `fork_version` | Response chunk SSZ type |
| ------------------------------------------------------------------- | ------------------------------------- |
| `GENESIS_FORK_VERSION` | n/a |
| <nobr>`ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION`</nobr> | `altair.LightClientUpdate` |
| <nobr>`CAPELLA_FORK_VERSION` and later</nobr> | `capella.LightClientUpdate` |
"400":
description: Malformed or missing request parameter
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
examples:
InvalidSyncPeriod:
value:
code: 400
message: "Invalid sync committee period requested"
InvalidCount:
value:
code: 400
message: "Invalid count requested"
MissingStartPeriodValue:
value:
code: 400
message: "Missing `start_period` value"
MissingCountValue:
value:
code: 400
message: "Missing `count` value"
"406":
description: Unacceptable media type
content:
application/json:
schema:
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage"
example:
code: 406
message: "Accepted media type not supported"
"500":
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError"