@lodestar/api 1.43.0-dev.4fb05c546d → 1.43.0-dev.4fe6b362c9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/beacon/routes/beacon/block.js +2 -2
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +79 -0
- package/lib/beacon/routes/beacon/pool.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/pool.js +86 -1
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +39 -5
- package/lib/beacon/routes/events.d.ts.map +1 -1
- package/lib/beacon/routes/events.js +4 -2
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/node.d.ts +1 -0
- package/lib/beacon/routes/node.d.ts.map +1 -1
- package/lib/beacon/routes/node.js +1 -0
- package/lib/beacon/routes/node.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +45 -0
- package/lib/beacon/routes/validator.d.ts.map +1 -1
- package/lib/beacon/routes/validator.js +42 -0
- package/lib/beacon/routes/validator.js.map +1 -1
- package/package.json +7 -7
- package/src/beacon/routes/beacon/block.ts +2 -2
- package/src/beacon/routes/beacon/pool.ts +148 -1
- package/src/beacon/routes/events.ts +5 -4
- package/src/beacon/routes/node.ts +1 -0
- package/src/beacon/routes/validator.ts +80 -0
|
@@ -108,6 +108,8 @@ export enum EventType {
|
|
|
108
108
|
executionPayloadAvailable = "execution_payload_available",
|
|
109
109
|
/** The node has received a `SignedExecutionPayloadBid` (from P2P or API) that passes gossip validation on the `execution_payload_bid` topic */
|
|
110
110
|
executionPayloadBid = "execution_payload_bid",
|
|
111
|
+
/** The node has received a `SignedProposerPreferences` (from P2P or API) that passes gossip validation on the `proposer_preferences` topic */
|
|
112
|
+
proposerPreferences = "proposer_preferences",
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
export const eventTypes: {[K in EventType]: K} = {
|
|
@@ -132,6 +134,7 @@ export const eventTypes: {[K in EventType]: K} = {
|
|
|
132
134
|
[EventType.executionPayloadGossip]: EventType.executionPayloadGossip,
|
|
133
135
|
[EventType.executionPayloadAvailable]: EventType.executionPayloadAvailable,
|
|
134
136
|
[EventType.executionPayloadBid]: EventType.executionPayloadBid,
|
|
137
|
+
[EventType.proposerPreferences]: EventType.proposerPreferences,
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
export type EventData = {
|
|
@@ -186,7 +189,6 @@ export type EventData = {
|
|
|
186
189
|
builderIndex: BuilderIndex;
|
|
187
190
|
blockHash: RootHex;
|
|
188
191
|
blockRoot: RootHex;
|
|
189
|
-
stateRoot: RootHex;
|
|
190
192
|
executionOptimistic: boolean;
|
|
191
193
|
};
|
|
192
194
|
[EventType.executionPayloadGossip]: {
|
|
@@ -194,13 +196,13 @@ export type EventData = {
|
|
|
194
196
|
builderIndex: BuilderIndex;
|
|
195
197
|
blockHash: RootHex;
|
|
196
198
|
blockRoot: RootHex;
|
|
197
|
-
stateRoot: RootHex;
|
|
198
199
|
};
|
|
199
200
|
[EventType.executionPayloadAvailable]: {
|
|
200
201
|
slot: Slot;
|
|
201
202
|
blockRoot: RootHex;
|
|
202
203
|
};
|
|
203
204
|
[EventType.executionPayloadBid]: {version: ForkName; data: gloas.SignedExecutionPayloadBid};
|
|
205
|
+
[EventType.proposerPreferences]: {version: ForkName; data: gloas.SignedProposerPreferences};
|
|
204
206
|
};
|
|
205
207
|
|
|
206
208
|
export type BeaconEvent = {[K in EventType]: {type: K; message: EventData[K]}}[EventType];
|
|
@@ -376,7 +378,6 @@ export function getTypeByEvent(config: ChainForkConfig): {[K in EventType]: Type
|
|
|
376
378
|
builderIndex: ssz.BuilderIndex,
|
|
377
379
|
blockHash: stringType,
|
|
378
380
|
blockRoot: stringType,
|
|
379
|
-
stateRoot: stringType,
|
|
380
381
|
executionOptimistic: ssz.Boolean,
|
|
381
382
|
},
|
|
382
383
|
{jsonCase: "eth2"}
|
|
@@ -387,7 +388,6 @@ export function getTypeByEvent(config: ChainForkConfig): {[K in EventType]: Type
|
|
|
387
388
|
builderIndex: ssz.BuilderIndex,
|
|
388
389
|
blockHash: stringType,
|
|
389
390
|
blockRoot: stringType,
|
|
390
|
-
stateRoot: stringType,
|
|
391
391
|
},
|
|
392
392
|
{jsonCase: "eth2"}
|
|
393
393
|
),
|
|
@@ -399,6 +399,7 @@ export function getTypeByEvent(config: ChainForkConfig): {[K in EventType]: Type
|
|
|
399
399
|
{jsonCase: "eth2"}
|
|
400
400
|
),
|
|
401
401
|
[EventType.executionPayloadBid]: WithVersion((fork) => getPostGloasForkTypes(fork).SignedExecutionPayloadBid),
|
|
402
|
+
[EventType.proposerPreferences]: WithVersion((fork) => getPostGloasForkTypes(fork).SignedProposerPreferences),
|
|
402
403
|
|
|
403
404
|
[EventType.lightClientOptimisticUpdate]: WithVersion(
|
|
404
405
|
(fork) => getPostAltairForkTypes(fork).LightClientOptimisticUpdate
|
|
@@ -131,6 +131,18 @@ export const ProposerDutyType = new ContainerType(
|
|
|
131
131
|
{jsonCase: "eth2"}
|
|
132
132
|
);
|
|
133
133
|
|
|
134
|
+
export const PtcDutyType = new ContainerType(
|
|
135
|
+
{
|
|
136
|
+
/** Public key of the validator in the registry */
|
|
137
|
+
pubkey: ssz.BLSPubkey,
|
|
138
|
+
/** Index of validator in the registry. */
|
|
139
|
+
validatorIndex: ssz.ValidatorIndex,
|
|
140
|
+
/** The slot at which the validator must perform PTC duties. */
|
|
141
|
+
slot: ssz.Slot,
|
|
142
|
+
},
|
|
143
|
+
{jsonCase: "eth2"}
|
|
144
|
+
);
|
|
145
|
+
|
|
134
146
|
/**
|
|
135
147
|
* From https://github.com/ethereum/beacon-APIs/pull/134
|
|
136
148
|
*/
|
|
@@ -219,6 +231,7 @@ export const LivenessResponseDataType = new ContainerType(
|
|
|
219
231
|
export const ValidatorIndicesType = ArrayOf(ssz.ValidatorIndex);
|
|
220
232
|
export const AttesterDutyListType = ArrayOf(AttesterDutyType);
|
|
221
233
|
export const ProposerDutyListType = ArrayOf(ProposerDutyType);
|
|
234
|
+
export const PtcDutyListType = ArrayOf(PtcDutyType);
|
|
222
235
|
export const SyncDutyListType = ArrayOf(SyncDutyType);
|
|
223
236
|
export const SignedAggregateAndProofListPhase0Type = ArrayOf(ssz.phase0.SignedAggregateAndProof);
|
|
224
237
|
export const SignedAggregateAndProofListElectraType = ArrayOf(ssz.electra.SignedAggregateAndProof);
|
|
@@ -239,6 +252,8 @@ export type AttesterDuty = ValueOf<typeof AttesterDutyType>;
|
|
|
239
252
|
export type AttesterDutyList = ValueOf<typeof AttesterDutyListType>;
|
|
240
253
|
export type ProposerDuty = ValueOf<typeof ProposerDutyType>;
|
|
241
254
|
export type ProposerDutyList = ValueOf<typeof ProposerDutyListType>;
|
|
255
|
+
export type PtcDuty = ValueOf<typeof PtcDutyType>;
|
|
256
|
+
export type PtcDutyList = ValueOf<typeof PtcDutyListType>;
|
|
242
257
|
export type SyncDuty = ValueOf<typeof SyncDutyType>;
|
|
243
258
|
export type SyncDutyList = ValueOf<typeof SyncDutyListType>;
|
|
244
259
|
export type SignedAggregateAndProofListPhase0 = ValueOf<typeof SignedAggregateAndProofListPhase0Type>;
|
|
@@ -336,6 +351,23 @@ export type Endpoints = {
|
|
|
336
351
|
ExecutionOptimisticMeta
|
|
337
352
|
>;
|
|
338
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Get PTC duties
|
|
356
|
+
* Requests the beacon node to provide a set of Payload Timeliness Committee duties for a particular epoch.
|
|
357
|
+
*/
|
|
358
|
+
getPtcDuties: Endpoint<
|
|
359
|
+
"POST",
|
|
360
|
+
{
|
|
361
|
+
/** Must not be greater than the next epoch */
|
|
362
|
+
epoch: Epoch;
|
|
363
|
+
/** An array of the validator indices for which to obtain the duties */
|
|
364
|
+
indices: ValidatorIndices;
|
|
365
|
+
},
|
|
366
|
+
{params: {epoch: Epoch}; body: unknown},
|
|
367
|
+
PtcDutyList,
|
|
368
|
+
ExecutionOptimisticAndDependentRootMeta
|
|
369
|
+
>;
|
|
370
|
+
|
|
339
371
|
/**
|
|
340
372
|
* Requests a beacon node to produce a valid block, which can then be signed by a validator.
|
|
341
373
|
* Metadata in the response indicates the type of block produced, and the supported types of block
|
|
@@ -440,6 +472,21 @@ export type Endpoints = {
|
|
|
440
472
|
EmptyMeta
|
|
441
473
|
>;
|
|
442
474
|
|
|
475
|
+
/**
|
|
476
|
+
* Produce payload attestation data
|
|
477
|
+
* Requests that the beacon node produce a PayloadAttestationData.
|
|
478
|
+
*/
|
|
479
|
+
producePayloadAttestationData: Endpoint<
|
|
480
|
+
"GET",
|
|
481
|
+
{
|
|
482
|
+
/** The slot for which payload attestation data should be created */
|
|
483
|
+
slot: Slot;
|
|
484
|
+
},
|
|
485
|
+
{params: {slot: Slot}},
|
|
486
|
+
gloas.PayloadAttestationData,
|
|
487
|
+
VersionMeta
|
|
488
|
+
>;
|
|
489
|
+
|
|
443
490
|
produceSyncCommitteeContribution: Endpoint<
|
|
444
491
|
"GET",
|
|
445
492
|
{
|
|
@@ -698,6 +745,24 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
698
745
|
meta: ExecutionOptimisticCodec,
|
|
699
746
|
},
|
|
700
747
|
},
|
|
748
|
+
getPtcDuties: {
|
|
749
|
+
url: "/eth/v1/validator/duties/ptc/{epoch}",
|
|
750
|
+
method: "POST",
|
|
751
|
+
req: {
|
|
752
|
+
writeReqJson: ({epoch, indices}) => ({params: {epoch}, body: ValidatorIndicesType.toJson(indices)}),
|
|
753
|
+
parseReqJson: ({params, body}) => ({epoch: params.epoch, indices: ValidatorIndicesType.fromJson(body)}),
|
|
754
|
+
writeReqSsz: ({epoch, indices}) => ({params: {epoch}, body: ValidatorIndicesType.serialize(indices)}),
|
|
755
|
+
parseReqSsz: ({params, body}) => ({epoch: params.epoch, indices: ValidatorIndicesType.deserialize(body)}),
|
|
756
|
+
schema: {
|
|
757
|
+
params: {epoch: Schema.UintRequired},
|
|
758
|
+
body: Schema.StringArray,
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
resp: {
|
|
762
|
+
data: PtcDutyListType,
|
|
763
|
+
meta: ExecutionOptimisticAndDependentRootCodec,
|
|
764
|
+
},
|
|
765
|
+
},
|
|
701
766
|
produceBlockV3: {
|
|
702
767
|
url: "/eth/v3/validator/blocks/{slot}",
|
|
703
768
|
method: "GET",
|
|
@@ -935,6 +1000,21 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
935
1000
|
meta: EmptyMetaCodec,
|
|
936
1001
|
},
|
|
937
1002
|
},
|
|
1003
|
+
producePayloadAttestationData: {
|
|
1004
|
+
url: "/eth/v1/validator/payload_attestation_data/{slot}",
|
|
1005
|
+
method: "GET",
|
|
1006
|
+
req: {
|
|
1007
|
+
writeReq: ({slot}) => ({params: {slot}}),
|
|
1008
|
+
parseReq: ({params}) => ({slot: params.slot}),
|
|
1009
|
+
schema: {
|
|
1010
|
+
params: {slot: Schema.UintRequired},
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
1013
|
+
resp: {
|
|
1014
|
+
data: ssz.gloas.PayloadAttestationData,
|
|
1015
|
+
meta: VersionCodec,
|
|
1016
|
+
},
|
|
1017
|
+
},
|
|
938
1018
|
produceSyncCommitteeContribution: {
|
|
939
1019
|
url: "/eth/v1/validator/sync_committee_contribution",
|
|
940
1020
|
method: "GET",
|