@lodestar/beacon-node 1.51.0-dev.b41e3a7363 → 1.51.0-dev.bb16085c5e

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 (115) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +7 -6
  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/api/impl/beacon/state/utils.d.ts +1 -1
  8. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  9. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  10. package/lib/chain/GetBlobsTracker.js +4 -2
  11. package/lib/chain/GetBlobsTracker.js.map +1 -1
  12. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  13. package/lib/chain/archiveStore/archiveStore.js +1 -0
  14. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  15. package/lib/chain/blocks/payloadEnvelopeProcessor.js +2 -2
  16. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  17. package/lib/chain/bls/multithread/index.js +5 -5
  18. package/lib/chain/bls/multithread/index.js.map +1 -1
  19. package/lib/chain/bls/multithread/types.d.ts +1 -1
  20. package/lib/chain/bls/multithread/types.d.ts.map +1 -1
  21. package/lib/chain/bls/multithread/worker.js +1 -1
  22. package/lib/chain/bls/multithread/worker.js.map +1 -1
  23. package/lib/chain/bls/singleThread.js +1 -1
  24. package/lib/chain/bls/singleThread.js.map +1 -1
  25. package/lib/chain/bls/utils.js +1 -1
  26. package/lib/chain/bls/utils.js.map +1 -1
  27. package/lib/chain/chain.d.ts +1 -1
  28. package/lib/chain/chain.d.ts.map +1 -1
  29. package/lib/chain/chain.js.map +1 -1
  30. package/lib/chain/interface.d.ts +2 -3
  31. package/lib/chain/interface.d.ts.map +1 -1
  32. package/lib/chain/interface.js.map +1 -1
  33. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  34. package/lib/chain/opPools/aggregatedAttestationPool.js +1 -1
  35. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  36. package/lib/chain/opPools/attestationPool.d.ts +1 -1
  37. package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
  38. package/lib/chain/opPools/attestationPool.js +1 -1
  39. package/lib/chain/opPools/attestationPool.js.map +1 -1
  40. package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
  41. package/lib/chain/opPools/payloadAttestationPool.js +1 -1
  42. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  43. package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
  44. package/lib/chain/opPools/syncCommitteeMessagePool.js +1 -1
  45. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  46. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  47. package/lib/chain/opPools/syncContributionAndProofPool.js +1 -1
  48. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  49. package/lib/chain/opPools/utils.d.ts +1 -1
  50. package/lib/chain/opPools/utils.d.ts.map +1 -1
  51. package/lib/chain/opPools/utils.js +1 -1
  52. package/lib/chain/opPools/utils.js.map +1 -1
  53. package/lib/execution/engine/index.d.ts +1 -1
  54. package/lib/execution/engine/index.d.ts.map +1 -1
  55. package/lib/execution/engine/index.js +1 -1
  56. package/lib/execution/engine/index.js.map +1 -1
  57. package/lib/execution/engine/interface.d.ts +1 -1
  58. package/lib/execution/engine/interface.d.ts.map +1 -1
  59. package/lib/execution/engine/interface.js.map +1 -1
  60. package/lib/execution/engine/types.d.ts.map +1 -1
  61. package/lib/execution/engine/types.js +2 -2
  62. package/lib/execution/engine/types.js.map +1 -1
  63. package/lib/monitoring/service.js +1 -1
  64. package/lib/monitoring/service.js.map +1 -1
  65. package/lib/network/network.d.ts.map +1 -1
  66. package/lib/network/network.js +3 -1
  67. package/lib/network/network.js.map +1 -1
  68. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  69. package/lib/network/processor/gossipHandlers.js +0 -2
  70. package/lib/network/processor/gossipHandlers.js.map +1 -1
  71. package/lib/node/nodejs.d.ts +1 -1
  72. package/lib/node/nodejs.d.ts.map +1 -1
  73. package/lib/node/nodejs.js +1 -1
  74. package/lib/node/nodejs.js.map +1 -1
  75. package/lib/node/options.d.ts +1 -1
  76. package/lib/node/options.d.ts.map +1 -1
  77. package/lib/node/options.js +1 -1
  78. package/lib/node/options.js.map +1 -1
  79. package/lib/sync/interface.d.ts.map +1 -1
  80. package/lib/sync/interface.js.map +1 -1
  81. package/lib/util/queue/itemQueue.js +1 -1
  82. package/lib/util/queue/itemQueue.js.map +1 -1
  83. package/lib/util/sszBytes.js +2 -2
  84. package/lib/util/sszBytes.js.map +1 -1
  85. package/package.json +16 -16
  86. package/src/api/impl/beacon/blocks/index.ts +24 -22
  87. package/src/api/impl/beacon/pool/index.ts +5 -1
  88. package/src/api/impl/beacon/state/utils.ts +1 -1
  89. package/src/chain/GetBlobsTracker.ts +4 -2
  90. package/src/chain/archiveStore/archiveStore.ts +1 -0
  91. package/src/chain/blocks/payloadEnvelopeProcessor.ts +2 -2
  92. package/src/chain/bls/multithread/index.ts +5 -5
  93. package/src/chain/bls/multithread/types.ts +1 -1
  94. package/src/chain/bls/multithread/worker.ts +1 -5
  95. package/src/chain/bls/singleThread.ts +1 -1
  96. package/src/chain/bls/utils.ts +1 -1
  97. package/src/chain/chain.ts +1 -1
  98. package/src/chain/interface.ts +2 -3
  99. package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
  100. package/src/chain/opPools/attestationPool.ts +1 -1
  101. package/src/chain/opPools/payloadAttestationPool.ts +1 -1
  102. package/src/chain/opPools/syncCommitteeMessagePool.ts +1 -1
  103. package/src/chain/opPools/syncContributionAndProofPool.ts +1 -1
  104. package/src/chain/opPools/utils.ts +1 -1
  105. package/src/execution/engine/index.ts +1 -1
  106. package/src/execution/engine/interface.ts +1 -1
  107. package/src/execution/engine/types.ts +3 -1
  108. package/src/monitoring/service.ts +1 -1
  109. package/src/network/network.ts +3 -1
  110. package/src/network/processor/gossipHandlers.ts +0 -2
  111. package/src/node/nodejs.ts +6 -6
  112. package/src/node/options.ts +4 -5
  113. package/src/sync/interface.ts +1 -0
  114. package/src/util/queue/itemQueue.ts +1 -1
  115. package/src/util/sszBytes.ts +2 -2
@@ -1,6 +1,6 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {ChainForkConfig} from "@lodestar/config";
3
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
4
4
  import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
5
5
  import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
6
6
  import {Root, Slot, SubnetID, altair, ssz} from "@lodestar/types";
@@ -1,6 +1,6 @@
1
- import {Signature} from "@chainsafe/lodestar-z/blst";
2
1
  import {BeaconConfig} from "@lodestar/config";
3
2
  import {DbBatch, Id, Repository} from "@lodestar/db";
3
+ import {Signature} from "@lodestar/native/blst";
4
4
  import {BLS_WITHDRAWAL_PREFIX, DOMAIN_BEACON_ATTESTER, DOMAIN_BEACON_PROPOSER} from "@lodestar/params";
5
5
  import {IBeaconStateView, computeStartSlotAtEpoch} from "@lodestar/state-transition";
6
6
  import {AttesterSlashing, Domain, Slot, capella, phase0} from "@lodestar/types";
@@ -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
 
@@ -9,6 +9,7 @@ import {
9
9
  DEPOSIT_REQUEST_TYPE,
10
10
  FIELD_ELEMENTS_PER_BLOB,
11
11
  ForkName,
12
+ ForkPostElectra,
12
13
  ForkSeq,
13
14
  WITHDRAWAL_REQUEST_TYPE,
14
15
  } from "@lodestar/params";
@@ -23,6 +24,7 @@ import {
23
24
  deneb,
24
25
  gloas,
25
26
  ssz,
27
+ sszTypesFor,
26
28
  } from "@lodestar/types";
27
29
  import {BlobAndProof} from "@lodestar/types/deneb";
28
30
  import {BlobAndProofV2} from "@lodestar/types/fulu";
@@ -628,7 +630,7 @@ export function deserializeExecutionRequestsFromBytes(fork: ForkName, serialized
628
630
 
629
631
  switch (currentRequestType) {
630
632
  case DEPOSIT_REQUEST_TYPE: {
631
- result.deposits = ssz.electra.DepositRequests.deserialize(requests);
633
+ result.deposits = sszTypesFor(fork as ForkPostElectra).DepositRequests.deserialize(requests);
632
634
  break;
633
635
  }
634
636
  case WITHDRAWAL_REQUEST_TYPE: {
@@ -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);
@@ -1,17 +1,17 @@
1
1
  import {setMaxListeners} from "node:events";
2
2
  import {PrivateKey} from "@libp2p/interface";
3
3
  import {Registry} from "prom-client";
4
+ import {hasher} from "@chainsafe/persistent-merkle-tree";
5
+ import {BeaconApiMethods} from "@lodestar/api/beacon/server";
6
+ import {BeaconConfig} from "@lodestar/config";
7
+ import type {LoggerNode} from "@lodestar/logger/node";
4
8
  import {
5
9
  init as initNativeMetrics,
6
10
  registerLocalValidator as registerNativeLocalValidator,
7
11
  scrapeMetrics as scrapeNativeMetrics,
8
12
  unregisterLocalValidator as unregisterNativeLocalValidator,
9
- } from "@chainsafe/lodestar-z/metrics";
10
- import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
11
- import {hasher} from "@chainsafe/persistent-merkle-tree";
12
- import {BeaconApiMethods} from "@lodestar/api/beacon/server";
13
- import {BeaconConfig} from "@lodestar/config";
14
- import type {LoggerNode} from "@lodestar/logger/node";
13
+ } from "@lodestar/native/metrics";
14
+ import {type PubkeyCache} from "@lodestar/native/pubkeys";
15
15
  import {ZERO_HASH_HEX} from "@lodestar/params";
16
16
  import {
17
17
  IBeaconStateView,
@@ -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
  }