@lodestar/beacon-node 1.49.0-dev.ee7c2aa8ee → 1.49.0-dev.f1b14bce8f
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/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +13 -4
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +4 -2
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts +1 -2
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +5 -8
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js +2 -7
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +11 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +46 -28
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +2 -2
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +1 -0
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +13 -0
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/chain.d.ts +10 -0
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +85 -16
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/envelopeReconstructionError.d.ts +23 -0
- package/lib/chain/errors/envelopeReconstructionError.d.ts.map +1 -0
- package/lib/chain/errors/envelopeReconstructionError.js +13 -0
- package/lib/chain/errors/envelopeReconstructionError.js.map +1 -0
- package/lib/chain/errors/index.d.ts +1 -0
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +1 -0
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/interface.d.ts +6 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/options.d.ts +2 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +4 -2
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/db/beacon.d.ts +1 -2
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +1 -3
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +0 -1
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +1 -1
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/interface.d.ts +1 -2
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts +21 -9
- package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js +32 -12
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/db/repositories/index.d.ts +1 -2
- package/lib/db/repositories/index.d.ts.map +1 -1
- package/lib/db/repositories/index.js +1 -2
- package/lib/db/repositories/index.js.map +1 -1
- package/lib/execution/engine/disabled.d.ts +1 -0
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +3 -0
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +2 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +7 -1
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +3 -1
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/mock.d.ts +1 -0
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +14 -2
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/types.d.ts +11 -0
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +10 -0
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +9 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +16 -0
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +21 -11
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +48 -23
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.d.ts +3 -1
- package/lib/metrics/metrics.d.ts.map +1 -1
- package/lib/metrics/metrics.js +2 -2
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +47 -34
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +23 -4
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +20 -4
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -7
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +2 -22
- package/lib/node/nodejs.js.map +1 -1
- package/lib/sync/interface.d.ts +1 -2
- package/lib/sync/interface.d.ts.map +1 -1
- package/lib/sync/options.d.ts +0 -6
- package/lib/sync/options.d.ts.map +1 -1
- package/lib/sync/options.js +0 -2
- package/lib/sync/options.js.map +1 -1
- package/lib/sync/types.d.ts +18 -3
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +19 -3
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +19 -0
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +184 -15
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/util/execution.d.ts +42 -0
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +123 -2
- package/lib/util/execution.js.map +1 -1
- package/lib/util/headerEnvelope.d.ts +17 -0
- package/lib/util/headerEnvelope.d.ts.map +1 -0
- package/lib/util/headerEnvelope.js +43 -0
- package/lib/util/headerEnvelope.js.map +1 -0
- package/lib/util/shuffle.d.ts +0 -4
- package/lib/util/shuffle.d.ts.map +1 -1
- package/lib/util/shuffle.js +0 -8
- package/lib/util/shuffle.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +16 -3
- package/src/api/impl/beacon/pool/index.ts +6 -2
- package/src/chain/archiveStore/archiveStore.ts +6 -9
- package/src/chain/archiveStore/historicalState/metrics.ts +3 -9
- package/src/chain/archiveStore/utils/archiveBlocks.ts +54 -32
- package/src/chain/archiveStore/utils/pruneHistory.ts +4 -2
- package/src/chain/blocks/importExecutionPayload.ts +14 -0
- package/src/chain/chain.ts +96 -20
- package/src/chain/errors/envelopeReconstructionError.ts +22 -0
- package/src/chain/errors/index.ts +1 -0
- package/src/chain/interface.ts +6 -1
- package/src/chain/options.ts +3 -0
- package/src/chain/produceBlock/computeNewStateRoot.ts +9 -2
- package/src/db/beacon.ts +0 -5
- package/src/db/buckets.ts +2 -2
- package/src/db/interface.ts +0 -3
- package/src/db/repositories/executionPayloadEnvelopeArchive.ts +43 -13
- package/src/db/repositories/index.ts +6 -2
- package/src/execution/engine/disabled.ts +4 -0
- package/src/execution/engine/http.ts +12 -0
- package/src/execution/engine/interface.ts +4 -1
- package/src/execution/engine/mock.ts +22 -2
- package/src/execution/engine/types.ts +25 -0
- package/src/metrics/metrics/beacon.ts +16 -0
- package/src/metrics/metrics/lodestar.ts +58 -26
- package/src/metrics/metrics.ts +7 -2
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +57 -39
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +27 -5
- package/src/network/reqresp/handlers/index.ts +49 -5
- package/src/node/nodejs.ts +0 -27
- package/src/sync/interface.ts +1 -2
- package/src/sync/options.ts +0 -8
- package/src/sync/types.ts +19 -3
- package/src/sync/unknownBlock.ts +192 -14
- package/src/util/execution.ts +175 -2
- package/src/util/headerEnvelope.ts +76 -0
- package/src/util/shuffle.ts +0 -9
- package/lib/chain/archiveStore/utils/updateBackfillRange.d.ts +0 -20
- package/lib/chain/archiveStore/utils/updateBackfillRange.d.ts.map +0 -1
- package/lib/chain/archiveStore/utils/updateBackfillRange.js +0 -40
- package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +0 -1
- package/lib/db/repositories/backfilledRanges.d.ts +0 -18
- package/lib/db/repositories/backfilledRanges.d.ts.map +0 -1
- package/lib/db/repositories/backfilledRanges.js +0 -26
- package/lib/db/repositories/backfilledRanges.js.map +0 -1
- package/lib/sync/backfill/backfill.d.ts +0 -169
- package/lib/sync/backfill/backfill.d.ts.map +0 -1
- package/lib/sync/backfill/backfill.js +0 -686
- package/lib/sync/backfill/backfill.js.map +0 -1
- package/lib/sync/backfill/errors.d.ts +0 -30
- package/lib/sync/backfill/errors.d.ts.map +0 -1
- package/lib/sync/backfill/errors.js +0 -15
- package/lib/sync/backfill/errors.js.map +0 -1
- package/lib/sync/backfill/index.d.ts +0 -2
- package/lib/sync/backfill/index.d.ts.map +0 -1
- package/lib/sync/backfill/index.js +0 -2
- package/lib/sync/backfill/index.js.map +0 -1
- package/lib/sync/backfill/verify.d.ts +0 -18
- package/lib/sync/backfill/verify.d.ts.map +0 -1
- package/lib/sync/backfill/verify.js +0 -36
- package/lib/sync/backfill/verify.js.map +0 -1
- package/src/chain/archiveStore/utils/updateBackfillRange.ts +0 -50
- package/src/db/repositories/backfilledRanges.ts +0 -29
- package/src/sync/backfill/backfill.ts +0 -916
- package/src/sync/backfill/errors.ts +0 -23
- package/src/sync/backfill/index.ts +0 -1
- package/src/sync/backfill/verify.ts +0 -58
|
@@ -13,7 +13,7 @@ import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, ca
|
|
|
13
13
|
import {BlobAndProof} from "@lodestar/types/deneb";
|
|
14
14
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
15
15
|
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
|
|
16
|
-
import {ExecutionPayloadBody} from "./types.js";
|
|
16
|
+
import {ExecutionPayloadBody, ExecutionPayloadBodyV2} from "./types.js";
|
|
17
17
|
import {DATA} from "./utils.js";
|
|
18
18
|
|
|
19
19
|
export {PayloadIdCache, type PayloadId, type WithdrawalV1};
|
|
@@ -172,6 +172,9 @@ export interface IExecutionEngine {
|
|
|
172
172
|
|
|
173
173
|
getPayloadBodiesByHash(fork: ForkName, blockHash: DATA[]): Promise<(ExecutionPayloadBody | null)[]>;
|
|
174
174
|
|
|
175
|
+
/** Amsterdam: like V1 but also returns the block access list (null if the EL no longer has it) */
|
|
176
|
+
getPayloadBodiesByHashV2(blockHash: DATA[]): Promise<(ExecutionPayloadBodyV2 | null)[]>;
|
|
177
|
+
|
|
175
178
|
getPayloadBodiesByRange(fork: ForkName, start: number, count: number): Promise<(ExecutionPayloadBody | null)[]>;
|
|
176
179
|
|
|
177
180
|
getBlobs(
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
EngineApiRpcParamTypes,
|
|
24
24
|
EngineApiRpcReturnTypes,
|
|
25
25
|
ExecutionPayloadBodyRpc,
|
|
26
|
+
ExecutionPayloadBodyV2Rpc,
|
|
26
27
|
ExecutionPayloadRpc,
|
|
27
28
|
ExecutionRequestsRpc,
|
|
28
29
|
PayloadStatus,
|
|
@@ -49,6 +50,8 @@ type ExecutionBlock = {
|
|
|
49
50
|
blockHash: RootHex;
|
|
50
51
|
timestamp: number;
|
|
51
52
|
blockNumber: number;
|
|
53
|
+
/** Bodies as received via newPayload, served back by engine_getPayloadBodiesByHash{V1,V2} */
|
|
54
|
+
body: ExecutionPayloadBodyV2Rpc;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
57
|
const TX_TYPE_EIP1559 = 2;
|
|
@@ -93,6 +96,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
93
96
|
blockHash: ZERO_HASH_HEX,
|
|
94
97
|
timestamp: 0,
|
|
95
98
|
blockNumber: 0,
|
|
99
|
+
body: {transactions: [], withdrawals: null, blockAccessList: null},
|
|
96
100
|
});
|
|
97
101
|
|
|
98
102
|
const eth1BlockHash = opts.eth1BlockHash ?? toRootHex(INTEROP_BLOCK_HASH);
|
|
@@ -102,6 +106,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
102
106
|
blockHash: eth1BlockHash,
|
|
103
107
|
timestamp: 0,
|
|
104
108
|
blockNumber: 1,
|
|
109
|
+
body: {transactions: [], withdrawals: null, blockAccessList: null},
|
|
105
110
|
});
|
|
106
111
|
|
|
107
112
|
const {config} = opts;
|
|
@@ -144,6 +149,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
144
149
|
engine_getPayloadV5: this.getPayloadV5.bind(this),
|
|
145
150
|
engine_getPayloadV6: this.getPayloadV5.bind(this),
|
|
146
151
|
engine_getPayloadBodiesByHashV1: this.getPayloadBodiesByHash.bind(this),
|
|
152
|
+
engine_getPayloadBodiesByHashV2: this.getPayloadBodiesByHashV2.bind(this),
|
|
147
153
|
engine_getPayloadBodiesByRangeV1: this.getPayloadBodiesByRange.bind(this),
|
|
148
154
|
engine_getClientVersionV1: this.getClientVersionV1.bind(this),
|
|
149
155
|
engine_getBlobsV1: this.getBlobs.bind(this),
|
|
@@ -152,9 +158,18 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
152
158
|
}
|
|
153
159
|
|
|
154
160
|
private getPayloadBodiesByHash(
|
|
155
|
-
|
|
161
|
+
blockHashes: EngineApiRpcParamTypes["engine_getPayloadBodiesByHashV1"][0]
|
|
156
162
|
): EngineApiRpcReturnTypes["engine_getPayloadBodiesByHashV1"] {
|
|
157
|
-
return
|
|
163
|
+
return this.getPayloadBodiesByHashV2(blockHashes).map((body) =>
|
|
164
|
+
body ? {transactions: body.transactions, withdrawals: body.withdrawals} : null
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private getPayloadBodiesByHashV2(
|
|
169
|
+
blockHashes: EngineApiRpcParamTypes["engine_getPayloadBodiesByHashV2"][0]
|
|
170
|
+
): EngineApiRpcReturnTypes["engine_getPayloadBodiesByHashV2"] {
|
|
171
|
+
// null for unknown blocks, as a real EL does; the genesis/eth1 seed blocks carry no body
|
|
172
|
+
return blockHashes.map((hash) => this.validBlocks.get(hash)?.body ?? null);
|
|
158
173
|
}
|
|
159
174
|
|
|
160
175
|
private getPayloadBodiesByRange(
|
|
@@ -227,6 +242,11 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
227
242
|
blockHash,
|
|
228
243
|
timestamp: quantityToNum(executionPayloadRpc.timestamp),
|
|
229
244
|
blockNumber: quantityToNum(executionPayloadRpc.blockNumber),
|
|
245
|
+
body: {
|
|
246
|
+
transactions: executionPayloadRpc.transactions,
|
|
247
|
+
withdrawals: executionPayloadRpc.withdrawals ?? null,
|
|
248
|
+
blockAccessList: executionPayloadRpc.blockAccessList ?? null,
|
|
249
|
+
},
|
|
230
250
|
});
|
|
231
251
|
|
|
232
252
|
// IF the payload has been fully validated while processing the call
|
|
@@ -89,6 +89,7 @@ export type EngineApiRpcParamTypes = {
|
|
|
89
89
|
* 1. Array of DATA - Array of block_hash field values of the ExecutionPayload structure
|
|
90
90
|
* */
|
|
91
91
|
engine_getPayloadBodiesByHashV1: DATA[][];
|
|
92
|
+
engine_getPayloadBodiesByHashV2: DATA[][];
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
* 1. start: QUANTITY, 64 bits - Starting block number
|
|
@@ -148,6 +149,7 @@ export type EngineApiRpcReturnTypes = {
|
|
|
148
149
|
engine_getPayloadV6: ExecutionPayloadResponse;
|
|
149
150
|
|
|
150
151
|
engine_getPayloadBodiesByHashV1: (ExecutionPayloadBodyRpc | null)[];
|
|
152
|
+
engine_getPayloadBodiesByHashV2: (ExecutionPayloadBodyV2Rpc | null)[];
|
|
151
153
|
|
|
152
154
|
engine_getPayloadBodiesByRangeV1: (ExecutionPayloadBodyRpc | null)[];
|
|
153
155
|
|
|
@@ -177,6 +179,15 @@ export type ExecutionPayloadBody = {
|
|
|
177
179
|
withdrawals: capella.Withdrawals | null;
|
|
178
180
|
};
|
|
179
181
|
|
|
182
|
+
/** engine_getPayloadBodiesByHashV2 (Amsterdam): adds the RLP-encoded block access list, or null if the EL has pruned it */
|
|
183
|
+
export type ExecutionPayloadBodyV2Rpc = ExecutionPayloadBodyRpc & {
|
|
184
|
+
blockAccessList?: DATA | null;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export type ExecutionPayloadBodyV2 = ExecutionPayloadBody & {
|
|
188
|
+
blockAccessList: Uint8Array | null;
|
|
189
|
+
};
|
|
190
|
+
|
|
180
191
|
export type ExecutionPayloadRpc = {
|
|
181
192
|
parentHash: DATA; // 32 bytes
|
|
182
193
|
feeRecipient: DATA; // 20 bytes
|
|
@@ -678,6 +689,20 @@ export function deserializeExecutionPayloadBody(data: ExecutionPayloadBodyRpc |
|
|
|
678
689
|
: null;
|
|
679
690
|
}
|
|
680
691
|
|
|
692
|
+
export function deserializeExecutionPayloadBodyV2(
|
|
693
|
+
data: ExecutionPayloadBodyV2Rpc | null
|
|
694
|
+
): ExecutionPayloadBodyV2 | null {
|
|
695
|
+
const body = deserializeExecutionPayloadBody(data);
|
|
696
|
+
return body
|
|
697
|
+
? {...body, blockAccessList: data?.blockAccessList ? dataToBytes(data.blockAccessList, null) : null}
|
|
698
|
+
: null;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export function serializeExecutionPayloadBodyV2(data: ExecutionPayloadBodyV2 | null): ExecutionPayloadBodyV2Rpc | null {
|
|
702
|
+
const body = serializeExecutionPayloadBody(data);
|
|
703
|
+
return body ? {...body, blockAccessList: data?.blockAccessList ? bytesToData(data.blockAccessList) : null} : null;
|
|
704
|
+
}
|
|
705
|
+
|
|
681
706
|
export function serializeExecutionPayloadBody(data: ExecutionPayloadBody | null): ExecutionPayloadBodyRpc | null {
|
|
682
707
|
return data
|
|
683
708
|
? {
|
|
@@ -215,6 +215,22 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
215
215
|
help: "Number of getBlobsV1 hits where a versioned hash returns blob and the blob is needed so call is useful",
|
|
216
216
|
}),
|
|
217
217
|
},
|
|
218
|
+
payloadEnvelopeReconstruction: {
|
|
219
|
+
envelopes: register.counter<{result: "ok" | "unavailable" | "mismatch"}>({
|
|
220
|
+
name: "beacon_payload_envelope_reconstruction_envelopes_total",
|
|
221
|
+
help: "Archived header envelopes rebuilt from EL bodies, by outcome",
|
|
222
|
+
labelNames: ["result"],
|
|
223
|
+
}),
|
|
224
|
+
mismatchByField: register.counter<{field: "transactions" | "withdrawals" | "blockAccessList"}>({
|
|
225
|
+
name: "beacon_payload_envelope_reconstruction_mismatch_total",
|
|
226
|
+
help: "Body root mismatches, by which body differed from the stored root",
|
|
227
|
+
labelNames: ["field"],
|
|
228
|
+
}),
|
|
229
|
+
engineErrors: register.counter({
|
|
230
|
+
name: "beacon_payload_envelope_reconstruction_engine_errors_total",
|
|
231
|
+
help: "engine_getPayloadBodiesByHashV2 round-trips that failed while rebuilding envelopes",
|
|
232
|
+
}),
|
|
233
|
+
},
|
|
218
234
|
|
|
219
235
|
blockInputFetchStats: {
|
|
220
236
|
// of already available blocks which didn't have to go through blobs pull
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** biome-ignore-all lint/suspicious/noTemplateCurlyInString: The metric templates requires to have `${}` in a normal string */
|
|
2
2
|
import {NotReorgedReason} from "@lodestar/fork-choice";
|
|
3
|
+
import {StateHashTreeRootSource} from "@lodestar/state-transition";
|
|
3
4
|
import {ArchiveStoreTask} from "../../chain/archiveStore/archiveStore.js";
|
|
4
5
|
import {FrequencyStateArchiveStep} from "../../chain/archiveStore/strategies/frequencyStateArchiveStrategy.js";
|
|
5
6
|
import type {LateCanonicalBlockReason} from "../../chain/archiveStore/utils/archiveBlocks.js";
|
|
@@ -25,8 +26,13 @@ import type {FlatFileStoreOperation} from "../../db/flatFileStore/metrics.js";
|
|
|
25
26
|
import {ExecutionPayloadStatus} from "../../execution/index.js";
|
|
26
27
|
import {GossipType} from "../../network/index.js";
|
|
27
28
|
import {CannotAcceptWorkReason, ReprocessRejectReason} from "../../network/processor/index.js";
|
|
28
|
-
import {
|
|
29
|
-
|
|
29
|
+
import {
|
|
30
|
+
DeferredPayloadResult,
|
|
31
|
+
DownloadResult,
|
|
32
|
+
DroppedItemReason,
|
|
33
|
+
FetchResult,
|
|
34
|
+
PendingBlockType,
|
|
35
|
+
} from "../../sync/types.js";
|
|
30
36
|
import {PeerSyncType, RangeSyncType} from "../../sync/utils/remoteSyncType.js";
|
|
31
37
|
import {AllocSource} from "../../util/bufferPool.js";
|
|
32
38
|
import {DataColumnReconstructionCode} from "../../util/dataColumns.js";
|
|
@@ -174,6 +180,30 @@ export function createLodestarMetrics(
|
|
|
174
180
|
buckets: [0.001, 0.003, 0.01, 0.03, 0.1],
|
|
175
181
|
}),
|
|
176
182
|
|
|
183
|
+
reqRespByRange: {
|
|
184
|
+
requestedSlots: register.histogram<{method: string}>({
|
|
185
|
+
name: "lodestar_reqresp_by_range_requested_slots",
|
|
186
|
+
help: "Histogram of slot count requested per served by_range request",
|
|
187
|
+
labelNames: ["method"],
|
|
188
|
+
buckets: [1, 16, 32, 64, 128],
|
|
189
|
+
}),
|
|
190
|
+
// data_column_sidecars_by_range is the only by_range request carrying columns
|
|
191
|
+
requestedColumns: register.histogram({
|
|
192
|
+
name: "lodestar_reqresp_by_range_requested_columns",
|
|
193
|
+
help: "Histogram of column count requested per served data_column_sidecars_by_range request",
|
|
194
|
+
// 128 is NUMBER_OF_COLUMNS.
|
|
195
|
+
buckets: [1, 4, 8, 32, 128],
|
|
196
|
+
}),
|
|
197
|
+
servedBytes: register.histogram<{method: string}>({
|
|
198
|
+
name: "lodestar_reqresp_by_range_served_bytes",
|
|
199
|
+
help: "Histogram of total serialized bytes served per by_range request",
|
|
200
|
+
labelNames: ["method"],
|
|
201
|
+
// min bucket is roughly a typical mainnet block is 100MB,
|
|
202
|
+
// max bucket is roughly 100 * MAX_PAYLOAD_SIZE
|
|
203
|
+
buckets: [100e3, 1e6, 10e6, 100e6, 1000e6],
|
|
204
|
+
}),
|
|
205
|
+
},
|
|
206
|
+
|
|
177
207
|
regenQueue: {
|
|
178
208
|
length: register.gauge({
|
|
179
209
|
name: "lodestar_regen_queue_length",
|
|
@@ -403,6 +433,15 @@ export function createLodestarMetrics(
|
|
|
403
433
|
labelNames: ["caller"],
|
|
404
434
|
}),
|
|
405
435
|
|
|
436
|
+
// this metrics stay here instead of @lodestar/state-transition in order to prepare
|
|
437
|
+
// for the native zig state-transition in the future
|
|
438
|
+
stateHashTreeRootTime: register.histogram<{source: StateHashTreeRootSource}>({
|
|
439
|
+
name: "lodestar_stfn_hash_tree_root_seconds",
|
|
440
|
+
help: "Time to compute the hash tree root of a post state in seconds",
|
|
441
|
+
buckets: [0.01, 0.05, 0.1, 0.2, 0.3, 0.5],
|
|
442
|
+
labelNames: ["source"],
|
|
443
|
+
}),
|
|
444
|
+
|
|
406
445
|
// BLS verifier thread pool and queue
|
|
407
446
|
|
|
408
447
|
bls: {
|
|
@@ -655,6 +694,16 @@ export function createLodestarMetrics(
|
|
|
655
694
|
help: "Count of payload (execution payload envelope) sync triggers, labeled by their source",
|
|
656
695
|
labelNames: ["source"],
|
|
657
696
|
}),
|
|
697
|
+
deferredPayloadResult: register.counter<{result: DeferredPayloadResult}>({
|
|
698
|
+
name: "lodestar_sync_deferred_payload_result_total",
|
|
699
|
+
help: "Outcome of a slot's deferred optimistic payload searches, by result",
|
|
700
|
+
labelNames: ["result"],
|
|
701
|
+
}),
|
|
702
|
+
deferredPayloadPolls: register.histogram({
|
|
703
|
+
name: "lodestar_sync_deferred_payload_polls_count",
|
|
704
|
+
help: "Poll ticks after PAYLOAD_DUE until a searched payload was imported",
|
|
705
|
+
buckets: [0, 1, 2, 3, 6],
|
|
706
|
+
}),
|
|
658
707
|
pendingBlocks: register.gauge({
|
|
659
708
|
name: "lodestar_sync_unknown_block_pending_blocks_size",
|
|
660
709
|
help: "Current size of UnknownBlockSync pending blocks cache",
|
|
@@ -986,6 +1035,13 @@ export function createLodestarMetrics(
|
|
|
986
1035
|
help: "Count of errors, by error type, while processing execution payload envelopes",
|
|
987
1036
|
labelNames: ["error"],
|
|
988
1037
|
}),
|
|
1038
|
+
executionPayload: {
|
|
1039
|
+
recvToValidation: register.histogram({
|
|
1040
|
+
name: "lodestar_gossip_execution_payload_envelope_received_to_execution_payload_verification_seconds",
|
|
1041
|
+
help: "Time elapsed between execution payload envelope received and execution payload verification",
|
|
1042
|
+
buckets: [0.05, 0.1, 0.25, 0.5, 1, 2, 3, 4, 6, 8],
|
|
1043
|
+
}),
|
|
1044
|
+
},
|
|
989
1045
|
},
|
|
990
1046
|
gossipExecutionPayloadBid: {
|
|
991
1047
|
elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
|
|
@@ -1120,30 +1176,6 @@ export function createLodestarMetrics(
|
|
|
1120
1176
|
help: "The total result of calling notifyForkchoiceUpdate execution engine api",
|
|
1121
1177
|
labelNames: ["result"],
|
|
1122
1178
|
}),
|
|
1123
|
-
backfillSync: {
|
|
1124
|
-
backfilledTillSlot: register.gauge({
|
|
1125
|
-
name: "lodestar_backfill_till_slot",
|
|
1126
|
-
help: "Current lowest backfilled slot",
|
|
1127
|
-
}),
|
|
1128
|
-
prevFinOrWsSlot: register.gauge({
|
|
1129
|
-
name: "lodestar_backfill_prev_fin_or_ws_slot",
|
|
1130
|
-
help: "Slot of previous finalized or wsCheckpoint block to be validated",
|
|
1131
|
-
}),
|
|
1132
|
-
totalBlocks: register.gauge<{method: BackfillSyncMethod}>({
|
|
1133
|
-
name: "lodestar_backfill_sync_blocks_total",
|
|
1134
|
-
help: "Total amount of backfilled blocks",
|
|
1135
|
-
labelNames: ["method"],
|
|
1136
|
-
}),
|
|
1137
|
-
errors: register.gauge({
|
|
1138
|
-
name: "lodestar_backfill_sync_errors_total",
|
|
1139
|
-
help: "Total number of errors while backfilling",
|
|
1140
|
-
}),
|
|
1141
|
-
status: register.gauge({
|
|
1142
|
-
name: "lodestar_backfill_sync_status",
|
|
1143
|
-
help: "Current backfill syncing status: [Aborted, Pending, Syncing, Completed]",
|
|
1144
|
-
}),
|
|
1145
|
-
},
|
|
1146
|
-
|
|
1147
1179
|
opPool: {
|
|
1148
1180
|
aggregatedAttestationPool: {
|
|
1149
1181
|
size: register.gauge({
|
package/src/metrics/metrics.ts
CHANGED
|
@@ -12,7 +12,12 @@ export type Metrics = BeaconMetrics &
|
|
|
12
12
|
BeaconStateTransitionMetrics &
|
|
13
13
|
LodestarMetrics & {register: RegistryMetricCreator; close: () => void};
|
|
14
14
|
|
|
15
|
-
export function createMetrics(
|
|
15
|
+
export function createMetrics(
|
|
16
|
+
opts: MetricsOptions,
|
|
17
|
+
genesisTime: number,
|
|
18
|
+
externalRegistries: Registry[] = [],
|
|
19
|
+
{collectNodeMetrics = true}: {collectNodeMetrics?: boolean} = {}
|
|
20
|
+
): Metrics {
|
|
16
21
|
const register = new RegistryMetricCreator();
|
|
17
22
|
const beacon = createBeaconMetrics(register);
|
|
18
23
|
const forkChoice = getForkChoiceMetrics(register);
|
|
@@ -24,7 +29,7 @@ export function createMetrics(opts: MetricsOptions, genesisTime: number, externa
|
|
|
24
29
|
};
|
|
25
30
|
process.on("unhandledRejection", onUnhandledRejection);
|
|
26
31
|
|
|
27
|
-
const nodeJsMetricsClose = collectNodeJSMetrics(register);
|
|
32
|
+
const nodeJsMetricsClose = collectNodeMetrics ? collectNodeJSMetrics(register) : (): void => {};
|
|
28
33
|
const close = (): void => {
|
|
29
34
|
process.removeListener("unhandledRejection", onUnhandledRejection);
|
|
30
35
|
nodeJsMetricsClose();
|
|
@@ -5,8 +5,10 @@ import {GENESIS_SLOT} from "@lodestar/params";
|
|
|
5
5
|
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
6
6
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
7
7
|
import {gloas} from "@lodestar/types";
|
|
8
|
+
import {EnvelopeReconstructionError} from "../../../chain/errors/index.js";
|
|
8
9
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
9
10
|
import {IBeaconDb} from "../../../db/index.js";
|
|
11
|
+
import {reconstructExecutionPayloadEnvelopesByRange} from "../../../util/execution.js";
|
|
10
12
|
import {prettyPrintPeerId} from "../../util.js";
|
|
11
13
|
|
|
12
14
|
export async function* onExecutionPayloadEnvelopesByRange(
|
|
@@ -35,58 +37,74 @@ export async function* onExecutionPayloadEnvelopesByRange(
|
|
|
35
37
|
);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
const finalized = db.executionPayloadEnvelopeArchive;
|
|
39
40
|
// Use the finalized block's actual slot as the checkpoint epoch-boundary slot may be skipped
|
|
40
41
|
const finalizedSlot = chain.forkChoice.getFinalizedBlock().slot;
|
|
41
42
|
// The finalized block's envelope stays in the hot db until the next finalization run
|
|
42
43
|
const archiveMaxSlot = finalizedSlot - 1;
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
let yielded = 0;
|
|
46
|
+
try {
|
|
47
|
+
if (startSlot <= archiveMaxSlot) {
|
|
48
|
+
for await (const {slot, envelopeBytes} of reconstructExecutionPayloadEnvelopesByRange(
|
|
49
|
+
db,
|
|
50
|
+
chain.executionEngine,
|
|
51
|
+
chain.logger,
|
|
52
|
+
chain.metrics,
|
|
53
|
+
startSlot,
|
|
54
|
+
Math.min(endSlot, archiveMaxSlot + 1)
|
|
55
|
+
)) {
|
|
56
|
+
yielded++;
|
|
57
|
+
yield {
|
|
58
|
+
data: envelopeBytes,
|
|
59
|
+
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(slot)),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
55
62
|
}
|
|
56
|
-
}
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
// Non-finalized range of envelopes. The finalized block's own envelope may be archived by a
|
|
65
|
+
// migration that ran since archiveMaxSlot was computed, so this read can reconstruct too.
|
|
66
|
+
if (endSlot > archiveMaxSlot) {
|
|
67
|
+
const headBlock = chain.forkChoice.getHead();
|
|
68
|
+
const headRoot = headBlock.blockRoot;
|
|
69
|
+
const headChain = chain.forkChoice.getAllAncestorBlocks(headRoot, headBlock.payloadStatus);
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
// Iterate head chain with ascending block numbers
|
|
72
|
+
for (let i = headChain.length - 1; i >= 0; i--) {
|
|
73
|
+
const block = headChain[i];
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
if (block.slot > archiveMaxSlot && block.slot >= startSlot && block.slot < endSlot) {
|
|
76
|
+
// Skip EMPTY blocks
|
|
77
|
+
if (block.payloadStatus !== PayloadStatus.FULL) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
const envelopeBytes = await chain.getSerializedExecutionPayloadEnvelope(block.slot, block.blockRoot);
|
|
82
|
+
if (!envelopeBytes) {
|
|
83
|
+
throw new ResponseError(
|
|
84
|
+
RespStatus.SERVER_ERROR,
|
|
85
|
+
`No envelope for root ${block.blockRoot} slot ${block.slot}, startSlot=${startSlot} endSlot=${endSlot} finalizedSlot=${finalizedSlot}`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
yielded++;
|
|
90
|
+
yield {
|
|
91
|
+
data: envelopeBytes,
|
|
92
|
+
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(block.slot)),
|
|
93
|
+
};
|
|
94
|
+
} else if (block.slot >= endSlot) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
88
97
|
}
|
|
89
98
|
}
|
|
99
|
+
} catch (e) {
|
|
100
|
+
if (e instanceof EnvelopeReconstructionError) {
|
|
101
|
+
// An unservable entry or our own EL failing: after some envelopes, end short (spec-legal, the
|
|
102
|
+
// peer fetches the rest elsewhere); with nothing served, RESOURCE_UNAVAILABLE rather than
|
|
103
|
+
// SERVER_ERROR so peers don't downscore us for it
|
|
104
|
+
if (yielded > 0) return;
|
|
105
|
+
throw new ResponseError(RespStatus.RESOURCE_UNAVAILABLE, `Failed to serve envelopes: ${e.message}`);
|
|
106
|
+
}
|
|
107
|
+
throw e;
|
|
90
108
|
}
|
|
91
109
|
}
|
|
92
110
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {PeerId} from "@libp2p/interface";
|
|
2
|
-
import {ResponseOutgoing} from "@lodestar/reqresp";
|
|
2
|
+
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
3
3
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
4
|
+
import {RootHex, Slot} from "@lodestar/types";
|
|
4
5
|
import {toRootHex} from "@lodestar/utils";
|
|
6
|
+
import {EnvelopeReconstructionError} from "../../../chain/errors/index.js";
|
|
5
7
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
6
8
|
import {IBeaconDb} from "../../../db/index.js";
|
|
7
9
|
import {ExecutionPayloadEnvelopesByRootRequest} from "../../../util/types.js";
|
|
@@ -17,6 +19,8 @@ export async function* onExecutionPayloadEnvelopesByRoot(
|
|
|
17
19
|
// The gloas req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
18
20
|
// Archival nodes may still serve older retained payloads to allow genesis sync.
|
|
19
21
|
|
|
22
|
+
// Resolve slots first so archived header envelopes are rebuilt in one EL batch, not one call per root
|
|
23
|
+
const requests: {blockSlot: Slot; blockRootHex: RootHex}[] = [];
|
|
20
24
|
for (const root of requestBody) {
|
|
21
25
|
const rootHex = toRootHex(root);
|
|
22
26
|
const block = chain.forkChoice.getBlockHexDefaultStatus(rootHex);
|
|
@@ -34,17 +38,35 @@ export async function* onExecutionPayloadEnvelopesByRoot(
|
|
|
34
38
|
);
|
|
35
39
|
continue;
|
|
36
40
|
}
|
|
41
|
+
requests.push({blockSlot: slot, blockRootHex: rootHex});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let envelopesBytes: (Uint8Array | null)[];
|
|
45
|
+
try {
|
|
46
|
+
// by-root allows omission, so a mismatched envelope is left out rather than failing the response
|
|
47
|
+
envelopesBytes = await chain.getSerializedExecutionPayloadEnvelopes(requests, "omit");
|
|
48
|
+
} catch (e) {
|
|
49
|
+
if (e instanceof EnvelopeReconstructionError) {
|
|
50
|
+
throw new ResponseError(
|
|
51
|
+
RespStatus.RESOURCE_UNAVAILABLE,
|
|
52
|
+
`Failed to reconstruct archived envelopes: ${e.message}`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
37
57
|
|
|
38
|
-
|
|
58
|
+
for (let i = 0; i < requests.length; i++) {
|
|
59
|
+
const {blockSlot, blockRootHex} = requests[i];
|
|
60
|
+
const envelopeBytes = envelopesBytes[i];
|
|
39
61
|
if (envelopeBytes) {
|
|
40
62
|
yield {
|
|
41
63
|
data: envelopeBytes,
|
|
42
|
-
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(
|
|
64
|
+
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(blockSlot)),
|
|
43
65
|
};
|
|
44
66
|
} else {
|
|
45
67
|
chain.logger.debug("Cannot serve ExecutionPayloadEnvelopesByRoot: envelope not found", {
|
|
46
|
-
slot,
|
|
47
|
-
root:
|
|
68
|
+
slot: blockSlot,
|
|
69
|
+
root: blockRootHex,
|
|
48
70
|
peer: prettyPrintPeerId(peerId),
|
|
49
71
|
client: peerClient,
|
|
50
72
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {Type} from "@chainsafe/ssz";
|
|
2
|
-
import {ProtocolHandler, RespStatus, ResponseError} from "@lodestar/reqresp";
|
|
2
|
+
import {ProtocolHandler, RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
3
3
|
import {ssz} from "@lodestar/types";
|
|
4
4
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
5
5
|
import {IBeaconDb} from "../../../db/index.js";
|
|
@@ -38,6 +38,29 @@ function deserializeRequestBody<T>(type: Type<T>, data: Uint8Array): T {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
async function* trackByRangeResponse(
|
|
42
|
+
chain: IBeaconChain,
|
|
43
|
+
method: ReqRespMethod,
|
|
44
|
+
count: number,
|
|
45
|
+
source: AsyncIterable<ResponseOutgoing>,
|
|
46
|
+
columns?: number
|
|
47
|
+
): AsyncIterable<ResponseOutgoing> {
|
|
48
|
+
chain.metrics?.reqRespByRange.requestedSlots.observe({method}, count);
|
|
49
|
+
if (columns !== undefined) {
|
|
50
|
+
chain.metrics?.reqRespByRange.requestedColumns.observe(columns);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let servedBytes = 0;
|
|
54
|
+
try {
|
|
55
|
+
for await (const chunk of source) {
|
|
56
|
+
servedBytes += chunk.data.length;
|
|
57
|
+
yield chunk;
|
|
58
|
+
}
|
|
59
|
+
} finally {
|
|
60
|
+
chain.metrics?.reqRespByRange.servedBytes.observe({method}, servedBytes);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
41
64
|
/**
|
|
42
65
|
* The ReqRespHandler module handles app-level requests / responses from other peers,
|
|
43
66
|
* fetching state from the chain and database as needed.
|
|
@@ -50,7 +73,12 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
|
|
|
50
73
|
[ReqRespMethod.Metadata]: notImplemented(ReqRespMethod.Metadata),
|
|
51
74
|
[ReqRespMethod.BeaconBlocksByRange]: (req, peerId, peerClient) => {
|
|
52
75
|
const body = deserializeRequestBody(ssz.phase0.BeaconBlocksByRangeRequest, req.data);
|
|
53
|
-
return
|
|
76
|
+
return trackByRangeResponse(
|
|
77
|
+
chain,
|
|
78
|
+
ReqRespMethod.BeaconBlocksByRange,
|
|
79
|
+
body.count,
|
|
80
|
+
onBeaconBlocksByRange(body, chain, db, peerId, peerClient)
|
|
81
|
+
);
|
|
54
82
|
},
|
|
55
83
|
[ReqRespMethod.BeaconBlocksByRoot]: (req) => {
|
|
56
84
|
const fork = chain.config.getForkName(chain.clock.currentSlot);
|
|
@@ -68,11 +96,22 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
|
|
|
68
96
|
},
|
|
69
97
|
[ReqRespMethod.BlobSidecarsByRange]: (req) => {
|
|
70
98
|
const body = deserializeRequestBody(ssz.deneb.BlobSidecarsByRangeRequest, req.data);
|
|
71
|
-
return
|
|
99
|
+
return trackByRangeResponse(
|
|
100
|
+
chain,
|
|
101
|
+
ReqRespMethod.BlobSidecarsByRange,
|
|
102
|
+
body.count,
|
|
103
|
+
onBlobSidecarsByRange(body, chain, db)
|
|
104
|
+
);
|
|
72
105
|
},
|
|
73
106
|
[ReqRespMethod.DataColumnSidecarsByRange]: (req, peerId, peerClient) => {
|
|
74
107
|
const body = deserializeRequestBody(ssz.fulu.DataColumnSidecarsByRangeRequest, req.data);
|
|
75
|
-
return
|
|
108
|
+
return trackByRangeResponse(
|
|
109
|
+
chain,
|
|
110
|
+
ReqRespMethod.DataColumnSidecarsByRange,
|
|
111
|
+
body.count,
|
|
112
|
+
onDataColumnSidecarsByRange(body, chain, db, peerId, peerClient),
|
|
113
|
+
body.columns.length
|
|
114
|
+
);
|
|
76
115
|
},
|
|
77
116
|
[ReqRespMethod.DataColumnSidecarsByRoot]: (req, peerId, peerClient) => {
|
|
78
117
|
const body = deserializeRequestBody(DataColumnSidecarsByRootRequestType(chain.config), req.data);
|
|
@@ -85,7 +124,12 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
|
|
|
85
124
|
},
|
|
86
125
|
[ReqRespMethod.ExecutionPayloadEnvelopesByRange]: (req, peerId, peerClient) => {
|
|
87
126
|
const body = deserializeRequestBody(ssz.gloas.ExecutionPayloadEnvelopesByRangeRequest, req.data);
|
|
88
|
-
return
|
|
127
|
+
return trackByRangeResponse(
|
|
128
|
+
chain,
|
|
129
|
+
ReqRespMethod.ExecutionPayloadEnvelopesByRange,
|
|
130
|
+
body.count,
|
|
131
|
+
onExecutionPayloadEnvelopesByRange(body, chain, db, peerId, peerClient)
|
|
132
|
+
);
|
|
89
133
|
},
|
|
90
134
|
|
|
91
135
|
[ReqRespMethod.LightClientBootstrap]: (req) => {
|