@lodestar/api 1.44.0-dev.f507c14622 → 1.44.0-dev.f6b2af6879
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.d.ts +1 -26
- package/lib/beacon/routes/beacon/block.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/block.js +3 -130
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +0 -41
- package/lib/beacon/routes/beacon/pool.d.ts.map +1 -1
- package/lib/beacon/routes/beacon/pool.js +0 -50
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/debug.d.ts +51 -1
- package/lib/beacon/routes/debug.d.ts.map +1 -1
- package/lib/beacon/routes/debug.js +55 -1
- package/lib/beacon/routes/debug.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +13 -2
- package/lib/beacon/routes/events.d.ts.map +1 -1
- package/lib/beacon/routes/events.js +8 -0
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/lodestar.d.ts +19 -0
- package/lib/beacon/routes/lodestar.d.ts.map +1 -1
- package/lib/beacon/routes/lodestar.js +6 -2
- package/lib/beacon/routes/lodestar.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +0 -24
- package/lib/beacon/routes/validator.d.ts.map +1 -1
- package/lib/beacon/routes/validator.js +1 -46
- package/lib/beacon/routes/validator.js.map +1 -1
- package/package.json +6 -6
- package/src/beacon/routes/beacon/block.ts +3 -169
- package/src/beacon/routes/beacon/pool.ts +0 -103
- package/src/beacon/routes/debug.ts +81 -1
- package/src/beacon/routes/events.ts +16 -0
- package/src/beacon/routes/lodestar.ts +27 -2
- package/src/beacon/routes/validator.ts +1 -75
|
@@ -110,6 +110,8 @@ export enum EventType {
|
|
|
110
110
|
executionPayloadBid = "execution_payload_bid",
|
|
111
111
|
/** The node has received a `SignedProposerPreferences` (from P2P or API) that passes gossip validation on the `proposer_preferences` topic */
|
|
112
112
|
proposerPreferences = "proposer_preferences",
|
|
113
|
+
/** The node has executed the Fast Confirmation Rule and produced a confirmed beacon block */
|
|
114
|
+
fastConfirmation = "fast_confirmation",
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
export const eventTypes: {[K in EventType]: K} = {
|
|
@@ -135,6 +137,7 @@ export const eventTypes: {[K in EventType]: K} = {
|
|
|
135
137
|
[EventType.executionPayloadAvailable]: EventType.executionPayloadAvailable,
|
|
136
138
|
[EventType.executionPayloadBid]: EventType.executionPayloadBid,
|
|
137
139
|
[EventType.proposerPreferences]: EventType.proposerPreferences,
|
|
140
|
+
[EventType.fastConfirmation]: EventType.fastConfirmation,
|
|
138
141
|
};
|
|
139
142
|
|
|
140
143
|
export type EventData = {
|
|
@@ -203,6 +206,11 @@ export type EventData = {
|
|
|
203
206
|
};
|
|
204
207
|
[EventType.executionPayloadBid]: {version: ForkName; data: gloas.SignedExecutionPayloadBid};
|
|
205
208
|
[EventType.proposerPreferences]: {version: ForkName; data: gloas.SignedProposerPreferences};
|
|
209
|
+
[EventType.fastConfirmation]: {
|
|
210
|
+
block: RootHex;
|
|
211
|
+
slot: Slot;
|
|
212
|
+
currentSlot: Slot;
|
|
213
|
+
};
|
|
206
214
|
};
|
|
207
215
|
|
|
208
216
|
export type BeaconEvent = {[K in EventType]: {type: K; message: EventData[K]}}[EventType];
|
|
@@ -400,6 +408,14 @@ export function getTypeByEvent(config: ChainForkConfig): {[K in EventType]: Type
|
|
|
400
408
|
),
|
|
401
409
|
[EventType.executionPayloadBid]: WithVersion((fork) => getPostGloasForkTypes(fork).SignedExecutionPayloadBid),
|
|
402
410
|
[EventType.proposerPreferences]: WithVersion((fork) => getPostGloasForkTypes(fork).SignedProposerPreferences),
|
|
411
|
+
[EventType.fastConfirmation]: new ContainerType(
|
|
412
|
+
{
|
|
413
|
+
block: stringType,
|
|
414
|
+
slot: ssz.Slot,
|
|
415
|
+
currentSlot: ssz.Slot,
|
|
416
|
+
},
|
|
417
|
+
{jsonCase: "eth2"}
|
|
418
|
+
),
|
|
403
419
|
|
|
404
420
|
[EventType.lightClientOptimisticUpdate]: WithVersion(
|
|
405
421
|
(fork) => getPostAltairForkTypes(fork).LightClientOptimisticUpdate
|
|
@@ -136,6 +136,25 @@ export type CustodyInfo = {
|
|
|
136
136
|
custodyColumns: number[];
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
+
export type FastConfirmationInfo = {
|
|
140
|
+
confirmed: {
|
|
141
|
+
rootHex: RootHex | null;
|
|
142
|
+
slot: Slot | null;
|
|
143
|
+
};
|
|
144
|
+
head: {
|
|
145
|
+
rootHex: RootHex;
|
|
146
|
+
slot: Slot;
|
|
147
|
+
};
|
|
148
|
+
justifiedCheckpoint: {
|
|
149
|
+
rootHex: RootHex;
|
|
150
|
+
epoch: Epoch;
|
|
151
|
+
};
|
|
152
|
+
finalizedCheckpoint: {
|
|
153
|
+
rootHex: RootHex;
|
|
154
|
+
epoch: Epoch;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
|
|
139
158
|
export type Endpoints = {
|
|
140
159
|
/** Trigger to write a heapdump to disk at `dirpath`. May take > 1min */
|
|
141
160
|
writeHeapdump: Endpoint<
|
|
@@ -397,6 +416,8 @@ export type Endpoints = {
|
|
|
397
416
|
EmptyMeta
|
|
398
417
|
>;
|
|
399
418
|
|
|
419
|
+
getFastConfirmationInfo: Endpoint<"GET", EmptyArgs, EmptyRequest, FastConfirmationInfo, EmptyMeta>;
|
|
420
|
+
|
|
400
421
|
/** Craft attester slashings from the attestations in the provided blocks */
|
|
401
422
|
getAttesterSlashingsFromBlocks: Endpoint<
|
|
402
423
|
"POST",
|
|
@@ -579,8 +600,6 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
579
600
|
meta: ExecutionOptimisticFinalizedAndVersionCodec,
|
|
580
601
|
},
|
|
581
602
|
},
|
|
582
|
-
// TODO GLOAS: this endpoint needs to be updated because post-gloas there could be two variants of the persisted checkpoint state (empty or full).
|
|
583
|
-
// Either add a an additional parameter `payloadPresent`, or return one or both variants of state.
|
|
584
603
|
getPersistedCheckpointState: {
|
|
585
604
|
url: "/eth/v1/lodestar/persisted_checkpoint_state",
|
|
586
605
|
method: "GET",
|
|
@@ -634,6 +653,12 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
634
653
|
req: EmptyRequestCodec,
|
|
635
654
|
resp: JsonOnlyResponseCodec,
|
|
636
655
|
},
|
|
656
|
+
getFastConfirmationInfo: {
|
|
657
|
+
url: "/eth/v1/lodestar/fast_confirmation",
|
|
658
|
+
method: "GET",
|
|
659
|
+
req: EmptyRequestCodec,
|
|
660
|
+
resp: JsonOnlyResponseCodec,
|
|
661
|
+
},
|
|
637
662
|
getAttesterSlashingsFromBlocks: {
|
|
638
663
|
url: "/eth/v1/lodestar/blocks/attester_slashings",
|
|
639
664
|
method: "POST",
|
|
@@ -499,23 +499,6 @@ export type Endpoints = {
|
|
|
499
499
|
EmptyMeta
|
|
500
500
|
>;
|
|
501
501
|
|
|
502
|
-
/**
|
|
503
|
-
* Get aggregated attestation
|
|
504
|
-
* Aggregates all attestations matching given attestation data root and slot
|
|
505
|
-
* Returns an aggregated `Attestation` object with same `AttestationData` root.
|
|
506
|
-
*/
|
|
507
|
-
getAggregatedAttestation: Endpoint<
|
|
508
|
-
"GET",
|
|
509
|
-
{
|
|
510
|
-
/** HashTreeRoot of AttestationData that validator want's aggregated */
|
|
511
|
-
attestationDataRoot: Root;
|
|
512
|
-
slot: Slot;
|
|
513
|
-
},
|
|
514
|
-
{query: {attestation_data_root: string; slot: number}},
|
|
515
|
-
phase0.Attestation,
|
|
516
|
-
EmptyMeta
|
|
517
|
-
>;
|
|
518
|
-
|
|
519
502
|
/**
|
|
520
503
|
* Get aggregated attestation
|
|
521
504
|
* Aggregates all attestations matching given attestation data root, slot and committee index
|
|
@@ -534,18 +517,6 @@ export type Endpoints = {
|
|
|
534
517
|
VersionMeta
|
|
535
518
|
>;
|
|
536
519
|
|
|
537
|
-
/**
|
|
538
|
-
* Publish multiple aggregate and proofs
|
|
539
|
-
* Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
|
|
540
|
-
*/
|
|
541
|
-
publishAggregateAndProofs: Endpoint<
|
|
542
|
-
"POST",
|
|
543
|
-
{signedAggregateAndProofs: SignedAggregateAndProofListPhase0},
|
|
544
|
-
{body: unknown},
|
|
545
|
-
EmptyResponseData,
|
|
546
|
-
EmptyMeta
|
|
547
|
-
>;
|
|
548
|
-
|
|
549
520
|
/**
|
|
550
521
|
* Publish multiple aggregate and proofs
|
|
551
522
|
* Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
|
|
@@ -960,7 +931,7 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
960
931
|
},
|
|
961
932
|
},
|
|
962
933
|
getExecutionPayloadEnvelope: {
|
|
963
|
-
url: "/eth/v1/validator/
|
|
934
|
+
url: "/eth/v1/validator/execution_payload_envelopes/{slot}/{beacon_block_root}",
|
|
964
935
|
method: "GET",
|
|
965
936
|
req: {
|
|
966
937
|
writeReq: ({slot, beaconBlockRoot}) => ({
|
|
@@ -1040,29 +1011,6 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
1040
1011
|
meta: EmptyMetaCodec,
|
|
1041
1012
|
},
|
|
1042
1013
|
},
|
|
1043
|
-
getAggregatedAttestation: {
|
|
1044
|
-
url: "/eth/v1/validator/aggregate_attestation",
|
|
1045
|
-
method: "GET",
|
|
1046
|
-
req: {
|
|
1047
|
-
writeReq: ({attestationDataRoot, slot}) => ({
|
|
1048
|
-
query: {attestation_data_root: toRootHex(attestationDataRoot), slot},
|
|
1049
|
-
}),
|
|
1050
|
-
parseReq: ({query}) => ({
|
|
1051
|
-
attestationDataRoot: fromHex(query.attestation_data_root),
|
|
1052
|
-
slot: query.slot,
|
|
1053
|
-
}),
|
|
1054
|
-
schema: {
|
|
1055
|
-
query: {
|
|
1056
|
-
attestation_data_root: Schema.StringRequired,
|
|
1057
|
-
slot: Schema.UintRequired,
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
},
|
|
1061
|
-
resp: {
|
|
1062
|
-
data: ssz.phase0.Attestation,
|
|
1063
|
-
meta: EmptyMetaCodec,
|
|
1064
|
-
},
|
|
1065
|
-
},
|
|
1066
1014
|
getAggregatedAttestationV2: {
|
|
1067
1015
|
url: "/eth/v2/validator/aggregate_attestation",
|
|
1068
1016
|
method: "GET",
|
|
@@ -1088,28 +1036,6 @@ export function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoi
|
|
|
1088
1036
|
meta: VersionCodec,
|
|
1089
1037
|
},
|
|
1090
1038
|
},
|
|
1091
|
-
publishAggregateAndProofs: {
|
|
1092
|
-
url: "/eth/v1/validator/aggregate_and_proofs",
|
|
1093
|
-
method: "POST",
|
|
1094
|
-
req: {
|
|
1095
|
-
writeReqJson: ({signedAggregateAndProofs}) => ({
|
|
1096
|
-
body: SignedAggregateAndProofListPhase0Type.toJson(signedAggregateAndProofs),
|
|
1097
|
-
}),
|
|
1098
|
-
parseReqJson: ({body}) => ({
|
|
1099
|
-
signedAggregateAndProofs: SignedAggregateAndProofListPhase0Type.fromJson(body),
|
|
1100
|
-
}),
|
|
1101
|
-
writeReqSsz: ({signedAggregateAndProofs}) => ({
|
|
1102
|
-
body: SignedAggregateAndProofListPhase0Type.serialize(signedAggregateAndProofs),
|
|
1103
|
-
}),
|
|
1104
|
-
parseReqSsz: ({body}) => ({
|
|
1105
|
-
signedAggregateAndProofs: SignedAggregateAndProofListPhase0Type.deserialize(body),
|
|
1106
|
-
}),
|
|
1107
|
-
schema: {
|
|
1108
|
-
body: Schema.ObjectArray,
|
|
1109
|
-
},
|
|
1110
|
-
},
|
|
1111
|
-
resp: EmptyResponseCodec,
|
|
1112
|
-
},
|
|
1113
1039
|
publishAggregateAndProofsV2: {
|
|
1114
1040
|
url: "/eth/v2/validator/aggregate_and_proofs",
|
|
1115
1041
|
method: "POST",
|