@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
@@ -21,7 +21,6 @@ import {
21
21
  SubnetID,
22
22
  ValidatorIndex,
23
23
  altair,
24
- deneb,
25
24
  gloas,
26
25
  } from "@lodestar/types";
27
26
  import {
@@ -70,7 +69,6 @@ export type ValidatorMonitor = {
70
69
  balances?: number[]
71
70
  ): void;
72
71
  registerBeaconBlock(src: OpSource, delaySec: Seconds, block: BeaconBlock): void;
73
- registerBlobSidecar(src: OpSource, seenTimestampSec: Seconds, blob: deneb.BlobSidecar): void;
74
72
  registerExecutionPayloadEnvelope(
75
73
  src: OpSource,
76
74
  delaySec: Seconds,
@@ -434,10 +432,6 @@ export function createValidatorMonitor(
434
432
  }
435
433
  },
436
434
 
437
- registerBlobSidecar(_src, _seenTimestampSec, _blob) {
438
- //TODO: freetheblobs
439
- },
440
-
441
435
  registerExecutionPayloadEnvelope(_src, _delaySec, _envelope) {
442
436
  // TODO GLOAS: implement execution payload envelope monitoring
443
437
  },
@@ -1222,137 +1216,137 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
1222
1216
 
1223
1217
  return {
1224
1218
  validatorsConnected: register.gauge({
1225
- name: "validator_monitor_validators",
1219
+ name: "lodestar_validator_monitor_validators",
1226
1220
  help: "Count of validators that are specifically monitored by this beacon node",
1227
1221
  }),
1228
1222
 
1229
1223
  validatorsConnectedIndices: register.gauge<{indices: string}>({
1230
- name: "validator_monitor_indices",
1224
+ name: "lodestar_validator_monitor_indices",
1231
1225
  help: "Static metric with connected validator indices as label, value is always 1",
1232
1226
  labelNames: ["indices"],
1233
1227
  }),
1234
1228
 
1235
1229
  validatorsInSyncCommittee: register.gauge({
1236
- name: "validator_monitor_validators_in_sync_committee",
1230
+ name: "lodestar_validator_monitor_validators_in_sync_committee",
1237
1231
  help: "Count of validators monitored by this beacon node that are part of sync committee",
1238
1232
  }),
1239
1233
 
1240
1234
  // Validator Monitor Metrics (per-epoch summaries)
1241
1235
  prevEpochOnChainBalance: stateDerivedRegister?.gauge({
1242
- name: "validator_monitor_prev_epoch_on_chain_balance",
1236
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_balance",
1243
1237
  help: "Total balance of all monitored validators after an epoch",
1244
1238
  }),
1245
1239
  prevEpochOnChainAttesterHit: register.gauge({
1246
- name: "validator_monitor_prev_epoch_on_chain_attester_hit_total",
1240
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_attester_hit_total",
1247
1241
  help: "Incremented if validator's submitted attestation is included in some blocks",
1248
1242
  }),
1249
1243
  prevEpochOnChainAttesterMiss: register.gauge({
1250
- name: "validator_monitor_prev_epoch_on_chain_attester_miss_total",
1244
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_attester_miss_total",
1251
1245
  help: "Incremented if validator's submitted attestation is not included in any blocks",
1252
1246
  }),
1253
1247
  prevEpochOnChainSourceAttesterHit: stateDerivedRegister?.gauge({
1254
- name: "validator_monitor_prev_epoch_on_chain_source_attester_hit_total",
1248
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_source_attester_hit_total",
1255
1249
  help: "Incremented if the validator is flagged as a previous epoch source attester during per epoch processing",
1256
1250
  }),
1257
1251
  prevEpochOnChainSourceAttesterMiss: stateDerivedRegister?.gauge({
1258
- name: "validator_monitor_prev_epoch_on_chain_source_attester_miss_total",
1252
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_source_attester_miss_total",
1259
1253
  help: "Incremented if the validator is not flagged as a previous epoch source attester during per epoch processing",
1260
1254
  }),
1261
1255
  prevEpochOnChainHeadAttesterHit: stateDerivedRegister?.gauge({
1262
- name: "validator_monitor_prev_epoch_on_chain_head_attester_hit_total",
1256
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_head_attester_hit_total",
1263
1257
  help: "Incremented if the validator is flagged as a previous epoch head attester during per epoch processing",
1264
1258
  }),
1265
1259
  prevEpochOnChainHeadAttesterMiss: stateDerivedRegister?.gauge({
1266
- name: "validator_monitor_prev_epoch_on_chain_head_attester_miss_total",
1260
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_head_attester_miss_total",
1267
1261
  help: "Incremented if the validator is not flagged as a previous epoch head attester during per epoch processing",
1268
1262
  }),
1269
1263
  prevOnChainAttesterCorrectHead: register.gauge({
1270
- name: "validator_monitor_prev_epoch_on_chain_attester_correct_head_total",
1264
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_attester_correct_head_total",
1271
1265
  help: "Total count of times a validator votes correct head",
1272
1266
  }),
1273
1267
  prevOnChainAttesterIncorrectHead: register.gauge({
1274
- name: "validator_monitor_prev_epoch_on_chain_attester_incorrect_head_total",
1268
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_attester_incorrect_head_total",
1275
1269
  help: "Total count of times a validator votes incorrect head",
1276
1270
  }),
1277
1271
  prevEpochOnChainTargetAttesterHit: stateDerivedRegister?.gauge({
1278
- name: "validator_monitor_prev_epoch_on_chain_target_attester_hit_total",
1272
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_target_attester_hit_total",
1279
1273
  help: "Incremented if the validator is flagged as a previous epoch target attester during per epoch processing",
1280
1274
  }),
1281
1275
  prevEpochOnChainTargetAttesterMiss: stateDerivedRegister?.gauge({
1282
- name: "validator_monitor_prev_epoch_on_chain_target_attester_miss_total",
1276
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_target_attester_miss_total",
1283
1277
  help: "Incremented if the validator is not flagged as a previous epoch target attester during per epoch processing",
1284
1278
  }),
1285
1279
  prevEpochOnChainInclusionDistance: register.histogram({
1286
- name: "validator_monitor_prev_epoch_on_chain_inclusion_distance",
1280
+ name: "lodestar_validator_monitor_prev_epoch_on_chain_inclusion_distance",
1287
1281
  help: "The attestation inclusion distance calculated during per epoch processing",
1288
1282
  // min inclusion distance is 1, usual values are 1,2,3 max is 32 (1 epoch)
1289
1283
  buckets: [1, 2, 3, 5, 10, 32],
1290
1284
  }),
1291
1285
  prevEpochAttestations: register.histogram({
1292
- name: "validator_monitor_prev_epoch_attestations",
1286
+ name: "lodestar_validator_monitor_prev_epoch_attestations",
1293
1287
  help: "The number of unagg. attestations seen in the previous epoch",
1294
1288
  buckets: [0, 1, 2, 3],
1295
1289
  }),
1296
1290
  prevEpochAttestationsMinDelaySeconds: register.histogram({
1297
- name: "validator_monitor_prev_epoch_attestations_min_delay_seconds",
1291
+ name: "lodestar_validator_monitor_prev_epoch_attestations_min_delay_seconds",
1298
1292
  help: "The min delay between when the validator should send the attestation and when it was received",
1299
1293
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1300
1294
  }),
1301
1295
  prevEpochAttestationAggregateInclusions: register.histogram({
1302
- name: "validator_monitor_prev_epoch_attestation_aggregate_inclusions",
1296
+ name: "lodestar_validator_monitor_prev_epoch_attestation_aggregate_inclusions",
1303
1297
  help: "The count of times an attestation was seen inside an aggregate",
1304
1298
  buckets: [0, 1, 2, 3, 5, 10],
1305
1299
  }),
1306
1300
  prevEpochAttestationBlockInclusions: register.histogram({
1307
- name: "validator_monitor_prev_epoch_attestation_block_inclusions",
1301
+ name: "lodestar_validator_monitor_prev_epoch_attestation_block_inclusions",
1308
1302
  help: "The count of times an attestation was seen inside a block",
1309
1303
  buckets: [0, 1, 2, 3, 5],
1310
1304
  }),
1311
1305
  prevEpochAttestationBlockMinInclusionDistance: register.histogram({
1312
- name: "validator_monitor_prev_epoch_attestation_block_min_inclusion_distance",
1306
+ name: "lodestar_validator_monitor_prev_epoch_attestation_block_min_inclusion_distance",
1313
1307
  help: "The minimum inclusion distance observed for the inclusion of an attestation in a block",
1314
1308
  buckets: [1, 2, 3, 5, 10, 32],
1315
1309
  }),
1316
1310
  prevEpochBeaconBlocks: register.histogram({
1317
- name: "validator_monitor_prev_epoch_beacon_blocks",
1311
+ name: "lodestar_validator_monitor_prev_epoch_beacon_blocks",
1318
1312
  help: "The number of beacon_blocks seen in the previous epoch",
1319
1313
  buckets: [0, 1, 2, 3, 5, 10],
1320
1314
  }),
1321
1315
  prevEpochBeaconBlocksMinDelaySeconds: register.histogram({
1322
- name: "validator_monitor_prev_epoch_beacon_blocks_min_delay_seconds",
1316
+ name: "lodestar_validator_monitor_prev_epoch_beacon_blocks_min_delay_seconds",
1323
1317
  help: "The min delay between when the validator should send the block and when it was received",
1324
1318
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1325
1319
  }),
1326
1320
  prevEpochAggregatesTotal: register.histogram({
1327
- name: "validator_monitor_prev_epoch_aggregates",
1321
+ name: "lodestar_validator_monitor_prev_epoch_aggregates",
1328
1322
  help: "The number of aggregates seen in the previous epoch",
1329
1323
  buckets: [0, 1, 2, 3, 5, 10],
1330
1324
  }),
1331
1325
  prevEpochAggregatesMinDelaySeconds: register.histogram({
1332
- name: "validator_monitor_prev_epoch_aggregates_min_delay_seconds",
1326
+ name: "lodestar_validator_monitor_prev_epoch_aggregates_min_delay_seconds",
1333
1327
  help: "The min delay between when the validator should send the aggregate and when it was received",
1334
1328
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1335
1329
  }),
1336
1330
  prevEpochSyncCommitteeHits: register.gauge({
1337
- name: "validator_monitor_prev_epoch_sync_committee_hits",
1331
+ name: "lodestar_validator_monitor_prev_epoch_sync_committee_hits",
1338
1332
  help: "Count of times in prev epoch connected validators participated in imported block's syncAggregate",
1339
1333
  }),
1340
1334
  prevEpochSyncCommitteeMisses: register.gauge({
1341
- name: "validator_monitor_prev_epoch_sync_committee_misses",
1335
+ name: "lodestar_validator_monitor_prev_epoch_sync_committee_misses",
1342
1336
  help: "Count of times in prev epoch connected validators fail to participate in imported block's syncAggregate",
1343
1337
  }),
1344
1338
  prevEpochSyncSignatureAggregateInclusions: register.histogram({
1345
- name: "validator_monitor_prev_epoch_sync_signature_aggregate_inclusions",
1339
+ name: "lodestar_validator_monitor_prev_epoch_sync_signature_aggregate_inclusions",
1346
1340
  help: "The count of times a sync signature was seen inside an aggregate",
1347
1341
  buckets: [0, 1, 2, 3, 5, 10],
1348
1342
  }),
1349
1343
  prevEpochAttestationSummary: register.gauge<{summary: string}>({
1350
- name: "validator_monitor_prev_epoch_attestation_summary",
1344
+ name: "lodestar_validator_monitor_prev_epoch_attestation_summary",
1351
1345
  help: "Best guess of the node of the result of previous epoch validators attestation actions and causality",
1352
1346
  labelNames: ["summary"],
1353
1347
  }),
1354
1348
  prevEpochBlockProposalSummary: register.gauge<{summary: string}>({
1355
- name: "validator_monitor_prev_epoch_block_proposal_summary",
1349
+ name: "lodestar_validator_monitor_prev_epoch_block_proposal_summary",
1356
1350
  help: "Best guess of the node of the result of previous epoch validators block proposal actions and causality",
1357
1351
  labelNames: ["summary"],
1358
1352
  }),
@@ -1360,18 +1354,18 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
1360
1354
  // Validator Monitor Metrics (real-time)
1361
1355
 
1362
1356
  unaggregatedAttestationTotal: register.gauge<{src: OpSource}>({
1363
- name: "validator_monitor_unaggregated_attestation_total",
1357
+ name: "lodestar_validator_monitor_unaggregated_attestation_total",
1364
1358
  help: "Number of unaggregated attestations seen",
1365
1359
  labelNames: ["src"],
1366
1360
  }),
1367
1361
  unaggregatedAttestationDelaySeconds: register.histogram<{src: OpSource}>({
1368
- name: "validator_monitor_unaggregated_attestation_delay_seconds",
1362
+ name: "lodestar_validator_monitor_unaggregated_attestation_delay_seconds",
1369
1363
  help: "The delay between when the validator should send the attestation and when it was received",
1370
1364
  labelNames: ["src"],
1371
1365
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1372
1366
  }),
1373
1367
  unaggregatedAttestationSubmittedSentPeers: register.histogram({
1374
- name: "validator_monitor_unaggregated_attestation_submitted_sent_peers_count",
1368
+ name: "lodestar_validator_monitor_unaggregated_attestation_submitted_sent_peers_count",
1375
1369
  help: "Number of peers that an unaggregated attestation sent to",
1376
1370
  // as of Apr 2022, most of the time we sent to >30 peers per attestations
1377
1371
  // these bucket values just base on that fact to get equal range
@@ -1379,52 +1373,52 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
1379
1373
  buckets: [0, 10, 20, 30],
1380
1374
  }),
1381
1375
  aggregatedAttestationTotal: register.gauge<{src: OpSource}>({
1382
- name: "validator_monitor_aggregated_attestation_total",
1376
+ name: "lodestar_validator_monitor_aggregated_attestation_total",
1383
1377
  help: "Number of aggregated attestations seen",
1384
1378
  labelNames: ["src"],
1385
1379
  }),
1386
1380
  aggregatedAttestationDelaySeconds: register.histogram<{src: OpSource}>({
1387
- name: "validator_monitor_aggregated_attestation_delay_seconds",
1381
+ name: "lodestar_validator_monitor_aggregated_attestation_delay_seconds",
1388
1382
  help: "The delay between then the validator should send the aggregate and when it was received",
1389
1383
  labelNames: ["src"],
1390
1384
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1391
1385
  }),
1392
1386
  attestationInAggregateTotal: register.gauge<{src: OpSource}>({
1393
- name: "validator_monitor_attestation_in_aggregate_total",
1387
+ name: "lodestar_validator_monitor_attestation_in_aggregate_total",
1394
1388
  help: "Number of times an attestation has been seen in an aggregate",
1395
1389
  labelNames: ["src"],
1396
1390
  }),
1397
1391
  attestationInAggregateDelaySeconds: register.histogram<{src: OpSource}>({
1398
- name: "validator_monitor_attestation_in_aggregate_delay_seconds",
1392
+ name: "lodestar_validator_monitor_attestation_in_aggregate_delay_seconds",
1399
1393
  help: "The delay between when the validator should send the aggregate and when it was received",
1400
1394
  labelNames: ["src"],
1401
1395
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1402
1396
  }),
1403
1397
  attestationInBlockTotal: register.gauge({
1404
- name: "validator_monitor_attestation_in_block_total",
1398
+ name: "lodestar_validator_monitor_attestation_in_block_total",
1405
1399
  help: "Number of times an attestation has been seen in a block",
1406
1400
  }),
1407
1401
  attestationInBlockDelaySlots: register.histogram({
1408
- name: "validator_monitor_attestation_in_block_delay_slots",
1402
+ name: "lodestar_validator_monitor_attestation_in_block_delay_slots",
1409
1403
  help: "The excess slots (beyond the minimum delay) between the attestation slot and the block slot",
1410
1404
  buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
1411
1405
  }),
1412
1406
  attestationInBlockParticipants: register.histogram({
1413
- name: "validator_monitor_attestation_in_block_participants",
1407
+ name: "lodestar_validator_monitor_attestation_in_block_participants",
1414
1408
  help: "The total participants in attestations of monitored validators included in blocks",
1415
1409
  buckets: [1, 5, 20, 50, 100, 200],
1416
1410
  }),
1417
1411
  syncSignatureInAggregateTotal: register.gauge({
1418
- name: "validator_monitor_sync_signature_in_aggregate_total",
1412
+ name: "lodestar_validator_monitor_sync_signature_in_aggregate_total",
1419
1413
  help: "Number of times a sync signature has been seen in an aggregate",
1420
1414
  }),
1421
1415
  beaconBlockTotal: register.gauge<{src: OpSource}>({
1422
- name: "validator_monitor_beacon_block_total",
1416
+ name: "lodestar_validator_monitor_beacon_block_total",
1423
1417
  help: "Total number of beacon blocks seen",
1424
1418
  labelNames: ["src"],
1425
1419
  }),
1426
1420
  beaconBlockDelaySeconds: register.histogram<{src: OpSource}>({
1427
- name: "validator_monitor_beacon_block_delay_seconds",
1421
+ name: "lodestar_validator_monitor_beacon_block_delay_seconds",
1428
1422
  help: "The delay between when the validator should send the block and when it was received",
1429
1423
  labelNames: ["src"],
1430
1424
  // we also want other nodes to received our published before 4s so add bucket 3 and 3.5
@@ -1433,7 +1427,7 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
1433
1427
 
1434
1428
  // Only for known
1435
1429
  proposerBalanceDeltaKnown: register.histogram({
1436
- name: "validator_monitor_proposer_balance_delta_known_gwei",
1430
+ name: "lodestar_validator_monitor_proposer_balance_delta_known_gwei",
1437
1431
  help: "Balance delta of known block proposer after importing a valid block",
1438
1432
  // Jul22 mainnet block reward is consistently between 29,000,000-28,000,000 GWei
1439
1433
  buckets: [10_000, 100_000, 1e6, 10e6, 20e6, 50e6, 100e6, 1000e6],
@@ -22,7 +22,8 @@ export interface IDataColumnStore {
22
22
  getManyBinary(key: DataColumnKey, indices: ColumnIndex[]): Promise<(Uint8Array | undefined)[]>;
23
23
  putManyBinary(key: DataColumnKey, columns: IndexedDataColumnBytes[]): Promise<void>;
24
24
  deleteMany(keys: DataColumnKey[]): Promise<void>;
25
- pruneBefore(slot: Slot): Promise<Slot[]>;
25
+ /** Prunes the oldest slots before `slot`, at most `maxSlots` of them per backing store. Returns the pruned slots. */
26
+ pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]>;
26
27
  }
27
28
 
28
29
  /**
@@ -84,9 +85,9 @@ export class LegacyDataColumnStore implements IDataColumnStore {
84
85
  await this.legacyHot.deleteMany(keys.map(({blockRoot}) => fromHex(blockRoot)));
85
86
  }
86
87
 
87
- async pruneBefore(slot: Slot): Promise<Slot[]> {
88
- const flatFileSlots = await this.flatFiles.pruneBefore(slot);
89
- const slots = await this.legacyArchive.pruneBefore(slot);
88
+ async pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]> {
89
+ const flatFileSlots = await this.flatFiles.pruneBefore(slot, maxSlots);
90
+ const slots = await this.legacyArchive.pruneBefore(slot, maxSlots);
90
91
  return [...new Set([...flatFileSlots, ...slots])].sort((a, b) => a - b);
91
92
  }
92
93
  }
@@ -1,4 +1,4 @@
1
- import fs from "node:fs";
1
+ import {type FileHandle, open, readFile, rm} from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import {ChainForkConfig} from "@lodestar/config";
4
4
  import {ForkPostFulu} from "@lodestar/params";
@@ -161,25 +161,26 @@ export class FlatFileStore implements IFlatFileStore {
161
161
  }
162
162
  }
163
163
 
164
- async pruneBefore(minSlot: Slot): Promise<Slot[]> {
164
+ async pruneBefore(minSlot: Slot, maxSlots = Infinity): Promise<Slot[]> {
165
165
  return observeFlatFileStoreOperation(this.metrics, FlatFileStoreOperation.prune, async () => {
166
166
  this.minRetainedSlot = Math.max(this.minRetainedSlot, minSlot);
167
- const slotsToPrune = new Set(this.slotIndex.getBefore(this.minRetainedSlot));
167
+ const expiredSlots = new Set(this.slotIndex.getBefore(this.minRetainedSlot));
168
168
  for (const slot of this.mutationLocks.keys()) {
169
- if (slot < this.minRetainedSlot) slotsToPrune.add(slot);
169
+ if (slot < this.minRetainedSlot) expiredSlots.add(slot);
170
170
  }
171
+ const slotsToPrune = [...expiredSlots].sort((a, b) => a - b).slice(0, maxSlots);
171
172
 
172
173
  for (const slot of slotsToPrune) {
173
174
  const release = await this.acquireMutationLock(slot);
174
175
  try {
175
- await fs.promises.rm(path.join(this.dataColumnDir, padSlot(slot)), {recursive: true, force: true});
176
+ await rm(path.join(this.dataColumnDir, padSlot(slot)), {recursive: true, force: true});
176
177
  this.slotIndex.remove(slot);
177
178
  this.metrics?.prunedDirectories.inc();
178
179
  } finally {
179
180
  release();
180
181
  }
181
182
  }
182
- return [...slotsToPrune].sort((a, b) => a - b);
183
+ return slotsToPrune;
183
184
  });
184
185
  }
185
186
 
@@ -212,7 +213,7 @@ export class FlatFileStore implements IFlatFileStore {
212
213
 
213
214
  private async readFile(slot: Slot, rootHex: RootHex): Promise<Uint8Array | null> {
214
215
  try {
215
- return await fs.promises.readFile(this.filePath(slot, rootHex));
216
+ return await readFile(this.filePath(slot, rootHex));
216
217
  } catch (e) {
217
218
  if (!isFsNotFoundError(e)) throw e;
218
219
  return null;
@@ -224,9 +225,9 @@ export class FlatFileStore implements IFlatFileStore {
224
225
  rootHex: RootHex,
225
226
  indices: number[]
226
227
  ): Promise<(Uint8Array | undefined)[] | null> {
227
- let fd: fs.promises.FileHandle;
228
+ let fd: FileHandle;
228
229
  try {
229
- fd = await fs.promises.open(this.filePath(slot, rootHex), "r");
230
+ fd = await open(this.filePath(slot, rootHex), "r");
230
231
  } catch (e) {
231
232
  if (!isFsNotFoundError(e)) throw e;
232
233
  return null;
@@ -270,7 +271,7 @@ export class FlatFileStore implements IFlatFileStore {
270
271
  await observeFlatFileStoreOperation(this.metrics, FlatFileStoreOperation.delete, async () => {
271
272
  const release = await this.acquireMutationLock(slot);
272
273
  try {
273
- await fs.promises.rm(this.filePath(slot, rootHex), {force: true});
274
+ await rm(this.filePath(slot, rootHex), {force: true});
274
275
  } finally {
275
276
  release();
276
277
  }
@@ -294,7 +295,7 @@ function validateDcolHeader(header: DcolHeader, slot: Slot, rootHex: RootHex): v
294
295
  }
295
296
  }
296
297
 
297
- async function readExactly(fd: fs.promises.FileHandle, buffer: Uint8Array, position: number): Promise<void> {
298
+ async function readExactly(fd: FileHandle, buffer: Uint8Array, position: number): Promise<void> {
298
299
  let totalRead = 0;
299
300
  while (totalRead < buffer.length) {
300
301
  const {bytesRead} = await fd.read(buffer, totalRead, buffer.length - totalRead, position + totalRead);
@@ -17,5 +17,6 @@ export interface IFlatFileStore {
17
17
  putDataColumnsBinary(slot: Slot, blockRoot: RootHex, columns: {index: number; data: Uint8Array}[]): Promise<void>;
18
18
 
19
19
  deleteMany(items: {slot: Slot; blockRoot: RootHex}[]): Promise<void>;
20
- pruneBefore(slot: Slot): Promise<Slot[]>;
20
+ /** Prunes the oldest slots before `slot`, at most `maxSlots` of them. Returns the pruned slots. */
21
+ pruneBefore(slot: Slot, maxSlots?: number): Promise<Slot[]>;
21
22
  }
@@ -1,4 +1,5 @@
1
- import fs from "node:fs";
1
+ import type {Dirent} from "node:fs";
2
+ import {readdir} from "node:fs/promises";
2
3
  import {Slot} from "@lodestar/types";
3
4
  import {isFsNotFoundError} from "./errors.js";
4
5
  import {padSlot} from "./path.js";
@@ -33,9 +34,9 @@ export class SlotIndex {
33
34
 
34
35
  async rebuildFromDisk(columnsDir: string): Promise<SlotIndexRebuildStats> {
35
36
  this.slots.clear();
36
- let entries: fs.Dirent[];
37
+ let entries: Dirent[];
37
38
  try {
38
- entries = await fs.promises.readdir(columnsDir, {withFileTypes: true});
39
+ entries = await readdir(columnsDir, {withFileTypes: true});
39
40
  } catch (e) {
40
41
  if (!isFsNotFoundError(e)) throw e;
41
42
  return {slots: 0, ignoredEntries: 0};
@@ -14,7 +14,6 @@ export const blobSidecarsWrapperSsz = new ContainerType(
14
14
  );
15
15
 
16
16
  export type BlobSidecarsWrapper = ValueOf<typeof blobSidecarsWrapperSsz>;
17
- export const BLOB_SIDECARS_IN_WRAPPER_INDEX = 44;
18
17
 
19
18
  /**
20
19
  * blobSidecarsWrapper by block root (= hash_tree_root(SignedBeaconBlock.message))
@@ -76,18 +76,28 @@ export class DataColumnSidecarArchiveRepository extends PrefixedRepository<Slot,
76
76
  /**
77
77
  * Deletes all entries before `slot`. Prunes only delete from the start of the bucket, so the first prune
78
78
  * compacts the range to drop tombstones of earlier runs and later prunes resume where the previous one ended.
79
+ * Prunes at most `maxSlots` slots, the oldest first.
79
80
  */
80
- async pruneBefore(slot: Slot): Promise<Slot[]> {
81
+ async pruneBefore(slot: Slot, maxSlots = Infinity): Promise<Slot[]> {
81
82
  if (this.prunedBeforeSlot === null) {
82
83
  await this.db.compactRange(this.wrapKey(this.getMinKeyRaw(0)), this.wrapKey(this.getMinKeyRaw(slot)));
83
84
  } else if (slot <= this.prunedBeforeSlot) {
84
85
  return [];
85
86
  }
86
87
 
87
- const keys = await this.keys({gte: {prefix: this.prunedBeforeSlot ?? 0, id: 0}, lt: {prefix: slot, id: 0}});
88
- const slots = [...new Set(keys.map(({prefix}) => prefix))];
88
+ // A slot holds at most NUMBER_OF_COLUMNS keys, so this many keys cover at least `maxSlots` slots
89
+ const maxKeys = maxSlots * NUMBER_OF_COLUMNS;
90
+ const keys = await this.keys({
91
+ gte: {prefix: this.prunedBeforeSlot ?? 0, id: 0},
92
+ lt: {prefix: slot, id: 0},
93
+ ...(Number.isFinite(maxKeys) && {limit: maxKeys}),
94
+ });
95
+ const expiredSlots = [...new Set(keys.map(({prefix}) => prefix))];
96
+ const slots = expiredSlots.slice(0, maxSlots);
89
97
  if (slots.length > 0) await this.deleteMany(slots);
90
- this.prunedBeforeSlot = slot;
98
+ const isCapped = expiredSlots.length > maxSlots || keys.length === maxKeys;
99
+ const lastPrunedSlot = slots.at(-1);
100
+ this.prunedBeforeSlot = isCapped && lastPrunedSlot !== undefined ? lastPrunedSlot + 1 : slot;
91
101
  return slots;
92
102
  }
93
103
  }
@@ -19,21 +19,20 @@ import {IClock} from "../../util/clock.js";
19
19
  * Additional duration to account for potential event loop lag which causes
20
20
  * builder bids to be rejected even though the response was sent in time.
21
21
  */
22
- const EVENT_LOOP_LAG_BUFFER = 250;
22
+ export const BUILDER_BID_LAG_BUFFER_MS = 250;
23
23
 
24
24
  /**
25
- * Duration given to a builder to provide a `SignedExecutionPayloadBid` before the deadline
26
- * is reached, advertised on each bid request via the `X-Timeout-Ms` header. The p2p bid is
27
- * selected after the same duration, only considering bids received up to that point.
25
+ * Default duration given to a builder to provide a `SignedExecutionPayloadBid` before the deadline
26
+ * is reached, advertised on each bid request via the `X-Timeout-Ms` header. Bids received via
27
+ * p2p are given the same time to bid up.
28
28
  */
29
- export const BUILDER_BID_DEADLINE_MS = 500;
30
-
31
- /** Local timeout for bid requests, event loop lag must not discard bids that arrived in time */
32
- export const BUILDER_BID_REQUEST_TIMEOUT_MS = BUILDER_BID_DEADLINE_MS + EVENT_LOOP_LAG_BUFFER;
29
+ export const DEFAULT_BUILDER_BID_DEADLINE_MS = 500;
33
30
 
34
31
  export type BuilderApiClientOpts = {
35
- /** Timeout for builder api requests, bid requests always use `BUILDER_BID_REQUEST_TIMEOUT_MS` */
32
+ /** Timeout for builder api requests, bid requests are bounded by `bidDeadline` instead */
36
33
  timeout?: number;
34
+ /** Time builders are given to provide a bid once block production starts, in milliseconds */
35
+ bidDeadline?: number;
37
36
  // Add User-Agent header to all requests
38
37
  userAgent?: string;
39
38
  };
@@ -69,6 +68,7 @@ export type BuilderApiBid = {
69
68
  * each block production request, clients are dialed on demand based on the entry `url`.
70
69
  */
71
70
  export class BuilderApiClient {
71
+ readonly bidDeadline: number;
72
72
  private readonly clients = new Map<BuilderUrl, BuilderApi>();
73
73
 
74
74
  constructor(
@@ -78,7 +78,9 @@ export class BuilderApiClient {
78
78
  private readonly bls: IBlsVerifier,
79
79
  private readonly metrics: Metrics | null = null,
80
80
  private readonly logger?: Logger
81
- ) {}
81
+ ) {
82
+ this.bidDeadline = opts.bidDeadline ?? DEFAULT_BUILDER_BID_DEADLINE_MS;
83
+ }
82
84
 
83
85
  /**
84
86
  * Fan out bid requests to the builders named by the entries, one request per unique
@@ -139,9 +141,10 @@ export class BuilderApiClient {
139
141
  proposerPubkey,
140
142
  requestAuth: entry.auth,
141
143
  dateMilliseconds: Date.now(),
142
- timeoutMs: BUILDER_BID_DEADLINE_MS,
144
+ timeoutMs: this.bidDeadline,
143
145
  },
144
- {timeoutMs: BUILDER_BID_REQUEST_TIMEOUT_MS}
146
+ // Event loop lag must not discard bids that arrived in time
147
+ {timeoutMs: this.bidDeadline + BUILDER_BID_LAG_BUFFER_MS}
145
148
  );
146
149
  const signedBid = res.value();
147
150
  if (signedBid === undefined) {
@@ -203,7 +206,7 @@ export class BuilderApiClient {
203
206
 
204
207
  /**
205
208
  * Establish the connection to every known builder outside the bid deadline, a cold TCP/TLS handshake
206
- * to a distant builder can exhaust `BUILDER_BID_DEADLINE_MS` on its own, and a long idle connection
209
+ * to a distant builder can exhaust the bid deadline on its own, and a long idle connection
207
210
  * may be half-open and only fail once written to.
208
211
  */
209
212
  async checkStatus(): Promise<void> {
@@ -20,6 +20,7 @@ import {
20
20
  } from "@lodestar/types";
21
21
  import {toPrintableUrl} from "@lodestar/utils";
22
22
  import {Metrics} from "../../metrics/metrics.js";
23
+ import {DEFAULT_BUILDER_BID_DEADLINE_MS} from "./apiClient.js";
23
24
  import {ValidatorRegistration, ValidatorRegistrationCache} from "./cache.js";
24
25
  import {IExecutionBuilder} from "./interface.js";
25
26
 
@@ -29,6 +30,8 @@ export type ExecutionBuilderHttpOpts = {
29
30
  timeout?: number;
30
31
  faultInspectionWindow?: number;
31
32
  allowedFaults?: number;
33
+ /** Post-gloas only, time builders are given to provide a bid once block production starts, in milliseconds */
34
+ bidDeadline?: number;
32
35
 
33
36
  // Only required for merge-mock runs, no need to expose it to cli
34
37
  issueLocalFcUWithFeeRecipient?: string;
@@ -40,6 +43,7 @@ export const defaultExecutionBuilderHttpOpts: ExecutionBuilderHttpOpts = {
40
43
  enabled: false,
41
44
  url: "http://localhost:8661",
42
45
  timeout: 12000,
46
+ bidDeadline: DEFAULT_BUILDER_BID_DEADLINE_MS,
43
47
  };
44
48
 
45
49
  export enum BuilderStatus {