@lodestar/beacon-node 1.51.0-dev.a46d0194c5 → 1.51.0-dev.a6cf8a3100

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 (65) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +9 -5
  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 +5 -2
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  8. package/lib/chain/GetBlobsTracker.js +4 -2
  9. package/lib/chain/GetBlobsTracker.js.map +1 -1
  10. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  11. package/lib/chain/archiveStore/archiveStore.js +1 -0
  12. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  13. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  14. package/lib/chain/blocks/importExecutionPayload.js +5 -1
  15. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  16. package/lib/chain/blocks/payloadEnvelopeProcessor.js +2 -2
  17. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  18. package/lib/chain/bls/multithread/index.js +5 -5
  19. package/lib/chain/bls/multithread/index.js.map +1 -1
  20. package/lib/chain/interface.d.ts +1 -2
  21. package/lib/chain/interface.d.ts.map +1 -1
  22. package/lib/chain/interface.js.map +1 -1
  23. package/lib/execution/engine/index.d.ts +1 -1
  24. package/lib/execution/engine/index.d.ts.map +1 -1
  25. package/lib/execution/engine/index.js +1 -1
  26. package/lib/execution/engine/index.js.map +1 -1
  27. package/lib/execution/engine/interface.d.ts +1 -1
  28. package/lib/execution/engine/interface.d.ts.map +1 -1
  29. package/lib/execution/engine/interface.js.map +1 -1
  30. package/lib/monitoring/service.js +1 -1
  31. package/lib/monitoring/service.js.map +1 -1
  32. package/lib/network/network.d.ts.map +1 -1
  33. package/lib/network/network.js +3 -1
  34. package/lib/network/network.js.map +1 -1
  35. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  36. package/lib/network/processor/gossipHandlers.js +0 -2
  37. package/lib/network/processor/gossipHandlers.js.map +1 -1
  38. package/lib/node/options.d.ts +1 -1
  39. package/lib/node/options.d.ts.map +1 -1
  40. package/lib/node/options.js +1 -1
  41. package/lib/node/options.js.map +1 -1
  42. package/lib/sync/interface.d.ts.map +1 -1
  43. package/lib/sync/interface.js.map +1 -1
  44. package/lib/util/queue/itemQueue.js +1 -1
  45. package/lib/util/queue/itemQueue.js.map +1 -1
  46. package/lib/util/sszBytes.js +2 -2
  47. package/lib/util/sszBytes.js.map +1 -1
  48. package/package.json +15 -15
  49. package/src/api/impl/beacon/blocks/index.ts +26 -21
  50. package/src/api/impl/beacon/pool/index.ts +5 -1
  51. package/src/chain/GetBlobsTracker.ts +4 -2
  52. package/src/chain/archiveStore/archiveStore.ts +1 -0
  53. package/src/chain/blocks/importExecutionPayload.ts +7 -1
  54. package/src/chain/blocks/payloadEnvelopeProcessor.ts +2 -2
  55. package/src/chain/bls/multithread/index.ts +5 -5
  56. package/src/chain/interface.ts +1 -2
  57. package/src/execution/engine/index.ts +1 -1
  58. package/src/execution/engine/interface.ts +1 -1
  59. package/src/monitoring/service.ts +1 -1
  60. package/src/network/network.ts +3 -1
  61. package/src/network/processor/gossipHandlers.ts +0 -2
  62. package/src/node/options.ts +4 -5
  63. package/src/sync/interface.ts +1 -0
  64. package/src/util/queue/itemQueue.ts +1 -1
  65. package/src/util/sszBytes.ts +2 -2
@@ -333,7 +333,13 @@ export async function importExecutionPayload(
333
333
 
334
334
  // 7. Queue notifyForkchoiceUpdate to engine api
335
335
  const head = this.forkChoice.getHead();
336
- if (!this.opts.disableImportExecutionFcU && blockRootHex === head.blockRoot) {
336
+ if (
337
+ !this.opts.disableImportExecutionFcU &&
338
+ blockRootHex === head.blockRoot &&
339
+ // Skip a payload that does not satisfy the inclusion list constraints, fork choice keeps the EMPTY
340
+ // variant as head and the next prepare fcU keeps the engine on the parent payload
341
+ this.forkChoice.isPayloadInclusionListSatisfied(blockRootHex)
342
+ ) {
337
343
  const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice, this.logger);
338
344
  const finalizedBlockHash = getFinalizedExecutionBlockHash(this.forkChoice);
339
345
  this.executionEngine.notifyForkchoiceUpdate(fork, blockHashHex, safeBlockHash, finalizedBlockHash).catch((e) => {
@@ -35,7 +35,7 @@ export class PayloadEnvelopeProcessor {
35
35
 
36
36
  async processPayloadEnvelopeJob(payloadInput: PayloadEnvelopeInput, opts: ImportPayloadOpts = {}): Promise<void> {
37
37
  const existing = this.imports.get(payloadInput);
38
- if (existing) {
38
+ if (existing !== undefined) {
39
39
  return existing;
40
40
  }
41
41
 
@@ -43,7 +43,7 @@ export class PayloadEnvelopeProcessor {
43
43
 
44
44
  // Re-check after await, as another call may have queued this payload.
45
45
  const queued = this.imports.get(payloadInput);
46
- if (queued) {
46
+ if (queued !== undefined) {
47
47
  return queued;
48
48
  }
49
49
 
@@ -342,7 +342,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
342
342
  } else {
343
343
  this.jobs.push(job);
344
344
  }
345
- callInNextEventLoop(this.runJob);
345
+ callInNextEventLoop(() => void this.runJob());
346
346
  }
347
347
  }
348
348
 
@@ -377,7 +377,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
377
377
  let completedJobsCount = 0;
378
378
 
379
379
  if (this.jobs.length > 0) {
380
- callInNextEventLoop(this.runJob);
380
+ callInNextEventLoop(() => void this.runJob());
381
381
  }
382
382
 
383
383
  try {
@@ -423,7 +423,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
423
423
  if (workReqs.length === 0) {
424
424
  worker.status = {code: WorkerStatusCode.idle, workerApi};
425
425
  this.workersBusy--;
426
- callInNextEventLoop(this.runJob);
426
+ callInNextEventLoop(() => void this.runJob());
427
427
  return;
428
428
  }
429
429
 
@@ -499,7 +499,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
499
499
  this.workersBusy--;
500
500
 
501
501
  // Potentially run a new job
502
- callInNextEventLoop(this.runJob);
502
+ callInNextEventLoop(() => void this.runJob());
503
503
  };
504
504
 
505
505
  /**
@@ -542,7 +542,7 @@ export class BlsMultiThreadWorkerPool implements IBlsVerifier {
542
542
  this.jobs.unshift(job);
543
543
  }
544
544
  this.bufferedJobs = null;
545
- callInNextEventLoop(this.runJob);
545
+ callInNextEventLoop(() => void this.runJob());
546
546
  }
547
547
  };
548
548
 
@@ -77,8 +77,7 @@ import {PayloadEnvelopeInput, SeenPayloadEnvelopeInput} from "./seenCache/seenPa
77
77
  import {ShufflingCache} from "./shufflingCache.js";
78
78
  import {ValidatorMonitor} from "./validatorMonitor.js";
79
79
 
80
- export {BlockType, type AssembledBlockType};
81
- export {type ProposerPreparationData};
80
+ export {type AssembledBlockType, BlockType, type ProposerPreparationData};
82
81
  export type BlockHash = RootHex;
83
82
 
84
83
  export type StateGetOpts = {
@@ -17,8 +17,8 @@ import {EngineRestHttpClient} from "./restHttpClient.js";
17
17
  import {RestEngineTransport, formatClientVersionHeader} from "./restTransport.js";
18
18
  import {ExecutionEngineMockJsonRpcClient, JsonRpcBackend} from "./utils.js";
19
19
 
20
- export {ExecutionEngineHttp, ExecutionEngineDisabled, defaultExecutionEngineHttpOpts, engineApiModes};
21
20
  export type {EngineApiMode};
21
+ export {ExecutionEngineDisabled, ExecutionEngineHttp, defaultExecutionEngineHttpOpts, engineApiModes};
22
22
 
23
23
  export type ExecutionEngineOpts =
24
24
  | ({mode?: "http"} & ExecutionEngineHttpOpts)
@@ -25,7 +25,7 @@ import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
25
25
  import {ExecutionPayloadBodyV2} from "./types.js";
26
26
  import {DATA} from "./utils.js";
27
27
 
28
- export {PayloadIdCache, type PayloadId, type WithdrawalV1};
28
+ export {type PayloadId, PayloadIdCache, type WithdrawalV1};
29
29
  export type ClientVersion = routes.node.ClientVersion;
30
30
  export const ClientCode = routes.node.ClientCode;
31
31
 
@@ -101,7 +101,7 @@ export class MonitoringService {
101
101
  if (this.monitoringInterval) {
102
102
  clearTimeout(this.monitoringInterval);
103
103
  }
104
- if (this.pendingRequest) {
104
+ if (this.pendingRequest !== undefined) {
105
105
  this.fetchAbortController?.abort(FetchAbortReason.Close);
106
106
  await this.pendingRequest;
107
107
  }
@@ -855,7 +855,9 @@ export class Network implements INetwork {
855
855
  };
856
856
 
857
857
  private onTargetGroupCountUpdated = (count: number): void => {
858
- this.core.setTargetGroupCount(count);
858
+ this.core.setTargetGroupCount(count).catch((e) => {
859
+ this.logger.debug("Error setting target custody group count", {count}, e as Error);
860
+ });
859
861
  };
860
862
 
861
863
  private onPublishDataColumns = async (sidecars: DataColumnSidecar[]): Promise<void> => {
@@ -705,8 +705,6 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
705
705
 
706
706
  // Immediately attempt fetch of data columns from execution engine as the bid contains kzg commitments
707
707
  // which is all the information we need so there is no reason to delay until execution payload arrives
708
- // TODO GLOAS: If we want EL retries after this initial attempt, add an explicit retry policy here
709
- // (for example later in the slot). Do not couple retries to incoming gossip columns.
710
708
  // Columns fetched here feed payloadInput.addColumn, which resolves waitForAllData for any
711
709
  // in-flight importExecutionPayload. No processExecutionPayload trigger needed from this path.
712
710
  chain.getBlobsTracker.triggerGetBlobs(payloadInput);
@@ -19,16 +19,15 @@ import {SyncOptions, defaultSyncOptions} from "../sync/options.js";
19
19
 
20
20
  // Re-export so the CLI doesn't need to depend on lodestar-api
21
21
  export {allNamespaces} from "../api/rest/index.js";
22
-
22
+ export type {EngineApiMode};
23
23
  // Re-export to use as default values in CLI args
24
24
  export {
25
- defaultExecutionEngineHttpOpts,
26
- defaultExecutionBuilderHttpOpts,
27
- engineApiModes,
28
25
  ArchiveMode,
29
26
  DEFAULT_ARCHIVE_MODE,
27
+ defaultExecutionBuilderHttpOpts,
28
+ defaultExecutionEngineHttpOpts,
29
+ engineApiModes,
30
30
  };
31
- export type {EngineApiMode};
32
31
 
33
32
  export interface IBeaconNodeOptions {
34
33
  api: ApiOptions;
@@ -7,6 +7,7 @@ import {IBeaconDb} from "../db/index.js";
7
7
  import {Metrics} from "../metrics/index.js";
8
8
  import {INetwork} from "../network/index.js";
9
9
  import {SyncChainDebugState} from "./range/chain.js";
10
+
10
11
  export type {SyncChainDebugState};
11
12
 
12
13
  export type SyncingStatus = routes.node.SyncingStatus;
@@ -69,7 +69,7 @@ export class JobItemQueue<Args extends any[], R> {
69
69
  if (this.jobs.length === 1 && this.opts.noYieldIfOneItem) {
70
70
  void this.runJob();
71
71
  } else if (this.runningJobs < this.opts.maxConcurrency) {
72
- callInNextEventLoop(this.runJob);
72
+ callInNextEventLoop(() => void this.runJob());
73
73
  }
74
74
  });
75
75
  }
@@ -854,7 +854,7 @@ export function getBlobKzgCommitmentsCountFromSignedBeaconBlockSerialized(
854
854
 
855
855
  const start = bidMsgStart + commitmentsRange.start;
856
856
  const end = bidMsgStart + commitmentsRange.end;
857
- return Math.round(((end > blockBytes.byteLength ? blockBytes.byteLength : end) - start) / commitmentSize);
857
+ return Math.round((Math.min(end, blockBytes.byteLength) - start) / commitmentSize);
858
858
  }
859
859
 
860
860
  const {SignedBeaconBlock, BeaconBlock, BeaconBlockBody, KZGCommitment} = ssz[forkName as ForkPostDeneb];
@@ -880,5 +880,5 @@ export function getBlobKzgCommitmentsCountFromSignedBeaconBlockSerialized(
880
880
  const end = messageRange.end + bodyRange.end + kzgCommitmentsRange.end;
881
881
  const start = messageRange.start + bodyRange.start + kzgCommitmentsRange.start;
882
882
 
883
- return Math.round(((end > blockBytes.byteLength ? blockBytes.byteLength : end) - start) / commitmentSize);
883
+ return Math.round((Math.min(end, blockBytes.byteLength) - start) / commitmentSize);
884
884
  }