@lodestar/beacon-node 1.45.0 → 1.46.0-dev.13423cff6d

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 (237) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +186 -57
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/config/constants.d.ts +1 -0
  5. package/lib/api/impl/config/constants.d.ts.map +1 -1
  6. package/lib/api/impl/config/constants.js +2 -1
  7. package/lib/api/impl/config/constants.js.map +1 -1
  8. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  9. package/lib/api/impl/lodestar/index.js +2 -3
  10. package/lib/api/impl/lodestar/index.js.map +1 -1
  11. package/lib/api/impl/validator/index.d.ts.map +1 -1
  12. package/lib/api/impl/validator/index.js +172 -88
  13. package/lib/api/impl/validator/index.js.map +1 -1
  14. package/lib/api/rest/base.d.ts.map +1 -1
  15. package/lib/api/rest/base.js +6 -3
  16. package/lib/api/rest/base.js.map +1 -1
  17. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  18. package/lib/chain/archiveStore/archiveStore.js +17 -3
  19. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  20. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  21. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +0 -1
  22. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  23. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  24. package/lib/chain/blocks/importBlock.js +2 -17
  25. package/lib/chain/blocks/importBlock.js.map +1 -1
  26. package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
  27. package/lib/chain/blocks/utils/chainSegment.js +13 -5
  28. package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
  29. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +1 -1
  30. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  31. package/lib/chain/blocks/verifyBlocksSanityChecks.js +1 -1
  32. package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
  33. package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +3 -3
  34. package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -1
  35. package/lib/chain/bls/multithread/index.d.ts.map +1 -1
  36. package/lib/chain/bls/multithread/index.js +0 -1
  37. package/lib/chain/bls/multithread/index.js.map +1 -1
  38. package/lib/chain/chain.d.ts.map +1 -1
  39. package/lib/chain/chain.js +44 -2
  40. package/lib/chain/chain.js.map +1 -1
  41. package/lib/chain/errors/blockError.d.ts +48 -6
  42. package/lib/chain/errors/blockError.d.ts.map +1 -1
  43. package/lib/chain/errors/blockError.js +25 -4
  44. package/lib/chain/errors/blockError.js.map +1 -1
  45. package/lib/chain/errors/executionPayloadEnvelope.d.ts +11 -0
  46. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  47. package/lib/chain/errors/executionPayloadEnvelope.js +2 -0
  48. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  49. package/lib/chain/errors/proposerPreferences.d.ts +14 -1
  50. package/lib/chain/errors/proposerPreferences.d.ts.map +1 -1
  51. package/lib/chain/errors/proposerPreferences.js +2 -0
  52. package/lib/chain/errors/proposerPreferences.js.map +1 -1
  53. package/lib/chain/lightClient/index.d.ts.map +1 -1
  54. package/lib/chain/lightClient/index.js +11 -6
  55. package/lib/chain/lightClient/index.js.map +1 -1
  56. package/lib/chain/lightClient/proofs.d.ts.map +1 -1
  57. package/lib/chain/lightClient/proofs.js +28 -2
  58. package/lib/chain/lightClient/proofs.js.map +1 -1
  59. package/lib/chain/lightClient/types.d.ts +3 -1
  60. package/lib/chain/lightClient/types.d.ts.map +1 -1
  61. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  62. package/lib/chain/opPools/aggregatedAttestationPool.js +2 -1
  63. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  64. package/lib/chain/opPools/proposerPreferencesPool.d.ts +1 -1
  65. package/lib/chain/opPools/proposerPreferencesPool.d.ts.map +1 -1
  66. package/lib/chain/opPools/proposerPreferencesPool.js +1 -1
  67. package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
  68. package/lib/chain/produceBlock/produceBlockBody.js +1 -1
  69. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  70. package/lib/chain/validation/aggregateAndProof.js +10 -6
  71. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  72. package/lib/chain/validation/attestation.d.ts.map +1 -1
  73. package/lib/chain/validation/attestation.js +10 -6
  74. package/lib/chain/validation/attestation.js.map +1 -1
  75. package/lib/chain/validation/blobSidecar.js +1 -1
  76. package/lib/chain/validation/block.d.ts.map +1 -1
  77. package/lib/chain/validation/block.js +53 -4
  78. package/lib/chain/validation/block.js.map +1 -1
  79. package/lib/chain/validation/executionPayloadBid.d.ts +5 -0
  80. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  81. package/lib/chain/validation/executionPayloadBid.js +32 -4
  82. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  83. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  84. package/lib/chain/validation/executionPayloadEnvelope.js +29 -0
  85. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  86. package/lib/chain/validation/proposerPreferences.d.ts +9 -2
  87. package/lib/chain/validation/proposerPreferences.d.ts.map +1 -1
  88. package/lib/chain/validation/proposerPreferences.js +65 -13
  89. package/lib/chain/validation/proposerPreferences.js.map +1 -1
  90. package/lib/chain/validation/signatureSets/aggregateAndProof.d.ts.map +1 -1
  91. package/lib/chain/validation/signatureSets/aggregateAndProof.js +2 -3
  92. package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
  93. package/lib/chain/validatorMonitor.js +1 -1
  94. package/lib/chain/validatorMonitor.js.map +1 -1
  95. package/lib/db/repositories/lightclientSyncCommitteeWitness.d.ts.map +1 -1
  96. package/lib/db/repositories/lightclientSyncCommitteeWitness.js +42 -7
  97. package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
  98. package/lib/metrics/nodeJsMetrics.js +1 -1
  99. package/lib/metrics/nodeJsMetrics.js.map +1 -1
  100. package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
  101. package/lib/network/core/networkCoreWorkerHandler.js +2 -7
  102. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  103. package/lib/network/discv5/index.d.ts.map +1 -1
  104. package/lib/network/discv5/index.js +1 -4
  105. package/lib/network/discv5/index.js.map +1 -1
  106. package/lib/network/gossip/encoding.d.ts +2 -2
  107. package/lib/network/gossip/encoding.d.ts.map +1 -1
  108. package/lib/network/gossip/encoding.js +15 -9
  109. package/lib/network/gossip/encoding.js.map +1 -1
  110. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  111. package/lib/network/gossip/gossipsub.js +2 -2
  112. package/lib/network/gossip/gossipsub.js.map +1 -1
  113. package/lib/network/gossip/topic.d.ts +76 -233
  114. package/lib/network/gossip/topic.d.ts.map +1 -1
  115. package/lib/network/gossip/topic.js +24 -1
  116. package/lib/network/gossip/topic.js.map +1 -1
  117. package/lib/network/interface.d.ts +4 -1
  118. package/lib/network/interface.d.ts.map +1 -1
  119. package/lib/network/libp2p/index.d.ts.map +1 -1
  120. package/lib/network/libp2p/index.js +2 -9
  121. package/lib/network/libp2p/index.js.map +1 -1
  122. package/lib/network/network.d.ts +4 -1
  123. package/lib/network/network.d.ts.map +1 -1
  124. package/lib/network/network.js +19 -11
  125. package/lib/network/network.js.map +1 -1
  126. package/lib/network/peers/datastore.d.ts +1 -1
  127. package/lib/network/peers/datastore.d.ts.map +1 -1
  128. package/lib/network/peers/datastore.js +1 -1
  129. package/lib/network/peers/datastore.js.map +1 -1
  130. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  131. package/lib/network/processor/gossipHandlers.js +12 -6
  132. package/lib/network/processor/gossipHandlers.js.map +1 -1
  133. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
  134. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +4 -2
  135. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
  136. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  137. package/lib/network/reqresp/handlers/index.js +20 -11
  138. package/lib/network/reqresp/handlers/index.js.map +1 -1
  139. package/lib/network/util.d.ts +1 -0
  140. package/lib/network/util.d.ts.map +1 -1
  141. package/lib/network/util.js +4 -0
  142. package/lib/network/util.js.map +1 -1
  143. package/lib/sync/constants.d.ts +6 -5
  144. package/lib/sync/constants.d.ts.map +1 -1
  145. package/lib/sync/constants.js +6 -5
  146. package/lib/sync/constants.js.map +1 -1
  147. package/lib/sync/range/batch.d.ts +10 -1
  148. package/lib/sync/range/batch.d.ts.map +1 -1
  149. package/lib/sync/range/batch.js +28 -10
  150. package/lib/sync/range/batch.js.map +1 -1
  151. package/lib/sync/range/chain.d.ts.map +1 -1
  152. package/lib/sync/range/chain.js +30 -15
  153. package/lib/sync/range/chain.js.map +1 -1
  154. package/lib/sync/range/utils/batches.d.ts +18 -0
  155. package/lib/sync/range/utils/batches.d.ts.map +1 -1
  156. package/lib/sync/range/utils/batches.js +39 -0
  157. package/lib/sync/range/utils/batches.js.map +1 -1
  158. package/lib/sync/sync.d.ts.map +1 -1
  159. package/lib/sync/sync.js +7 -0
  160. package/lib/sync/sync.js.map +1 -1
  161. package/lib/sync/unknownBlock.d.ts.map +1 -1
  162. package/lib/sync/unknownBlock.js +7 -2
  163. package/lib/sync/unknownBlock.js.map +1 -1
  164. package/lib/util/execution.js +1 -1
  165. package/lib/util/execution.js.map +1 -1
  166. package/lib/util/profile.d.ts +3 -0
  167. package/lib/util/profile.d.ts.map +1 -1
  168. package/lib/util/profile.js +1 -27
  169. package/lib/util/profile.js.map +1 -1
  170. package/lib/util/sszBytes.js +1 -1
  171. package/package.json +29 -38
  172. package/src/api/impl/beacon/blocks/index.ts +221 -63
  173. package/src/api/impl/config/constants.ts +2 -0
  174. package/src/api/impl/lodestar/index.ts +2 -3
  175. package/src/api/impl/validator/index.ts +206 -98
  176. package/src/api/rest/base.ts +8 -3
  177. package/src/chain/archiveStore/archiveStore.ts +20 -3
  178. package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +0 -1
  179. package/src/chain/blocks/importBlock.ts +0 -17
  180. package/src/chain/blocks/utils/chainSegment.ts +16 -5
  181. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +1 -1
  182. package/src/chain/blocks/verifyBlocksSanityChecks.ts +1 -1
  183. package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +3 -3
  184. package/src/chain/bls/multithread/index.ts +0 -1
  185. package/src/chain/chain.ts +61 -2
  186. package/src/chain/errors/blockError.ts +44 -7
  187. package/src/chain/errors/executionPayloadEnvelope.ts +9 -0
  188. package/src/chain/errors/proposerPreferences.ts +16 -1
  189. package/src/chain/lightClient/index.ts +12 -7
  190. package/src/chain/lightClient/proofs.ts +36 -1
  191. package/src/chain/lightClient/types.ts +3 -1
  192. package/src/chain/opPools/aggregatedAttestationPool.ts +4 -2
  193. package/src/chain/opPools/proposerPreferencesPool.ts +1 -1
  194. package/src/chain/produceBlock/produceBlockBody.ts +1 -1
  195. package/src/chain/validation/aggregateAndProof.ts +12 -6
  196. package/src/chain/validation/attestation.ts +12 -6
  197. package/src/chain/validation/blobSidecar.ts +1 -1
  198. package/src/chain/validation/block.ts +69 -4
  199. package/src/chain/validation/executionPayloadBid.ts +34 -4
  200. package/src/chain/validation/executionPayloadEnvelope.ts +37 -0
  201. package/src/chain/validation/proposerPreferences.ts +75 -13
  202. package/src/chain/validation/signatureSets/aggregateAndProof.ts +3 -3
  203. package/src/chain/validatorMonitor.ts +1 -1
  204. package/src/db/repositories/lightclientSyncCommitteeWitness.ts +57 -9
  205. package/src/metrics/nodeJsMetrics.ts +1 -1
  206. package/src/network/core/networkCoreWorkerHandler.ts +2 -6
  207. package/src/network/discv5/index.ts +1 -4
  208. package/src/network/gossip/encoding.ts +13 -7
  209. package/src/network/gossip/gossipsub.ts +7 -2
  210. package/src/network/gossip/topic.ts +30 -0
  211. package/src/network/interface.ts +3 -1
  212. package/src/network/libp2p/index.ts +2 -10
  213. package/src/network/network.ts +24 -15
  214. package/src/network/peers/datastore.ts +1 -1
  215. package/src/network/processor/gossipHandlers.ts +12 -6
  216. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +4 -2
  217. package/src/network/reqresp/handlers/index.ts +21 -12
  218. package/src/network/util.ts +5 -0
  219. package/src/sync/constants.ts +6 -5
  220. package/src/sync/range/batch.ts +31 -10
  221. package/src/sync/range/chain.ts +36 -16
  222. package/src/sync/range/utils/batches.ts +44 -0
  223. package/src/sync/sync.ts +10 -0
  224. package/src/sync/unknownBlock.ts +8 -2
  225. package/src/util/execution.ts +1 -1
  226. package/src/util/profile.ts +1 -31
  227. package/src/util/sszBytes.ts +1 -1
  228. package/lib/bun-wrappers/prometheus-gc-stats.d.ts +0 -2
  229. package/lib/bun-wrappers/prometheus-gc-stats.d.ts.map +0 -1
  230. package/lib/bun-wrappers/prometheus-gc-stats.js +0 -8
  231. package/lib/bun-wrappers/prometheus-gc-stats.js.map +0 -1
  232. package/lib/network/peers/datastore_bun.d.ts +0 -3
  233. package/lib/network/peers/datastore_bun.d.ts.map +0 -1
  234. package/lib/network/peers/datastore_bun.js +0 -3
  235. package/lib/network/peers/datastore_bun.js.map +0 -1
  236. package/src/bun-wrappers/prometheus-gc-stats.ts +0 -7
  237. package/src/network/peers/datastore_bun.ts +0 -3
@@ -176,7 +176,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
176
176
 
177
177
  // optimistically add gossip block to the seen cache
178
178
  // if validation fails, we will NOT forward this gossip block to peers
179
- // - if PARENT_UNKNOWN error, blockInput will then be queued inside BlockInputSync. If the gossip block is really invalid, it will be pruned there
179
+ // - if PARENT_BLOCK_UNKNOWN error, blockInput will then be queued inside BlockInputSync. If the gossip block is really invalid, it will be pruned there
180
180
  // - if other validator errors, blockInput will stay in the seen cache and will be pruned on finalization
181
181
  const blockInput = chain.seenBlockInputCache.getByBlock({
182
182
  block: signedBlock,
@@ -187,7 +187,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
187
187
  });
188
188
 
189
189
  // Optimistically seed the payload-envelope cache too, mirroring seenBlockInputCache above.
190
- // This ensures we have PayloadEnvelopeInput, even through "PARENT_UNKNOWN" error
190
+ // This ensures we have PayloadEnvelopeInput, even through "PARENT_BLOCK_UNKNOWN" error
191
191
  // see https://github.com/ChainSafe/lodestar/issues/9475
192
192
  if (isForkPostGloas(fork)) {
193
193
  chain.seenPayloadEnvelopeInputCache.add({
@@ -227,7 +227,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
227
227
  if (e instanceof BlockGossipError) {
228
228
  logger.debug("Gossip block has error", {slot, root: blockShortHex, code: e.type.code});
229
229
  if (
230
- (e.type.code === BlockErrorCode.PARENT_UNKNOWN || e.type.code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) &&
230
+ (e.type.code === BlockErrorCode.PARENT_BLOCK_UNKNOWN ||
231
+ e.type.code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) &&
231
232
  blockInput
232
233
  ) {
233
234
  chain.emitter.emit(ChainEvent.blockUnknownParent, {
@@ -661,14 +662,19 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
661
662
  break;
662
663
  }
663
664
  // ALREADY_KNOWN should not happen with ignoreIfKnown=true above
664
- // PARENT_UNKNOWN should not happen, we handled this in validateBeaconBlock() function above
665
+ // PARENT_BLOCK_UNKNOWN should not happen, we handled this in validateBeaconBlock() function above
665
666
  case BlockErrorCode.ALREADY_KNOWN:
666
- case BlockErrorCode.PARENT_UNKNOWN:
667
+ case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
667
668
  case BlockErrorCode.PRESTATE_MISSING:
668
669
  case BlockErrorCode.EXECUTION_ENGINE_ERROR:
669
- // Errors might indicate an issue with our node or the connected EL client
670
+ // Errors might indicate an issue with our node or the connected EL client.
670
671
  logLevel = LogLevel.error;
671
672
  break;
673
+ case BlockErrorCode.EXECUTION_ENGINE_INVALID:
674
+ // the peer served a bad block
675
+ core.reportPeer(peerIdStr, PeerAction.LowToleranceError, "ExecutionEngineInvalid");
676
+ logLevel = LogLevel.warn;
677
+ break;
672
678
  default:
673
679
  // TODO: Should it use PeerId or string?
674
680
  core.reportPeer(peerIdStr, PeerAction.LowToleranceError, "BadGossipBlock");
@@ -107,8 +107,10 @@ export function validateExecutionPayloadEnvelopesByRangeRequest(
107
107
  // The gloas req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
108
108
  // Archival nodes may still serve older retained payloads to allow genesis sync.
109
109
 
110
- if (count > config.MAX_REQUEST_BLOCKS_DENEB) {
111
- count = config.MAX_REQUEST_BLOCKS_DENEB;
110
+ // Spec: EnvelopesByRange response is bounded by MAX_REQUEST_PAYLOADS (consensus-specs #5383),
111
+ // distinct from the MAX_REQUEST_BLOCKS_DENEB cap used for block-by-range.
112
+ if (count > config.MAX_REQUEST_PAYLOADS) {
113
+ count = config.MAX_REQUEST_PAYLOADS;
112
114
  }
113
115
 
114
116
  return {startSlot, count};
@@ -1,4 +1,5 @@
1
- import {ProtocolHandler} from "@lodestar/reqresp";
1
+ import type {Type} from "@chainsafe/ssz";
2
+ import {ProtocolHandler, RespStatus, ResponseError} from "@lodestar/reqresp";
2
3
  import {ssz} from "@lodestar/types";
3
4
  import {IBeaconChain} from "../../../chain/index.js";
4
5
  import {IBeaconDb} from "../../../db/index.js";
@@ -29,6 +30,14 @@ function notImplemented(method: ReqRespMethod): ProtocolHandler {
29
30
  };
30
31
  }
31
32
 
33
+ function deserializeRequestBody<T>(type: Type<T>, data: Uint8Array): T {
34
+ try {
35
+ return type.deserialize(data);
36
+ } catch (e) {
37
+ throw new ResponseError(RespStatus.INVALID_REQUEST, e instanceof Error ? e.message : String(e));
38
+ }
39
+ }
40
+
32
41
  /**
33
42
  * The ReqRespHandler module handles app-level requests / responses from other peers,
34
43
  * fetching state from the chain and database as needed.
@@ -40,51 +49,51 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
40
49
  [ReqRespMethod.Ping]: notImplemented(ReqRespMethod.Ping),
41
50
  [ReqRespMethod.Metadata]: notImplemented(ReqRespMethod.Metadata),
42
51
  [ReqRespMethod.BeaconBlocksByRange]: (req, peerId, peerClient) => {
43
- const body = ssz.phase0.BeaconBlocksByRangeRequest.deserialize(req.data);
52
+ const body = deserializeRequestBody(ssz.phase0.BeaconBlocksByRangeRequest, req.data);
44
53
  return onBeaconBlocksByRange(body, chain, db, peerId, peerClient);
45
54
  },
46
55
  [ReqRespMethod.BeaconBlocksByRoot]: (req) => {
47
56
  const fork = chain.config.getForkName(chain.clock.currentSlot);
48
- const body = BeaconBlocksByRootRequestType(fork, chain.config).deserialize(req.data);
57
+ const body = deserializeRequestBody(BeaconBlocksByRootRequestType(fork, chain.config), req.data);
49
58
  return onBeaconBlocksByRoot(body, chain);
50
59
  },
51
60
  [ReqRespMethod.BeaconBlocksByHead]: (req, peerId, peerClient) => {
52
- const body = ssz.fulu.BeaconBlocksByHeadRequest.deserialize(req.data);
61
+ const body = deserializeRequestBody(ssz.fulu.BeaconBlocksByHeadRequest, req.data);
53
62
  return onBeaconBlocksByHead(body, chain, peerId, peerClient);
54
63
  },
55
64
  [ReqRespMethod.BlobSidecarsByRoot]: (req) => {
56
65
  const fork = chain.config.getForkName(chain.clock.currentSlot);
57
- const body = BlobSidecarsByRootRequestType(fork, chain.config).deserialize(req.data);
66
+ const body = deserializeRequestBody(BlobSidecarsByRootRequestType(fork, chain.config), req.data);
58
67
  return onBlobSidecarsByRoot(body, chain);
59
68
  },
60
69
  [ReqRespMethod.BlobSidecarsByRange]: (req) => {
61
- const body = ssz.deneb.BlobSidecarsByRangeRequest.deserialize(req.data);
70
+ const body = deserializeRequestBody(ssz.deneb.BlobSidecarsByRangeRequest, req.data);
62
71
  return onBlobSidecarsByRange(body, chain, db);
63
72
  },
64
73
  [ReqRespMethod.DataColumnSidecarsByRange]: (req, peerId, peerClient) => {
65
- const body = ssz.fulu.DataColumnSidecarsByRangeRequest.deserialize(req.data);
74
+ const body = deserializeRequestBody(ssz.fulu.DataColumnSidecarsByRangeRequest, req.data);
66
75
  return onDataColumnSidecarsByRange(body, chain, db, peerId, peerClient);
67
76
  },
68
77
  [ReqRespMethod.DataColumnSidecarsByRoot]: (req, peerId, peerClient) => {
69
- const body = DataColumnSidecarsByRootRequestType(chain.config).deserialize(req.data);
78
+ const body = deserializeRequestBody(DataColumnSidecarsByRootRequestType(chain.config), req.data);
70
79
  return onDataColumnSidecarsByRoot(body, chain, db, peerId, peerClient);
71
80
  },
72
81
 
73
82
  [ReqRespMethod.ExecutionPayloadEnvelopesByRoot]: (req, peerId, peerClient) => {
74
- const body = ExecutionPayloadEnvelopesByRootRequestType(chain.config).deserialize(req.data);
83
+ const body = deserializeRequestBody(ExecutionPayloadEnvelopesByRootRequestType(chain.config), req.data);
75
84
  return onExecutionPayloadEnvelopesByRoot(body, chain, db, peerId, peerClient);
76
85
  },
77
86
  [ReqRespMethod.ExecutionPayloadEnvelopesByRange]: (req, peerId, peerClient) => {
78
- const body = ssz.gloas.ExecutionPayloadEnvelopesByRangeRequest.deserialize(req.data);
87
+ const body = deserializeRequestBody(ssz.gloas.ExecutionPayloadEnvelopesByRangeRequest, req.data);
79
88
  return onExecutionPayloadEnvelopesByRange(body, chain, db, peerId, peerClient);
80
89
  },
81
90
 
82
91
  [ReqRespMethod.LightClientBootstrap]: (req) => {
83
- const body = ssz.Root.deserialize(req.data);
92
+ const body = deserializeRequestBody(ssz.Root, req.data);
84
93
  return onLightClientBootstrap(body, chain);
85
94
  },
86
95
  [ReqRespMethod.LightClientUpdatesByRange]: (req) => {
87
- const body = ssz.altair.LightClientUpdatesByRange.deserialize(req.data);
96
+ const body = deserializeRequestBody(ssz.altair.LightClientUpdatesByRange, req.data);
88
97
  return onLightClientUpdatesByRange(body, chain);
89
98
  },
90
99
  [ReqRespMethod.LightClientFinalityUpdate]: () => onLightClientFinalityUpdate(chain),
@@ -27,3 +27,8 @@ export function getConnection(libp2p: Libp2p, peerIdStr: string): Connection | u
27
27
  export function isPublishToZeroPeersError(e: Error): boolean {
28
28
  return e.message.includes("PublishError.NoPeersSubscribedToTopic");
29
29
  }
30
+
31
+ // https://github.com/libp2p/js-libp2p/blob/f87cba928991736d9646b3e054c367f55cab315c/packages/gossipsub/src/gossipsub.ts#L2076
32
+ export function isPublishDuplicateError(e: Error): boolean {
33
+ return e.message.includes("PublishError.Duplicate");
34
+ }
@@ -15,12 +15,13 @@ export const MAX_BATCH_DOWNLOAD_ATTEMPTS = 5;
15
15
  export const RATE_LIMITED_PEER_BACKOFF_MS = 5_000;
16
16
 
17
17
  /**
18
- * Consider batch faulty after downloading and processing this number of times
19
- * as in https://github.com/ChainSafe/lodestar/issues/8147 we cannot proceed the sync chain if there is unknown parent
20
- * from prior batch. For example a peer may send us a non-canonical chain segment or not returning all blocks
21
- * in that case we should throw error and `RangeSync` should remove that error chain and add a new one.
18
+ * Consider a batch faulty once its failed processing attempts EXCEED this number, i.e. the batch is
19
+ * processed up to `MAX_BATCH_PROCESSING_ATTEMPTS + 1` times before teardown (the check is `>`, same
20
+ * convention as `MAX_BATCH_DOWNLOAD_ATTEMPTS`).
21
+ * Some processing failures can be caused by a different batch, so range sync classifies the fault
22
+ * before deciding which batch to redownload.
22
23
  **/
23
- export const MAX_BATCH_PROCESSING_ATTEMPTS = 0;
24
+ export const MAX_BATCH_PROCESSING_ATTEMPTS = 3;
24
25
 
25
26
  /**
26
27
  * Number of slots to offset batches.
@@ -64,6 +64,7 @@ export type DownloadSuccessState = {
64
64
  status: BatchStatus.AwaitingProcessing;
65
65
  blocks: IBlockInput[];
66
66
  payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null;
67
+ attempt: Attempt;
67
68
  };
68
69
 
69
70
  export type BatchState =
@@ -589,7 +590,11 @@ export class Batch {
589
590
  }
590
591
 
591
592
  if (allComplete) {
592
- this.state = {status: BatchStatus.AwaitingProcessing, blocks, payloadEnvelopes: newPayloadEnvelopes};
593
+ const attempt: Attempt = {
594
+ peers: this.getSuccessfulPeers(),
595
+ hash: hashBlocks(blocks, this.config),
596
+ };
597
+ this.state = {status: BatchStatus.AwaitingProcessing, blocks, payloadEnvelopes: newPayloadEnvelopes, attempt};
593
598
  } else {
594
599
  this.state = {status: BatchStatus.AwaitingDownload, blocks, payloadEnvelopes: newPayloadEnvelopes};
595
600
  this.requests = this.getRequests(blocks);
@@ -646,15 +651,11 @@ export class Batch {
646
651
  throw new BatchError(this.wrongStatusErrorType(BatchStatus.AwaitingProcessing));
647
652
  }
648
653
 
649
- const blocks = this.state.blocks;
650
- const payloadEnvelopes = this.state.payloadEnvelopes;
651
- const hash = hashBlocks(blocks, this.config); // tracks blocks to report peer on processing error
652
- // Reset successfulDownloads in case another download attempt needs to be made. When Attempt is successful or not
653
- // the peers that the data came from will be handled by the Attempt that goes for processing.
654
- const peers = this.getSuccessfulPeers();
654
+ const {blocks, payloadEnvelopes, attempt} = this.state;
655
+ // No need to track successfulDownloads anymore, the batch goes to Processing status.
655
656
  this.successfulDownloads.clear();
656
- this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt: {peers, hash}};
657
- return {blocks, payloadEnvelopes, peers};
657
+ this.state = {status: BatchStatus.Processing, blocks, payloadEnvelopes, attempt};
658
+ return {blocks, payloadEnvelopes, peers: attempt.peers};
658
659
  }
659
660
 
660
661
  /**
@@ -673,6 +674,26 @@ export class Batch {
673
674
  };
674
675
  }
675
676
 
677
+ /**
678
+ * Processing -> AwaitingProcessing
679
+ *
680
+ * The batch's own blocks are valid but processing failed because a previous batch did not
681
+ * deliver the parent. Keep the downloaded blocks and process them again once the previous
682
+ * batch is repaired.
683
+ */
684
+ retainForReprocessing(): void {
685
+ if (this.state.status !== BatchStatus.Processing) {
686
+ throw new BatchError(this.wrongStatusErrorType(BatchStatus.Processing));
687
+ }
688
+
689
+ this.state = {
690
+ status: BatchStatus.AwaitingProcessing,
691
+ blocks: this.state.blocks,
692
+ payloadEnvelopes: this.state.payloadEnvelopes,
693
+ attempt: this.state.attempt,
694
+ };
695
+ }
696
+
676
697
  /**
677
698
  * Processing -> AwaitingDownload
678
699
  */
@@ -750,7 +771,7 @@ export enum BatchErrorCode {
750
771
  INVALID_COUNT = "BATCH_ERROR_INVALID_COUNT",
751
772
  MAX_DOWNLOAD_ATTEMPTS = "BATCH_ERROR_MAX_DOWNLOAD_ATTEMPTS",
752
773
  MAX_PROCESSING_ATTEMPTS = "BATCH_ERROR_MAX_PROCESSING_ATTEMPTS",
753
- MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS",
774
+ MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS = "BATCH_ERROR_MAX_EXECUTION_ENGINE_ERROR_ATTEMPTS",
754
775
  }
755
776
 
756
777
  type BatchErrorType =
@@ -23,7 +23,9 @@ import {Batch, BatchError, BatchErrorCode, BatchMetadata, BatchStatus} from "./b
23
23
  import {
24
24
  ChainPeersBalancer,
25
25
  PeerSyncInfo,
26
+ ProcessingFaultKind,
26
27
  batchStartEpochIsAfterSlot,
28
+ classifyProcessingFault,
27
29
  computeHighestTarget,
28
30
  getBatchSlotRange,
29
31
  getNextBatchToProcess,
@@ -708,23 +710,41 @@ export class SyncChain {
708
710
  this.triggerBatchProcessor();
709
711
  } else {
710
712
  this.logger.verbose("Batch process error", logCtx, res.err);
711
- batch.processingError(res.err); // Throws after MAX_BATCH_PROCESSING_ATTEMPTS
712
-
713
- // At least one block was successfully verified and imported, so we can be sure all
714
- // previous batches are valid and we only need to download the current failed batch.
715
- // TODO: Disabled for now
716
- // if (res.err instanceof ChainSegmentError && res.err.importedBlocks > 0) {
717
- // this.advanceChain(batch.startEpoch);
718
- // }
719
-
720
- // The current batch could not be processed, so either this or previous batches are invalid.
721
- // All previous batches (AwaitingValidation) are potentially faulty and marked for retry.
722
- // Progress will be drop back to `this.startEpoch`
723
- for (const pendingBatch of this.batches.values()) {
724
- if (pendingBatch.startEpoch < batch.startEpoch) {
725
- this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
726
- pendingBatch.validationError(res.err); // Throws after MAX_BATCH_PROCESSING_ATTEMPTS
713
+
714
+ const invalidatePreviousBatches = (): number => {
715
+ let invalidatedCount = 0;
716
+ for (const pendingBatch of this.batches.values()) {
717
+ if (
718
+ pendingBatch.startEpoch < batch.startEpoch &&
719
+ pendingBatch.state.status === BatchStatus.AwaitingValidation
720
+ ) {
721
+ this.logger.verbose("Batch validation error", {id: this.logId, ...pendingBatch.getMetadata()});
722
+ pendingBatch.validationError(res.err);
723
+ invalidatedCount++;
724
+ }
727
725
  }
726
+ return invalidatedCount;
727
+ };
728
+
729
+ const prevBatch = this.batches.get(batch.startEpoch - EPOCHS_PER_BATCH);
730
+ switch (classifyProcessingFault(res.err, batch, prevBatch)) {
731
+ case ProcessingFaultKind.CurrentBatch:
732
+ batch.processingError(res.err);
733
+ break;
734
+
735
+ case ProcessingFaultKind.PreviousBatch:
736
+ // If no previous batch was invalidated, it means the error is on this batch
737
+ if (invalidatePreviousBatches() === 0) {
738
+ batch.processingError(res.err);
739
+ } else {
740
+ batch.retainForReprocessing();
741
+ }
742
+ break;
743
+
744
+ case ProcessingFaultKind.Ambiguous:
745
+ batch.processingError(res.err);
746
+ invalidatePreviousBatches();
747
+ break;
728
748
  }
729
749
  }
730
750
 
@@ -1,6 +1,7 @@
1
1
  import {SLOTS_PER_EPOCH} from "@lodestar/params";
2
2
  import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
3
3
  import {Epoch, Slot} from "@lodestar/types";
4
+ import {BlockError, BlockErrorCode} from "../../../chain/errors/index.js";
4
5
  import {BATCH_SLOT_OFFSET, EPOCHS_PER_BATCH} from "../../constants.js";
5
6
  import {Batch, BatchStatus} from "../batch.js";
6
7
 
@@ -117,3 +118,46 @@ export function isSyncChainDone(batches: Batch[], lastEpochWithProcessBlocks: Ep
117
118
 
118
119
  return batchStartEpochIsAfterSlot(lastEpochWithProcessBlocks, targetSlot);
119
120
  }
121
+
122
+ /**
123
+ * Where a batch processing error should be attributed.
124
+ */
125
+ export enum ProcessingFaultKind {
126
+ /** This batch's own blocks are bad or incomplete, so redownload this batch. */
127
+ CurrentBatch = "CurrentBatch",
128
+ /** This batch is valid, but a previous batch did not deliver the parent. */
129
+ PreviousBatch = "PreviousBatch",
130
+ /** The fault could be in this batch or a previous batch, so hedge both ways. */
131
+ Ambiguous = "Ambiguous",
132
+ }
133
+
134
+ /**
135
+ * Classify a processChainSegment error for a batch so range sync only redownloads
136
+ * the batch or batches that could actually be at fault.
137
+ * Note that range sync is supposed to only handle linear chain, for forky condition we'll handle it via backward sync
138
+ * in BlockInputSync or the upcoming/TODO beacon_blocks_by_head req/resp.
139
+ */
140
+ export function classifyProcessingFault(err: Error, batch: Batch, prevBatch: Batch | undefined): ProcessingFaultKind {
141
+ if (!(err instanceof BlockError)) {
142
+ return ProcessingFaultKind.CurrentBatch;
143
+ }
144
+
145
+ const {code} = err.type;
146
+ if (code !== BlockErrorCode.PARENT_BLOCK_UNKNOWN && code !== BlockErrorCode.PARENT_PAYLOAD_UNKNOWN) {
147
+ return ProcessingFaultKind.CurrentBatch;
148
+ }
149
+
150
+ const firstErrorSlot = err.signedBlock.message.slot;
151
+ if (firstErrorSlot === batch.startSlot) {
152
+ // note that range sync is for linear chain, so this is clearly an issue of the previous batch
153
+ return prevBatch === undefined ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.PreviousBatch;
154
+ }
155
+
156
+ const prevTailSlot = batch.startSlot - 1;
157
+ const prevHasFullTail =
158
+ code === BlockErrorCode.PARENT_PAYLOAD_UNKNOWN
159
+ ? (prevBatch?.getPayloadEnvelopes()?.get(prevTailSlot)?.hasPayloadEnvelope() ?? false)
160
+ : (prevBatch?.getBlocks().some((b) => b.slot === prevTailSlot) ?? false);
161
+
162
+ return prevHasFullTail ? ProcessingFaultKind.CurrentBatch : ProcessingFaultKind.Ambiguous;
163
+ }
package/src/sync/sync.ts CHANGED
@@ -75,6 +75,11 @@ export class BeaconSync implements IBeaconSync {
75
75
  if (metrics) {
76
76
  metrics.syncStatus.addCollect(() => this.scrapeMetrics(metrics));
77
77
  }
78
+
79
+ // A from-scratch or large-gap start boots not synced; updateSyncState resumes once synced
80
+ if (this.state !== SyncState.Synced) {
81
+ this.chain.forkChoice.pauseFastConfirmation();
82
+ }
78
83
  }
79
84
 
80
85
  close(): void {
@@ -228,6 +233,8 @@ export class BeaconSync implements IBeaconSync {
228
233
 
229
234
  // We have become synced, subscribe to all the gossip core topics
230
235
  if (state === SyncState.Synced && this.chain.clock.currentEpoch >= MIN_EPOCH_TO_START_GOSSIP) {
236
+ this.chain.forkChoice.resumeFastConfirmation();
237
+
231
238
  if (!this.network.isSubscribedToGossipCoreTopics()) {
232
239
  this.network
233
240
  .subscribeGossipCoreTopics()
@@ -251,6 +258,9 @@ export class BeaconSync implements IBeaconSync {
251
258
  else if (state !== SyncState.Synced) {
252
259
  const syncDiff = this.chain.clock.currentSlot - this.chain.forkChoice.getHead().slot;
253
260
  if (syncDiff > this.slotImportTolerance * 2) {
261
+ // Same debounce as gossip: transient blips keep the rule running, only a real gap pauses it
262
+ this.chain.forkChoice.pauseFastConfirmation();
263
+
254
264
  if (this.network.isSubscribedToGossipCoreTopics()) {
255
265
  this.logger.warn(`Node sync has fallen behind by ${syncDiff} slots`);
256
266
  this.network
@@ -819,7 +819,7 @@ export class BlockInputSync {
819
819
  // case BlockErrorCode.ALREADY_KNOWN:
820
820
  // case BlockErrorCode.GENESIS_BLOCK:
821
821
 
822
- case BlockErrorCode.PARENT_UNKNOWN:
822
+ case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
823
823
  case BlockErrorCode.PRESTATE_MISSING:
824
824
  // Should not happen, mark as downloaded to try again latter
825
825
  this.logger.debug("Attempted to process block but its parent was still unknown", errorData, res.err);
@@ -841,10 +841,16 @@ export class BlockInputSync {
841
841
 
842
842
  case BlockErrorCode.EXECUTION_ENGINE_ERROR:
843
843
  // Removing the block(s) without penalizing the peers, hoping for EL to
844
- // recover on a latter download + verify attempt
844
+ // recover on a latter download + verify attempt.
845
845
  this.removeAllDescendants(pendingBlock);
846
846
  break;
847
847
 
848
+ case BlockErrorCode.EXECUTION_ENGINE_INVALID:
849
+ // the peer served a bad block
850
+ this.logger.debug("Execution engine rejected block from unknown parent sync", errorData, res.err);
851
+ this.removeAndDownScoreAllDescendants(pendingBlock);
852
+ break;
853
+
848
854
  default:
849
855
  // Block is not correct with respect to our chain. Log error loudly
850
856
  this.logger.debug("Error processing block from unknown parent sync", errorData, res.err);
@@ -199,7 +199,7 @@ export async function getDataColumnSidecarsFromExecution(
199
199
  const previouslyMissingColumns = input.getMissingSampledColumnMeta().missing;
200
200
  const sampledColumns = previouslyMissingColumns.map((columnIndex) => dataColumnSidecars[columnIndex]);
201
201
 
202
- // for columns that we already seen, it will be ignored through `ignoreDuplicatePublishError` gossip option
202
+ // for columns we have already seen, publishDataColumnSidecar() catches PublishError.Duplicate and marks alreadyPublished=true
203
203
  emitter.emit(ChainEvent.publishDataColumns, sampledColumns);
204
204
  // TODO: Can we record dataColumns.sentPeersPerSubnet metric here somehow
205
205
 
@@ -8,21 +8,10 @@ export enum ProfileThread {
8
8
  DISC5 = "discv5",
9
9
  }
10
10
 
11
- /**
12
- * The time to take a Bun profile.
13
- * If we increase this time it'll potentiall cause the app to crash.
14
- * If we decrease this time, profile recorded will be fragmented and hard to analyze.
15
- */
16
- const BUN_PROFILE_MS = 3 * 1000;
17
-
18
- export async function profileThread(thread: ProfileThread, durationMs: number, dirpath: string): Promise<string> {
19
- return globalThis.Bun ? profileBun(thread, durationMs) : profileNodeJS(thread, durationMs, dirpath);
20
- }
21
-
22
11
  /**
23
12
  * Take `durationMs` profile of the current thread and return the persisted file path.
24
13
  */
25
- async function profileNodeJS(thread: ProfileThread, durationMs: number, dirpath: string): Promise<string> {
14
+ export async function profileThread(thread: ProfileThread, durationMs: number, dirpath: string): Promise<string> {
26
15
  const inspector = await import("node:inspector");
27
16
 
28
17
  // due to some typing issues, not able to use promisify here
@@ -54,25 +43,6 @@ async function profileNodeJS(thread: ProfileThread, durationMs: number, dirpath:
54
43
  return filePath;
55
44
  }
56
45
 
57
- /**
58
- * Unlike NodeJS, Bun console.profile() api flush data to the inspector,
59
- * so this api returns ms taken of this profile instead of file path.
60
- */
61
- async function profileBun(thread: ProfileThread, durationMs: number): Promise<string> {
62
- const start = Date.now();
63
- let now = Date.now();
64
- while (now - start < durationMs) {
65
- // biome-ignore lint/suspicious/noConsole: need to use console api to profile in Bun
66
- console.profile(String(now));
67
- await sleep(BUN_PROFILE_MS);
68
- // biome-ignore lint/suspicious/noConsole: need to use console api to profile in Bun
69
- console.profileEnd(String(now));
70
- now = Date.now();
71
- }
72
-
73
- return `Successfully take Bun ${thread} thread profile in ${now - start}ms. Check your inspector to see the profile.`;
74
- }
75
-
76
46
  /**
77
47
  * Write heap snapshot of the current thread to the specified file.
78
48
  */
@@ -706,7 +706,7 @@ export function getBlockRootFromPayloadAttestationMessageSerialized(data: Uint8A
706
706
  * blockHash: Bytes32 (32 bytes)
707
707
  * prevRandao: Bytes32 (32 bytes)
708
708
  * feeRecipient: ExecutionAddress(20 bytes)
709
- * gasLimit: UintNum64 (8 bytes)
709
+ * gasLimit: UintBn64 (8 bytes)
710
710
  * builderIndex: BuilderIndex (8 bytes)
711
711
  * slot: Slot (8 bytes) ← absolute offset 264
712
712
  */
@@ -1,2 +0,0 @@
1
- export declare function gcStats(): () => void;
2
- //# sourceMappingURL=prometheus-gc-stats.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prometheus-gc-stats.d.ts","sourceRoot":"","sources":["../../src/bun-wrappers/prometheus-gc-stats.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,eAEtB"}
@@ -1,8 +0,0 @@
1
- // Bun does not support `GCProfiler` from `node:v8`a
2
- // Which is exposed from `@chainsafe/prometheus-gc-stats` and used in `packages/beacon-node/src/metrics/nodeJsMetrics.ts`
3
- // So we expose a dummy function for Bun runtime which do nothing for now
4
- // TODO: May look get some useful data from `bun:jsc`
5
- export function gcStats() {
6
- return () => { };
7
- }
8
- //# sourceMappingURL=prometheus-gc-stats.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prometheus-gc-stats.js","sourceRoot":"","sources":["../../src/bun-wrappers/prometheus-gc-stats.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,yHAAyH;AACzH,yEAAyE;AACzE,qDAAqD;AACrD,MAAM,UAAU,OAAO,GAAG;IACxB,OAAO,GAAG,EAAE,CAAC,EAAC,CAAC,CAAC;AAAA,CACjB"}
@@ -1,3 +0,0 @@
1
- import { FsDatastore } from "datastore-fs";
2
- export declare const LevelDatastore: typeof FsDatastore;
3
- //# sourceMappingURL=datastore_bun.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datastore_bun.d.ts","sourceRoot":"","sources":["../../../src/network/peers/datastore_bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,oBAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- import { FsDatastore } from "datastore-fs";
2
- export const LevelDatastore = FsDatastore;
3
- //# sourceMappingURL=datastore_bun.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datastore_bun.js","sourceRoot":"","sources":["../../../src/network/peers/datastore_bun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC"}
@@ -1,7 +0,0 @@
1
- // Bun does not support `GCProfiler` from `node:v8`a
2
- // Which is exposed from `@chainsafe/prometheus-gc-stats` and used in `packages/beacon-node/src/metrics/nodeJsMetrics.ts`
3
- // So we expose a dummy function for Bun runtime which do nothing for now
4
- // TODO: May look get some useful data from `bun:jsc`
5
- export function gcStats() {
6
- return () => {};
7
- }
@@ -1,3 +0,0 @@
1
- import {FsDatastore} from "datastore-fs";
2
-
3
- export const LevelDatastore = FsDatastore;