@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.
Files changed (203) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +13 -4
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/pool/index.js +4 -2
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/chain/archiveStore/archiveStore.d.ts +1 -2
  8. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  9. package/lib/chain/archiveStore/archiveStore.js +5 -8
  10. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  11. package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
  12. package/lib/chain/archiveStore/historicalState/metrics.js +2 -7
  13. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  14. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +11 -2
  15. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  16. package/lib/chain/archiveStore/utils/archiveBlocks.js +46 -28
  17. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  18. package/lib/chain/archiveStore/utils/pruneHistory.d.ts +2 -2
  19. package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
  20. package/lib/chain/archiveStore/utils/pruneHistory.js +1 -0
  21. package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
  22. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  23. package/lib/chain/blocks/importExecutionPayload.js +13 -0
  24. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  25. package/lib/chain/chain.d.ts +10 -0
  26. package/lib/chain/chain.d.ts.map +1 -1
  27. package/lib/chain/chain.js +85 -16
  28. package/lib/chain/chain.js.map +1 -1
  29. package/lib/chain/errors/envelopeReconstructionError.d.ts +23 -0
  30. package/lib/chain/errors/envelopeReconstructionError.d.ts.map +1 -0
  31. package/lib/chain/errors/envelopeReconstructionError.js +13 -0
  32. package/lib/chain/errors/envelopeReconstructionError.js.map +1 -0
  33. package/lib/chain/errors/index.d.ts +1 -0
  34. package/lib/chain/errors/index.d.ts.map +1 -1
  35. package/lib/chain/errors/index.js +1 -0
  36. package/lib/chain/errors/index.js.map +1 -1
  37. package/lib/chain/interface.d.ts +6 -1
  38. package/lib/chain/interface.d.ts.map +1 -1
  39. package/lib/chain/interface.js.map +1 -1
  40. package/lib/chain/options.d.ts +2 -0
  41. package/lib/chain/options.d.ts.map +1 -1
  42. package/lib/chain/options.js +1 -0
  43. package/lib/chain/options.js.map +1 -1
  44. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  45. package/lib/chain/produceBlock/computeNewStateRoot.js +4 -2
  46. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  47. package/lib/db/beacon.d.ts +1 -2
  48. package/lib/db/beacon.d.ts.map +1 -1
  49. package/lib/db/beacon.js +1 -3
  50. package/lib/db/beacon.js.map +1 -1
  51. package/lib/db/buckets.d.ts +0 -1
  52. package/lib/db/buckets.d.ts.map +1 -1
  53. package/lib/db/buckets.js +1 -1
  54. package/lib/db/buckets.js.map +1 -1
  55. package/lib/db/interface.d.ts +1 -2
  56. package/lib/db/interface.d.ts.map +1 -1
  57. package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
  58. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  59. package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts +21 -9
  60. package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts.map +1 -1
  61. package/lib/db/repositories/executionPayloadEnvelopeArchive.js +32 -12
  62. package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
  63. package/lib/db/repositories/index.d.ts +1 -2
  64. package/lib/db/repositories/index.d.ts.map +1 -1
  65. package/lib/db/repositories/index.js +1 -2
  66. package/lib/db/repositories/index.js.map +1 -1
  67. package/lib/execution/engine/disabled.d.ts +1 -0
  68. package/lib/execution/engine/disabled.d.ts.map +1 -1
  69. package/lib/execution/engine/disabled.js +3 -0
  70. package/lib/execution/engine/disabled.js.map +1 -1
  71. package/lib/execution/engine/http.d.ts +2 -1
  72. package/lib/execution/engine/http.d.ts.map +1 -1
  73. package/lib/execution/engine/http.js +7 -1
  74. package/lib/execution/engine/http.js.map +1 -1
  75. package/lib/execution/engine/interface.d.ts +3 -1
  76. package/lib/execution/engine/interface.d.ts.map +1 -1
  77. package/lib/execution/engine/mock.d.ts +1 -0
  78. package/lib/execution/engine/mock.d.ts.map +1 -1
  79. package/lib/execution/engine/mock.js +14 -2
  80. package/lib/execution/engine/mock.js.map +1 -1
  81. package/lib/execution/engine/types.d.ts +11 -0
  82. package/lib/execution/engine/types.d.ts.map +1 -1
  83. package/lib/execution/engine/types.js +10 -0
  84. package/lib/execution/engine/types.js.map +1 -1
  85. package/lib/metrics/metrics/beacon.d.ts +9 -0
  86. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  87. package/lib/metrics/metrics/beacon.js +16 -0
  88. package/lib/metrics/metrics/beacon.js.map +1 -1
  89. package/lib/metrics/metrics/lodestar.d.ts +21 -11
  90. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  91. package/lib/metrics/metrics/lodestar.js +48 -23
  92. package/lib/metrics/metrics/lodestar.js.map +1 -1
  93. package/lib/metrics/metrics.d.ts +3 -1
  94. package/lib/metrics/metrics.d.ts.map +1 -1
  95. package/lib/metrics/metrics.js +2 -2
  96. package/lib/metrics/metrics.js.map +1 -1
  97. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
  98. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +47 -34
  99. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
  100. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -1
  101. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +23 -4
  102. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
  103. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  104. package/lib/network/reqresp/handlers/index.js +20 -4
  105. package/lib/network/reqresp/handlers/index.js.map +1 -1
  106. package/lib/node/nodejs.d.ts +2 -7
  107. package/lib/node/nodejs.d.ts.map +1 -1
  108. package/lib/node/nodejs.js +2 -22
  109. package/lib/node/nodejs.js.map +1 -1
  110. package/lib/sync/interface.d.ts +1 -2
  111. package/lib/sync/interface.d.ts.map +1 -1
  112. package/lib/sync/options.d.ts +0 -6
  113. package/lib/sync/options.d.ts.map +1 -1
  114. package/lib/sync/options.js +0 -2
  115. package/lib/sync/options.js.map +1 -1
  116. package/lib/sync/types.d.ts +18 -3
  117. package/lib/sync/types.d.ts.map +1 -1
  118. package/lib/sync/types.js +19 -3
  119. package/lib/sync/types.js.map +1 -1
  120. package/lib/sync/unknownBlock.d.ts +19 -0
  121. package/lib/sync/unknownBlock.d.ts.map +1 -1
  122. package/lib/sync/unknownBlock.js +184 -15
  123. package/lib/sync/unknownBlock.js.map +1 -1
  124. package/lib/util/execution.d.ts +42 -0
  125. package/lib/util/execution.d.ts.map +1 -1
  126. package/lib/util/execution.js +123 -2
  127. package/lib/util/execution.js.map +1 -1
  128. package/lib/util/headerEnvelope.d.ts +17 -0
  129. package/lib/util/headerEnvelope.d.ts.map +1 -0
  130. package/lib/util/headerEnvelope.js +43 -0
  131. package/lib/util/headerEnvelope.js.map +1 -0
  132. package/lib/util/shuffle.d.ts +0 -4
  133. package/lib/util/shuffle.d.ts.map +1 -1
  134. package/lib/util/shuffle.js +0 -8
  135. package/lib/util/shuffle.js.map +1 -1
  136. package/package.json +16 -16
  137. package/src/api/impl/beacon/blocks/index.ts +16 -3
  138. package/src/api/impl/beacon/pool/index.ts +6 -2
  139. package/src/chain/archiveStore/archiveStore.ts +6 -9
  140. package/src/chain/archiveStore/historicalState/metrics.ts +3 -9
  141. package/src/chain/archiveStore/utils/archiveBlocks.ts +54 -32
  142. package/src/chain/archiveStore/utils/pruneHistory.ts +4 -2
  143. package/src/chain/blocks/importExecutionPayload.ts +14 -0
  144. package/src/chain/chain.ts +96 -20
  145. package/src/chain/errors/envelopeReconstructionError.ts +22 -0
  146. package/src/chain/errors/index.ts +1 -0
  147. package/src/chain/interface.ts +6 -1
  148. package/src/chain/options.ts +3 -0
  149. package/src/chain/produceBlock/computeNewStateRoot.ts +9 -2
  150. package/src/db/beacon.ts +0 -5
  151. package/src/db/buckets.ts +2 -2
  152. package/src/db/interface.ts +0 -3
  153. package/src/db/repositories/executionPayloadEnvelopeArchive.ts +43 -13
  154. package/src/db/repositories/index.ts +6 -2
  155. package/src/execution/engine/disabled.ts +4 -0
  156. package/src/execution/engine/http.ts +12 -0
  157. package/src/execution/engine/interface.ts +4 -1
  158. package/src/execution/engine/mock.ts +22 -2
  159. package/src/execution/engine/types.ts +25 -0
  160. package/src/metrics/metrics/beacon.ts +16 -0
  161. package/src/metrics/metrics/lodestar.ts +58 -26
  162. package/src/metrics/metrics.ts +7 -2
  163. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +57 -39
  164. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +27 -5
  165. package/src/network/reqresp/handlers/index.ts +49 -5
  166. package/src/node/nodejs.ts +0 -27
  167. package/src/sync/interface.ts +1 -2
  168. package/src/sync/options.ts +0 -8
  169. package/src/sync/types.ts +19 -3
  170. package/src/sync/unknownBlock.ts +192 -14
  171. package/src/util/execution.ts +175 -2
  172. package/src/util/headerEnvelope.ts +76 -0
  173. package/src/util/shuffle.ts +0 -9
  174. package/lib/chain/archiveStore/utils/updateBackfillRange.d.ts +0 -20
  175. package/lib/chain/archiveStore/utils/updateBackfillRange.d.ts.map +0 -1
  176. package/lib/chain/archiveStore/utils/updateBackfillRange.js +0 -40
  177. package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +0 -1
  178. package/lib/db/repositories/backfilledRanges.d.ts +0 -18
  179. package/lib/db/repositories/backfilledRanges.d.ts.map +0 -1
  180. package/lib/db/repositories/backfilledRanges.js +0 -26
  181. package/lib/db/repositories/backfilledRanges.js.map +0 -1
  182. package/lib/sync/backfill/backfill.d.ts +0 -169
  183. package/lib/sync/backfill/backfill.d.ts.map +0 -1
  184. package/lib/sync/backfill/backfill.js +0 -686
  185. package/lib/sync/backfill/backfill.js.map +0 -1
  186. package/lib/sync/backfill/errors.d.ts +0 -30
  187. package/lib/sync/backfill/errors.d.ts.map +0 -1
  188. package/lib/sync/backfill/errors.js +0 -15
  189. package/lib/sync/backfill/errors.js.map +0 -1
  190. package/lib/sync/backfill/index.d.ts +0 -2
  191. package/lib/sync/backfill/index.d.ts.map +0 -1
  192. package/lib/sync/backfill/index.js +0 -2
  193. package/lib/sync/backfill/index.js.map +0 -1
  194. package/lib/sync/backfill/verify.d.ts +0 -18
  195. package/lib/sync/backfill/verify.d.ts.map +0 -1
  196. package/lib/sync/backfill/verify.js +0 -36
  197. package/lib/sync/backfill/verify.js.map +0 -1
  198. package/src/chain/archiveStore/utils/updateBackfillRange.ts +0 -50
  199. package/src/db/repositories/backfilledRanges.ts +0 -29
  200. package/src/sync/backfill/backfill.ts +0 -916
  201. package/src/sync/backfill/errors.ts +0 -23
  202. package/src/sync/backfill/index.ts +0 -1
  203. package/src/sync/backfill/verify.ts +0 -58
@@ -2,12 +2,18 @@ import {routes} from "@lodestar/api";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
3
  import {ForkPostFulu, ForkPreFulu} from "@lodestar/params";
4
4
  import {signedBlockToSignedHeader} from "@lodestar/state-transition";
5
- import {DataColumnSidecar, SignedBeaconBlock, deneb, isGloasDataColumnSidecar} from "@lodestar/types";
6
- import {fromHex, toHex} from "@lodestar/utils";
5
+ import {DataColumnSidecar, SignedBeaconBlock, Slot, deneb, gloas, isGloasDataColumnSidecar, ssz} from "@lodestar/types";
6
+ import {Logger, fromHex, toHex, toRootHex} from "@lodestar/utils";
7
7
  import {isBlockInputBlobs, isBlockInputColumns} from "../chain/blocks/blockInput/blockInput.js";
8
8
  import {BlockInputSource, IBlockInput} from "../chain/blocks/blockInput/types.js";
9
9
  import {PayloadEnvelopeInput, PayloadEnvelopeInputSource} from "../chain/blocks/payloadEnvelopeInput/index.js";
10
10
  import {ChainEvent, ChainEventEmitter} from "../chain/emitter.js";
11
+ import {
12
+ EnvelopeReconstructionError,
13
+ EnvelopeReconstructionErrorCode,
14
+ } from "../chain/errors/envelopeReconstructionError.js";
15
+ import {IBeaconDb} from "../db/index.js";
16
+ import {ArchivedEnvelope, decodeArchivedEnvelope} from "../db/repositories/index.js";
11
17
  import {IExecutionEngine} from "../execution/index.js";
12
18
  import {Metrics} from "../metrics/index.js";
13
19
  import {computePreFuluKzgCommitmentsInclusionProof} from "./blobs.js";
@@ -17,6 +23,7 @@ import {
17
23
  getDataColumnSidecarsFromColumnSidecar,
18
24
  getGloasDataColumnSidecars,
19
25
  } from "./dataColumns.js";
26
+ import {signedHeaderEnvelopeToFull} from "./headerEnvelope.js";
20
27
 
21
28
  export enum DataColumnEngineResult {
22
29
  PreFulu = "pre_fulu",
@@ -251,3 +258,169 @@ export async function getDataColumnSidecarsFromExecution(
251
258
  );
252
259
  return DataColumnEngineResult.SuccessResolved;
253
260
  }
261
+
262
+ /** engine_getPayloadBodiesByHashV2: ELs MUST support at least 32 hashes per request. */
263
+ const MAX_BODIES_REQUEST = 32;
264
+
265
+ type SlotEnvelopeBytes = {slot: Slot; envelopeBytes: Uint8Array};
266
+
267
+ type RangeEntry = ArchivedEnvelope & {slot: Slot};
268
+
269
+ /** What a body root mismatch means on a given serving path */
270
+ export type ReconstructMismatchPolicy = "throw" | "omit";
271
+
272
+ export type RebuildMiss =
273
+ /** EL does not have the block, or has pruned its block access list */
274
+ | {slot: Slot; reason: "unavailable"}
275
+ /** An EL body does not hash to its stored root (local inconsistency) */
276
+ | {slot: Slot; reason: "mismatch"; error: EnvelopeReconstructionError};
277
+
278
+ /**
279
+ * Stream finalized envelopes over [startSlot, endSlot) as serialized bytes, rebuilding header
280
+ * entries from EL bodies 32 per round-trip.
281
+ *
282
+ * Ends at the first entry that cannot be served by throwing RANGE_UNSERVABLE with that slot: the
283
+ * by-range spec inherits BeaconBlocksByRange v2 semantics (consecutive, MAY be short), and a hole
284
+ * looks like a lying peer to one that already holds the blocks. Entries are attempted regardless of
285
+ * age; the EL's block access list retention is the floor, not MIN_EPOCHS_FOR_BLOCK_REQUESTS.
286
+ *
287
+ * Throws ENGINE_UNAVAILABLE if the EL call fails. Either may surface after envelopes were yielded.
288
+ */
289
+ export async function* reconstructExecutionPayloadEnvelopesByRange(
290
+ db: IBeaconDb,
291
+ executionEngine: IExecutionEngine,
292
+ logger: Logger,
293
+ metrics: Metrics | null,
294
+ startSlot: Slot,
295
+ endSlot: Slot
296
+ ): AsyncIterable<SlotEnvelopeBytes> {
297
+ const archive = db.executionPayloadEnvelopeArchive;
298
+ let batch: RangeEntry[] = [];
299
+
300
+ for await (const {key, value: bytes} of archive.binaryEntriesStream({gte: startSlot, lt: endSlot})) {
301
+ batch.push({slot: archive.decodeKey(key), ...decodeArchivedEnvelope(bytes)});
302
+ if (batch.length === MAX_BODIES_REQUEST) {
303
+ yield* reconstructBatch(executionEngine, logger, metrics, batch);
304
+ batch = [];
305
+ }
306
+ }
307
+ if (batch.length > 0) {
308
+ yield* reconstructBatch(executionEngine, logger, metrics, batch);
309
+ }
310
+ }
311
+
312
+ /**
313
+ * Rebuild a range batch, yielding what precedes the first unservable entry before throwing
314
+ * RANGE_UNSERVABLE for it
315
+ */
316
+ async function* reconstructBatch(
317
+ executionEngine: IExecutionEngine,
318
+ logger: Logger,
319
+ metrics: Metrics | null,
320
+ batch: RangeEntry[]
321
+ ): AsyncIterable<SlotEnvelopeBytes> {
322
+ const headerEnvelopes: gloas.SignedExecutionPayloadHeaderEnvelope[] = [];
323
+ for (const entry of batch) {
324
+ if (entry.headerEnvelope !== undefined) headerEnvelopes.push(entry.headerEnvelope);
325
+ }
326
+ const rebuilt = await reconstructEnvelopesBatch(executionEngine, metrics, headerEnvelopes);
327
+
328
+ let rebuiltIdx = 0;
329
+ for (const entry of batch) {
330
+ if (entry.envelopeBytes !== undefined) {
331
+ yield {slot: entry.slot, envelopeBytes: entry.envelopeBytes};
332
+ continue;
333
+ }
334
+ const result = rebuilt[rebuiltIdx++];
335
+ if (isRebuildMiss(result)) {
336
+ // Peer-triggered, so debug: a persistent local mismatch would otherwise log on every request
337
+ if (result.reason === "mismatch") {
338
+ logger.debug("Archived envelope failed body root check against EL bodies", {slot: entry.slot}, result.error);
339
+ } else {
340
+ logger.debug("EL cannot serve bodies for archived envelope, ending range", {slot: entry.slot});
341
+ }
342
+ throw new EnvelopeReconstructionError(
343
+ {code: EnvelopeReconstructionErrorCode.RANGE_UNSERVABLE, slot: entry.slot},
344
+ `archived envelope range unservable from slot=${entry.slot}`
345
+ );
346
+ }
347
+ yield {slot: entry.slot, envelopeBytes: ssz.gloas.SignedExecutionPayloadEnvelope.serialize(result)};
348
+ }
349
+ }
350
+
351
+ /**
352
+ * Rebuild header envelopes from EL bodies, 32 per round-trip. Aligned with the input, with a
353
+ * {@link RebuildMiss} where the envelope could not be rebuilt; the caller decides what a miss means
354
+ * on its path. Throws ENGINE_UNAVAILABLE only.
355
+ */
356
+ export async function reconstructExecutionPayloadEnvelopes(
357
+ executionEngine: IExecutionEngine,
358
+ metrics: Metrics | null,
359
+ headerEnvelopes: gloas.SignedExecutionPayloadHeaderEnvelope[]
360
+ ): Promise<(gloas.SignedExecutionPayloadEnvelope | RebuildMiss)[]> {
361
+ const out: (gloas.SignedExecutionPayloadEnvelope | RebuildMiss)[] = [];
362
+ for (let i = 0; i < headerEnvelopes.length; i += MAX_BODIES_REQUEST) {
363
+ out.push(
364
+ ...(await reconstructEnvelopesBatch(executionEngine, metrics, headerEnvelopes.slice(i, i + MAX_BODIES_REQUEST)))
365
+ );
366
+ }
367
+ return out;
368
+ }
369
+
370
+ export function isRebuildMiss(result: gloas.SignedExecutionPayloadEnvelope | RebuildMiss): result is RebuildMiss {
371
+ return "reason" in result;
372
+ }
373
+
374
+ /**
375
+ * One EL round-trip. Aligned with the input; never throws per envelope, only ENGINE_UNAVAILABLE.
376
+ * Every serving path (by-range, by-root, REST) comes through here, so the outcome metrics are
377
+ * incremented once, in this function.
378
+ */
379
+ async function reconstructEnvelopesBatch(
380
+ executionEngine: IExecutionEngine,
381
+ metrics: Metrics | null,
382
+ headerEnvelopes: gloas.SignedExecutionPayloadHeaderEnvelope[]
383
+ ): Promise<(gloas.SignedExecutionPayloadEnvelope | RebuildMiss)[]> {
384
+ if (headerEnvelopes.length === 0) return [];
385
+ const hashes = headerEnvelopes.map((headerEnvelope) => toRootHex(headerEnvelope.message.payloadHeader.blockHash));
386
+
387
+ let bodies: Awaited<ReturnType<IExecutionEngine["getPayloadBodiesByHashV2"]>>;
388
+ try {
389
+ bodies = await executionEngine.getPayloadBodiesByHashV2(hashes);
390
+ } catch (e) {
391
+ metrics?.payloadEnvelopeReconstruction.engineErrors.inc();
392
+ throw new EnvelopeReconstructionError(
393
+ {code: EnvelopeReconstructionErrorCode.ENGINE_UNAVAILABLE},
394
+ `engine_getPayloadBodiesByHashV2 failed: ${(e as Error).message}`
395
+ );
396
+ }
397
+
398
+ return headerEnvelopes.map((headerEnvelope, i) => {
399
+ const slot = headerEnvelope.message.payloadHeader.slotNumber;
400
+ const body = bodies[i];
401
+ // A zero-length block access list cannot be valid, RLP encodes an empty list as 0xc0
402
+ if (body == null || body.withdrawals == null || body.blockAccessList == null || body.blockAccessList.length === 0) {
403
+ metrics?.payloadEnvelopeReconstruction.envelopes.inc({result: "unavailable"});
404
+ return {slot, reason: "unavailable"};
405
+ }
406
+ try {
407
+ const envelope = signedHeaderEnvelopeToFull(headerEnvelope, {
408
+ transactions: body.transactions,
409
+ withdrawals: body.withdrawals,
410
+ blockAccessList: body.blockAccessList,
411
+ });
412
+ metrics?.payloadEnvelopeReconstruction.envelopes.inc({result: "ok"});
413
+ return envelope;
414
+ } catch (e) {
415
+ if (
416
+ e instanceof EnvelopeReconstructionError &&
417
+ e.type.code === EnvelopeReconstructionErrorCode.BODY_ROOT_MISMATCH
418
+ ) {
419
+ metrics?.payloadEnvelopeReconstruction.envelopes.inc({result: "mismatch"});
420
+ metrics?.payloadEnvelopeReconstruction.mismatchByField.inc({field: e.type.field});
421
+ return {slot, reason: "mismatch", error: e};
422
+ }
423
+ throw e;
424
+ }
425
+ });
426
+ }
@@ -0,0 +1,76 @@
1
+ import {ssz} from "@lodestar/types";
2
+ import {
3
+ BlockAccessList,
4
+ ExecutionPayloadEnvelope,
5
+ ExecutionPayloadHeaderEnvelope,
6
+ SignedExecutionPayloadEnvelope,
7
+ SignedExecutionPayloadHeaderEnvelope,
8
+ Transactions,
9
+ Withdrawals,
10
+ } from "@lodestar/types/gloas";
11
+ import {toRootHex} from "@lodestar/utils";
12
+ import {
13
+ EnvelopeReconstructionError,
14
+ EnvelopeReconstructionErrorCode,
15
+ } from "../chain/errors/envelopeReconstructionError.js";
16
+
17
+ /** The parts of an execution payload the EL serves back via engine_getPayloadBodiesByHashV2 */
18
+ export type ExecutionPayloadBodies = {
19
+ transactions: Transactions;
20
+ withdrawals: Withdrawals;
21
+ blockAccessList: BlockAccessList;
22
+ };
23
+
24
+ export type ExecutionPayloadBodyField = keyof ExecutionPayloadBodies;
25
+
26
+ const {transactions, withdrawals, blockAccessList} = ssz.gloas.ExecutionPayload.fields;
27
+
28
+ /** Replace the three body lists by their roots; hashes to the same root as the full envelope */
29
+ export function toHeaderEnvelope(envelope: ExecutionPayloadEnvelope): ExecutionPayloadHeaderEnvelope {
30
+ const {payload, ...envelopeFields} = envelope;
31
+ const {transactions: txs, withdrawals: wds, blockAccessList: bal, ...scalars} = payload;
32
+ return {
33
+ ...envelopeFields,
34
+ payloadHeader: {
35
+ ...scalars,
36
+ transactionsRoot: transactions.hashTreeRoot(txs),
37
+ withdrawalsRoot: withdrawals.hashTreeRoot(wds),
38
+ blockAccessListRoot: blockAccessList.hashTreeRoot(bal),
39
+ },
40
+ };
41
+ }
42
+
43
+ export function toSignedHeaderEnvelope(envelope: SignedExecutionPayloadEnvelope): SignedExecutionPayloadHeaderEnvelope {
44
+ return {message: toHeaderEnvelope(envelope.message), signature: envelope.signature};
45
+ }
46
+
47
+ /**
48
+ * Rebuild the full signed envelope from header envelope + EL bodies, each body verified against its stored
49
+ * root. Throws {@link EnvelopeReconstructionError} BODY_ROOT_MISMATCH naming the first body that differs.
50
+ */
51
+ export function signedHeaderEnvelopeToFull(
52
+ headerEnvelope: SignedExecutionPayloadHeaderEnvelope,
53
+ bodies: ExecutionPayloadBodies
54
+ ): SignedExecutionPayloadEnvelope {
55
+ const {payloadHeader, ...envelopeFields} = headerEnvelope.message;
56
+ const {transactionsRoot, withdrawalsRoot, blockAccessListRoot, ...scalars} = payloadHeader;
57
+ const slot = scalars.slotNumber;
58
+
59
+ assertBodyRoot("transactions", slot, transactionsRoot, transactions.hashTreeRoot(bodies.transactions));
60
+ assertBodyRoot("withdrawals", slot, withdrawalsRoot, withdrawals.hashTreeRoot(bodies.withdrawals));
61
+ assertBodyRoot("blockAccessList", slot, blockAccessListRoot, blockAccessList.hashTreeRoot(bodies.blockAccessList));
62
+
63
+ return {
64
+ message: {...envelopeFields, payload: {...scalars, ...bodies}},
65
+ signature: headerEnvelope.signature,
66
+ };
67
+ }
68
+
69
+ function assertBodyRoot(field: ExecutionPayloadBodyField, slot: number, stored: Uint8Array, rebuilt: Uint8Array): void {
70
+ if (!ssz.Root.equals(stored, rebuilt)) {
71
+ throw new EnvelopeReconstructionError(
72
+ {code: EnvelopeReconstructionErrorCode.BODY_ROOT_MISMATCH, slot, field},
73
+ `reconstructed ${field} root mismatch slot=${slot} stored=${toRootHex(stored)} rebuilt=${toRootHex(rebuilt)}`
74
+ );
75
+ }
76
+ }
@@ -10,12 +10,3 @@ export function shuffle<T>(arr: T[]): T[] {
10
10
  }
11
11
  return _arr;
12
12
  }
13
-
14
- /**
15
- * Return one random item from array
16
- */
17
- export function shuffleOne<T>(arr: T[]): T | undefined {
18
- if (arr.length === 0) return undefined;
19
-
20
- return arr[Math.floor(Math.random() * arr.length)];
21
- }
@@ -1,20 +0,0 @@
1
- import { CheckpointWithHex } from "@lodestar/fork-choice";
2
- import { Logger } from "@lodestar/logger";
3
- import { IBeaconDb } from "../../../db/interface.js";
4
- import { IBeaconChain } from "../../interface.js";
5
- /**
6
- * Backfill sync relies on verified connected ranges (which are represented as key,value
7
- * with a verified jump from a key back to value). Since the node could have progressed
8
- * ahead from, we need to save the forward progress of this node as another backfill
9
- * range entry, that backfill sync will use to jump back if this node is restarted
10
- * for any reason.
11
- * The current backfill has its own backfill entry from anchor slot to last backfilled
12
- * slot. And this would create the entry from the current finalized slot to the anchor
13
- * slot.
14
- */
15
- export declare function updateBackfillRange({ chain, db, logger }: {
16
- chain: IBeaconChain;
17
- db: IBeaconDb;
18
- logger: Logger;
19
- }, finalized: CheckpointWithHex): Promise<void>;
20
- //# sourceMappingURL=updateBackfillRange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateBackfillRange.d.ts","sourceRoot":"","sources":["../../../../src/chain/archiveStore/utils/updateBackfillRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAC,EAAE;IAAC,KAAK,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,EACzE,SAAS,EAAE,iBAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
@@ -1,40 +0,0 @@
1
- /**
2
- * Backfill sync relies on verified connected ranges (which are represented as key,value
3
- * with a verified jump from a key back to value). Since the node could have progressed
4
- * ahead from, we need to save the forward progress of this node as another backfill
5
- * range entry, that backfill sync will use to jump back if this node is restarted
6
- * for any reason.
7
- * The current backfill has its own backfill entry from anchor slot to last backfilled
8
- * slot. And this would create the entry from the current finalized slot to the anchor
9
- * slot.
10
- */
11
- export async function updateBackfillRange({ chain, db, logger }, finalized) {
12
- try {
13
- // Mark the sequence in backfill db from finalized block's slot till anchor slot as
14
- // filled.
15
- const finalizedBlockFC = chain.forkChoice.getBlockHexDefaultStatus(finalized.rootHex);
16
- if (finalizedBlockFC && finalizedBlockFC.slot > chain.anchorStateLatestBlockSlot) {
17
- await db.backfilledRanges.put(finalizedBlockFC.slot, chain.anchorStateLatestBlockSlot);
18
- // Clear previously marked sequence till anchorStateLatestBlockSlot, without
19
- // touching backfill sync process sequence which are at
20
- // <=anchorStateLatestBlockSlot i.e. clear >anchorStateLatestBlockSlot
21
- // and < currentSlot
22
- const filteredSeqs = await db.backfilledRanges.entries({
23
- gt: chain.anchorStateLatestBlockSlot,
24
- lt: finalizedBlockFC.slot,
25
- });
26
- logger.debug("updated backfilledRanges", {
27
- key: finalizedBlockFC.slot,
28
- value: chain.anchorStateLatestBlockSlot,
29
- });
30
- if (filteredSeqs.length > 0) {
31
- await db.backfilledRanges.batchDelete(filteredSeqs.map((entry) => entry.key));
32
- logger.debug(`Forward Sync - cleaned up backfilledRanges between ${finalizedBlockFC.slot},${chain.anchorStateLatestBlockSlot}`, { seqs: JSON.stringify(filteredSeqs) });
33
- }
34
- }
35
- }
36
- catch (e) {
37
- logger.error("Error updating backfilledRanges on finalization", { epoch: finalized.epoch }, e);
38
- }
39
- }
40
- //# sourceMappingURL=updateBackfillRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateBackfillRange.js","sourceRoot":"","sources":["../../../../src/chain/archiveStore/utils/updateBackfillRange.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAuD,EACzE,SAA4B;IAE5B,IAAI,CAAC;QACH,mFAAmF;QACnF,UAAU;QACV,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtF,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,IAAI,GAAG,KAAK,CAAC,0BAA0B,EAAE,CAAC;YACjF,MAAM,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAEvF,4EAA4E;YAC5E,uDAAuD;YACvD,sEAAsE;YACtE,oBAAoB;YACpB,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC;gBACrD,EAAE,EAAE,KAAK,CAAC,0BAA0B;gBACpC,EAAE,EAAE,gBAAgB,CAAC,IAAI;aAC1B,CAAC,CAAC;YACH,MAAM,CAAC,KAAK,CAAC,0BAA0B,EAAE;gBACvC,GAAG,EAAE,gBAAgB,CAAC,IAAI;gBAC1B,KAAK,EAAE,KAAK,CAAC,0BAA0B;aACxC,CAAC,CAAC;YACH,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC9E,MAAM,CAAC,KAAK,CACV,sDAAsD,gBAAgB,CAAC,IAAI,IAAI,KAAK,CAAC,0BAA0B,EAAE,EACjH,EAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAC,CACrC,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,iDAAiD,EAAE,EAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAC,EAAE,CAAU,CAAC,CAAC;IACxG,CAAC;AACH,CAAC"}
@@ -1,18 +0,0 @@
1
- import { ChainForkConfig } from "@lodestar/config";
2
- import { DatabaseController, Repository } from "@lodestar/db";
3
- import { Slot } from "@lodestar/types";
4
- /**
5
- * Slot to slot ranges that ensure that block range is fully backfilled
6
- *
7
- * If node starts backfilling at slots 1000, and backfills to 800, there will be an entry
8
- * 1000 -> 800
9
- *
10
- * When the node is backfilling if it starts at 1200 and backfills to 1000, it will find this sequence and,
11
- * jump directly to 800 and delete the key 1000.
12
- */
13
- export declare class BackfilledRanges extends Repository<Slot, Slot> {
14
- constructor(config: ChainForkConfig, db: DatabaseController<Uint8Array, Uint8Array>);
15
- decodeKey(data: Buffer): number;
16
- getId(_value: Slot): number;
17
- }
18
- //# sourceMappingURL=backfilledRanges.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backfilledRanges.d.ts","sourceRoot":"","sources":["../../../src/db/repositories/backfilledRanges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,kBAAkB,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAC,IAAI,EAAM,MAAM,iBAAiB,CAAC;AAI1C;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC;IAC1D,YAAY,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE,kBAAkB,CAAC,UAAU,EAAE,UAAU,CAAC,EAGlF;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9B;IAED,KAAK,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAE1B;CACF"}
@@ -1,26 +0,0 @@
1
- import { Repository } from "@lodestar/db";
2
- import { ssz } from "@lodestar/types";
3
- import { bytesToInt } from "@lodestar/utils";
4
- import { Bucket, getBucketNameByValue } from "../buckets.js";
5
- /**
6
- * Slot to slot ranges that ensure that block range is fully backfilled
7
- *
8
- * If node starts backfilling at slots 1000, and backfills to 800, there will be an entry
9
- * 1000 -> 800
10
- *
11
- * When the node is backfilling if it starts at 1200 and backfills to 1000, it will find this sequence and,
12
- * jump directly to 800 and delete the key 1000.
13
- */
14
- export class BackfilledRanges extends Repository {
15
- constructor(config, db) {
16
- const bucket = Bucket.backfilled_ranges;
17
- super(config, db, bucket, ssz.Slot, getBucketNameByValue(bucket));
18
- }
19
- decodeKey(data) {
20
- return bytesToInt(super.decodeKey(data), "be");
21
- }
22
- getId(_value) {
23
- throw new Error("Cannot get the db key from slot");
24
- }
25
- }
26
- //# sourceMappingURL=backfilledRanges.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backfilledRanges.js","sourceRoot":"","sources":["../../../src/db/repositories/backfilledRanges.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,UAAU,EAAC,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAO,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAC,MAAM,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAsB;IAC1D,YAAY,MAAuB,EAAE,EAA8C;QACjF,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;QACxC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,SAAS,CAAC,IAAY;QACpB,OAAO,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAA0B,EAAE,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,MAAY;QAChB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;CACF"}
@@ -1,169 +0,0 @@
1
- import { EventEmitter } from "node:events";
2
- import { StrictEventEmitter } from "strict-event-emitter-types";
3
- import { BeaconConfig } from "@lodestar/config";
4
- import { IBeaconStateView } from "@lodestar/state-transition";
5
- import { Root, SignedBeaconBlock, Slot, phase0 } from "@lodestar/types";
6
- import { Logger } from "@lodestar/utils";
7
- import { IBeaconChain } from "../../chain/index.js";
8
- import { IBeaconDb } from "../../db/index.js";
9
- import { Metrics } from "../../metrics/metrics.js";
10
- import { INetwork } from "../../network/index.js";
11
- import { BackfillBlock, BackfillBlockHeader } from "./verify.js";
12
- export type BackfillSyncModules = {
13
- chain: IBeaconChain;
14
- db: IBeaconDb;
15
- network: INetwork;
16
- config: BeaconConfig;
17
- logger: Logger;
18
- metrics: Metrics | null;
19
- anchorState: IBeaconStateView;
20
- wsCheckpoint?: phase0.Checkpoint;
21
- signal: AbortSignal;
22
- };
23
- type BackfillModules = BackfillSyncModules & {
24
- syncAnchor: BackFillSyncAnchor;
25
- backfillStartFromSlot: Slot;
26
- prevFinalizedCheckpointBlock: BackfillBlockHeader;
27
- wsCheckpointHeader: BackfillBlockHeader | null;
28
- backfillRangeWrittenSlot: Slot | null;
29
- };
30
- export type BackfillSyncOpts = {
31
- backfillBatchSize: number;
32
- };
33
- export declare enum BackfillSyncEvent {
34
- completed = "BackfillSync-completed"
35
- }
36
- export declare enum BackfillSyncMethod {
37
- database = "database",
38
- backfilled_ranges = "backfilled_ranges",
39
- rangesync = "rangesync",
40
- blockbyroot = "blockbyroot"
41
- }
42
- export declare enum BackfillSyncStatus {
43
- pending = "pending",
44
- syncing = "syncing",
45
- completed = "completed",
46
- aborted = "aborted"
47
- }
48
- type BackfillSyncEvents = {
49
- [BackfillSyncEvent.completed]: (
50
- /** Oldest slot synced */
51
- oldestSlotSynced: Slot) => void;
52
- };
53
- type BackfillSyncEmitter = StrictEventEmitter<EventEmitter, BackfillSyncEvents>;
54
- /**
55
- * At any given point, we should have
56
- * 1. anchorBlock (with its root anchorBlockRoot at anchorSlot) for next round of sync
57
- * which is the same as the lastBackSyncedBlock
58
- * 2. We know the anchorBlockRoot but don't have its anchorBlock and anchorSlot yet, and its
59
- * parent of lastBackSyncedBlock we synced in a previous successfull round
60
- * 3. We just started with only anchorBlockRoot, but we know (and will validate) its anchorSlot
61
- */
62
- type BackFillSyncAnchor = {
63
- anchorBlock: SignedBeaconBlock;
64
- anchorBlockRoot: Root;
65
- anchorSlot: Slot;
66
- lastBackSyncedBlock: BackfillBlock;
67
- } | {
68
- anchorBlock: null;
69
- anchorBlockRoot: Root;
70
- anchorSlot: null;
71
- lastBackSyncedBlock: BackfillBlock;
72
- } | {
73
- anchorBlock: null;
74
- anchorBlockRoot: Root;
75
- anchorSlot: Slot;
76
- lastBackSyncedBlock: null;
77
- };
78
- declare const BackfillSync_base: new () => BackfillSyncEmitter;
79
- export declare class BackfillSync extends BackfillSync_base {
80
- /** Lowest slot that we have backfilled to */
81
- syncAnchor: BackFillSyncAnchor;
82
- private readonly chain;
83
- private readonly network;
84
- private readonly db;
85
- private readonly config;
86
- private readonly logger;
87
- private readonly metrics;
88
- /**
89
- * Process in blocks of at max batchSize
90
- */
91
- private opts;
92
- /**
93
- * If wsCheckpoint provided was in past then the (db) state from which beacon node started,
94
- * needs to be validated as per spec.
95
- *
96
- * 1. This could lie in between of the previous backfilled range, in which case it would be
97
- * sufficient to check if its DB, once the linkage to that range has been verified.
98
- * 2. Else if it lies outside the backfilled range, the linkage to this checkpoint in
99
- * backfill needs to be verified.
100
- */
101
- private wsCheckpointHeader;
102
- private wsValidated;
103
- /**
104
- * From https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/phase0/weak-subjectivity.md
105
- *
106
- *
107
- * If
108
- * 1. The wsCheckpoint provided was ahead of the db's finalized checkpoint or
109
- * 2. There were gaps in the backfill - keys to backfillRanges are always (by construction)
110
- * a) Finalized Checkpoint or b) previous wsCheckpoint
111
- *
112
- * the linkage to the previous finalized/wss checkpoint(s) needs to be verfied. If there is
113
- * no such checkpoint remaining, the linkage to genesis needs to be validated
114
- *
115
- * Initialize with the blockArchive's last block, and on verification update to the next
116
- * preceding backfillRange key's checkpoint.
117
- */
118
- private prevFinalizedCheckpointBlock;
119
- /** Starting point that this specific backfill sync "session" started from */
120
- private backfillStartFromSlot;
121
- private backfillRangeWrittenSlot;
122
- private processor;
123
- private peers;
124
- private status;
125
- private signal;
126
- constructor(opts: BackfillSyncOpts, modules: BackfillModules);
127
- /**
128
- * Use the root of the anchorState of the beacon node as the starting point of the
129
- * backfill sync with its expected slot to be anchorState.slot, which will be
130
- * validated once the block is resolved in the backfill sync.
131
- *
132
- * NOTE: init here is quite light involving couple of
133
- *
134
- * 1. db keys lookup in stateArchive/backfilledRanges
135
- * 2. computing root(s) for anchorBlockRoot and prevFinalizedCheckpointBlock
136
- *
137
- * The way we initialize beacon node, wsCheckpoint's slot is always <= anchorSlot
138
- * If:
139
- * the root belonging to wsCheckpoint is in the DB, we need to verify linkage to it
140
- * i.e. it becomes our first prevFinalizedCheckpointBlock
141
- * Else
142
- * we initialize prevFinalizedCheckpointBlock from the last stored db finalized state
143
- * for verification and when we go below its epoch we just check if a correct block
144
- * corresponding to wsCheckpoint root was stored.
145
- *
146
- * and then we continue going back and verifying the next unconnected previous finalized
147
- * or wsCheckpoints identifiable as the keys of backfill sync.
148
- */
149
- static init<T extends BackfillSync = BackfillSync>(opts: BackfillSyncOpts, modules: BackfillSyncModules): Promise<T>;
150
- /** Throw / return all AsyncGenerators */
151
- close(): void;
152
- /**
153
- * @returns Returns oldestSlotSynced
154
- */
155
- private sync;
156
- private addPeer;
157
- private removePeer;
158
- /**
159
- * Ensure that any weak subjectivity checkpoint provided in past with respect
160
- * the initialization point is the same block tree as the DB once backfill
161
- */
162
- private checkIfCheckpointSyncedAndValidate;
163
- private checkUpdateFromBackfillSequences;
164
- private fastBackfillDb;
165
- private syncBlockByRoot;
166
- private syncRange;
167
- }
168
- export {};
169
- //# sourceMappingURL=backfill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../../src/sync/backfill/backfill.ts"],"names":[],"mappings":"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"}