@lodestar/beacon-node 1.51.0 → 1.52.0-dev.47827ac6f8

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 (588) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +36 -88
  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 +22 -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/api/impl/validator/index.d.ts +6 -0
  10. package/lib/api/impl/validator/index.d.ts.map +1 -1
  11. package/lib/api/impl/validator/index.js +38 -25
  12. package/lib/api/impl/validator/index.js.map +1 -1
  13. package/lib/chain/GetBlobsTracker.d.ts +13 -2
  14. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  15. package/lib/chain/GetBlobsTracker.js +69 -35
  16. package/lib/chain/GetBlobsTracker.js.map +1 -1
  17. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  18. package/lib/chain/archiveStore/archiveStore.js +4 -4
  19. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  20. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +12 -0
  21. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  22. package/lib/chain/archiveStore/utils/archiveBlocks.js +17 -2
  23. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  24. package/lib/chain/archiveStore/utils/pruneHistory.d.ts +9 -2
  25. package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
  26. package/lib/chain/archiveStore/utils/pruneHistory.js +12 -4
  27. package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
  28. package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
  29. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  30. package/lib/chain/blocks/blockInput/blockInput.js +8 -242
  31. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  32. package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
  33. package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
  34. package/lib/chain/blocks/blockInput/errors.js.map +1 -1
  35. package/lib/chain/blocks/blockInput/types.d.ts +2 -18
  36. package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
  37. package/lib/chain/blocks/blockInput/types.js +0 -1
  38. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  39. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  40. package/lib/chain/blocks/importBlock.js +36 -53
  41. package/lib/chain/blocks/importBlock.js.map +1 -1
  42. package/lib/chain/blocks/importExecutionPayload.d.ts +10 -11
  43. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  44. package/lib/chain/blocks/importExecutionPayload.js +48 -20
  45. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  46. package/lib/chain/blocks/index.d.ts.map +1 -1
  47. package/lib/chain/blocks/index.js +2 -2
  48. package/lib/chain/blocks/index.js.map +1 -1
  49. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +10 -7
  50. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
  51. package/lib/chain/blocks/payloadEnvelopeProcessor.js +22 -17
  52. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  53. package/lib/chain/blocks/types.d.ts +4 -20
  54. package/lib/chain/blocks/types.d.ts.map +1 -1
  55. package/lib/chain/blocks/types.js +0 -24
  56. package/lib/chain/blocks/types.js.map +1 -1
  57. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  58. package/lib/chain/blocks/verifyBlock.js +25 -11
  59. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  60. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +2 -2
  61. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
  62. package/lib/chain/blocks/verifyBlocksDataAvailability.js +17 -5
  63. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  64. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +1 -1
  65. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  66. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +14 -8
  67. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  68. package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
  69. package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -0
  70. package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
  71. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  72. package/lib/chain/blocks/verifyBlocksSignatures.js +10 -5
  73. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  74. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +2 -2
  75. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
  76. package/lib/chain/blocks/verifyPayloadsDataAvailability.js +12 -7
  77. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  78. package/lib/chain/blocks/writeBlockInputToDb.d.ts +0 -2
  79. package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
  80. package/lib/chain/blocks/writeBlockInputToDb.js +6 -24
  81. package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
  82. package/lib/chain/bls/interface.d.ts +2 -0
  83. package/lib/chain/bls/interface.d.ts.map +1 -1
  84. package/lib/chain/bls/multithread/index.d.ts +1 -1
  85. package/lib/chain/bls/multithread/index.d.ts.map +1 -1
  86. package/lib/chain/bls/multithread/index.js +50 -22
  87. package/lib/chain/bls/multithread/index.js.map +1 -1
  88. package/lib/chain/bls/multithread/types.d.ts +1 -1
  89. package/lib/chain/bls/multithread/types.d.ts.map +1 -1
  90. package/lib/chain/bls/multithread/worker.js +1 -1
  91. package/lib/chain/bls/multithread/worker.js.map +1 -1
  92. package/lib/chain/bls/singleThread.js +1 -1
  93. package/lib/chain/bls/singleThread.js.map +1 -1
  94. package/lib/chain/bls/utils.js +1 -1
  95. package/lib/chain/bls/utils.js.map +1 -1
  96. package/lib/chain/chain.d.ts +25 -4
  97. package/lib/chain/chain.d.ts.map +1 -1
  98. package/lib/chain/chain.js +120 -39
  99. package/lib/chain/chain.js.map +1 -1
  100. package/lib/chain/emitter.d.ts +7 -7
  101. package/lib/chain/emitter.d.ts.map +1 -1
  102. package/lib/chain/emitter.js +5 -5
  103. package/lib/chain/emitter.js.map +1 -1
  104. package/lib/chain/errors/blockError.d.ts +1 -1
  105. package/lib/chain/errors/blockError.d.ts.map +1 -1
  106. package/lib/chain/errors/blockError.js +1 -1
  107. package/lib/chain/errors/blockError.js.map +1 -1
  108. package/lib/chain/errors/executionPayloadEnvelope.d.ts +7 -0
  109. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  110. package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
  111. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  112. package/lib/chain/errors/index.d.ts +0 -1
  113. package/lib/chain/errors/index.d.ts.map +1 -1
  114. package/lib/chain/errors/index.js +0 -1
  115. package/lib/chain/errors/index.js.map +1 -1
  116. package/lib/chain/forkChoice/index.d.ts +8 -1
  117. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  118. package/lib/chain/forkChoice/index.js +8 -0
  119. package/lib/chain/forkChoice/index.js.map +1 -1
  120. package/lib/chain/forkChoiceExecutionEngine.d.ts +53 -0
  121. package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
  122. package/lib/chain/forkChoiceExecutionEngine.js +140 -0
  123. package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
  124. package/lib/chain/interface.d.ts +9 -7
  125. package/lib/chain/interface.d.ts.map +1 -1
  126. package/lib/chain/interface.js.map +1 -1
  127. package/lib/chain/opPools/aggregatedAttestationPool.d.ts +17 -4
  128. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  129. package/lib/chain/opPools/aggregatedAttestationPool.js +199 -46
  130. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  131. package/lib/chain/opPools/attestationPool.d.ts +1 -1
  132. package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
  133. package/lib/chain/opPools/attestationPool.js +15 -4
  134. package/lib/chain/opPools/attestationPool.js.map +1 -1
  135. package/lib/chain/opPools/index.d.ts +1 -0
  136. package/lib/chain/opPools/index.d.ts.map +1 -1
  137. package/lib/chain/opPools/index.js +1 -0
  138. package/lib/chain/opPools/index.js.map +1 -1
  139. package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
  140. package/lib/chain/opPools/payloadAttestationPool.js +17 -7
  141. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  142. package/lib/chain/opPools/singleAttestationPool.d.ts +77 -0
  143. package/lib/chain/opPools/singleAttestationPool.d.ts.map +1 -0
  144. package/lib/chain/opPools/singleAttestationPool.js +209 -0
  145. package/lib/chain/opPools/singleAttestationPool.js.map +1 -0
  146. package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
  147. package/lib/chain/opPools/syncCommitteeMessagePool.js +9 -3
  148. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  149. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  150. package/lib/chain/opPools/syncContributionAndProofPool.js +11 -3
  151. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  152. package/lib/chain/opPools/utils.d.ts +1 -1
  153. package/lib/chain/opPools/utils.d.ts.map +1 -1
  154. package/lib/chain/opPools/utils.js +1 -1
  155. package/lib/chain/opPools/utils.js.map +1 -1
  156. package/lib/chain/options.d.ts +5 -3
  157. package/lib/chain/options.d.ts.map +1 -1
  158. package/lib/chain/options.js +2 -3
  159. package/lib/chain/options.js.map +1 -1
  160. package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
  161. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  162. package/lib/chain/produceBlock/produceBlockBody.js +3 -2
  163. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  164. package/lib/chain/proposerTracker.d.ts +31 -0
  165. package/lib/chain/proposerTracker.d.ts.map +1 -0
  166. package/lib/chain/proposerTracker.js +75 -0
  167. package/lib/chain/proposerTracker.js.map +1 -0
  168. package/lib/chain/regen/interface.d.ts +1 -1
  169. package/lib/chain/regen/interface.d.ts.map +1 -1
  170. package/lib/chain/regen/queued.d.ts +1 -1
  171. package/lib/chain/regen/queued.d.ts.map +1 -1
  172. package/lib/chain/regen/queued.js +5 -3
  173. package/lib/chain/regen/queued.js.map +1 -1
  174. package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -14
  175. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  176. package/lib/chain/seenCache/seenGossipBlockInput.js +6 -65
  177. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  178. package/lib/chain/validation/aggregateAndProof.js +1 -1
  179. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  180. package/lib/chain/validation/attestation.js +1 -1
  181. package/lib/chain/validation/attestation.js.map +1 -1
  182. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  183. package/lib/chain/validation/dataColumnSidecar.js +8 -1
  184. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  185. package/lib/chain/validation/executionPayloadBid.js +13 -13
  186. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  187. package/lib/chain/validation/executionPayloadEnvelope.d.ts +6 -0
  188. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  189. package/lib/chain/validation/executionPayloadEnvelope.js +53 -0
  190. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  191. package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
  192. package/lib/chain/validation/syncCommittee.js +16 -10
  193. package/lib/chain/validation/syncCommittee.js.map +1 -1
  194. package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
  195. package/lib/chain/validation/syncCommitteeContributionAndProof.js +11 -0
  196. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  197. package/lib/chain/validatorMonitor.d.ts +1 -2
  198. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  199. package/lib/chain/validatorMonitor.js +43 -46
  200. package/lib/chain/validatorMonitor.js.map +1 -1
  201. package/lib/db/dataColumnStore.d.ts +3 -2
  202. package/lib/db/dataColumnStore.d.ts.map +1 -1
  203. package/lib/db/dataColumnStore.js +3 -3
  204. package/lib/db/dataColumnStore.js.map +1 -1
  205. package/lib/db/flatFileStore/flatFileStore.d.ts +1 -1
  206. package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -1
  207. package/lib/db/flatFileStore/flatFileStore.js +10 -9
  208. package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
  209. package/lib/db/flatFileStore/interface.d.ts +2 -1
  210. package/lib/db/flatFileStore/interface.d.ts.map +1 -1
  211. package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
  212. package/lib/db/flatFileStore/slotIndex.js +2 -2
  213. package/lib/db/flatFileStore/slotIndex.js.map +1 -1
  214. package/lib/db/repositories/blobSidecars.d.ts +0 -1
  215. package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
  216. package/lib/db/repositories/blobSidecars.js +0 -1
  217. package/lib/db/repositories/blobSidecars.js.map +1 -1
  218. package/lib/db/repositories/dataColumnSidecarArchive.d.ts +2 -1
  219. package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
  220. package/lib/db/repositories/dataColumnSidecarArchive.js +14 -4
  221. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  222. package/lib/execution/builder/apiClient.d.ts +14 -8
  223. package/lib/execution/builder/apiClient.d.ts.map +1 -1
  224. package/lib/execution/builder/apiClient.js +12 -10
  225. package/lib/execution/builder/apiClient.js.map +1 -1
  226. package/lib/execution/builder/http.d.ts +2 -0
  227. package/lib/execution/builder/http.d.ts.map +1 -1
  228. package/lib/execution/builder/http.js +2 -0
  229. package/lib/execution/builder/http.js.map +1 -1
  230. package/lib/execution/engine/http.d.ts +4 -6
  231. package/lib/execution/engine/http.d.ts.map +1 -1
  232. package/lib/execution/engine/http.js +8 -10
  233. package/lib/execution/engine/http.js.map +1 -1
  234. package/lib/execution/engine/index.d.ts +1 -1
  235. package/lib/execution/engine/index.d.ts.map +1 -1
  236. package/lib/execution/engine/index.js +1 -1
  237. package/lib/execution/engine/index.js.map +1 -1
  238. package/lib/execution/engine/interface.d.ts +18 -6
  239. package/lib/execution/engine/interface.d.ts.map +1 -1
  240. package/lib/execution/engine/interface.js.map +1 -1
  241. package/lib/execution/engine/jsonRpcTransport.d.ts +2 -4
  242. package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
  243. package/lib/execution/engine/jsonRpcTransport.js +2 -12
  244. package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
  245. package/lib/execution/engine/mock.d.ts +0 -1
  246. package/lib/execution/engine/mock.d.ts.map +1 -1
  247. package/lib/execution/engine/mock.js +0 -4
  248. package/lib/execution/engine/mock.js.map +1 -1
  249. package/lib/execution/engine/restTransport.d.ts +2 -4
  250. package/lib/execution/engine/restTransport.d.ts.map +1 -1
  251. package/lib/execution/engine/restTransport.js +1 -15
  252. package/lib/execution/engine/restTransport.js.map +1 -1
  253. package/lib/execution/engine/sszTypes.d.ts +0 -9
  254. package/lib/execution/engine/sszTypes.d.ts.map +1 -1
  255. package/lib/execution/engine/sszTypes.js +0 -5
  256. package/lib/execution/engine/sszTypes.js.map +1 -1
  257. package/lib/execution/engine/transport.d.ts +1 -14
  258. package/lib/execution/engine/transport.d.ts.map +1 -1
  259. package/lib/execution/engine/types.d.ts +0 -8
  260. package/lib/execution/engine/types.d.ts.map +1 -1
  261. package/lib/execution/engine/types.js +2 -10
  262. package/lib/execution/engine/types.js.map +1 -1
  263. package/lib/execution/engine/utils.d.ts.map +1 -1
  264. package/lib/execution/engine/utils.js +3 -2
  265. package/lib/execution/engine/utils.js.map +1 -1
  266. package/lib/index.d.ts +1 -1
  267. package/lib/index.d.ts.map +1 -1
  268. package/lib/index.js +1 -1
  269. package/lib/index.js.map +1 -1
  270. package/lib/metrics/metrics/beacon.d.ts +4 -9
  271. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  272. package/lib/metrics/metrics/beacon.js +11 -32
  273. package/lib/metrics/metrics/beacon.js.map +1 -1
  274. package/lib/metrics/metrics/lodestar.d.ts +30 -8
  275. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  276. package/lib/metrics/metrics/lodestar.js +107 -46
  277. package/lib/metrics/metrics/lodestar.js.map +1 -1
  278. package/lib/metrics/server/http.js +5 -5
  279. package/lib/metrics/server/http.js.map +1 -1
  280. package/lib/monitoring/service.js +1 -1
  281. package/lib/monitoring/service.js.map +1 -1
  282. package/lib/network/core/networkCore.d.ts +4 -1
  283. package/lib/network/core/networkCore.d.ts.map +1 -1
  284. package/lib/network/core/networkCore.js +7 -0
  285. package/lib/network/core/networkCore.js.map +1 -1
  286. package/lib/network/core/networkCoreWorker.js +2 -0
  287. package/lib/network/core/networkCoreWorker.js.map +1 -1
  288. package/lib/network/core/networkCoreWorkerHandler.d.ts +4 -1
  289. package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
  290. package/lib/network/core/networkCoreWorkerHandler.js +6 -0
  291. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  292. package/lib/network/core/types.d.ts +6 -1
  293. package/lib/network/core/types.d.ts.map +1 -1
  294. package/lib/network/gossip/gossipsub.d.ts +1 -0
  295. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  296. package/lib/network/gossip/gossipsub.js +23 -6
  297. package/lib/network/gossip/gossipsub.js.map +1 -1
  298. package/lib/network/gossip/interface.d.ts +1 -8
  299. package/lib/network/gossip/interface.d.ts.map +1 -1
  300. package/lib/network/gossip/interface.js +0 -1
  301. package/lib/network/gossip/interface.js.map +1 -1
  302. package/lib/network/gossip/topic.d.ts +0 -16
  303. package/lib/network/gossip/topic.d.ts.map +1 -1
  304. package/lib/network/gossip/topic.js +0 -23
  305. package/lib/network/gossip/topic.js.map +1 -1
  306. package/lib/network/interface.d.ts +4 -5
  307. package/lib/network/interface.d.ts.map +1 -1
  308. package/lib/network/libp2p/index.d.ts.map +1 -1
  309. package/lib/network/libp2p/index.js +5 -1
  310. package/lib/network/libp2p/index.js.map +1 -1
  311. package/lib/network/network.d.ts +8 -7
  312. package/lib/network/network.d.ts.map +1 -1
  313. package/lib/network/network.js +53 -35
  314. package/lib/network/network.js.map +1 -1
  315. package/lib/network/options.d.ts +2 -0
  316. package/lib/network/options.d.ts.map +1 -1
  317. package/lib/network/options.js +2 -0
  318. package/lib/network/options.js.map +1 -1
  319. package/lib/network/peers/peerManager.d.ts +2 -1
  320. package/lib/network/peers/peerManager.d.ts.map +1 -1
  321. package/lib/network/peers/peerManager.js +28 -1
  322. package/lib/network/peers/peerManager.js.map +1 -1
  323. package/lib/network/peers/utils/assertPeerRelevance.d.ts +9 -1
  324. package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -1
  325. package/lib/network/peers/utils/assertPeerRelevance.js +32 -21
  326. package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
  327. package/lib/network/peers/utils/prioritizePeers.d.ts +4 -1
  328. package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
  329. package/lib/network/peers/utils/prioritizePeers.js +8 -16
  330. package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
  331. package/lib/network/peers/utils/subnetMap.d.ts +5 -2
  332. package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
  333. package/lib/network/peers/utils/subnetMap.js +6 -3
  334. package/lib/network/peers/utils/subnetMap.js.map +1 -1
  335. package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
  336. package/lib/network/processor/extractSlotRootFns.js +1 -8
  337. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  338. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  339. package/lib/network/processor/gossipHandlers.js +55 -134
  340. package/lib/network/processor/gossipHandlers.js.map +1 -1
  341. package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
  342. package/lib/network/processor/gossipQueues/index.js +0 -6
  343. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  344. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  345. package/lib/network/processor/gossipValidatorFn.js +1 -5
  346. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  347. package/lib/network/processor/index.d.ts +6 -0
  348. package/lib/network/processor/index.d.ts.map +1 -1
  349. package/lib/network/processor/index.js +29 -4
  350. package/lib/network/processor/index.js.map +1 -1
  351. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  352. package/lib/network/reqresp/ReqRespBeaconNode.js +0 -3
  353. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  354. package/lib/network/reqresp/handlers/beaconBlocksByHead.js +1 -1
  355. package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
  356. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
  357. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
  358. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  359. package/lib/network/reqresp/handlers/index.js +1 -12
  360. package/lib/network/reqresp/handlers/index.js.map +1 -1
  361. package/lib/network/reqresp/protocols.d.ts +0 -2
  362. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  363. package/lib/network/reqresp/protocols.js +0 -10
  364. package/lib/network/reqresp/protocols.js.map +1 -1
  365. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  366. package/lib/network/reqresp/rateLimit.js +1 -17
  367. package/lib/network/reqresp/rateLimit.js.map +1 -1
  368. package/lib/network/reqresp/types.d.ts +2 -8
  369. package/lib/network/reqresp/types.d.ts.map +1 -1
  370. package/lib/network/reqresp/types.js +1 -7
  371. package/lib/network/reqresp/types.js.map +1 -1
  372. package/lib/network/subnets/attnetsService.d.ts +35 -5
  373. package/lib/network/subnets/attnetsService.d.ts.map +1 -1
  374. package/lib/network/subnets/attnetsService.js +84 -6
  375. package/lib/network/subnets/attnetsService.js.map +1 -1
  376. package/lib/network/subnets/interface.d.ts +7 -0
  377. package/lib/network/subnets/interface.d.ts.map +1 -1
  378. package/lib/network/subnets/interface.js.map +1 -1
  379. package/lib/node/nodejs.d.ts +3 -1
  380. package/lib/node/nodejs.d.ts.map +1 -1
  381. package/lib/node/nodejs.js +38 -20
  382. package/lib/node/nodejs.js.map +1 -1
  383. package/lib/node/options.d.ts +3 -1
  384. package/lib/node/options.d.ts.map +1 -1
  385. package/lib/node/options.js +4 -2
  386. package/lib/node/options.js.map +1 -1
  387. package/lib/sync/interface.d.ts.map +1 -1
  388. package/lib/sync/interface.js.map +1 -1
  389. package/lib/sync/range/batch.d.ts +2 -3
  390. package/lib/sync/range/batch.d.ts.map +1 -1
  391. package/lib/sync/range/batch.js +9 -22
  392. package/lib/sync/range/batch.js.map +1 -1
  393. package/lib/sync/range/chain.d.ts.map +1 -1
  394. package/lib/sync/range/chain.js +2 -15
  395. package/lib/sync/range/chain.js.map +1 -1
  396. package/lib/sync/sync.d.ts +15 -0
  397. package/lib/sync/sync.d.ts.map +1 -1
  398. package/lib/sync/sync.js +103 -25
  399. package/lib/sync/sync.js.map +1 -1
  400. package/lib/sync/unknownBlock.d.ts.map +1 -1
  401. package/lib/sync/unknownBlock.js +1 -7
  402. package/lib/sync/unknownBlock.js.map +1 -1
  403. package/lib/sync/utils/downloadByRange.d.ts +6 -34
  404. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  405. package/lib/sync/utils/downloadByRange.js +24 -128
  406. package/lib/sync/utils/downloadByRange.js.map +1 -1
  407. package/lib/sync/utils/downloadByRoot.d.ts +2 -18
  408. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  409. package/lib/sync/utils/downloadByRoot.js +14 -99
  410. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  411. package/lib/util/bitArray.d.ts +6 -6
  412. package/lib/util/bitArray.d.ts.map +1 -1
  413. package/lib/util/bitArray.js +25 -50
  414. package/lib/util/bitArray.js.map +1 -1
  415. package/lib/util/blobs.d.ts +1 -7
  416. package/lib/util/blobs.d.ts.map +1 -1
  417. package/lib/util/blobs.js +0 -19
  418. package/lib/util/blobs.js.map +1 -1
  419. package/lib/util/eventLoop.d.ts +5 -0
  420. package/lib/util/eventLoop.d.ts.map +1 -1
  421. package/lib/util/eventLoop.js +7 -0
  422. package/lib/util/eventLoop.js.map +1 -1
  423. package/lib/util/execution.d.ts +3 -4
  424. package/lib/util/execution.d.ts.map +1 -1
  425. package/lib/util/execution.js +1 -73
  426. package/lib/util/execution.js.map +1 -1
  427. package/lib/util/file.d.ts.map +1 -1
  428. package/lib/util/file.js +8 -9
  429. package/lib/util/file.js.map +1 -1
  430. package/lib/util/queue/itemQueue.js +1 -1
  431. package/lib/util/queue/itemQueue.js.map +1 -1
  432. package/lib/util/sszBytes.d.ts +5 -1
  433. package/lib/util/sszBytes.d.ts.map +1 -1
  434. package/lib/util/sszBytes.js +36 -19
  435. package/lib/util/sszBytes.js.map +1 -1
  436. package/lib/util/types.d.ts +0 -5
  437. package/lib/util/types.d.ts.map +1 -1
  438. package/lib/util/types.js +1 -2
  439. package/lib/util/types.js.map +1 -1
  440. package/package.json +17 -18
  441. package/src/api/impl/beacon/blocks/index.ts +59 -109
  442. package/src/api/impl/beacon/pool/index.ts +31 -1
  443. package/src/api/impl/beacon/state/utils.ts +1 -1
  444. package/src/api/impl/validator/index.ts +43 -29
  445. package/src/chain/GetBlobsTracker.ts +82 -52
  446. package/src/chain/archiveStore/archiveStore.ts +6 -4
  447. package/src/chain/archiveStore/utils/archiveBlocks.ts +21 -2
  448. package/src/chain/archiveStore/utils/pruneHistory.ts +16 -6
  449. package/src/chain/blocks/blockInput/blockInput.ts +15 -344
  450. package/src/chain/blocks/blockInput/errors.ts +1 -2
  451. package/src/chain/blocks/blockInput/types.ts +2 -20
  452. package/src/chain/blocks/importBlock.ts +56 -72
  453. package/src/chain/blocks/importExecutionPayload.ts +76 -36
  454. package/src/chain/blocks/index.ts +5 -2
  455. package/src/chain/blocks/payloadEnvelopeProcessor.ts +33 -22
  456. package/src/chain/blocks/types.ts +5 -31
  457. package/src/chain/blocks/verifyBlock.ts +40 -23
  458. package/src/chain/blocks/verifyBlocksDataAvailability.ts +20 -6
  459. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +16 -10
  460. package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
  461. package/src/chain/blocks/verifyBlocksSignatures.ts +10 -5
  462. package/src/chain/blocks/verifyPayloadsDataAvailability.ts +16 -8
  463. package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
  464. package/src/chain/bls/interface.ts +2 -0
  465. package/src/chain/bls/multithread/index.ts +48 -24
  466. package/src/chain/bls/multithread/types.ts +1 -1
  467. package/src/chain/bls/multithread/worker.ts +1 -5
  468. package/src/chain/bls/singleThread.ts +1 -1
  469. package/src/chain/bls/utils.ts +1 -1
  470. package/src/chain/chain.ts +136 -38
  471. package/src/chain/emitter.ts +8 -8
  472. package/src/chain/errors/blockError.ts +1 -1
  473. package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
  474. package/src/chain/errors/index.ts +0 -1
  475. package/src/chain/forkChoice/index.ts +8 -0
  476. package/src/chain/forkChoiceExecutionEngine.ts +216 -0
  477. package/src/chain/interface.ts +9 -6
  478. package/src/chain/opPools/aggregatedAttestationPool.ts +246 -43
  479. package/src/chain/opPools/attestationPool.ts +16 -4
  480. package/src/chain/opPools/index.ts +1 -0
  481. package/src/chain/opPools/payloadAttestationPool.ts +18 -7
  482. package/src/chain/opPools/singleAttestationPool.ts +287 -0
  483. package/src/chain/opPools/syncCommitteeMessagePool.ts +10 -3
  484. package/src/chain/opPools/syncContributionAndProofPool.ts +13 -3
  485. package/src/chain/opPools/utils.ts +1 -1
  486. package/src/chain/options.ts +7 -6
  487. package/src/chain/produceBlock/produceBlockBody.ts +7 -3
  488. package/src/chain/proposerTracker.ts +94 -0
  489. package/src/chain/regen/interface.ts +1 -1
  490. package/src/chain/regen/queued.ts +6 -4
  491. package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
  492. package/src/chain/validation/aggregateAndProof.ts +1 -1
  493. package/src/chain/validation/attestation.ts +1 -1
  494. package/src/chain/validation/dataColumnSidecar.ts +7 -1
  495. package/src/chain/validation/executionPayloadBid.ts +14 -13
  496. package/src/chain/validation/executionPayloadEnvelope.ts +68 -1
  497. package/src/chain/validation/syncCommittee.ts +31 -15
  498. package/src/chain/validation/syncCommitteeContributionAndProof.ts +13 -0
  499. package/src/chain/validatorMonitor.ts +43 -49
  500. package/src/db/dataColumnStore.ts +5 -4
  501. package/src/db/flatFileStore/flatFileStore.ts +12 -11
  502. package/src/db/flatFileStore/interface.ts +2 -1
  503. package/src/db/flatFileStore/slotIndex.ts +4 -3
  504. package/src/db/repositories/blobSidecars.ts +0 -1
  505. package/src/db/repositories/dataColumnSidecarArchive.ts +14 -4
  506. package/src/execution/builder/apiClient.ts +16 -13
  507. package/src/execution/builder/http.ts +4 -0
  508. package/src/execution/engine/http.ts +19 -42
  509. package/src/execution/engine/index.ts +1 -1
  510. package/src/execution/engine/interface.ts +19 -10
  511. package/src/execution/engine/jsonRpcTransport.ts +10 -22
  512. package/src/execution/engine/mock.ts +0 -7
  513. package/src/execution/engine/restTransport.ts +3 -22
  514. package/src/execution/engine/sszTypes.ts +0 -9
  515. package/src/execution/engine/transport.ts +8 -17
  516. package/src/execution/engine/types.ts +3 -18
  517. package/src/execution/engine/utils.ts +4 -2
  518. package/src/index.ts +1 -1
  519. package/src/metrics/metrics/beacon.ts +11 -32
  520. package/src/metrics/metrics/lodestar.ts +108 -46
  521. package/src/metrics/server/http.ts +5 -5
  522. package/src/monitoring/service.ts +1 -1
  523. package/src/network/core/networkCore.ts +11 -1
  524. package/src/network/core/networkCoreWorker.ts +2 -0
  525. package/src/network/core/networkCoreWorkerHandler.ts +8 -1
  526. package/src/network/core/types.ts +6 -1
  527. package/src/network/gossip/gossipsub.ts +24 -6
  528. package/src/network/gossip/interface.ts +0 -5
  529. package/src/network/gossip/topic.ts +0 -25
  530. package/src/network/interface.ts +2 -5
  531. package/src/network/libp2p/index.ts +5 -1
  532. package/src/network/network.ts +55 -58
  533. package/src/network/options.ts +4 -0
  534. package/src/network/peers/peerManager.ts +28 -3
  535. package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
  536. package/src/network/peers/utils/prioritizePeers.ts +14 -22
  537. package/src/network/peers/utils/subnetMap.ts +6 -3
  538. package/src/network/processor/extractSlotRootFns.ts +0 -9
  539. package/src/network/processor/gossipHandlers.ts +68 -167
  540. package/src/network/processor/gossipQueues/index.ts +0 -6
  541. package/src/network/processor/gossipValidatorFn.ts +0 -5
  542. package/src/network/processor/index.ts +25 -4
  543. package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
  544. package/src/network/reqresp/handlers/beaconBlocksByHead.ts +1 -1
  545. package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
  546. package/src/network/reqresp/handlers/index.ts +0 -17
  547. package/src/network/reqresp/protocols.ts +0 -12
  548. package/src/network/reqresp/rateLimit.ts +1 -17
  549. package/src/network/reqresp/types.ts +0 -13
  550. package/src/network/subnets/attnetsService.ts +94 -6
  551. package/src/network/subnets/interface.ts +7 -0
  552. package/src/node/nodejs.ts +40 -21
  553. package/src/node/options.ts +9 -6
  554. package/src/sync/interface.ts +1 -0
  555. package/src/sync/range/batch.ts +9 -21
  556. package/src/sync/range/chain.ts +2 -14
  557. package/src/sync/sync.ts +108 -26
  558. package/src/sync/unknownBlock.ts +1 -8
  559. package/src/sync/utils/downloadByRange.ts +31 -230
  560. package/src/sync/utils/downloadByRoot.ts +15 -142
  561. package/src/util/bitArray.ts +22 -43
  562. package/src/util/blobs.ts +0 -34
  563. package/src/util/eventLoop.ts +8 -0
  564. package/src/util/execution.ts +8 -102
  565. package/src/util/file.ts +8 -9
  566. package/src/util/queue/itemQueue.ts +1 -1
  567. package/src/util/sszBytes.ts +42 -24
  568. package/src/util/types.ts +1 -8
  569. package/lib/chain/errors/blobSidecarError.d.ts +0 -108
  570. package/lib/chain/errors/blobSidecarError.d.ts.map +0 -1
  571. package/lib/chain/errors/blobSidecarError.js +0 -38
  572. package/lib/chain/errors/blobSidecarError.js.map +0 -1
  573. package/lib/chain/validation/blobSidecar.d.ts +0 -16
  574. package/lib/chain/validation/blobSidecar.d.ts.map +0 -1
  575. package/lib/chain/validation/blobSidecar.js +0 -276
  576. package/lib/chain/validation/blobSidecar.js.map +0 -1
  577. package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +0 -9
  578. package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +0 -1
  579. package/lib/network/reqresp/handlers/blobSidecarsByRange.js +0 -91
  580. package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +0 -1
  581. package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +0 -5
  582. package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +0 -1
  583. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +0 -46
  584. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +0 -1
  585. package/src/chain/errors/blobSidecarError.ts +0 -70
  586. package/src/chain/validation/blobSidecar.ts +0 -357
  587. package/src/network/reqresp/handlers/blobSidecarsByRange.ts +0 -133
  588. package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +0 -69
@@ -68,7 +68,7 @@ export function createLodestarMetrics(
68
68
  if (genesisTime) {
69
69
  register
70
70
  .gauge({
71
- name: "lodestar_genesis_time",
71
+ name: "lodestar_genesis_time_seconds",
72
72
  help: "Genesis time in seconds",
73
73
  })
74
74
  .set(genesisTime);
@@ -565,13 +565,13 @@ export function createLodestarMetrics(
565
565
  }),
566
566
  // To measure the time cost of main thread <-> worker message passing
567
567
  latencyToWorker: register.histogram({
568
- name: "lodestar_bls_thread_pool_latency_to_worker",
568
+ name: "lodestar_bls_thread_pool_latency_to_worker_seconds",
569
569
  help: "Time from sending the job to the worker and the worker receiving it",
570
570
  // The dashboard treats 20ms as slow; values above 100ms only need severe-stall classification.
571
571
  buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
572
572
  }),
573
573
  latencyFromWorker: register.histogram({
574
- name: "lodestar_bls_thread_pool_latency_from_worker",
574
+ name: "lodestar_bls_thread_pool_latency_from_worker_seconds",
575
575
  help: "Time from the worker sending the result and the main thread receiving it",
576
576
  buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
577
577
  }),
@@ -645,6 +645,11 @@ export function createLodestarMetrics(
645
645
  help: "Count of peers by sync type [FullySynced, Advanced, Behind]",
646
646
  labelNames: ["syncType"],
647
647
  }),
648
+ syncPeerFinalizedCheckpointMismatch: register.counter<{reason: string}>({
649
+ name: "lodestar_sync_peer_finalized_checkpoint_mismatch_total",
650
+ help: "Total behind peers whose Status finalized checkpoint is not in our chain, by reason",
651
+ labelNames: ["reason"],
652
+ }),
648
653
  syncSwitchGossipSubscriptions: register.gauge<{action: string}>({
649
654
  name: "lodestar_sync_switch_gossip_subscriptions",
650
655
  help: "Sync switched gossip subscriptions on/off",
@@ -770,7 +775,7 @@ export function createLodestarMetrics(
770
775
  labelNames: ["reason"],
771
776
  }),
772
777
  elapsedTimeTillReceived: register.histogram({
773
- name: "lodestar_sync_unknown_block_elapsed_time_till_received",
778
+ name: "lodestar_sync_unknown_block_elapsed_time_till_received_seconds",
774
779
  help: "Time elapsed between block slot time and the time block received via unknown block sync",
775
780
  buckets: [0.5, 1, 2, 4, 6, 12],
776
781
  }),
@@ -925,91 +930,96 @@ export function createLodestarMetrics(
925
930
  // Gossip block
926
931
  gossipBlock: {
927
932
  elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
928
- name: "lodestar_gossip_block_elapsed_time_till_received",
933
+ name: "lodestar_gossip_block_elapsed_time_till_received_seconds",
929
934
  help: "Time elapsed between block slot time and the time block received via gossip",
930
935
  labelNames: ["source"],
931
936
  buckets: [0.5, 1, 2, 4, 6, 12],
932
937
  }),
933
938
  elapsedTimeTillProcessed: register.histogram({
934
- name: "lodestar_gossip_block_elapsed_time_till_processed",
939
+ name: "lodestar_gossip_block_elapsed_time_till_processed_seconds",
935
940
  help: "Time elapsed between block slot time and the time block processed",
936
941
  buckets: [0.5, 1, 2, 4, 6, 12],
937
942
  }),
938
943
 
939
944
  gossipValidation: {
940
945
  recvToValidation: register.histogram({
941
- name: "lodestar_gossip_block_received_to_gossip_validate",
946
+ name: "lodestar_gossip_block_received_to_gossip_validate_seconds",
942
947
  help: "Time elapsed between block received and block validated",
943
948
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
944
949
  }),
945
950
  validationTime: register.histogram({
946
- name: "lodestar_gossip_block_gossip_validate_time",
951
+ name: "lodestar_gossip_block_gossip_validate_time_seconds",
947
952
  help: "Time to apply gossip validations",
948
953
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
949
954
  }),
950
955
  },
951
956
  stateTransition: {
952
957
  recvToValidation: register.histogram({
953
- name: "lodestar_gossip_block_received_to_state_transition",
958
+ name: "lodestar_gossip_block_received_to_state_transition_seconds",
954
959
  help: "Time elapsed between block received and block state transition",
955
960
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
956
961
  }),
957
962
  validationTime: register.histogram({
958
- name: "lodestar_gossip_block_state_transition_time",
963
+ name: "lodestar_gossip_block_state_transition_time_seconds",
959
964
  help: "Time to validate block state transition",
960
965
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
961
966
  }),
962
967
  },
963
968
  signatureVerification: {
964
969
  recvToValidation: register.histogram({
965
- name: "lodestar_gossip_block_received_to_signatures_verification",
970
+ name: "lodestar_gossip_block_received_to_signatures_verification_seconds",
966
971
  help: "Time elapsed between block received and block signatures verification",
967
972
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
968
973
  }),
969
974
  validationTime: register.histogram({
970
- name: "lodestar_gossip_block_signatures_verification_time",
975
+ name: "lodestar_gossip_block_signatures_verification_time_seconds",
971
976
  help: "Time elapsed for block signatures verification",
972
977
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
973
978
  }),
974
979
  },
975
980
  executionPayload: {
976
981
  recvToValidation: register.histogram({
977
- name: "lodestar_gossip_block_received_to_execution_payload_verification",
982
+ name: "lodestar_gossip_block_received_to_execution_payload_verification_seconds",
978
983
  help: "Time elapsed between block received and execution payload verification",
979
984
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
980
985
  }),
981
986
  validationTime: register.histogram({
982
- name: "lodestar_gossip_execution_payload_verification_time",
987
+ name: "lodestar_gossip_execution_payload_verification_time_seconds",
983
988
  help: "Time elapsed for execution payload verification",
984
989
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
985
990
  }),
986
991
  },
987
992
  blockImport: {
988
993
  recvToValidation: register.histogram({
989
- name: "lodestar_gossip_block_received_to_block_import",
994
+ name: "lodestar_gossip_block_received_to_block_import_seconds",
990
995
  help: "Time elapsed between block received and block import",
991
996
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
992
997
  }),
993
998
  validationTime: register.histogram({
994
- name: "lodestar_gossip_block_block_import_time",
999
+ name: "lodestar_gossip_block_block_import_time_seconds",
995
1000
  help: "Time elapsed for block import",
996
1001
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
997
1002
  }),
998
1003
  },
999
1004
 
1000
1005
  receivedToBlobsAvailabilityTime: register.histogram<{numBlobs: number}>({
1001
- name: "lodestar_gossip_block_received_to_blobs_availability_time",
1006
+ name: "lodestar_gossip_block_received_to_blobs_availability_time_seconds",
1002
1007
  help: "Time elapsed between block received and blobs became available",
1003
1008
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1004
1009
  labelNames: ["numBlobs"],
1005
1010
  }),
1006
1011
  receivedToFullyVerifiedTime: register.histogram({
1007
- name: "lodestar_gossip_block_received_to_fully_verified_time",
1012
+ name: "lodestar_gossip_block_received_to_fully_verified_time_seconds",
1008
1013
  help: "Time elapsed between block received and fully verified state, signatures and payload",
1009
1014
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1010
1015
  }),
1016
+ receivedToConsensusVerifiedTime: register.histogram({
1017
+ name: "lodestar_gossip_block_received_to_consensus_verified_seconds",
1018
+ help: "Time from gossip block arrival until both the state transition and all block signature verifications are complete, excluding execution payload verification",
1019
+ buckets: [0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.5, 1],
1020
+ }),
1011
1021
  verifiedToBlobsAvailabiltyTime: register.histogram<{numBlobs: number}>({
1012
- name: "lodestar_gossip_block_verified_to_blobs_availability_time",
1022
+ name: "lodestar_gossip_block_verified_to_blobs_availability_time_seconds",
1013
1023
  help: "Time elapsed between block verified and blobs became available",
1014
1024
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1015
1025
  labelNames: ["numBlobs"],
@@ -1035,24 +1045,20 @@ export function createLodestarMetrics(
1035
1045
  },
1036
1046
  gossipBlob: {
1037
1047
  recvToValidation: register.histogram({
1038
- name: "lodestar_gossip_blob_received_to_gossip_validate",
1048
+ name: "lodestar_gossip_blob_received_to_gossip_validate_seconds",
1039
1049
  help: "Time elapsed between blob received and blob validation",
1040
1050
  buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
1041
1051
  }),
1042
1052
  validationTime: register.histogram({
1043
- name: "lodestar_gossip_blob_gossip_validate_time",
1053
+ name: "lodestar_gossip_blob_gossip_validate_time_seconds",
1044
1054
  help: "Time elapsed for blob validation",
1045
1055
  buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
1046
1056
  }),
1047
- publishedFromEngine: register.counter({
1048
- name: "lodestar_gossip_blob_published_from_engine_total",
1049
- help: "Total number of blobs retrieved from execution engine and published to gossip",
1050
- }),
1051
1057
  },
1052
1058
  // Gossip execution payload envelope
1053
1059
  gossipExecutionPayloadEnvelope: {
1054
1060
  elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
1055
- name: "lodestar_gossip_execution_payload_envelope_elapsed_time_till_received",
1061
+ name: "lodestar_gossip_execution_payload_envelope_elapsed_time_till_received_seconds",
1056
1062
  help: "Time elapsed between slot time and the time execution payload envelope received",
1057
1063
  labelNames: ["source"],
1058
1064
  buckets: [0.5, 1, 2, 4, 6, 12],
@@ -1151,7 +1157,7 @@ export function createLodestarMetrics(
1151
1157
  help: "Count persisting block with serialized data",
1152
1158
  }),
1153
1159
  elapsedTimeTillBecomeHead: register.histogram({
1154
- name: "lodestar_gossip_block_elapsed_time_till_become_head",
1160
+ name: "lodestar_gossip_block_elapsed_time_till_become_head_seconds",
1155
1161
  help: "Time elapsed between block slot time and the time block becomes head",
1156
1162
  buckets: [0.5, 1, 2, 4, 6, 12],
1157
1163
  }),
@@ -1169,11 +1175,6 @@ export function createLodestarMetrics(
1169
1175
  help: "Total number of imported blocks by source",
1170
1176
  labelNames: ["source"],
1171
1177
  }),
1172
- blobsBySource: register.gauge<{blobsSource: BlockInputSource}>({
1173
- name: "lodestar_import_blobs_by_source_total",
1174
- help: "Total number of imported blobs by source",
1175
- labelNames: ["blobsSource"],
1176
- }),
1177
1178
  notOverrideFcuReason: register.counter<{reason: NotReorgedReason}>({
1178
1179
  name: "lodestar_import_block_not_override_fcu_reason_total",
1179
1180
  help: "Reason why the fcu call is not suppressed during block import",
@@ -1337,8 +1338,67 @@ export function createLodestarMetrics(
1337
1338
  name: "lodestar_oppool_aggregated_attestation_pool_packed_attestations_missing_shuffling_committees_total",
1338
1339
  help: "Total number of committees skipped due to missing shuffling when producing packed attestations",
1339
1340
  }),
1341
+ attestationValue: register.counter<{source: "aggregate" | "single"}>({
1342
+ name: "lodestar_oppool_packed_attestation_value_total",
1343
+ help: "Sum of new seen effective balance increments times participation flag weight of packed attestations, by source",
1344
+ labelNames: ["source"],
1345
+ }),
1346
+ blockNewSeenAttesters: register.gauge({
1347
+ name: "lodestar_oppool_packed_attestations_block_new_seen_attesters",
1348
+ help: "Total number of new seen attesters across all packed attestations of the last produced block",
1349
+ }),
1350
+ singlesValueRatio: register.histogram({
1351
+ name: "lodestar_oppool_packed_attestations_singles_value_ratio",
1352
+ help: "Ratio of attestation value contributed by single attestations per produced block",
1353
+ buckets: [0, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1],
1354
+ }),
1355
+ singlesNewSeenAttesters: register.histogram({
1356
+ name: "lodestar_oppool_packed_attestations_singles_new_seen_attesters",
1357
+ help: "Number of attesters newly included only thanks to single attestations per produced block",
1358
+ buckets: [0, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 1024],
1359
+ }),
1360
+ singlesNewSeenAttestersByInclusionDistance: register.gauge<{inclusionDistance: number}>({
1361
+ name: "lodestar_oppool_packed_attestations_singles_new_seen_attesters_by_inclusion_distance",
1362
+ help: "Number of attesters newly included only thanks to single attestations in the last produced block, by inclusion distance",
1363
+ labelNames: ["inclusionDistance"],
1364
+ }),
1365
+ singlesNewSeenEffectiveBalance: register.histogram({
1366
+ name: "lodestar_oppool_packed_attestations_singles_new_seen_effective_balance",
1367
+ help: "Effective balance increments of attesters newly included only thanks to single attestations per produced block",
1368
+ buckets: [0, 32, 160, 320, 800, 1600, 3200, 8000, 32000],
1369
+ }),
1370
+ singlesOnlyConsolidations: register.histogram({
1371
+ name: "lodestar_oppool_packed_attestations_singles_only_consolidations",
1372
+ help: "Number of packed attestations built only from single attestations per produced block",
1373
+ buckets: [0, 1, 2, 4, 8],
1374
+ }),
1375
+ singlesFoldedCommittees: register.histogram({
1376
+ name: "lodestar_oppool_packed_attestations_singles_folded_committees",
1377
+ help: "Number of committees in packed attestations that received single attestations per produced block",
1378
+ buckets: [0, 1, 2, 4, 8, 16, 32, 64],
1379
+ }),
1340
1380
  },
1341
1381
  },
1382
+ singleAttestationPool: {
1383
+ size: register.gauge({
1384
+ name: "lodestar_oppool_single_attestation_pool_size",
1385
+ help: "Current number of single attestations in the SingleAttestationPool",
1386
+ }),
1387
+ gossipInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
1388
+ name: "lodestar_oppool_single_attestation_pool_gossip_insert_outcome_total",
1389
+ help: "Total number of InsertOutcome as a result of adding a single attestation from gossip to the SingleAttestationPool",
1390
+ labelNames: ["insertOutcome"],
1391
+ }),
1392
+ apiInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
1393
+ name: "lodestar_oppool_single_attestation_pool_api_insert_outcome_total",
1394
+ help: "Total number of InsertOutcome as a result of adding a single attestation from api to the SingleAttestationPool",
1395
+ labelNames: ["insertOutcome"],
1396
+ }),
1397
+ deletedByBlock: register.counter({
1398
+ name: "lodestar_oppool_single_attestation_pool_deleted_by_block_total",
1399
+ help: "Total number of single attestations deleted because a canonical block includes them",
1400
+ }),
1401
+ },
1342
1402
  attestationPool: {
1343
1403
  size: register.gauge({
1344
1404
  name: "lodestar_oppool_attestation_pool_size",
@@ -1487,6 +1547,17 @@ export function createLodestarMetrics(
1487
1547
  },
1488
1548
  },
1489
1549
 
1550
+ proposerTracker: {
1551
+ proposalSlots: register.gauge({
1552
+ name: "lodestar_proposer_tracker_proposal_slots",
1553
+ help: "Current number of upcoming block proposals of connected validators tracked by the ProposerTracker",
1554
+ }),
1555
+ collectableSlot: register.gauge({
1556
+ name: "lodestar_proposer_tracker_collectable_slot",
1557
+ help: "1 if single attestations of the clock slot are collected for an upcoming local proposal, 0 otherwise",
1558
+ }),
1559
+ },
1560
+
1490
1561
  chain: {
1491
1562
  blacklistedBlocks: register.gauge({
1492
1563
  name: "lodestar_blacklisted_blocks_total",
@@ -1524,7 +1595,7 @@ export function createLodestarMetrics(
1524
1595
  help: "Avg min max of all state cache items total read count",
1525
1596
  }),
1526
1597
  secondsSinceLastRead: register.avgMinMax({
1527
- name: "lodestar_state_cache_seconds_since_last_read",
1598
+ name: "lodestar_state_cache_since_last_read_seconds",
1528
1599
  help: "Avg min max of all state cache items seconds since last reads",
1529
1600
  }),
1530
1601
  stateClonedCount: register.histogram({
@@ -1593,7 +1664,7 @@ export function createLodestarMetrics(
1593
1664
  help: "Avg min max of all state cache items total read count",
1594
1665
  }),
1595
1666
  secondsSinceLastRead: register.avgMinMax({
1596
- name: "lodestar_cp_state_epoch_seconds_since_last_read",
1667
+ name: "lodestar_cp_state_epoch_since_last_read_seconds",
1597
1668
  help: "Avg min max of all state cache items seconds since last reads",
1598
1669
  }),
1599
1670
  stateClonedCount: register.histogram({
@@ -1611,7 +1682,7 @@ export function createLodestarMetrics(
1611
1682
  help: "Total number of states pruned from memory",
1612
1683
  }),
1613
1684
  statePersistSecFromSlot: register.histogram({
1614
- name: "lodestar_cp_state_cache_state_persist_seconds_from_slot",
1685
+ name: "lodestar_cp_state_cache_state_persist_from_slot_seconds",
1615
1686
  help: "Histogram of time to persist state to db since the clock slot",
1616
1687
  buckets: [0, 2, 4, 6, 8, 10, 12],
1617
1688
  }),
@@ -1639,7 +1710,7 @@ export function createLodestarMetrics(
1639
1710
  buckets: [0, 1, 2, 4, 8, 16, 32],
1640
1711
  }),
1641
1712
  stateReloadSecFromSlot: register.histogram({
1642
- name: "lodestar_cp_state_cache_state_reload_seconds_from_slot",
1713
+ name: "lodestar_cp_state_cache_state_reload_from_slot_seconds",
1643
1714
  help: "Histogram of time to load state from db since the clock slot",
1644
1715
  buckets: [0, 2, 4, 6, 8, 10, 12],
1645
1716
  }),
@@ -1783,11 +1854,6 @@ export function createLodestarMetrics(
1783
1854
  help: "Total number of duplicate blocks that pass validation and attempt to be cached but are known",
1784
1855
  labelNames: ["source"],
1785
1856
  }),
1786
- duplicateBlobCount: register.counter<{source: BlockInputSource}>({
1787
- name: "lodestar_seen_block_input_cache_duplicate_blob_total",
1788
- help: "Total number of duplicate blobs that pass validation and attempt to be cached but are known",
1789
- labelNames: ["source"],
1790
- }),
1791
1857
  duplicateColumnCount: register.counter<{source: BlockInputSource}>({
1792
1858
  name: "lodestar_seen_block_input_cache_duplicate_column_total",
1793
1859
  help: "Total number of duplicate columns that pass validation and attempt to be cached but are known",
@@ -1797,10 +1863,6 @@ export function createLodestarMetrics(
1797
1863
  name: "lodestar_seen_block_input_cache_items_created_by_block_total",
1798
1864
  help: "Number of BlockInputs created via a block being seen first",
1799
1865
  }),
1800
- createdByBlob: register.counter({
1801
- name: "lodestar_seen_block_input_cache_items_created_by_blob_total",
1802
- help: "Number of BlockInputs created via a blob being seen first",
1803
- }),
1804
1866
  createdByColumn: register.counter({
1805
1867
  name: "lodestar_seen_block_input_cache_items_created_by_column_total",
1806
1868
  help: "Number of BlockInputs created via a data column being seen first",
@@ -1854,7 +1916,7 @@ export function createLodestarMetrics(
1854
1916
  labelNames: ["entrypoint", "caller"],
1855
1917
  }),
1856
1918
  regenFnCallDuration: register.histogram<{entrypoint: RegenFnName; caller: RegenCaller}>({
1857
- name: "lodestar_regen_fn_call_duration",
1919
+ name: "lodestar_regen_fn_call_duration_seconds",
1858
1920
  help: "regen function duration",
1859
1921
  labelNames: ["entrypoint", "caller"],
1860
1922
  buckets: [0.1, 1, 10, 100],
@@ -44,16 +44,16 @@ export async function getHttpMetricsServer(
44
44
  ): Promise<void> {
45
45
  if (req.method === "GET" && req.url && req.url.includes("/metrics")) {
46
46
  const timer = scrapeTimeMetric.startTimer();
47
- const metricsRes = await Promise.all([wrapError(register.metrics()), getOtherMetrics()]);
48
- timer({status: metricsRes[0].err ? RequestStatus.error : RequestStatus.success});
47
+ const metricsRes = await wrapError(Promise.all([register.metrics(), getOtherMetrics()]));
48
+ timer({status: metricsRes.err ? RequestStatus.error : RequestStatus.success});
49
49
 
50
50
  // Ensure we only writeHead once
51
- if (metricsRes[0].err) {
52
- res.writeHead(500, {"content-type": "text/plain"}).end(metricsRes[0].err.stack);
51
+ if (metricsRes.err) {
52
+ res.writeHead(500, {"content-type": "text/plain"}).end(metricsRes.err.stack);
53
53
  } else {
54
54
  // Get scrape time metrics
55
55
  const httpServerMetrics = await httpServerRegister.metrics();
56
- const metrics = [metricsRes[0].result, httpServerMetrics, ...metricsRes[1]];
56
+ const metrics = [metricsRes.result[0], httpServerMetrics, ...metricsRes.result[1]];
57
57
  const metricsStr = metrics.join("\n\n");
58
58
  res.writeHead(200, {"content-type": register.contentType}).end(metricsStr);
59
59
  }
@@ -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
  }
@@ -8,8 +8,9 @@ import {BeaconConfig, ForkBoundary} from "@lodestar/config";
8
8
  import type {LoggerNode} from "@lodestar/logger/node";
9
9
  import {isForkPostFulu} from "@lodestar/params";
10
10
  import {ResponseIncoming} from "@lodestar/reqresp";
11
- import {Epoch, Status, fulu, sszTypesFor} from "@lodestar/types";
11
+ import {Epoch, Slot, Status, fulu, sszTypesFor} from "@lodestar/types";
12
12
  import {formatNodePeer} from "../../api/impl/node/utils.js";
13
+ import {GoodByeReasonCode} from "../../constants/index.js";
13
14
  import {RegistryMetricCreator} from "../../metrics/index.js";
14
15
  import {ClockEvent, IClock} from "../../util/clock.js";
15
16
  import {CustodyConfig} from "../../util/dataColumns.js";
@@ -332,6 +333,10 @@ export class NetworkCore implements INetworkCore {
332
333
  this.peerManager.reStatusPeers(peers);
333
334
  }
334
335
 
336
+ async goodbyeAndDisconnect(peer: PeerIdStr, reason: GoodByeReasonCode): Promise<void> {
337
+ await this.peerManager.goodbyeAndDisconnect(peerIdFromString(peer), reason);
338
+ }
339
+
335
340
  /**
336
341
  * Request att subnets up `toSlot`. Network will ensure to mantain some peers for each
337
342
  */
@@ -340,6 +345,11 @@ export class NetworkCore implements INetworkCore {
340
345
  if (subscriptions.length > 0) this.peerManager.onCommitteeSubscriptions();
341
346
  }
342
347
 
348
+ async addLocalProposalSlots(slots: Slot[]): Promise<void> {
349
+ // no peerManager.onCommitteeSubscriptions(): the extra subscription relies on connected peers, no discovery
350
+ this.attnetsService.addLocalProposalSlots(slots);
351
+ }
352
+
343
353
  async prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void> {
344
354
  this.syncnetsService.addCommitteeSubscriptions(subscriptions);
345
355
  if (subscriptions.length > 0) this.peerManager.onCommitteeSubscriptions();
@@ -136,8 +136,10 @@ const libp2pWorkerApi: NetworkWorkerApi = {
136
136
 
137
137
  prepareBeaconCommitteeSubnets: (subscriptions) => core.prepareBeaconCommitteeSubnets(subscriptions),
138
138
  prepareSyncCommitteeSubnets: (subscriptions) => core.prepareSyncCommitteeSubnets(subscriptions),
139
+ addLocalProposalSlots: (slots) => core.addLocalProposalSlots(slots),
139
140
  reportPeer: (peer, action, actionName) => core.reportPeer(peer, action, actionName),
140
141
  reStatusPeers: (peers) => core.reStatusPeers(peers),
142
+ goodbyeAndDisconnect: (peer, reason) => core.goodbyeAndDisconnect(peer, reason),
141
143
  subscribeGossipCoreTopics: () => core.subscribeGossipCoreTopics(),
142
144
  unsubscribeGossipCoreTopics: () => core.unsubscribeGossipCoreTopics(),
143
145
 
@@ -9,8 +9,9 @@ import {routes} from "@lodestar/api";
9
9
  import {BeaconConfig, chainConfigToJson} from "@lodestar/config";
10
10
  import type {LoggerNode} from "@lodestar/logger/node";
11
11
  import {ResponseIncoming, ResponseOutgoing} from "@lodestar/reqresp";
12
- import {Status} from "@lodestar/types";
12
+ import {Slot, Status} from "@lodestar/types";
13
13
  import {withTimeout} from "@lodestar/utils";
14
+ import {GoodByeReasonCode} from "../../constants/index.js";
14
15
  import {Metrics} from "../../metrics/index.js";
15
16
  import {AsyncIterableBridgeCaller, AsyncIterableBridgeHandler} from "../../util/asyncIterableToEvents.js";
16
17
  import {PeerIdStr, peerIdFromString} from "../../util/peerId.js";
@@ -205,6 +206,9 @@ export class WorkerNetworkCore implements INetworkCore {
205
206
  reStatusPeers(peers: PeerIdStr[]): Promise<void> {
206
207
  return this.getApi().reStatusPeers(peers);
207
208
  }
209
+ goodbyeAndDisconnect(peer: PeerIdStr, reason: GoodByeReasonCode): Promise<void> {
210
+ return this.getApi().goodbyeAndDisconnect(peer, reason);
211
+ }
208
212
  reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): Promise<void> {
209
213
  return this.getApi().reportPeer(peer, action, actionName);
210
214
  }
@@ -216,6 +220,9 @@ export class WorkerNetworkCore implements INetworkCore {
216
220
  prepareSyncCommitteeSubnets(subscriptions: CommitteeSubscription[]): Promise<void> {
217
221
  return this.getApi().prepareSyncCommitteeSubnets(subscriptions);
218
222
  }
223
+ addLocalProposalSlots(slots: Slot[]): Promise<void> {
224
+ return this.getApi().addLocalProposalSlots(slots);
225
+ }
219
226
  subscribeGossipCoreTopics(): Promise<void> {
220
227
  return this.getApi().subscribeGossipCoreTopics();
221
228
  }
@@ -4,7 +4,8 @@ import {routes} from "@lodestar/api";
4
4
  import {SpecJson} from "@lodestar/config";
5
5
  import {LoggerNodeOpts} from "@lodestar/logger/node";
6
6
  import {ResponseIncoming} from "@lodestar/reqresp";
7
- import {Status} from "@lodestar/types";
7
+ import {Slot, Status} from "@lodestar/types";
8
+ import {GoodByeReasonCode} from "../../constants/index.js";
8
9
  import {PeerIdStr} from "../../util/peerId.js";
9
10
  import {NetworkOptions} from "../options.js";
10
11
  import {PeerAction, PeerScoreStats} from "../peers/index.js";
@@ -53,6 +54,7 @@ export interface INetworkCore extends INetworkCorePublic {
53
54
  // Sync method
54
55
  reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): void;
55
56
  reStatusPeers(peers: PeerIdStr[]): Promise<void>;
57
+ goodbyeAndDisconnect(peer: PeerIdStr, reason: GoodByeReasonCode): Promise<void>;
56
58
 
57
59
  // TODO: Duplicated methods with INetwork interface
58
60
  getConnectedPeers(): Promise<PeerIdStr[]>;
@@ -60,6 +62,8 @@ export interface INetworkCore extends INetworkCorePublic {
60
62
 
61
63
  /** Chain must push status updates to the network core */
62
64
  updateStatus(status: Status): Promise<void>;
65
+ /** Block proposal slots of connected validators, used to subscribe to all attestation subnets before them */
66
+ addLocalProposalSlots(slots: Slot[]): Promise<void>;
63
67
 
64
68
  setTargetGroupCount(count: number): Promise<void>;
65
69
  /** Opens stream to handle ReqResp outgoing request */
@@ -109,6 +113,7 @@ export type NetworkWorkerApi = INetworkCorePublic & {
109
113
  getConnectedPeers(): Promise<PeerIdStr[]>;
110
114
  getConnectedPeerCount(): Promise<number>;
111
115
  updateStatus(status: Status): Promise<void>;
116
+ addLocalProposalSlots(slots: Slot[]): Promise<void>;
112
117
 
113
118
  setTargetGroupCount(count: number): Promise<void>;
114
119
 
@@ -25,7 +25,7 @@ import {getSlotDurations} from "@lodestar/state-transition";
25
25
  import {SubnetID} from "@lodestar/types";
26
26
  import {Logger, Map2d, Map2dArr} from "@lodestar/utils";
27
27
  import {RegistryMetricCreator} from "../../metrics/index.js";
28
- import {callInNextEventLoop} from "../../util/eventLoop.js";
28
+ import {callImmediate, callInNextEventLoop} from "../../util/eventLoop.js";
29
29
  import {NetworkEvent, NetworkEventBus, NetworkEventData} from "../events.js";
30
30
  import {Libp2p} from "../interface.js";
31
31
  import {NetworkConfig} from "../networkConfig.js";
@@ -108,6 +108,7 @@ type GossipSubInternal = GossipSub & {
108
108
  score: {score: (peerIdStr: string) => number};
109
109
  direct: Set<string>;
110
110
  topics: Map<string, Set<string>>;
111
+ streamsOutbound: ReadonlyMap<string, unknown>;
111
112
  start: () => Promise<void>;
112
113
  stop: () => Promise<void>;
113
114
  publish: (topic: TopicStr, data: Uint8Array, opts?: PublishOpts) => Promise<PublishResult>;
@@ -248,6 +249,16 @@ export class Eth2Gossipsub {
248
249
  return this.gossipsub.getMeshPeers(topic);
249
250
  }
250
251
 
252
+ getSubscribersWithOutboundStream(topic: GossipTopic): Set<string> {
253
+ const topicStr = stringifyGossipTopic(this.config, topic);
254
+ const peers = new Set<string>();
255
+ for (const peer of this.gossipsub.getSubscribers(topicStr)) {
256
+ const id = peer.toString();
257
+ if (this.gossipsub.streamsOutbound.has(id)) peers.add(id);
258
+ }
259
+ return peers;
260
+ }
261
+
251
262
  publish(topic: TopicStr, data: Uint8Array, opts?: PublishOpts): Promise<PublishResult> {
252
263
  return this.gossipsub.publish(topic, data, opts);
253
264
  }
@@ -403,10 +414,7 @@ export class Eth2Gossipsub {
403
414
  const clientAgent = this.peersData.getPeerKind(peerIdStr) ?? "Unknown";
404
415
  const clientVersion = this.peersData.getAgentVersion(peerIdStr);
405
416
 
406
- // Use setTimeout to yield to the macro queue
407
- // Without this we'll have huge event loop lag
408
- // See https://github.com/ChainSafe/lodestar/issues/5604
409
- callInNextEventLoop(() => {
417
+ const emitPendingMessage = (): void => {
410
418
  this.events.emit(NetworkEvent.pendingGossipsubMessage, {
411
419
  topic,
412
420
  msg,
@@ -418,7 +426,17 @@ export class Eth2Gossipsub {
418
426
  seenTimestampSec,
419
427
  startProcessUnixSec: null,
420
428
  });
421
- });
429
+ };
430
+
431
+ // Use setTimeout to yield to the macro queue
432
+ // Without this we'll have huge event loop lag
433
+ // See https://github.com/ChainSafe/lodestar/issues/5604
434
+ // A block arrives once per slot and cannot cause that lag, so it skips the 1ms timer delay
435
+ if (topic.type === GossipType.beacon_block) {
436
+ callImmediate(emitPendingMessage);
437
+ } else {
438
+ callInNextEventLoop(emitPendingMessage);
439
+ }
422
440
  }
423
441
 
424
442
  private onValidationResult(data: NetworkEventData[NetworkEvent.gossipMessageValidationResult]): void {
@@ -14,7 +14,6 @@ import {
14
14
  SubnetID,
15
15
  altair,
16
16
  capella,
17
- deneb,
18
17
  gloas,
19
18
  heze,
20
19
  phase0,
@@ -27,7 +26,6 @@ import {JobItemQueue} from "../../util/queue/index.js";
27
26
 
28
27
  export enum GossipType {
29
28
  beacon_block = "beacon_block",
30
- blob_sidecar = "blob_sidecar",
31
29
  data_column_sidecar = "data_column_sidecar",
32
30
  beacon_aggregate_and_proof = "beacon_aggregate_and_proof",
33
31
  beacon_attestation = "beacon_attestation",
@@ -64,7 +62,6 @@ export interface IGossipTopic {
64
62
 
65
63
  export type GossipTopicTypeMap = {
66
64
  [GossipType.beacon_block]: {type: GossipType.beacon_block};
67
- [GossipType.blob_sidecar]: {type: GossipType.blob_sidecar; subnet: SubnetID};
68
65
  [GossipType.data_column_sidecar]: {type: GossipType.data_column_sidecar; subnet: SubnetID};
69
66
  [GossipType.beacon_aggregate_and_proof]: {type: GossipType.beacon_aggregate_and_proof};
70
67
  [GossipType.beacon_attestation]: {type: GossipType.beacon_attestation; subnet: SubnetID};
@@ -100,7 +97,6 @@ export type SSZTypeOfGossipTopic<T extends GossipTopic> = T extends {type: infer
100
97
 
101
98
  export type GossipTypeMap = {
102
99
  [GossipType.beacon_block]: SignedBeaconBlock;
103
- [GossipType.blob_sidecar]: deneb.BlobSidecar;
104
100
  [GossipType.beacon_aggregate_and_proof]: SignedAggregateAndProof;
105
101
  [GossipType.beacon_attestation]: SingleAttestation;
106
102
  [GossipType.data_column_sidecar]: DataColumnSidecar;
@@ -121,7 +117,6 @@ export type GossipTypeMap = {
121
117
 
122
118
  export type GossipFnByType = {
123
119
  [GossipType.beacon_block]: (signedBlock: SignedBeaconBlock) => Promise<void> | void;
124
- [GossipType.blob_sidecar]: (blobSidecar: deneb.BlobSidecar) => Promise<void> | void;
125
120
  [GossipType.beacon_aggregate_and_proof]: (aggregateAndProof: SignedAggregateAndProof) => Promise<void> | void;
126
121
  [GossipType.beacon_attestation]: (attestation: SingleAttestation) => Promise<void> | void;
127
122
  [GossipType.data_column_sidecar]: (dataColumnSidecar: DataColumnSidecar) => Promise<void> | void;