@lodestar/api 1.44.0-dev.b68fc56ae0 → 1.44.0-dev.be2850b7bb
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContainerType, Type, ValueOf } from "@chainsafe/ssz";
|
|
1
|
+
import { ContainerType, OptionalType, Type, ValueOf } from "@chainsafe/ssz";
|
|
2
2
|
import { ChainForkConfig } from "@lodestar/config";
|
|
3
3
|
import { BeaconState, DataColumnSidecars, StringType } from "@lodestar/types";
|
|
4
4
|
import { EmptyArgs, EmptyMeta, EmptyRequest } from "../../utils/codecs.js";
|
|
@@ -26,6 +26,51 @@ declare const ForkChoiceResponseType: ContainerType<{
|
|
|
26
26
|
executionBlockHash: StringType<string>;
|
|
27
27
|
}>>, unknown, unknown>;
|
|
28
28
|
}>;
|
|
29
|
+
declare const ForkChoiceResponseV2Type: ContainerType<{
|
|
30
|
+
justifiedCheckpoint: ContainerType<{
|
|
31
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
32
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
33
|
+
}>;
|
|
34
|
+
finalizedCheckpoint: ContainerType<{
|
|
35
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
36
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
37
|
+
}>;
|
|
38
|
+
forkChoiceNodes: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
39
|
+
payloadStatus: StringType<"empty" | "full" | "pending">;
|
|
40
|
+
slot: import("@chainsafe/ssz").UintNumberType;
|
|
41
|
+
blockRoot: StringType<string>;
|
|
42
|
+
parentRoot: StringType<string>;
|
|
43
|
+
weight: import("@chainsafe/ssz").UintNumberType;
|
|
44
|
+
validity: StringType<"invalid" | "optimistic" | "valid">;
|
|
45
|
+
executionBlockHash: StringType<string>;
|
|
46
|
+
extraData: ContainerType<{
|
|
47
|
+
executionOptimistic: import("@chainsafe/ssz").BooleanType;
|
|
48
|
+
timestamp: import("@chainsafe/ssz").UintNumberType;
|
|
49
|
+
target: StringType<string>;
|
|
50
|
+
justifiedEpoch: import("@chainsafe/ssz").UintNumberType;
|
|
51
|
+
finalizedEpoch: import("@chainsafe/ssz").UintNumberType;
|
|
52
|
+
unrealizedJustifiedEpoch: import("@chainsafe/ssz").UintNumberType;
|
|
53
|
+
unrealizedFinalizedEpoch: import("@chainsafe/ssz").UintNumberType;
|
|
54
|
+
payloadAttesterCount: OptionalType<import("@chainsafe/ssz").UintNumberType>;
|
|
55
|
+
payloadAvailabilityYesCount: OptionalType<import("@chainsafe/ssz").UintNumberType>;
|
|
56
|
+
payloadDataAvailabilityYesCount: OptionalType<import("@chainsafe/ssz").UintNumberType>;
|
|
57
|
+
gasLimit: OptionalType<import("@chainsafe/ssz").UintNumberType>;
|
|
58
|
+
}>;
|
|
59
|
+
}>>, unknown, unknown>;
|
|
60
|
+
extraData: ContainerType<{
|
|
61
|
+
unrealizedJustifiedCheckpoint: ContainerType<{
|
|
62
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
63
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
64
|
+
}>;
|
|
65
|
+
unrealizedFinalizedCheckpoint: ContainerType<{
|
|
66
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
67
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
68
|
+
}>;
|
|
69
|
+
proposerBoostRoot: StringType<string>;
|
|
70
|
+
previousProposerBoostRoot: StringType<string>;
|
|
71
|
+
headRoot: StringType<string>;
|
|
72
|
+
}>;
|
|
73
|
+
}>;
|
|
29
74
|
declare const ProtoNodeListType: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
30
75
|
executionPayloadBlockHash: StringType<string>;
|
|
31
76
|
executionPayloadNumber: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -57,6 +102,7 @@ declare const DebugChainHeadListType: import("@chainsafe/ssz").ArrayType<Type<im
|
|
|
57
102
|
type ProtoNodeList = ValueOf<typeof ProtoNodeListType>;
|
|
58
103
|
type DebugChainHeadList = ValueOf<typeof DebugChainHeadListType>;
|
|
59
104
|
type ForkChoiceResponse = ValueOf<typeof ForkChoiceResponseType>;
|
|
105
|
+
type ForkChoiceResponseV2 = ValueOf<typeof ForkChoiceResponseV2Type>;
|
|
60
106
|
export type Endpoints = {
|
|
61
107
|
/**
|
|
62
108
|
* Retrieves all possible chain heads (leaves of fork choice tree).
|
|
@@ -66,6 +112,10 @@ export type Endpoints = {
|
|
|
66
112
|
* Retrieves all current fork choice context
|
|
67
113
|
*/
|
|
68
114
|
getDebugForkChoice: Endpoint<"GET", EmptyArgs, EmptyRequest, ForkChoiceResponse, EmptyMeta>;
|
|
115
|
+
/**
|
|
116
|
+
* Retrieves all current fork choice context (v2: per (root, payload_status) with PTC vote tallies)
|
|
117
|
+
*/
|
|
118
|
+
getDebugForkChoiceV2: Endpoint<"GET", EmptyArgs, EmptyRequest, ForkChoiceResponseV2, EmptyMeta>;
|
|
69
119
|
/**
|
|
70
120
|
* Dump all ProtoArray's nodes to debug
|
|
71
121
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/beacon/routes/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/beacon/routes/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAU,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAA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CAE1B,KAAK,EACL,SAAS,EACT,YAAY,EACZ,aAAa,EACb,SAAS,CACV,CAAC;IAEF;;;;OAIG;IACH,UAAU,EAAE,QAAQ,CAClB,KAAK,EACL,SAAS,EACT;QAAC,MAAM,EAAE;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAC,CAAA;KAAC,EAC5B,WAAW,EACX,0CAA0C,CAC3C,CAAC;IAEF;;;OAGG;IACH,0BAA0B,EAAE,QAAQ,CAClC,KAAK,EACL,SAAS,GAAG;QACV;;;;WAIG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,EACD;QAAC,MAAM,EAAE;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAC,CAAC;QAAC,KAAK,EAAE;YAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;SAAC,CAAA;KAAC,EACzD,kBAAkB,EAClB,0CAA0C,CAC3C,CAAC;CACH,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAAC,SAAS,CAAC,CA6FpF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContainerType } from "@chainsafe/ssz";
|
|
1
|
+
import { ContainerType, OptionalType } from "@chainsafe/ssz";
|
|
2
2
|
import { isForkPostFulu } from "@lodestar/params";
|
|
3
3
|
import { ArrayOf, StringType, ssz, sszTypesFor } from "@lodestar/types";
|
|
4
4
|
import { EmptyMetaCodec, EmptyRequestCodec, WithVersion, } from "../../utils/codecs.js";
|
|
@@ -49,6 +49,42 @@ const ForkChoiceResponseType = new ContainerType({
|
|
|
49
49
|
finalizedCheckpoint: ssz.phase0.Checkpoint,
|
|
50
50
|
forkChoiceNodes: ArrayOf(ForkChoiceNodeType),
|
|
51
51
|
}, { jsonCase: "eth2" });
|
|
52
|
+
const ForkChoiceNodeV2ExtraDataType = new ContainerType({
|
|
53
|
+
executionOptimistic: ssz.Boolean,
|
|
54
|
+
timestamp: ssz.UintNum64,
|
|
55
|
+
target: stringType,
|
|
56
|
+
justifiedEpoch: ssz.Epoch,
|
|
57
|
+
finalizedEpoch: ssz.Epoch,
|
|
58
|
+
unrealizedJustifiedEpoch: ssz.Epoch,
|
|
59
|
+
unrealizedFinalizedEpoch: ssz.Epoch,
|
|
60
|
+
payloadAttesterCount: new OptionalType(ssz.UintNum64),
|
|
61
|
+
payloadAvailabilityYesCount: new OptionalType(ssz.UintNum64),
|
|
62
|
+
payloadDataAvailabilityYesCount: new OptionalType(ssz.UintNum64),
|
|
63
|
+
gasLimit: new OptionalType(ssz.UintNum64),
|
|
64
|
+
}, { jsonCase: "eth2" });
|
|
65
|
+
const ForkChoiceNodeV2Type = new ContainerType({
|
|
66
|
+
payloadStatus: new StringType(),
|
|
67
|
+
slot: ssz.Slot,
|
|
68
|
+
blockRoot: stringType,
|
|
69
|
+
parentRoot: stringType,
|
|
70
|
+
weight: ssz.UintNum64,
|
|
71
|
+
validity: new StringType(),
|
|
72
|
+
executionBlockHash: stringType,
|
|
73
|
+
extraData: ForkChoiceNodeV2ExtraDataType,
|
|
74
|
+
}, { jsonCase: "eth2" });
|
|
75
|
+
const ForkChoiceExtraDataType = new ContainerType({
|
|
76
|
+
unrealizedJustifiedCheckpoint: ssz.phase0.Checkpoint,
|
|
77
|
+
unrealizedFinalizedCheckpoint: ssz.phase0.Checkpoint,
|
|
78
|
+
proposerBoostRoot: stringType,
|
|
79
|
+
previousProposerBoostRoot: stringType,
|
|
80
|
+
headRoot: stringType,
|
|
81
|
+
}, { jsonCase: "eth2" });
|
|
82
|
+
const ForkChoiceResponseV2Type = new ContainerType({
|
|
83
|
+
justifiedCheckpoint: ssz.phase0.Checkpoint,
|
|
84
|
+
finalizedCheckpoint: ssz.phase0.Checkpoint,
|
|
85
|
+
forkChoiceNodes: ArrayOf(ForkChoiceNodeV2Type),
|
|
86
|
+
extraData: ForkChoiceExtraDataType,
|
|
87
|
+
}, { jsonCase: "eth2" });
|
|
52
88
|
const ProtoNodeListType = ArrayOf(ProtoNodeType);
|
|
53
89
|
const DebugChainHeadListType = ArrayOf(DebugChainHeadType);
|
|
54
90
|
export function getDefinitions(_config) {
|
|
@@ -81,6 +117,24 @@ export function getDefinitions(_config) {
|
|
|
81
117
|
},
|
|
82
118
|
},
|
|
83
119
|
},
|
|
120
|
+
getDebugForkChoiceV2: {
|
|
121
|
+
url: "/eth/v2/debug/fork_choice",
|
|
122
|
+
method: "GET",
|
|
123
|
+
req: EmptyRequestCodec,
|
|
124
|
+
resp: {
|
|
125
|
+
data: ForkChoiceResponseV2Type,
|
|
126
|
+
meta: EmptyMetaCodec,
|
|
127
|
+
onlySupport: WireFormat.json,
|
|
128
|
+
transform: {
|
|
129
|
+
toResponse: (data) => ({
|
|
130
|
+
...data,
|
|
131
|
+
}),
|
|
132
|
+
fromResponse: (resp) => ({
|
|
133
|
+
data: resp,
|
|
134
|
+
}),
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
84
138
|
getProtoArrayNodes: {
|
|
85
139
|
url: "/eth/v0/debug/forkchoice",
|
|
86
140
|
method: "GET",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/beacon/routes/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAgB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../src/beacon/routes/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAmC,UAAU,EAAE,GAAG,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAGL,cAAc,EAEd,iBAAiB,EACjB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2CAA2C,GAE5C,MAAM,yBAAyB,C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D;SACF;KACF,CAAC;AAAA,CACH"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.44.0-dev.
|
|
14
|
+
"version": "1.44.0-dev.be2850b7bb",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@chainsafe/persistent-merkle-tree": "^1.2.5",
|
|
78
78
|
"@chainsafe/ssz": "^1.4.0",
|
|
79
|
-
"@lodestar/config": "^1.44.0-dev.
|
|
80
|
-
"@lodestar/params": "^1.44.0-dev.
|
|
81
|
-
"@lodestar/types": "^1.44.0-dev.
|
|
82
|
-
"@lodestar/utils": "^1.44.0-dev.
|
|
79
|
+
"@lodestar/config": "^1.44.0-dev.be2850b7bb",
|
|
80
|
+
"@lodestar/params": "^1.44.0-dev.be2850b7bb",
|
|
81
|
+
"@lodestar/types": "^1.44.0-dev.be2850b7bb",
|
|
82
|
+
"@lodestar/utils": "^1.44.0-dev.be2850b7bb",
|
|
83
83
|
"eventsource": "^2.0.2",
|
|
84
84
|
"qs": "^6.11.1"
|
|
85
85
|
},
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"api",
|
|
97
97
|
"blockchain"
|
|
98
98
|
],
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "6006ab1cca25bb4d64302db69d3864ef42d6b23e"
|
|
100
100
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ContainerType, Type, ValueOf} from "@chainsafe/ssz";
|
|
1
|
+
import {ContainerType, OptionalType, Type, ValueOf} from "@chainsafe/ssz";
|
|
2
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
3
3
|
import {isForkPostFulu} from "@lodestar/params";
|
|
4
4
|
import {ArrayOf, BeaconState, DataColumnSidecars, StringType, ssz, sszTypesFor} from "@lodestar/types";
|
|
@@ -78,12 +78,62 @@ const ForkChoiceResponseType = new ContainerType(
|
|
|
78
78
|
{jsonCase: "eth2"}
|
|
79
79
|
);
|
|
80
80
|
|
|
81
|
+
const ForkChoiceNodeV2ExtraDataType = new ContainerType(
|
|
82
|
+
{
|
|
83
|
+
executionOptimistic: ssz.Boolean,
|
|
84
|
+
timestamp: ssz.UintNum64,
|
|
85
|
+
target: stringType,
|
|
86
|
+
justifiedEpoch: ssz.Epoch,
|
|
87
|
+
finalizedEpoch: ssz.Epoch,
|
|
88
|
+
unrealizedJustifiedEpoch: ssz.Epoch,
|
|
89
|
+
unrealizedFinalizedEpoch: ssz.Epoch,
|
|
90
|
+
payloadAttesterCount: new OptionalType(ssz.UintNum64),
|
|
91
|
+
payloadAvailabilityYesCount: new OptionalType(ssz.UintNum64),
|
|
92
|
+
payloadDataAvailabilityYesCount: new OptionalType(ssz.UintNum64),
|
|
93
|
+
gasLimit: new OptionalType(ssz.UintNum64),
|
|
94
|
+
},
|
|
95
|
+
{jsonCase: "eth2"}
|
|
96
|
+
);
|
|
97
|
+
const ForkChoiceNodeV2Type = new ContainerType(
|
|
98
|
+
{
|
|
99
|
+
payloadStatus: new StringType<"pending" | "empty" | "full">(),
|
|
100
|
+
slot: ssz.Slot,
|
|
101
|
+
blockRoot: stringType,
|
|
102
|
+
parentRoot: stringType,
|
|
103
|
+
weight: ssz.UintNum64,
|
|
104
|
+
validity: new StringType<"valid" | "invalid" | "optimistic">(),
|
|
105
|
+
executionBlockHash: stringType,
|
|
106
|
+
extraData: ForkChoiceNodeV2ExtraDataType,
|
|
107
|
+
},
|
|
108
|
+
{jsonCase: "eth2"}
|
|
109
|
+
);
|
|
110
|
+
const ForkChoiceExtraDataType = new ContainerType(
|
|
111
|
+
{
|
|
112
|
+
unrealizedJustifiedCheckpoint: ssz.phase0.Checkpoint,
|
|
113
|
+
unrealizedFinalizedCheckpoint: ssz.phase0.Checkpoint,
|
|
114
|
+
proposerBoostRoot: stringType,
|
|
115
|
+
previousProposerBoostRoot: stringType,
|
|
116
|
+
headRoot: stringType,
|
|
117
|
+
},
|
|
118
|
+
{jsonCase: "eth2"}
|
|
119
|
+
);
|
|
120
|
+
const ForkChoiceResponseV2Type = new ContainerType(
|
|
121
|
+
{
|
|
122
|
+
justifiedCheckpoint: ssz.phase0.Checkpoint,
|
|
123
|
+
finalizedCheckpoint: ssz.phase0.Checkpoint,
|
|
124
|
+
forkChoiceNodes: ArrayOf(ForkChoiceNodeV2Type),
|
|
125
|
+
extraData: ForkChoiceExtraDataType,
|
|
126
|
+
},
|
|
127
|
+
{jsonCase: "eth2"}
|
|
128
|
+
);
|
|
129
|
+
|
|
81
130
|
const ProtoNodeListType = ArrayOf(ProtoNodeType);
|
|
82
131
|
const DebugChainHeadListType = ArrayOf(DebugChainHeadType);
|
|
83
132
|
|
|
84
133
|
type ProtoNodeList = ValueOf<typeof ProtoNodeListType>;
|
|
85
134
|
type DebugChainHeadList = ValueOf<typeof DebugChainHeadListType>;
|
|
86
135
|
type ForkChoiceResponse = ValueOf<typeof ForkChoiceResponseType>;
|
|
136
|
+
type ForkChoiceResponseV2 = ValueOf<typeof ForkChoiceResponseV2Type>;
|
|
87
137
|
|
|
88
138
|
export type Endpoints = {
|
|
89
139
|
/**
|
|
@@ -110,6 +160,18 @@ export type Endpoints = {
|
|
|
110
160
|
EmptyMeta
|
|
111
161
|
>;
|
|
112
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Retrieves all current fork choice context (v2: per (root, payload_status) with PTC vote tallies)
|
|
165
|
+
*/
|
|
166
|
+
getDebugForkChoiceV2: Endpoint<
|
|
167
|
+
// ⏎
|
|
168
|
+
"GET",
|
|
169
|
+
EmptyArgs,
|
|
170
|
+
EmptyRequest,
|
|
171
|
+
ForkChoiceResponseV2,
|
|
172
|
+
EmptyMeta
|
|
173
|
+
>;
|
|
174
|
+
|
|
113
175
|
/**
|
|
114
176
|
* Dump all ProtoArray's nodes to debug
|
|
115
177
|
*/
|
|
@@ -185,6 +247,24 @@ export function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpo
|
|
|
185
247
|
},
|
|
186
248
|
},
|
|
187
249
|
},
|
|
250
|
+
getDebugForkChoiceV2: {
|
|
251
|
+
url: "/eth/v2/debug/fork_choice",
|
|
252
|
+
method: "GET",
|
|
253
|
+
req: EmptyRequestCodec,
|
|
254
|
+
resp: {
|
|
255
|
+
data: ForkChoiceResponseV2Type,
|
|
256
|
+
meta: EmptyMetaCodec,
|
|
257
|
+
onlySupport: WireFormat.json,
|
|
258
|
+
transform: {
|
|
259
|
+
toResponse: (data) => ({
|
|
260
|
+
...(data as ForkChoiceResponseV2),
|
|
261
|
+
}),
|
|
262
|
+
fromResponse: (resp) => ({
|
|
263
|
+
data: resp as ForkChoiceResponseV2,
|
|
264
|
+
}),
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
188
268
|
getProtoArrayNodes: {
|
|
189
269
|
url: "/eth/v0/debug/forkchoice",
|
|
190
270
|
method: "GET",
|