@lodestar/api 1.22.0-dev.20c18ad85d → 1.22.0-dev.295690b896
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/client/events.js +1 -1
- package/lib/beacon/client/events.js.map +1 -1
- package/lib/beacon/routes/beacon/block.d.ts +11 -2
- package/lib/beacon/routes/beacon/block.js +9 -0
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +116 -8
- package/lib/beacon/routes/beacon/pool.js +128 -10
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +5 -5
- package/lib/beacon/routes/events.js +24 -6
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/proof.js +6 -5
- package/lib/beacon/routes/proof.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +63 -154
- package/lib/beacon/routes/validator.js +105 -27
- package/lib/beacon/routes/validator.js.map +1 -1
- package/lib/beacon/server/events.js +1 -1
- package/lib/beacon/server/events.js.map +1 -1
- package/lib/builder/routes.js +4 -4
- package/lib/builder/routes.js.map +1 -1
- package/lib/utils/serdes.js +3 -3
- package/lib/utils/serdes.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/beacon/routes/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAKL,GAAG,EACH,UAAU,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/beacon/routes/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAKL,GAAG,EACH,UAAU,EASV,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAA6B,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACx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5E,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAE3C,OAAO;QACL,MAAM,EAAE,CAAC,KAAkB,EAAW,EAAE;YACtC,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAqC,CAAC;YAC9E,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;QACD,QAAQ,EAAE,CAAC,IAAe,EAAE,IAAa,EAA0B,EAAE;YACnE,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAqC,CAAC;YACxE,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
2
|
import { ProofType } from "@chainsafe/persistent-merkle-tree";
|
|
3
|
-
import { ByteListType, ContainerType
|
|
3
|
+
import { ByteListType, ContainerType } from "@chainsafe/ssz";
|
|
4
|
+
import { fromHex, toHex } from "@lodestar/utils";
|
|
4
5
|
import { ssz } from "@lodestar/types";
|
|
5
6
|
import { Schema } from "../../utils/index.js";
|
|
6
7
|
import { ArrayOf } from "../../utils/codecs.js";
|
|
@@ -15,8 +16,8 @@ export function getDefinitions(_config) {
|
|
|
15
16
|
url: "/eth/v0/beacon/proof/state/{state_id}",
|
|
16
17
|
method: "GET",
|
|
17
18
|
req: {
|
|
18
|
-
writeReq: ({ stateId, descriptor }) => ({ params: { state_id: stateId }, query: { format:
|
|
19
|
-
parseReq: ({ params, query }) => ({ stateId: params.state_id, descriptor:
|
|
19
|
+
writeReq: ({ stateId, descriptor }) => ({ params: { state_id: stateId }, query: { format: toHex(descriptor) } }),
|
|
20
|
+
parseReq: ({ params, query }) => ({ stateId: params.state_id, descriptor: fromHex(query.format) }),
|
|
20
21
|
schema: { params: { state_id: Schema.StringRequired }, query: { format: Schema.StringRequired } },
|
|
21
22
|
},
|
|
22
23
|
resp: {
|
|
@@ -33,8 +34,8 @@ export function getDefinitions(_config) {
|
|
|
33
34
|
url: "/eth/v0/beacon/proof/block/{block_id}",
|
|
34
35
|
method: "GET",
|
|
35
36
|
req: {
|
|
36
|
-
writeReq: ({ blockId, descriptor }) => ({ params: { block_id: blockId }, query: { format:
|
|
37
|
-
parseReq: ({ params, query }) => ({ blockId: params.block_id, descriptor:
|
|
37
|
+
writeReq: ({ blockId, descriptor }) => ({ params: { block_id: blockId }, query: { format: toHex(descriptor) } }),
|
|
38
|
+
parseReq: ({ params, query }) => ({ blockId: params.block_id, descriptor: fromHex(query.format) }),
|
|
38
39
|
schema: { params: { block_id: Schema.StringRequired }, query: { format: Schema.StringRequired } },
|
|
39
40
|
},
|
|
40
41
|
resp: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.js","sourceRoot":"","sources":["../../../src/beacon/routes/proof.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAoB,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAC,YAAY,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"proof.js","sourceRoot":"","sources":["../../../src/beacon/routes/proof.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAoB,SAAS,EAAC,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAC,YAAY,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACpC,OAAO,EAA6B,MAAM,EAAC,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAc,MAAM,yBAAyB,CAAC;AAElE,MAAM,C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AE,CAAC,CAAC,EAAC,GAAG,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,YAAY,EAAC,CAAC;iBACpG;gBACD,IAAI,EAAE,YAAY;aACnB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContainerType, Type, ValueOf } from "@chainsafe/ssz";
|
|
2
2
|
import { ChainForkConfig } from "@lodestar/config";
|
|
3
|
-
import { altair, BLSSignature, CommitteeIndex, Epoch, phase0, Root, Slot, UintBn64, ValidatorIndex, ProducedBlockSource, BeaconBlockOrContents, BlindedBeaconBlock } from "@lodestar/types";
|
|
3
|
+
import { altair, BLSSignature, CommitteeIndex, Epoch, phase0, Root, Slot, UintBn64, ValidatorIndex, ProducedBlockSource, BeaconBlockOrContents, BlindedBeaconBlock, Attestation } from "@lodestar/types";
|
|
4
4
|
import { Endpoint, RouteDefinitions } from "../../utils/index.js";
|
|
5
5
|
import { EmptyMeta, EmptyResponseData } from "../../utils/codecs.js";
|
|
6
|
-
import { ExecutionOptimisticAndDependentRootMeta, ExecutionOptimisticMeta, VersionMeta } from "../../utils/metadata.js";
|
|
6
|
+
import { ExecutionOptimisticAndDependentRootMeta, ExecutionOptimisticMeta, MetaHeader, VersionMeta } from "../../utils/metadata.js";
|
|
7
7
|
export declare enum BuilderSelection {
|
|
8
8
|
Default = "default",
|
|
9
9
|
BuilderAlways = "builderalways",
|
|
@@ -34,153 +34,6 @@ export type ProduceBlockV3Meta = ValueOf<typeof ProduceBlockV3MetaType> & {
|
|
|
34
34
|
/** Lodestar-specific (non-standardized) value */
|
|
35
35
|
executionPayloadSource: ProducedBlockSource;
|
|
36
36
|
};
|
|
37
|
-
export declare const BlockContentsType: ContainerType<{
|
|
38
|
-
block: ContainerType<{
|
|
39
|
-
body: ContainerType<{
|
|
40
|
-
executionPayload: ContainerType<{
|
|
41
|
-
blobGasUsed: import("@chainsafe/ssz").UintBigintType;
|
|
42
|
-
excessBlobGas: import("@chainsafe/ssz").UintBigintType;
|
|
43
|
-
withdrawals: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
44
|
-
index: import("@chainsafe/ssz").UintNumberType;
|
|
45
|
-
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
46
|
-
address: import("@lodestar/types/lib/utils/executionAddress.js").ExecutionAddressType;
|
|
47
|
-
amount: import("@chainsafe/ssz").UintBigintType;
|
|
48
|
-
}>>;
|
|
49
|
-
transactions: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteListType>;
|
|
50
|
-
parentHash: import("@chainsafe/ssz").ByteVectorType;
|
|
51
|
-
feeRecipient: import("@lodestar/types/lib/utils/executionAddress.js").ExecutionAddressType;
|
|
52
|
-
stateRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
53
|
-
receiptsRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
54
|
-
logsBloom: import("@chainsafe/ssz").ByteVectorType;
|
|
55
|
-
prevRandao: import("@chainsafe/ssz").ByteVectorType;
|
|
56
|
-
blockNumber: import("@chainsafe/ssz").UintNumberType;
|
|
57
|
-
gasLimit: import("@chainsafe/ssz").UintNumberType;
|
|
58
|
-
gasUsed: import("@chainsafe/ssz").UintNumberType;
|
|
59
|
-
timestamp: import("@chainsafe/ssz").UintNumberType;
|
|
60
|
-
extraData: import("@chainsafe/ssz").ByteListType;
|
|
61
|
-
baseFeePerGas: import("@chainsafe/ssz").UintBigintType;
|
|
62
|
-
blockHash: import("@chainsafe/ssz").ByteVectorType;
|
|
63
|
-
}>;
|
|
64
|
-
blsToExecutionChanges: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
65
|
-
message: ContainerType<{
|
|
66
|
-
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
67
|
-
fromBlsPubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
68
|
-
toExecutionAddress: import("@lodestar/types/lib/utils/executionAddress.js").ExecutionAddressType;
|
|
69
|
-
}>;
|
|
70
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
71
|
-
}>>;
|
|
72
|
-
blobKzgCommitments: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
73
|
-
syncAggregate: ContainerType<{
|
|
74
|
-
syncCommitteeBits: import("@chainsafe/ssz").BitVectorType;
|
|
75
|
-
syncCommitteeSignature: import("@chainsafe/ssz").ByteVectorType;
|
|
76
|
-
}>;
|
|
77
|
-
randaoReveal: import("@chainsafe/ssz").ByteVectorType;
|
|
78
|
-
eth1Data: ContainerType<{
|
|
79
|
-
depositRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
80
|
-
depositCount: import("@chainsafe/ssz").UintNumberType;
|
|
81
|
-
blockHash: import("@chainsafe/ssz").ByteVectorType;
|
|
82
|
-
}>;
|
|
83
|
-
graffiti: import("@chainsafe/ssz").ByteVectorType;
|
|
84
|
-
proposerSlashings: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
85
|
-
signedHeader1: ContainerType<{
|
|
86
|
-
message: ContainerType<{
|
|
87
|
-
slot: import("@chainsafe/ssz").UintBigintType;
|
|
88
|
-
proposerIndex: import("@chainsafe/ssz").UintNumberType;
|
|
89
|
-
parentRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
90
|
-
stateRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
91
|
-
bodyRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
92
|
-
}>;
|
|
93
|
-
signature: import("@chainsafe/ssz").ByteVectorType; /** The slot for which the block should be proposed */
|
|
94
|
-
}>;
|
|
95
|
-
signedHeader2: ContainerType<{
|
|
96
|
-
message: ContainerType<{
|
|
97
|
-
slot: import("@chainsafe/ssz").UintBigintType;
|
|
98
|
-
proposerIndex: import("@chainsafe/ssz").UintNumberType;
|
|
99
|
-
parentRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
100
|
-
stateRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
101
|
-
bodyRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
102
|
-
}>;
|
|
103
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
104
|
-
}>;
|
|
105
|
-
}>>;
|
|
106
|
-
attesterSlashings: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
107
|
-
attestation1: ContainerType<{
|
|
108
|
-
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
109
|
-
data: ContainerType<{
|
|
110
|
-
slot: import("@chainsafe/ssz").UintBigintType;
|
|
111
|
-
index: import("@chainsafe/ssz").UintBigintType;
|
|
112
|
-
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
113
|
-
source: ContainerType<{
|
|
114
|
-
epoch: import("@chainsafe/ssz").UintBigintType;
|
|
115
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
116
|
-
}>;
|
|
117
|
-
target: ContainerType<{
|
|
118
|
-
epoch: import("@chainsafe/ssz").UintBigintType;
|
|
119
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
120
|
-
}>;
|
|
121
|
-
}>;
|
|
122
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
123
|
-
}>;
|
|
124
|
-
attestation2: ContainerType<{
|
|
125
|
-
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
126
|
-
data: ContainerType<{
|
|
127
|
-
slot: import("@chainsafe/ssz").UintBigintType;
|
|
128
|
-
index: import("@chainsafe/ssz").UintBigintType;
|
|
129
|
-
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
130
|
-
source: ContainerType<{
|
|
131
|
-
epoch: import("@chainsafe/ssz").UintBigintType;
|
|
132
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
133
|
-
}>;
|
|
134
|
-
target: ContainerType<{
|
|
135
|
-
epoch: import("@chainsafe/ssz").UintBigintType;
|
|
136
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
137
|
-
}>;
|
|
138
|
-
}>;
|
|
139
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
140
|
-
}>;
|
|
141
|
-
}>>;
|
|
142
|
-
attestations: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
143
|
-
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
144
|
-
data: ContainerType<{
|
|
145
|
-
slot: import("@chainsafe/ssz").UintNumberType;
|
|
146
|
-
index: import("@chainsafe/ssz").UintNumberType;
|
|
147
|
-
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
148
|
-
source: ContainerType<{
|
|
149
|
-
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
150
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
151
|
-
}>;
|
|
152
|
-
target: ContainerType<{
|
|
153
|
-
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
154
|
-
root: import("@chainsafe/ssz").ByteVectorType;
|
|
155
|
-
}>;
|
|
156
|
-
}>;
|
|
157
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
158
|
-
}>>;
|
|
159
|
-
deposits: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
160
|
-
proof: import("@chainsafe/ssz").VectorCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
161
|
-
data: ContainerType<{
|
|
162
|
-
pubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
163
|
-
withdrawalCredentials: import("@chainsafe/ssz").ByteVectorType;
|
|
164
|
-
amount: import("@chainsafe/ssz").UintNumberType;
|
|
165
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
166
|
-
}>;
|
|
167
|
-
}>>;
|
|
168
|
-
voluntaryExits: import("@chainsafe/ssz").ListCompositeType<ContainerType<{
|
|
169
|
-
message: ContainerType<{
|
|
170
|
-
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
171
|
-
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
172
|
-
}>;
|
|
173
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
174
|
-
}>>;
|
|
175
|
-
}>;
|
|
176
|
-
slot: import("@chainsafe/ssz").UintNumberType;
|
|
177
|
-
proposerIndex: import("@chainsafe/ssz").UintNumberType;
|
|
178
|
-
parentRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
179
|
-
stateRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
180
|
-
}>;
|
|
181
|
-
kzgProofs: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
182
|
-
blobs: import("@chainsafe/ssz").ListCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
183
|
-
}>;
|
|
184
37
|
export declare const AttesterDutyType: ContainerType<{
|
|
185
38
|
/** The validator's public key, uniquely identifying them */
|
|
186
39
|
pubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -288,7 +141,7 @@ export declare const SyncDutyListType: import("@chainsafe/ssz").ArrayType<Type<i
|
|
|
288
141
|
/** The indices of the validator in the sync committee. */
|
|
289
142
|
validatorSyncCommitteeIndices: import("@chainsafe/ssz").ArrayType<Type<number>, unknown, unknown>;
|
|
290
143
|
}>>, unknown, unknown>;
|
|
291
|
-
export declare const
|
|
144
|
+
export declare const SignedAggregateAndProofListPhase0Type: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
292
145
|
message: ContainerType<{
|
|
293
146
|
aggregatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
294
147
|
aggregate: ContainerType<{
|
|
@@ -312,6 +165,31 @@ export declare const SignedAggregateAndProofListType: import("@chainsafe/ssz").A
|
|
|
312
165
|
}>;
|
|
313
166
|
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
314
167
|
}>>, unknown, unknown>;
|
|
168
|
+
export declare const SignedAggregateAndProofListElectraType: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
169
|
+
message: ContainerType<{
|
|
170
|
+
aggregatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
171
|
+
aggregate: ContainerType<{
|
|
172
|
+
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
173
|
+
data: ContainerType<{
|
|
174
|
+
slot: import("@chainsafe/ssz").UintNumberType;
|
|
175
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
176
|
+
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
177
|
+
source: ContainerType<{
|
|
178
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
179
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
180
|
+
}>;
|
|
181
|
+
target: ContainerType<{
|
|
182
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
183
|
+
root: import("@chainsafe/ssz").ByteVectorType;
|
|
184
|
+
}>;
|
|
185
|
+
}>;
|
|
186
|
+
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
187
|
+
committeeBits: import("@chainsafe/ssz").BitVectorType;
|
|
188
|
+
}>;
|
|
189
|
+
selectionProof: import("@chainsafe/ssz").ByteVectorType;
|
|
190
|
+
}>;
|
|
191
|
+
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
192
|
+
}>>, unknown, unknown>;
|
|
315
193
|
export declare const SignedContributionAndProofListType: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
316
194
|
message: ContainerType<{
|
|
317
195
|
aggregatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -320,10 +198,10 @@ export declare const SignedContributionAndProofListType: import("@chainsafe/ssz"
|
|
|
320
198
|
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
321
199
|
subcommitteeIndex: import("@chainsafe/ssz").UintNumberType;
|
|
322
200
|
aggregationBits: import("@chainsafe/ssz").BitVectorType;
|
|
323
|
-
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
201
|
+
signature: import("@chainsafe/ssz").ByteVectorType; /** Consensus rewards paid to the proposer for this block, in Wei */
|
|
324
202
|
}>;
|
|
325
203
|
selectionProof: import("@chainsafe/ssz").ByteVectorType;
|
|
326
|
-
}>;
|
|
204
|
+
}>;
|
|
327
205
|
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
328
206
|
}>>, unknown, unknown>;
|
|
329
207
|
export declare const BeaconCommitteeSubscriptionListType: import("@chainsafe/ssz").ArrayType<Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
@@ -380,7 +258,9 @@ export type ProposerDuty = ValueOf<typeof ProposerDutyType>;
|
|
|
380
258
|
export type ProposerDutyList = ValueOf<typeof ProposerDutyListType>;
|
|
381
259
|
export type SyncDuty = ValueOf<typeof SyncDutyType>;
|
|
382
260
|
export type SyncDutyList = ValueOf<typeof SyncDutyListType>;
|
|
383
|
-
export type
|
|
261
|
+
export type SignedAggregateAndProofListPhase0 = ValueOf<typeof SignedAggregateAndProofListPhase0Type>;
|
|
262
|
+
export type SignedAggregateAndProofListElectra = ValueOf<typeof SignedAggregateAndProofListElectraType>;
|
|
263
|
+
export type SignedAggregateAndProofList = SignedAggregateAndProofListPhase0 | SignedAggregateAndProofListElectra;
|
|
384
264
|
export type SignedContributionAndProofList = ValueOf<typeof SignedContributionAndProofListType>;
|
|
385
265
|
export type BeaconCommitteeSubscription = ValueOf<typeof BeaconCommitteeSubscriptionType>;
|
|
386
266
|
export type BeaconCommitteeSubscriptionList = ValueOf<typeof BeaconCommitteeSubscriptionListType>;
|
|
@@ -547,14 +427,43 @@ export type Endpoints = {
|
|
|
547
427
|
slot: number;
|
|
548
428
|
};
|
|
549
429
|
}, phase0.Attestation, EmptyMeta>;
|
|
430
|
+
/**
|
|
431
|
+
* Get aggregated attestation
|
|
432
|
+
* Aggregates all attestations matching given attestation data root, slot and committee index
|
|
433
|
+
* Returns an aggregated `Attestation` object with same `AttestationData` root.
|
|
434
|
+
*/
|
|
435
|
+
getAggregatedAttestationV2: Endpoint<"GET", {
|
|
436
|
+
/** HashTreeRoot of AttestationData that validator want's aggregated */
|
|
437
|
+
attestationDataRoot: Root;
|
|
438
|
+
slot: Slot;
|
|
439
|
+
committeeIndex: number;
|
|
440
|
+
}, {
|
|
441
|
+
query: {
|
|
442
|
+
attestation_data_root: string;
|
|
443
|
+
slot: number;
|
|
444
|
+
committee_index: number;
|
|
445
|
+
};
|
|
446
|
+
}, Attestation, VersionMeta>;
|
|
550
447
|
/**
|
|
551
448
|
* Publish multiple aggregate and proofs
|
|
552
449
|
* Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
|
|
553
450
|
*/
|
|
554
451
|
publishAggregateAndProofs: Endpoint<"POST", {
|
|
452
|
+
signedAggregateAndProofs: SignedAggregateAndProofListPhase0;
|
|
453
|
+
}, {
|
|
454
|
+
body: unknown;
|
|
455
|
+
}, EmptyResponseData, EmptyMeta>;
|
|
456
|
+
/**
|
|
457
|
+
* Publish multiple aggregate and proofs
|
|
458
|
+
* Verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
|
|
459
|
+
*/
|
|
460
|
+
publishAggregateAndProofsV2: Endpoint<"POST", {
|
|
555
461
|
signedAggregateAndProofs: SignedAggregateAndProofList;
|
|
556
462
|
}, {
|
|
557
463
|
body: unknown;
|
|
464
|
+
headers: {
|
|
465
|
+
[MetaHeader.Version]: string;
|
|
466
|
+
};
|
|
558
467
|
}, EmptyResponseData, EmptyMeta>;
|
|
559
468
|
publishContributionAndProofs: Endpoint<"POST", {
|
|
560
469
|
contributionAndProofs: SignedContributionAndProofList;
|
|
@@ -641,5 +550,5 @@ export type Endpoints = {
|
|
|
641
550
|
body: unknown;
|
|
642
551
|
}, EmptyResponseData, EmptyMeta>;
|
|
643
552
|
};
|
|
644
|
-
export declare function getDefinitions(
|
|
553
|
+
export declare function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoints>;
|
|
645
554
|
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import { ContainerType
|
|
3
|
-
import { isForkBlobs } from "@lodestar/params";
|
|
4
|
-
import { ssz, ProducedBlockSource, stringType, } from "@lodestar/types";
|
|
2
|
+
import { ContainerType } from "@chainsafe/ssz";
|
|
3
|
+
import { isForkBlobs, isForkPostElectra } from "@lodestar/params";
|
|
4
|
+
import { ssz, ProducedBlockSource, stringType, sszTypesFor, } from "@lodestar/types";
|
|
5
|
+
import { fromHex, toHex, toRootHex } from "@lodestar/utils";
|
|
5
6
|
import { Schema } from "../../utils/index.js";
|
|
6
7
|
import { fromGraffitiHex, toBoolean, toGraffitiHex } from "../../utils/serdes.js";
|
|
7
8
|
import { getExecutionForkTypes, toForkName } from "../../utils/fork.js";
|
|
8
9
|
import { ArrayOf, EmptyMetaCodec, EmptyResponseCodec, JsonOnlyReq, WithMeta, WithVersion, } from "../../utils/codecs.js";
|
|
9
10
|
import { ExecutionOptimisticAndDependentRootCodec, ExecutionOptimisticCodec, MetaHeader, VersionCodec, VersionType, } from "../../utils/metadata.js";
|
|
11
|
+
import { fromHeaders } from "../../utils/headers.js";
|
|
10
12
|
// See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
|
|
11
13
|
export var BuilderSelection;
|
|
12
14
|
(function (BuilderSelection) {
|
|
@@ -28,11 +30,6 @@ export const ProduceBlockV3MetaType = new ContainerType({
|
|
|
28
30
|
/** Consensus rewards paid to the proposer for this block, in Wei */
|
|
29
31
|
consensusBlockValue: ssz.UintBn64,
|
|
30
32
|
}, { jsonCase: "eth2" });
|
|
31
|
-
export const BlockContentsType = new ContainerType({
|
|
32
|
-
block: ssz.deneb.BeaconBlock,
|
|
33
|
-
kzgProofs: ssz.deneb.KZGProofs,
|
|
34
|
-
blobs: ssz.deneb.Blobs,
|
|
35
|
-
}, { jsonCase: "eth2" });
|
|
36
33
|
export const AttesterDutyType = new ContainerType({
|
|
37
34
|
/** The validator's public key, uniquely identifying them */
|
|
38
35
|
pubkey: ssz.BLSPubkey,
|
|
@@ -115,7 +112,8 @@ export const ValidatorIndicesType = ArrayOf(ssz.ValidatorIndex);
|
|
|
115
112
|
export const AttesterDutyListType = ArrayOf(AttesterDutyType);
|
|
116
113
|
export const ProposerDutyListType = ArrayOf(ProposerDutyType);
|
|
117
114
|
export const SyncDutyListType = ArrayOf(SyncDutyType);
|
|
118
|
-
export const
|
|
115
|
+
export const SignedAggregateAndProofListPhase0Type = ArrayOf(ssz.phase0.SignedAggregateAndProof);
|
|
116
|
+
export const SignedAggregateAndProofListElectraType = ArrayOf(ssz.electra.SignedAggregateAndProof);
|
|
119
117
|
export const SignedContributionAndProofListType = ArrayOf(ssz.altair.SignedContributionAndProof);
|
|
120
118
|
export const BeaconCommitteeSubscriptionListType = ArrayOf(BeaconCommitteeSubscriptionType);
|
|
121
119
|
export const SyncCommitteeSubscriptionListType = ArrayOf(SyncCommitteeSubscriptionType);
|
|
@@ -124,7 +122,7 @@ export const BeaconCommitteeSelectionListType = ArrayOf(BeaconCommitteeSelection
|
|
|
124
122
|
export const SyncCommitteeSelectionListType = ArrayOf(SyncCommitteeSelectionType);
|
|
125
123
|
export const LivenessResponseDataListType = ArrayOf(LivenessResponseDataType);
|
|
126
124
|
export const SignedValidatorRegistrationV1ListType = ArrayOf(ssz.bellatrix.SignedValidatorRegistrationV1);
|
|
127
|
-
export function getDefinitions(
|
|
125
|
+
export function getDefinitions(config) {
|
|
128
126
|
return {
|
|
129
127
|
getAttesterDuties: {
|
|
130
128
|
url: "/eth/v1/validator/duties/attester/{epoch}",
|
|
@@ -184,7 +182,7 @@ export function getDefinitions(_config) {
|
|
|
184
182
|
writeReq: ({ slot, randaoReveal, graffiti, feeRecipient, builderSelection, strictFeeRecipientCheck }) => ({
|
|
185
183
|
params: { slot },
|
|
186
184
|
query: {
|
|
187
|
-
randao_reveal:
|
|
185
|
+
randao_reveal: toHex(randaoReveal),
|
|
188
186
|
graffiti: toGraffitiHex(graffiti),
|
|
189
187
|
fee_recipient: feeRecipient,
|
|
190
188
|
builder_selection: builderSelection,
|
|
@@ -193,7 +191,7 @@ export function getDefinitions(_config) {
|
|
|
193
191
|
}),
|
|
194
192
|
parseReq: ({ params, query }) => ({
|
|
195
193
|
slot: params.slot,
|
|
196
|
-
randaoReveal:
|
|
194
|
+
randaoReveal: fromHex(query.randao_reveal),
|
|
197
195
|
graffiti: fromGraffitiHex(query.graffiti),
|
|
198
196
|
feeRecipient: query.fee_recipient,
|
|
199
197
|
builderSelection: query.builder_selection,
|
|
@@ -211,7 +209,7 @@ export function getDefinitions(_config) {
|
|
|
211
209
|
},
|
|
212
210
|
},
|
|
213
211
|
resp: {
|
|
214
|
-
data: WithVersion((fork) => (isForkBlobs(fork) ?
|
|
212
|
+
data: WithVersion((fork) => (isForkBlobs(fork) ? sszTypesFor(fork).BlockContents : ssz[fork].BeaconBlock)),
|
|
215
213
|
meta: VersionCodec,
|
|
216
214
|
},
|
|
217
215
|
},
|
|
@@ -222,7 +220,7 @@ export function getDefinitions(_config) {
|
|
|
222
220
|
writeReq: ({ slot, randaoReveal, graffiti, skipRandaoVerification, feeRecipient, builderSelection, builderBoostFactor, strictFeeRecipientCheck, blindedLocal, }) => ({
|
|
223
221
|
params: { slot },
|
|
224
222
|
query: {
|
|
225
|
-
randao_reveal:
|
|
223
|
+
randao_reveal: toHex(randaoReveal),
|
|
226
224
|
graffiti: toGraffitiHex(graffiti),
|
|
227
225
|
skip_randao_verification: writeSkipRandaoVerification(skipRandaoVerification),
|
|
228
226
|
fee_recipient: feeRecipient,
|
|
@@ -234,7 +232,7 @@ export function getDefinitions(_config) {
|
|
|
234
232
|
}),
|
|
235
233
|
parseReq: ({ params, query }) => ({
|
|
236
234
|
slot: params.slot,
|
|
237
|
-
randaoReveal:
|
|
235
|
+
randaoReveal: fromHex(query.randao_reveal),
|
|
238
236
|
graffiti: fromGraffitiHex(query.graffiti),
|
|
239
237
|
skipRandaoVerification: parseSkipRandaoVerification(query.skip_randao_verification),
|
|
240
238
|
feeRecipient: query.fee_recipient,
|
|
@@ -261,7 +259,7 @@ export function getDefinitions(_config) {
|
|
|
261
259
|
data: WithMeta(({ version, executionPayloadBlinded }) => (executionPayloadBlinded
|
|
262
260
|
? getExecutionForkTypes(version).BlindedBeaconBlock
|
|
263
261
|
: isForkBlobs(version)
|
|
264
|
-
?
|
|
262
|
+
? sszTypesFor(version).BlockContents
|
|
265
263
|
: ssz[version].BeaconBlock)),
|
|
266
264
|
meta: {
|
|
267
265
|
toJson: (meta) => ({
|
|
@@ -304,11 +302,11 @@ export function getDefinitions(_config) {
|
|
|
304
302
|
req: {
|
|
305
303
|
writeReq: ({ slot, randaoReveal, graffiti }) => ({
|
|
306
304
|
params: { slot },
|
|
307
|
-
query: { randao_reveal:
|
|
305
|
+
query: { randao_reveal: toHex(randaoReveal), graffiti: toGraffitiHex(graffiti) },
|
|
308
306
|
}),
|
|
309
307
|
parseReq: ({ params, query }) => ({
|
|
310
308
|
slot: params.slot,
|
|
311
|
-
randaoReveal:
|
|
309
|
+
randaoReveal: fromHex(query.randao_reveal),
|
|
312
310
|
graffiti: fromGraffitiHex(query.graffiti),
|
|
313
311
|
}),
|
|
314
312
|
schema: {
|
|
@@ -344,12 +342,12 @@ export function getDefinitions(_config) {
|
|
|
344
342
|
method: "GET",
|
|
345
343
|
req: {
|
|
346
344
|
writeReq: ({ slot, subcommitteeIndex, beaconBlockRoot }) => ({
|
|
347
|
-
query: { slot, subcommittee_index: subcommitteeIndex, beacon_block_root:
|
|
345
|
+
query: { slot, subcommittee_index: subcommitteeIndex, beacon_block_root: toRootHex(beaconBlockRoot) },
|
|
348
346
|
}),
|
|
349
347
|
parseReq: ({ query }) => ({
|
|
350
348
|
slot: query.slot,
|
|
351
349
|
subcommitteeIndex: query.subcommittee_index,
|
|
352
|
-
beaconBlockRoot:
|
|
350
|
+
beaconBlockRoot: fromHex(query.beacon_block_root),
|
|
353
351
|
}),
|
|
354
352
|
schema: {
|
|
355
353
|
query: {
|
|
@@ -369,11 +367,17 @@ export function getDefinitions(_config) {
|
|
|
369
367
|
method: "GET",
|
|
370
368
|
req: {
|
|
371
369
|
writeReq: ({ attestationDataRoot, slot }) => ({
|
|
372
|
-
query: { attestation_data_root:
|
|
370
|
+
query: { attestation_data_root: toRootHex(attestationDataRoot), slot },
|
|
371
|
+
}),
|
|
372
|
+
parseReq: ({ query }) => ({
|
|
373
|
+
attestationDataRoot: fromHex(query.attestation_data_root),
|
|
374
|
+
slot: query.slot,
|
|
373
375
|
}),
|
|
374
|
-
parseReq: ({ query }) => ({ attestationDataRoot: fromHexString(query.attestation_data_root), slot: query.slot }),
|
|
375
376
|
schema: {
|
|
376
|
-
query: {
|
|
377
|
+
query: {
|
|
378
|
+
attestation_data_root: Schema.StringRequired,
|
|
379
|
+
slot: Schema.UintRequired,
|
|
380
|
+
},
|
|
377
381
|
},
|
|
378
382
|
},
|
|
379
383
|
resp: {
|
|
@@ -381,20 +385,94 @@ export function getDefinitions(_config) {
|
|
|
381
385
|
meta: EmptyMetaCodec,
|
|
382
386
|
},
|
|
383
387
|
},
|
|
388
|
+
getAggregatedAttestationV2: {
|
|
389
|
+
url: "/eth/v2/validator/aggregate_attestation",
|
|
390
|
+
method: "GET",
|
|
391
|
+
req: {
|
|
392
|
+
writeReq: ({ attestationDataRoot, slot, committeeIndex }) => ({
|
|
393
|
+
query: { attestation_data_root: toHex(attestationDataRoot), slot, committee_index: committeeIndex },
|
|
394
|
+
}),
|
|
395
|
+
parseReq: ({ query }) => ({
|
|
396
|
+
attestationDataRoot: fromHex(query.attestation_data_root),
|
|
397
|
+
slot: query.slot,
|
|
398
|
+
committeeIndex: query.committee_index,
|
|
399
|
+
}),
|
|
400
|
+
schema: {
|
|
401
|
+
query: {
|
|
402
|
+
attestation_data_root: Schema.StringRequired,
|
|
403
|
+
slot: Schema.UintRequired,
|
|
404
|
+
committee_index: Schema.UintRequired,
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
resp: {
|
|
409
|
+
data: WithVersion((fork) => (isForkPostElectra(fork) ? ssz.electra.Attestation : ssz.phase0.Attestation)),
|
|
410
|
+
meta: VersionCodec,
|
|
411
|
+
},
|
|
412
|
+
},
|
|
384
413
|
publishAggregateAndProofs: {
|
|
385
414
|
url: "/eth/v1/validator/aggregate_and_proofs",
|
|
386
415
|
method: "POST",
|
|
387
416
|
req: {
|
|
388
417
|
writeReqJson: ({ signedAggregateAndProofs }) => ({
|
|
389
|
-
body:
|
|
418
|
+
body: SignedAggregateAndProofListPhase0Type.toJson(signedAggregateAndProofs),
|
|
419
|
+
}),
|
|
420
|
+
parseReqJson: ({ body }) => ({
|
|
421
|
+
signedAggregateAndProofs: SignedAggregateAndProofListPhase0Type.fromJson(body),
|
|
390
422
|
}),
|
|
391
|
-
parseReqJson: ({ body }) => ({ signedAggregateAndProofs: SignedAggregateAndProofListType.fromJson(body) }),
|
|
392
423
|
writeReqSsz: ({ signedAggregateAndProofs }) => ({
|
|
393
|
-
body:
|
|
424
|
+
body: SignedAggregateAndProofListPhase0Type.serialize(signedAggregateAndProofs),
|
|
394
425
|
}),
|
|
395
|
-
parseReqSsz: ({ body }) => ({
|
|
426
|
+
parseReqSsz: ({ body }) => ({
|
|
427
|
+
signedAggregateAndProofs: SignedAggregateAndProofListPhase0Type.deserialize(body),
|
|
428
|
+
}),
|
|
429
|
+
schema: {
|
|
430
|
+
body: Schema.ObjectArray,
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
resp: EmptyResponseCodec,
|
|
434
|
+
},
|
|
435
|
+
publishAggregateAndProofsV2: {
|
|
436
|
+
url: "/eth/v2/validator/aggregate_and_proofs",
|
|
437
|
+
method: "POST",
|
|
438
|
+
req: {
|
|
439
|
+
writeReqJson: ({ signedAggregateAndProofs }) => {
|
|
440
|
+
const fork = config.getForkName(signedAggregateAndProofs[0]?.message.aggregate.data.slot ?? 0);
|
|
441
|
+
return {
|
|
442
|
+
body: isForkPostElectra(fork)
|
|
443
|
+
? SignedAggregateAndProofListElectraType.toJson(signedAggregateAndProofs)
|
|
444
|
+
: SignedAggregateAndProofListPhase0Type.toJson(signedAggregateAndProofs),
|
|
445
|
+
headers: { [MetaHeader.Version]: fork },
|
|
446
|
+
};
|
|
447
|
+
},
|
|
448
|
+
parseReqJson: ({ body, headers }) => {
|
|
449
|
+
const fork = toForkName(fromHeaders(headers, MetaHeader.Version));
|
|
450
|
+
return {
|
|
451
|
+
signedAggregateAndProofs: isForkPostElectra(fork)
|
|
452
|
+
? SignedAggregateAndProofListElectraType.fromJson(body)
|
|
453
|
+
: SignedAggregateAndProofListPhase0Type.fromJson(body),
|
|
454
|
+
};
|
|
455
|
+
},
|
|
456
|
+
writeReqSsz: ({ signedAggregateAndProofs }) => {
|
|
457
|
+
const fork = config.getForkName(signedAggregateAndProofs[0]?.message.aggregate.data.slot ?? 0);
|
|
458
|
+
return {
|
|
459
|
+
body: isForkPostElectra(fork)
|
|
460
|
+
? SignedAggregateAndProofListElectraType.serialize(signedAggregateAndProofs)
|
|
461
|
+
: SignedAggregateAndProofListPhase0Type.serialize(signedAggregateAndProofs),
|
|
462
|
+
headers: { [MetaHeader.Version]: fork },
|
|
463
|
+
};
|
|
464
|
+
},
|
|
465
|
+
parseReqSsz: ({ body, headers }) => {
|
|
466
|
+
const fork = toForkName(fromHeaders(headers, MetaHeader.Version));
|
|
467
|
+
return {
|
|
468
|
+
signedAggregateAndProofs: isForkPostElectra(fork)
|
|
469
|
+
? SignedAggregateAndProofListElectraType.deserialize(body)
|
|
470
|
+
: SignedAggregateAndProofListPhase0Type.deserialize(body),
|
|
471
|
+
};
|
|
472
|
+
},
|
|
396
473
|
schema: {
|
|
397
474
|
body: Schema.ObjectArray,
|
|
475
|
+
headers: { [MetaHeader.Version]: Schema.String },
|
|
398
476
|
},
|
|
399
477
|
},
|
|
400
478
|
resp: EmptyResponseCodec,
|