@lodestar/beacon-node 1.50.1 → 1.51.0-dev.0586e6e617

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 (503) hide show
  1. package/lib/api/impl/api.js +1 -1
  2. package/lib/api/impl/api.js.map +1 -1
  3. package/lib/api/impl/beacon/blocks/index.d.ts +2 -1
  4. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/blocks/index.js +36 -36
  6. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  7. package/lib/api/impl/beacon/index.d.ts +2 -1
  8. package/lib/api/impl/beacon/index.d.ts.map +1 -1
  9. package/lib/api/impl/beacon/index.js +2 -2
  10. package/lib/api/impl/beacon/index.js.map +1 -1
  11. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  12. package/lib/api/impl/beacon/pool/index.js +5 -2
  13. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  14. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  15. package/lib/api/impl/beacon/state/index.js +8 -2
  16. package/lib/api/impl/beacon/state/index.js.map +1 -1
  17. package/lib/api/impl/beacon/state/utils.d.ts +3 -2
  18. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  19. package/lib/api/impl/beacon/state/utils.js +17 -9
  20. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  21. package/lib/api/impl/debug/index.d.ts.map +1 -1
  22. package/lib/api/impl/debug/index.js +3 -0
  23. package/lib/api/impl/debug/index.js.map +1 -1
  24. package/lib/api/impl/validator/index.d.ts.map +1 -1
  25. package/lib/api/impl/validator/index.js +136 -27
  26. package/lib/api/impl/validator/index.js.map +1 -1
  27. package/lib/api/options.d.ts +2 -0
  28. package/lib/api/options.d.ts.map +1 -1
  29. package/lib/api/options.js +1 -0
  30. package/lib/api/options.js.map +1 -1
  31. package/lib/chain/ColumnReconstructionTracker.d.ts +11 -13
  32. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  33. package/lib/chain/ColumnReconstructionTracker.js +49 -44
  34. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  35. package/lib/chain/GetBlobsTracker.d.ts +11 -0
  36. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  37. package/lib/chain/GetBlobsTracker.js +85 -27
  38. package/lib/chain/GetBlobsTracker.js.map +1 -1
  39. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  40. package/lib/chain/archiveStore/archiveStore.js +1 -0
  41. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  42. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +4 -0
  43. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  44. package/lib/chain/archiveStore/utils/archiveBlocks.js +63 -100
  45. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  46. package/lib/chain/blocks/blockInput/blockInput.d.ts +1 -1
  47. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  48. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  49. package/lib/chain/blocks/blockInput/utils.js +2 -2
  50. package/lib/chain/blocks/blockInput/utils.js.map +1 -1
  51. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  52. package/lib/chain/blocks/importBlock.js +16 -11
  53. package/lib/chain/blocks/importBlock.js.map +1 -1
  54. package/lib/chain/blocks/importExecutionPayload.d.ts +6 -11
  55. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  56. package/lib/chain/blocks/importExecutionPayload.js +58 -17
  57. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  58. package/lib/chain/blocks/index.js +2 -2
  59. package/lib/chain/blocks/index.js.map +1 -1
  60. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +12 -9
  61. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
  62. package/lib/chain/blocks/payloadEnvelopeProcessor.js +24 -19
  63. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  64. package/lib/chain/blocks/types.d.ts +4 -0
  65. package/lib/chain/blocks/types.d.ts.map +1 -1
  66. package/lib/chain/blocks/types.js +5 -0
  67. package/lib/chain/blocks/types.js.map +1 -1
  68. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  69. package/lib/chain/blocks/verifyBlock.js +1 -1
  70. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  71. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
  72. package/lib/chain/blocks/verifyBlocksDataAvailability.js +8 -1
  73. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  74. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
  75. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
  76. package/lib/chain/blocks/verifyPayloadsDataAvailability.js +11 -6
  77. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  78. package/lib/chain/bls/multithread/index.js +5 -5
  79. package/lib/chain/bls/multithread/index.js.map +1 -1
  80. package/lib/chain/bls/multithread/types.d.ts +1 -1
  81. package/lib/chain/bls/multithread/types.d.ts.map +1 -1
  82. package/lib/chain/bls/multithread/worker.js +1 -1
  83. package/lib/chain/bls/multithread/worker.js.map +1 -1
  84. package/lib/chain/bls/singleThread.js +1 -1
  85. package/lib/chain/bls/singleThread.js.map +1 -1
  86. package/lib/chain/bls/utils.js +1 -1
  87. package/lib/chain/bls/utils.js.map +1 -1
  88. package/lib/chain/chain.d.ts +3 -2
  89. package/lib/chain/chain.d.ts.map +1 -1
  90. package/lib/chain/chain.js +12 -7
  91. package/lib/chain/chain.js.map +1 -1
  92. package/lib/chain/errors/blockError.d.ts +1 -1
  93. package/lib/chain/errors/blockError.d.ts.map +1 -1
  94. package/lib/chain/errors/blockError.js +1 -1
  95. package/lib/chain/errors/blockError.js.map +1 -1
  96. package/lib/chain/errors/executionPayloadBid.d.ts +11 -1
  97. package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
  98. package/lib/chain/errors/executionPayloadBid.js +2 -0
  99. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  100. package/lib/chain/errors/inclusionList.d.ts +60 -0
  101. package/lib/chain/errors/inclusionList.d.ts.map +1 -0
  102. package/lib/chain/errors/inclusionList.js +19 -0
  103. package/lib/chain/errors/inclusionList.js.map +1 -0
  104. package/lib/chain/errors/index.d.ts +1 -0
  105. package/lib/chain/errors/index.d.ts.map +1 -1
  106. package/lib/chain/errors/index.js +1 -0
  107. package/lib/chain/errors/index.js.map +1 -1
  108. package/lib/chain/interface.d.ts +5 -5
  109. package/lib/chain/interface.d.ts.map +1 -1
  110. package/lib/chain/interface.js.map +1 -1
  111. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  112. package/lib/chain/opPools/aggregatedAttestationPool.js +23 -10
  113. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  114. package/lib/chain/opPools/attestationPool.d.ts +1 -1
  115. package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
  116. package/lib/chain/opPools/attestationPool.js +15 -4
  117. package/lib/chain/opPools/attestationPool.js.map +1 -1
  118. package/lib/chain/opPools/inclusionListStore.d.ts +63 -0
  119. package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -0
  120. package/lib/chain/opPools/inclusionListStore.js +171 -0
  121. package/lib/chain/opPools/inclusionListStore.js.map +1 -0
  122. package/lib/chain/opPools/index.d.ts +1 -0
  123. package/lib/chain/opPools/index.d.ts.map +1 -1
  124. package/lib/chain/opPools/index.js +1 -0
  125. package/lib/chain/opPools/index.js.map +1 -1
  126. package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
  127. package/lib/chain/opPools/payloadAttestationPool.js +17 -7
  128. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  129. package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
  130. package/lib/chain/opPools/syncCommitteeMessagePool.js +9 -3
  131. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  132. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  133. package/lib/chain/opPools/syncContributionAndProofPool.js +11 -3
  134. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  135. package/lib/chain/opPools/utils.d.ts +1 -1
  136. package/lib/chain/opPools/utils.d.ts.map +1 -1
  137. package/lib/chain/opPools/utils.js +1 -1
  138. package/lib/chain/opPools/utils.js.map +1 -1
  139. package/lib/chain/options.d.ts +0 -1
  140. package/lib/chain/options.d.ts.map +1 -1
  141. package/lib/chain/options.js +0 -1
  142. package/lib/chain/options.js.map +1 -1
  143. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  144. package/lib/chain/prepareNextSlot.js +4 -3
  145. package/lib/chain/prepareNextSlot.js.map +1 -1
  146. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  147. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  148. package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -1
  149. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  150. package/lib/chain/produceBlock/produceBlockBody.js +37 -15
  151. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  152. package/lib/chain/regen/interface.d.ts +1 -1
  153. package/lib/chain/regen/interface.d.ts.map +1 -1
  154. package/lib/chain/regen/interface.js +1 -1
  155. package/lib/chain/regen/interface.js.map +1 -1
  156. package/lib/chain/reprocess.d.ts +2 -1
  157. package/lib/chain/reprocess.d.ts.map +1 -1
  158. package/lib/chain/reprocess.js +2 -1
  159. package/lib/chain/reprocess.js.map +1 -1
  160. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  161. package/lib/chain/seenCache/seenGossipBlockInput.js +1 -1
  162. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  163. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  164. package/lib/chain/stateCache/persistentCheckpointsCache.js +1 -1
  165. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  166. package/lib/chain/validation/executionPayloadBid.d.ts +0 -15
  167. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  168. package/lib/chain/validation/executionPayloadBid.js +37 -158
  169. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  170. package/lib/chain/validation/inclusionList.d.ts +14 -0
  171. package/lib/chain/validation/inclusionList.d.ts.map +1 -0
  172. package/lib/chain/validation/inclusionList.js +150 -0
  173. package/lib/chain/validation/inclusionList.js.map +1 -0
  174. package/lib/chain/validation/index.d.ts +1 -0
  175. package/lib/chain/validation/index.d.ts.map +1 -1
  176. package/lib/chain/validation/index.js +1 -0
  177. package/lib/chain/validation/index.js.map +1 -1
  178. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  179. package/lib/chain/validatorMonitor.js +6 -4
  180. package/lib/chain/validatorMonitor.js.map +1 -1
  181. package/lib/constants/constants.d.ts +1 -0
  182. package/lib/constants/constants.d.ts.map +1 -1
  183. package/lib/constants/constants.js +1 -0
  184. package/lib/constants/constants.js.map +1 -1
  185. package/lib/db/beacon.d.ts +7 -0
  186. package/lib/db/beacon.d.ts.map +1 -1
  187. package/lib/db/beacon.js +34 -0
  188. package/lib/db/beacon.js.map +1 -1
  189. package/lib/db/dataColumnStore.d.ts +1 -1
  190. package/lib/db/dataColumnStore.d.ts.map +1 -1
  191. package/lib/db/dataColumnStore.js +1 -4
  192. package/lib/db/dataColumnStore.js.map +1 -1
  193. package/lib/db/flatFileStore/flatFileStore.js +5 -5
  194. package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
  195. package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
  196. package/lib/db/flatFileStore/slotIndex.js +2 -2
  197. package/lib/db/flatFileStore/slotIndex.js.map +1 -1
  198. package/lib/db/interface.d.ts +1 -0
  199. package/lib/db/interface.d.ts.map +1 -1
  200. package/lib/db/repositories/blockArchive.js +2 -2
  201. package/lib/db/repositories/blockArchive.js.map +1 -1
  202. package/lib/db/repositories/blockArchiveIndex.d.ts +1 -1
  203. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  204. package/lib/db/repositories/blockArchiveIndex.js +1 -2
  205. package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
  206. package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
  207. package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
  208. package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
  209. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  210. package/lib/execution/builder/validateBid.d.ts.map +1 -1
  211. package/lib/execution/builder/validateBid.js +14 -1
  212. package/lib/execution/builder/validateBid.js.map +1 -1
  213. package/lib/execution/engine/blobVersionedHashes.d.ts +1 -1
  214. package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
  215. package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
  216. package/lib/execution/engine/disabled.d.ts +1 -0
  217. package/lib/execution/engine/disabled.d.ts.map +1 -1
  218. package/lib/execution/engine/disabled.js +3 -0
  219. package/lib/execution/engine/disabled.js.map +1 -1
  220. package/lib/execution/engine/http.d.ts +8 -2
  221. package/lib/execution/engine/http.d.ts.map +1 -1
  222. package/lib/execution/engine/http.js +27 -4
  223. package/lib/execution/engine/http.js.map +1 -1
  224. package/lib/execution/engine/index.d.ts +1 -1
  225. package/lib/execution/engine/index.d.ts.map +1 -1
  226. package/lib/execution/engine/index.js +2 -2
  227. package/lib/execution/engine/index.js.map +1 -1
  228. package/lib/execution/engine/interface.d.ts +12 -3
  229. package/lib/execution/engine/interface.d.ts.map +1 -1
  230. package/lib/execution/engine/interface.js.map +1 -1
  231. package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
  232. package/lib/execution/engine/jsonRpcHttpClient.js +14 -4
  233. package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
  234. package/lib/execution/engine/jsonRpcTransport.d.ts +3 -2
  235. package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
  236. package/lib/execution/engine/jsonRpcTransport.js +33 -9
  237. package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
  238. package/lib/execution/engine/mock.d.ts +1 -0
  239. package/lib/execution/engine/mock.d.ts.map +1 -1
  240. package/lib/execution/engine/mock.js +31 -7
  241. package/lib/execution/engine/mock.js.map +1 -1
  242. package/lib/execution/engine/payloadIdCache.d.ts +5 -3
  243. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  244. package/lib/execution/engine/payloadIdCache.js +15 -4
  245. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  246. package/lib/execution/engine/restTransport.d.ts +5 -2
  247. package/lib/execution/engine/restTransport.d.ts.map +1 -1
  248. package/lib/execution/engine/restTransport.js +36 -21
  249. package/lib/execution/engine/restTransport.js.map +1 -1
  250. package/lib/execution/engine/sszTypes.d.ts +38 -38
  251. package/lib/execution/engine/transport.d.ts +5 -2
  252. package/lib/execution/engine/transport.d.ts.map +1 -1
  253. package/lib/execution/engine/transportMetrics.d.ts +5 -1
  254. package/lib/execution/engine/transportMetrics.d.ts.map +1 -1
  255. package/lib/execution/engine/types.d.ts +25 -1
  256. package/lib/execution/engine/types.d.ts.map +1 -1
  257. package/lib/execution/engine/types.js +31 -17
  258. package/lib/execution/engine/types.js.map +1 -1
  259. package/lib/index.d.ts +1 -0
  260. package/lib/index.d.ts.map +1 -1
  261. package/lib/index.js +2 -0
  262. package/lib/index.js.map +1 -1
  263. package/lib/metrics/metrics/beacon.d.ts +16 -0
  264. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  265. package/lib/metrics/metrics/beacon.js +35 -0
  266. package/lib/metrics/metrics/beacon.js.map +1 -1
  267. package/lib/metrics/metrics/lodestar.d.ts +26 -0
  268. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  269. package/lib/metrics/metrics/lodestar.js +61 -1
  270. package/lib/metrics/metrics/lodestar.js.map +1 -1
  271. package/lib/monitoring/service.js +1 -1
  272. package/lib/monitoring/service.js.map +1 -1
  273. package/lib/network/core/networkCore.d.ts +2 -0
  274. package/lib/network/core/networkCore.d.ts.map +1 -1
  275. package/lib/network/core/networkCore.js +3 -0
  276. package/lib/network/core/networkCore.js.map +1 -1
  277. package/lib/network/core/networkCoreWorker.js +1 -0
  278. package/lib/network/core/networkCoreWorker.js.map +1 -1
  279. package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -0
  280. package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
  281. package/lib/network/core/networkCoreWorkerHandler.js +3 -0
  282. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  283. package/lib/network/core/types.d.ts +2 -0
  284. package/lib/network/core/types.d.ts.map +1 -1
  285. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  286. package/lib/network/gossip/gossipsub.js +3 -1
  287. package/lib/network/gossip/gossipsub.js.map +1 -1
  288. package/lib/network/gossip/interface.d.ts +8 -2
  289. package/lib/network/gossip/interface.d.ts.map +1 -1
  290. package/lib/network/gossip/interface.js +1 -0
  291. package/lib/network/gossip/interface.js.map +1 -1
  292. package/lib/network/gossip/topic.d.ts +13 -19
  293. package/lib/network/gossip/topic.d.ts.map +1 -1
  294. package/lib/network/gossip/topic.js +13 -1
  295. package/lib/network/gossip/topic.js.map +1 -1
  296. package/lib/network/interface.d.ts +4 -1
  297. package/lib/network/interface.d.ts.map +1 -1
  298. package/lib/network/network.d.ts +4 -1
  299. package/lib/network/network.d.ts.map +1 -1
  300. package/lib/network/network.js +11 -1
  301. package/lib/network/network.js.map +1 -1
  302. package/lib/network/peers/peerManager.d.ts +2 -1
  303. package/lib/network/peers/peerManager.d.ts.map +1 -1
  304. package/lib/network/peers/peerManager.js.map +1 -1
  305. package/lib/network/peers/utils/assertPeerRelevance.d.ts +9 -1
  306. package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -1
  307. package/lib/network/peers/utils/assertPeerRelevance.js +32 -21
  308. package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
  309. package/lib/network/peers/utils/enrSubnetsDeserialize.d.ts.map +1 -1
  310. package/lib/network/peers/utils/enrSubnetsDeserialize.js +5 -2
  311. package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
  312. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  313. package/lib/network/processor/gossipHandlers.js +76 -27
  314. package/lib/network/processor/gossipHandlers.js.map +1 -1
  315. package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
  316. package/lib/network/processor/gossipQueues/index.js +6 -0
  317. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  318. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  319. package/lib/network/processor/gossipValidatorFn.js +5 -1
  320. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  321. package/lib/network/processor/index.d.ts +5 -0
  322. package/lib/network/processor/index.d.ts.map +1 -1
  323. package/lib/network/processor/index.js +40 -29
  324. package/lib/network/processor/index.js.map +1 -1
  325. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  326. package/lib/network/reqresp/ReqRespBeaconNode.js +6 -0
  327. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  328. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  329. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +4 -4
  330. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  331. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +3 -3
  332. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  333. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +10 -0
  334. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +1 -0
  335. package/lib/network/reqresp/handlers/inclusionListsByIndices.js +30 -0
  336. package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +1 -0
  337. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  338. package/lib/network/reqresp/handlers/index.js +5 -0
  339. package/lib/network/reqresp/handlers/index.js.map +1 -1
  340. package/lib/network/reqresp/protocols.d.ts +1 -0
  341. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  342. package/lib/network/reqresp/protocols.js +5 -0
  343. package/lib/network/reqresp/protocols.js.map +1 -1
  344. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  345. package/lib/network/reqresp/rateLimit.js +6 -2
  346. package/lib/network/reqresp/rateLimit.js.map +1 -1
  347. package/lib/network/reqresp/types.d.ts +5 -2
  348. package/lib/network/reqresp/types.d.ts.map +1 -1
  349. package/lib/network/reqresp/types.js +3 -0
  350. package/lib/network/reqresp/types.js.map +1 -1
  351. package/lib/network/subnets/attnetsService.d.ts.map +1 -1
  352. package/lib/network/subnets/attnetsService.js +3 -1
  353. package/lib/network/subnets/attnetsService.js.map +1 -1
  354. package/lib/node/nodejs.d.ts +1 -1
  355. package/lib/node/nodejs.d.ts.map +1 -1
  356. package/lib/node/nodejs.js +10 -2
  357. package/lib/node/nodejs.js.map +1 -1
  358. package/lib/node/notifier.d.ts.map +1 -1
  359. package/lib/node/notifier.js +12 -13
  360. package/lib/node/notifier.js.map +1 -1
  361. package/lib/node/options.d.ts +1 -1
  362. package/lib/node/options.d.ts.map +1 -1
  363. package/lib/node/options.js +1 -1
  364. package/lib/node/options.js.map +1 -1
  365. package/lib/sync/interface.d.ts.map +1 -1
  366. package/lib/sync/interface.js.map +1 -1
  367. package/lib/sync/sync.d.ts +7 -0
  368. package/lib/sync/sync.d.ts.map +1 -1
  369. package/lib/sync/sync.js +61 -3
  370. package/lib/sync/sync.js.map +1 -1
  371. package/lib/sync/unknownBlock.d.ts.map +1 -1
  372. package/lib/sync/unknownBlock.js +45 -20
  373. package/lib/sync/unknownBlock.js.map +1 -1
  374. package/lib/util/clock.d.ts.map +1 -1
  375. package/lib/util/clock.js +3 -4
  376. package/lib/util/clock.js.map +1 -1
  377. package/lib/util/file.d.ts.map +1 -1
  378. package/lib/util/file.js +8 -9
  379. package/lib/util/file.js.map +1 -1
  380. package/lib/util/queue/itemQueue.js +1 -1
  381. package/lib/util/queue/itemQueue.js.map +1 -1
  382. package/lib/util/sszBytes.d.ts +2 -2
  383. package/lib/util/sszBytes.d.ts.map +1 -1
  384. package/lib/util/sszBytes.js +24 -16
  385. package/lib/util/sszBytes.js.map +1 -1
  386. package/package.json +31 -32
  387. package/src/api/impl/api.ts +1 -1
  388. package/src/api/impl/beacon/blocks/index.ts +67 -65
  389. package/src/api/impl/beacon/index.ts +3 -1
  390. package/src/api/impl/beacon/pool/index.ts +5 -1
  391. package/src/api/impl/beacon/state/index.ts +10 -1
  392. package/src/api/impl/beacon/state/utils.ts +20 -10
  393. package/src/api/impl/debug/index.ts +4 -0
  394. package/src/api/impl/validator/index.ts +176 -29
  395. package/src/api/options.ts +3 -0
  396. package/src/chain/ColumnReconstructionTracker.ts +63 -46
  397. package/src/chain/GetBlobsTracker.ts +97 -38
  398. package/src/chain/archiveStore/archiveStore.ts +1 -0
  399. package/src/chain/archiveStore/utils/archiveBlocks.ts +78 -133
  400. package/src/chain/blocks/blockInput/blockInput.ts +1 -1
  401. package/src/chain/blocks/blockInput/utils.ts +2 -2
  402. package/src/chain/blocks/importBlock.ts +19 -18
  403. package/src/chain/blocks/importExecutionPayload.ts +81 -23
  404. package/src/chain/blocks/index.ts +6 -2
  405. package/src/chain/blocks/payloadEnvelopeProcessor.ts +35 -24
  406. package/src/chain/blocks/types.ts +5 -0
  407. package/src/chain/blocks/verifyBlock.ts +1 -0
  408. package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -1
  409. package/src/chain/blocks/verifyPayloadsDataAvailability.ts +14 -6
  410. package/src/chain/bls/multithread/index.ts +5 -5
  411. package/src/chain/bls/multithread/types.ts +1 -1
  412. package/src/chain/bls/multithread/worker.ts +1 -5
  413. package/src/chain/bls/singleThread.ts +1 -1
  414. package/src/chain/bls/utils.ts +1 -1
  415. package/src/chain/chain.ts +13 -7
  416. package/src/chain/errors/blockError.ts +1 -1
  417. package/src/chain/errors/executionPayloadBid.ts +12 -0
  418. package/src/chain/errors/inclusionList.ts +38 -0
  419. package/src/chain/errors/index.ts +1 -0
  420. package/src/chain/interface.ts +6 -4
  421. package/src/chain/opPools/aggregatedAttestationPool.ts +25 -9
  422. package/src/chain/opPools/attestationPool.ts +16 -4
  423. package/src/chain/opPools/inclusionListStore.ts +208 -0
  424. package/src/chain/opPools/index.ts +1 -0
  425. package/src/chain/opPools/payloadAttestationPool.ts +18 -7
  426. package/src/chain/opPools/syncCommitteeMessagePool.ts +10 -3
  427. package/src/chain/opPools/syncContributionAndProofPool.ts +13 -3
  428. package/src/chain/opPools/utils.ts +1 -1
  429. package/src/chain/options.ts +0 -2
  430. package/src/chain/prepareNextSlot.ts +7 -3
  431. package/src/chain/produceBlock/computeNewStateRoot.ts +9 -2
  432. package/src/chain/produceBlock/produceBlockBody.ts +70 -24
  433. package/src/chain/regen/interface.ts +1 -1
  434. package/src/chain/reprocess.ts +2 -1
  435. package/src/chain/seenCache/seenGossipBlockInput.ts +2 -1
  436. package/src/chain/stateCache/persistentCheckpointsCache.ts +4 -1
  437. package/src/chain/validation/executionPayloadBid.ts +54 -183
  438. package/src/chain/validation/inclusionList.ts +192 -0
  439. package/src/chain/validation/index.ts +1 -0
  440. package/src/chain/validatorMonitor.ts +7 -4
  441. package/src/constants/constants.ts +1 -0
  442. package/src/db/beacon.ts +44 -0
  443. package/src/db/dataColumnStore.ts +2 -4
  444. package/src/db/flatFileStore/flatFileStore.ts +7 -7
  445. package/src/db/flatFileStore/slotIndex.ts +4 -3
  446. package/src/db/interface.ts +2 -0
  447. package/src/db/repositories/blockArchive.ts +2 -2
  448. package/src/db/repositories/blockArchiveIndex.ts +2 -3
  449. package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
  450. package/src/execution/builder/validateBid.ts +23 -2
  451. package/src/execution/engine/blobVersionedHashes.ts +1 -1
  452. package/src/execution/engine/disabled.ts +4 -0
  453. package/src/execution/engine/http.ts +40 -5
  454. package/src/execution/engine/index.ts +3 -2
  455. package/src/execution/engine/interface.ts +28 -4
  456. package/src/execution/engine/jsonRpcHttpClient.ts +12 -5
  457. package/src/execution/engine/jsonRpcTransport.ts +46 -9
  458. package/src/execution/engine/mock.ts +32 -7
  459. package/src/execution/engine/payloadIdCache.ts +24 -6
  460. package/src/execution/engine/restTransport.ts +68 -23
  461. package/src/execution/engine/transport.ts +7 -2
  462. package/src/execution/engine/transportMetrics.ts +2 -1
  463. package/src/execution/engine/types.ts +56 -17
  464. package/src/index.ts +2 -0
  465. package/src/metrics/metrics/beacon.ts +37 -0
  466. package/src/metrics/metrics/lodestar.ts +63 -1
  467. package/src/monitoring/service.ts +1 -1
  468. package/src/network/core/networkCore.ts +5 -0
  469. package/src/network/core/networkCoreWorker.ts +1 -0
  470. package/src/network/core/networkCoreWorkerHandler.ts +4 -0
  471. package/src/network/core/types.ts +2 -0
  472. package/src/network/gossip/gossipsub.ts +3 -1
  473. package/src/network/gossip/interface.ts +5 -0
  474. package/src/network/gossip/topic.ts +14 -0
  475. package/src/network/interface.ts +4 -0
  476. package/src/network/network.ts +19 -1
  477. package/src/network/peers/peerManager.ts +1 -1
  478. package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
  479. package/src/network/peers/utils/enrSubnetsDeserialize.ts +5 -2
  480. package/src/network/processor/gossipHandlers.ts +96 -29
  481. package/src/network/processor/gossipQueues/index.ts +6 -0
  482. package/src/network/processor/gossipValidatorFn.ts +5 -0
  483. package/src/network/processor/index.ts +36 -27
  484. package/src/network/processor/types.ts +1 -1
  485. package/src/network/reqresp/ReqRespBeaconNode.ts +7 -0
  486. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -10
  487. package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +3 -3
  488. package/src/network/reqresp/handlers/inclusionListsByIndices.ts +44 -0
  489. package/src/network/reqresp/handlers/index.ts +5 -0
  490. package/src/network/reqresp/protocols.ts +6 -0
  491. package/src/network/reqresp/rateLimit.ts +6 -2
  492. package/src/network/reqresp/types.ts +6 -0
  493. package/src/network/subnets/attnetsService.ts +8 -3
  494. package/src/node/nodejs.ts +24 -7
  495. package/src/node/notifier.ts +14 -13
  496. package/src/node/options.ts +4 -5
  497. package/src/sync/interface.ts +1 -0
  498. package/src/sync/sync.ts +65 -4
  499. package/src/sync/unknownBlock.ts +50 -30
  500. package/src/util/clock.ts +3 -4
  501. package/src/util/file.ts +8 -9
  502. package/src/util/queue/itemQueue.ts +1 -1
  503. package/src/util/sszBytes.ts +27 -14
@@ -1,7 +1,7 @@
1
- import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
2
1
  import {Type} from "@chainsafe/ssz";
3
2
  import {BeaconConfig} from "@lodestar/config";
4
3
  import {CheckpointWithHex, IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
4
+ import {type PubkeyCache} from "@lodestar/native/pubkeys";
5
5
  import {EpochShuffling, IBeaconStateView} from "@lodestar/state-transition";
6
6
  import {
7
7
  BeaconBlock,
@@ -49,6 +49,7 @@ import {
49
49
  AttestationPool,
50
50
  DeferredVoluntaryExitPool,
51
51
  ExecutionPayloadBidPool,
52
+ InclusionListStore,
52
53
  OpPool,
53
54
  PayloadAttestationPool,
54
55
  ProposerPreferencesPool,
@@ -76,8 +77,7 @@ import {PayloadEnvelopeInput, SeenPayloadEnvelopeInput} from "./seenCache/seenPa
76
77
  import {ShufflingCache} from "./shufflingCache.js";
77
78
  import {ValidatorMonitor} from "./validatorMonitor.js";
78
79
 
79
- export {BlockType, type AssembledBlockType};
80
- export {type ProposerPreparationData};
80
+ export {type AssembledBlockType, BlockType, type ProposerPreparationData};
81
81
  export type BlockHash = RootHex;
82
82
 
83
83
  export type StateGetOpts = {
@@ -131,6 +131,7 @@ export interface IBeaconChain {
131
131
  readonly executionPayloadBidPool: ExecutionPayloadBidPool;
132
132
  readonly payloadAttestationPool: PayloadAttestationPool;
133
133
  readonly proposerPreferencesPool: ProposerPreferencesPool;
134
+ readonly inclusionListStore: InclusionListStore;
134
135
  readonly opPool: OpPool;
135
136
  readonly deferredVoluntaryExitPool: DeferredVoluntaryExitPool;
136
137
 
@@ -331,6 +332,7 @@ export type SSZObjectType =
331
332
  | "syncCommittee"
332
333
  | "contributionAndProof";
333
334
 
334
- export type CommonBlockBody = phase0.BeaconBlockBody &
335
+ export type CommonBlockBody = Omit<phase0.BeaconBlockBody, "eth1Data" | "deposits"> &
336
+ Partial<Pick<phase0.BeaconBlockBody, "eth1Data" | "deposits">> &
335
337
  Pick<capella.BeaconBlockBody, "blsToExecutionChanges"> &
336
338
  Pick<altair.BeaconBlockBody, "syncAggregate">;
@@ -1,7 +1,7 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {BeaconConfig} from "@lodestar/config";
4
3
  import {IForkChoice} from "@lodestar/fork-choice";
4
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
5
5
  import {
6
6
  ForkName,
7
7
  ForkSeq,
@@ -20,6 +20,7 @@ import {
20
20
  } from "@lodestar/params";
21
21
  import {
22
22
  EffectiveBalanceIncrements,
23
+ G2_POINT_AT_INFINITY,
23
24
  IBeaconStateView,
24
25
  RootCache,
25
26
  computeEpochAtSlot,
@@ -30,7 +31,7 @@ import {
30
31
  isStatePostGloas,
31
32
  } from "@lodestar/state-transition";
32
33
  import {Attestation, Epoch, RootHex, Slot, electra, isElectraAttestation, phase0, ssz} from "@lodestar/types";
33
- import {Logger, MapDef, assert, toRootHex} from "@lodestar/utils";
34
+ import {Logger, MapDef, assert, byteArrayEquals, toRootHex} from "@lodestar/utils";
34
35
  import {Metrics} from "../../metrics/metrics.js";
35
36
  import {IntersectResult, intersectUint8Arrays} from "../../util/bitArray.js";
36
37
  import {getShufflingDependentRoot} from "../../util/dependentRoot.js";
@@ -409,20 +410,34 @@ export class AggregatedAttestationPool {
409
410
 
410
411
  const sortedConsolidationsByScore = Array.from(consolidations.entries())
411
412
  .sort((a, b) => b[1] - a[1])
412
- .map(([consolidation, _]) => consolidation)
413
- .slice(0, MAX_ATTESTATIONS_ELECTRA);
413
+ .map(([consolidation, _]) => consolidation);
414
414
 
415
415
  // on chain aggregation is expensive, only do it after all
416
416
  const packedAttestationsMetrics = this.metrics?.opPool.aggregatedAttestationPool.packedAttestations;
417
- const packedAttestations: electra.Attestation[] = new Array(sortedConsolidationsByScore.length);
418
- for (const [i, consolidation] of sortedConsolidationsByScore.entries()) {
419
- packedAttestations[i] = aggregateConsolidation(consolidation);
417
+ const packedAttestations: electra.Attestation[] = [];
418
+ for (const consolidation of sortedConsolidationsByScore) {
419
+ if (packedAttestations.length >= MAX_ATTESTATIONS_ELECTRA) {
420
+ break;
421
+ }
422
+
423
+ const attestation = aggregateConsolidation(consolidation);
424
+ // The point at infinity is not a valid aggregate signature, exclude it from the block
425
+ if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
426
+ this.logger?.debug("Excluding aggregate with infinity signature", {
427
+ slot: stateSlot,
428
+ attestationSlot: attestation.data.slot,
429
+ committees: consolidation.byCommittee.size,
430
+ });
431
+ continue;
432
+ }
433
+
434
+ const i = packedAttestations.push(attestation) - 1;
420
435
 
421
436
  // record metrics of packed attestations
422
437
  packedAttestationsMetrics?.committeeCount.set({index: i}, consolidation.byCommittee.size);
423
438
  packedAttestationsMetrics?.totalAttesters.set({index: i}, consolidation.totalAttesters);
424
439
  packedAttestationsMetrics?.nonParticipation.set({index: i}, consolidation.notSeenAttesters);
425
- packedAttestationsMetrics?.inclusionDistance.set({index: i}, stateSlot - packedAttestations[i].data.slot);
440
+ packedAttestationsMetrics?.inclusionDistance.set({index: i}, stateSlot - attestation.data.slot);
426
441
  packedAttestationsMetrics?.newSeenAttesters.set({index: i}, consolidation.newSeenAttesters);
427
442
  packedAttestationsMetrics?.totalEffectiveBalance.set({index: i}, consolidation.totalNewSeenEffectiveBalance);
428
443
  }
@@ -462,7 +477,8 @@ export class AggregatedAttestationPool {
462
477
  attestations.push(...attestationGroup.getAttestations());
463
478
  }
464
479
  }
465
- return attestations;
480
+ // The point at infinity is not a valid aggregate signature, do not serve such an aggregate
481
+ return attestations.filter((attestation) => !byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY));
466
482
  }
467
483
 
468
484
  private onScrapeMetrics(metrics: Metrics): void {
@@ -1,9 +1,10 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {ChainForkConfig} from "@lodestar/config";
3
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
4
4
  import {MAX_COMMITTEES_PER_SLOT, isForkPostElectra} from "@lodestar/params";
5
+ import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
5
6
  import {Attestation, RootHex, SingleAttestation, Slot, isElectraSingleAttestation} from "@lodestar/types";
6
- import {MapDef, assert} from "@lodestar/utils";
7
+ import {MapDef, assert, byteArrayEquals} from "@lodestar/utils";
7
8
  import {Metrics} from "../../metrics/metrics.js";
8
9
  import {IClock} from "../../util/clock.js";
9
10
  import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";
@@ -180,7 +181,13 @@ export class AttestationPool {
180
181
  assert.true(!isElectraAggregate(aggregate), "Aggregate should be type AggregateFastPhase0");
181
182
  }
182
183
 
183
- return fastToAttestation(aggregate);
184
+ const attestation = fastToAttestation(aggregate);
185
+ // The point at infinity is not a valid aggregate signature, do not serve such an aggregate
186
+ if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
187
+ return null;
188
+ }
189
+
190
+ return attestation;
184
191
  }
185
192
 
186
193
  /**
@@ -209,7 +216,12 @@ export class AttestationPool {
209
216
  if (aggregateByRoot) {
210
217
  for (const aggFastByIndex of aggregateByRoot.values()) {
211
218
  for (const aggFast of aggFastByIndex.values()) {
212
- attestations.push(fastToAttestation(aggFast));
219
+ const attestation = fastToAttestation(aggFast);
220
+ // The point at infinity is not a valid aggregate signature, do not serve such an aggregate
221
+ if (byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY)) {
222
+ continue;
223
+ }
224
+ attestations.push(attestation);
213
225
  }
214
226
  }
215
227
  }
@@ -0,0 +1,208 @@
1
+ import {BitArray, SerializedList} from "@chainsafe/ssz";
2
+ import {BeaconConfig} from "@lodestar/config";
3
+ import {INCLUSION_LIST_COMMITTEE_SIZE} from "@lodestar/params";
4
+ import {RootHex, Slot, ValidatorIndex, bellatrix, heze, ssz} from "@lodestar/types";
5
+ import {MapDef, toHex, toRootHex} from "@lodestar/utils";
6
+
7
+ export enum InclusionListInsertOutcome {
8
+ /** Stored as a new entry. */
9
+ New = "New",
10
+ /** Slot is older than the prune horizon. */
11
+ Old = "Old",
12
+ /** Identical inclusion list already stored. */
13
+ Seen = "Seen",
14
+ /** New equivocation evidence: this validator already has a different inclusion list stored. */
15
+ Equivocating = "Equivocating",
16
+ /** Validator was already marked as an equivocator for this `(slot, dependent_root)`. */
17
+ SubsequentEquivocation = "SubsequentEquivocation",
18
+ }
19
+
20
+ type InclusionListEntry = {
21
+ signedInclusionList: heze.SignedInclusionList;
22
+ /** Positions of the validator in `get_inclusion_list_committee(state, slot)`, several when the committee cycles */
23
+ committeeIndices: number[];
24
+ /** Received before the inclusion list deadline of its slot. */
25
+ timely: boolean;
26
+ };
27
+
28
+ /**
29
+ * Spec `InclusionListStore`: inclusion lists keyed by `(slot, dependent_root)`, one per validator index.
30
+ * The committee position is recorded at insert time (gossip validation resolves it) so the bit-oriented
31
+ * reads need no shuffling lookup. Signed lists are kept so InclusionListsByIndices can serve them.
32
+ * A validator's first list stays stored and an equivocation marks the validator so reads skip it.
33
+ */
34
+ export class InclusionListStore {
35
+ /** slot -> dependent_root -> validator index -> entry */
36
+ private readonly inclusionLists = new MapDef<Slot, MapDef<RootHex, Map<ValidatorIndex, InclusionListEntry>>>(
37
+ () => new MapDef<RootHex, Map<ValidatorIndex, InclusionListEntry>>(() => new Map())
38
+ );
39
+ /** slot -> dependent_root -> equivocating validator indices */
40
+ private readonly equivocators = new MapDef<Slot, MapDef<RootHex, Set<ValidatorIndex>>>(
41
+ () => new MapDef<RootHex, Set<ValidatorIndex>>(() => new Set())
42
+ );
43
+ /** slot -> dependent_root -> validator index -> count, for the p2p "first or second message" rule */
44
+ private readonly seenCounts = new MapDef<Slot, MapDef<RootHex, Map<ValidatorIndex, number>>>(
45
+ () => new MapDef<RootHex, Map<ValidatorIndex, number>>(() => new Map())
46
+ );
47
+
48
+ private lowestPermissibleSlot = 0;
49
+
50
+ constructor(private readonly config: BeaconConfig) {}
51
+
52
+ get size(): number {
53
+ let count = 0;
54
+ for (const byDependentRoot of this.inclusionLists.values()) {
55
+ for (const entries of byDependentRoot.values()) {
56
+ count += entries.size;
57
+ }
58
+ }
59
+ return count;
60
+ }
61
+
62
+ /**
63
+ * Late lists are stored with `timely=false` rather than dropped: they still count toward the
64
+ * non-timely view used to validate another node's `inclusion_list_bits`.
65
+ */
66
+ process(
67
+ signedInclusionList: heze.SignedInclusionList,
68
+ committeeIndices: number[],
69
+ timely: boolean
70
+ ): InclusionListInsertOutcome {
71
+ const inclusionList = signedInclusionList.message;
72
+ const {slot, validatorIndex} = inclusionList;
73
+
74
+ if (slot < this.lowestPermissibleSlot) {
75
+ return InclusionListInsertOutcome.Old;
76
+ }
77
+
78
+ const dependentRoot = toRootHex(inclusionList.dependentRoot);
79
+ const stored = this.inclusionLists.getOrDefault(slot).getOrDefault(dependentRoot);
80
+
81
+ const entry = stored.get(validatorIndex);
82
+ if (entry !== undefined) {
83
+ if (ssz.heze.InclusionList.equals(entry.signedInclusionList.message, inclusionList)) {
84
+ return InclusionListInsertOutcome.Seen;
85
+ }
86
+ const equivocators = this.equivocators.getOrDefault(slot).getOrDefault(dependentRoot);
87
+ if (equivocators.has(validatorIndex)) {
88
+ return InclusionListInsertOutcome.SubsequentEquivocation;
89
+ }
90
+ equivocators.add(validatorIndex);
91
+ return InclusionListInsertOutcome.Equivocating;
92
+ }
93
+
94
+ stored.set(validatorIndex, {signedInclusionList, committeeIndices, timely});
95
+ return InclusionListInsertOutcome.New;
96
+ }
97
+
98
+ /** Count a valid message of `validatorIndex` for the first-or-second message gossip rule */
99
+ markSeen(slot: Slot, dependentRoot: RootHex, validatorIndex: ValidatorIndex): void {
100
+ const counts = this.seenCounts.getOrDefault(slot).getOrDefault(dependentRoot);
101
+ counts.set(validatorIndex, (counts.get(validatorIndex) ?? 0) + 1);
102
+ }
103
+
104
+ /** Gossip rule: at most two valid messages per validator for a `(slot, dependent_root)` */
105
+ seenTwice(slot: Slot, dependentRoot: RootHex, validatorIndex: ValidatorIndex): boolean {
106
+ return (this.seenCounts.get(slot)?.get(dependentRoot)?.get(validatorIndex) ?? 0) >= 2;
107
+ }
108
+
109
+ /** Deduplicated transactions from valid, non-equivocating inclusion lists at `(slot, dependentRoot)`. */
110
+ getInclusionListTransactions(slot: Slot, dependentRoot: RootHex, onlyTimely = true): bellatrix.Transactions {
111
+ const transactions: Uint8Array[] = [];
112
+ const seen = new Set<string>();
113
+
114
+ for (const {signedInclusionList} of this.getEligible(slot, dependentRoot, onlyTimely)) {
115
+ for (const transaction of signedInclusionList.message.transactions) {
116
+ const key = toHex(transaction);
117
+ if (!seen.has(key)) {
118
+ seen.add(key);
119
+ transactions.push(transaction);
120
+ }
121
+ }
122
+ }
123
+
124
+ return SerializedList.fromArray(transactions);
125
+ }
126
+
127
+ /** Bit `i` is set when committee member `i` submitted a valid, non-equivocating inclusion list */
128
+ getInclusionListBits(slot: Slot, dependentRoot: RootHex, onlyTimely = true): BitArray {
129
+ const bits = BitArray.fromBitLen(INCLUSION_LIST_COMMITTEE_SIZE);
130
+ for (const {committeeIndices} of this.getEligible(slot, dependentRoot, onlyTimely)) {
131
+ for (const committeeIndex of committeeIndices) {
132
+ bits.set(committeeIndex, true);
133
+ }
134
+ }
135
+ return bits;
136
+ }
137
+
138
+ /**
139
+ * True if `bits` has a bit set for every bit set in the local inclusion list bits.
140
+ *
141
+ * Intentionally deviates from the spec by only checking against timely lists, where the proposer would check
142
+ * against every list it observed (only_timely=False in
143
+ * https://github.com/ethereum/consensus-specs/blob/v1.7.0-beta.4/specs/heze/validator.md#signed-execution-payload-bid).
144
+ * A bid that passed gossip must stay eligible, otherwise a list released after the deadline voids every bid and
145
+ * a high early bid with empty bits crowds out the rest without ever paying.
146
+ */
147
+ isInclusionListBitsInclusive(slot: Slot, dependentRoot: RootHex, bits: BitArray): boolean {
148
+ for (const {committeeIndices} of this.getEligible(slot, dependentRoot, true)) {
149
+ if (committeeIndices.some((committeeIndex) => !bits.get(committeeIndex))) {
150
+ return false;
151
+ }
152
+ }
153
+ return true;
154
+ }
155
+
156
+ /** Inclusion lists for the given committee positions, to serve InclusionListsByIndices. */
157
+ getByIndices(slot: Slot, dependentRoot: RootHex, indices: BitArray): heze.SignedInclusionList[] {
158
+ const out: heze.SignedInclusionList[] = [];
159
+ for (const {signedInclusionList, committeeIndices} of this.getEligible(slot, dependentRoot, false)) {
160
+ if (committeeIndices.some((committeeIndex) => indices.get(committeeIndex))) {
161
+ out.push(signedInclusionList);
162
+ }
163
+ }
164
+ return out;
165
+ }
166
+
167
+ /** Lists are retained for MIN_SLOTS_FOR_INCLUSION_LISTS_REQUESTS slots so InclusionListsByIndices can serve them */
168
+ prune(clockSlot: Slot): void {
169
+ const horizon = clockSlot - this.config.MIN_SLOTS_FOR_INCLUSION_LISTS_REQUESTS;
170
+
171
+ for (const slot of this.inclusionLists.keys()) {
172
+ if (slot < horizon) {
173
+ this.inclusionLists.delete(slot);
174
+ }
175
+ }
176
+ for (const slot of this.equivocators.keys()) {
177
+ if (slot < horizon) {
178
+ this.equivocators.delete(slot);
179
+ }
180
+ }
181
+ for (const slot of this.seenCounts.keys()) {
182
+ if (slot < horizon) {
183
+ this.seenCounts.delete(slot);
184
+ }
185
+ }
186
+
187
+ this.lowestPermissibleSlot = Math.max(horizon, 0);
188
+ }
189
+
190
+ /** Entries at `(slot, dependentRoot)` from non-equivocating validators, timely when required. */
191
+ private *getEligible(slot: Slot, dependentRoot: RootHex, onlyTimely: boolean): Generator<InclusionListEntry> {
192
+ const stored = this.inclusionLists.get(slot)?.get(dependentRoot);
193
+ if (!stored || stored.size === 0) {
194
+ return;
195
+ }
196
+ const equivocators = this.equivocators.get(slot)?.get(dependentRoot);
197
+
198
+ for (const [validatorIndex, entry] of stored) {
199
+ if (equivocators?.has(validatorIndex)) {
200
+ continue;
201
+ }
202
+ if (onlyTimely && !entry.timely) {
203
+ continue;
204
+ }
205
+ yield entry;
206
+ }
207
+ }
208
+ }
@@ -2,6 +2,7 @@ export {AggregatedAttestationPool} from "./aggregatedAttestationPool.js";
2
2
  export {AttestationPool} from "./attestationPool.js";
3
3
  export {DeferredVoluntaryExitPool} from "./deferredVoluntaryExitPool.js";
4
4
  export {ExecutionPayloadBidPool, type PooledExecutionPayloadBid} from "./executionPayloadBidPool.js";
5
+ export {InclusionListInsertOutcome, InclusionListStore} from "./inclusionListStore.js";
5
6
  export {OpPool} from "./opPool.js";
6
7
  export {PayloadAttestationPool} from "./payloadAttestationPool.js";
7
8
  export {ProposerPreferencesPool} from "./proposerPreferencesPool.js";
@@ -1,9 +1,10 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {ChainForkConfig} from "@lodestar/config";
3
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
4
4
  import {MAX_COMMITTEES_PER_SLOT, MAX_PAYLOAD_ATTESTATIONS, PTC_SIZE} from "@lodestar/params";
5
+ import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
5
6
  import {RootHex, Slot, gloas} from "@lodestar/types";
6
- import {MapDef, toRootHex} from "@lodestar/utils";
7
+ import {MapDef, byteArrayEquals, toRootHex} from "@lodestar/utils";
7
8
  import {Metrics} from "../../metrics/metrics.js";
8
9
  import {IClock} from "../../util/clock.js";
9
10
  import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";
@@ -112,11 +113,19 @@ export class PayloadAttestationPool {
112
113
  return [];
113
114
  }
114
115
 
115
- return Array.from(aggregateByDataRoot.values())
116
- .slice()
116
+ const payloadAttestations: gloas.PayloadAttestation[] = [];
117
+ for (const aggregate of aggregateByDataRoot.values()) {
118
+ const payloadAttestation = fastToPayloadAttestation(aggregate);
119
+ // The point at infinity is not a valid aggregate signature, exclude it from the block
120
+ if (byteArrayEquals(payloadAttestation.signature, G2_POINT_AT_INFINITY)) {
121
+ continue;
122
+ }
123
+ payloadAttestations.push(payloadAttestation);
124
+ }
125
+
126
+ return payloadAttestations
117
127
  .sort((a, b) => b.aggregationBits.getTrueBitIndexes().length - a.aggregationBits.getTrueBitIndexes().length)
118
- .slice(0, MAX_PAYLOAD_ATTESTATIONS)
119
- .map(fastToPayloadAttestation);
128
+ .slice(0, MAX_PAYLOAD_ATTESTATIONS);
120
129
  }
121
130
 
122
131
  getAll(slot?: Slot): gloas.PayloadAttestation[] {
@@ -139,9 +148,11 @@ export class PayloadAttestationPool {
139
148
  }
140
149
  }
141
150
 
151
+ // The point at infinity is not a valid aggregate signature, do not serve such an aggregate
142
152
  return aggregates
143
153
  .sort((a, b) => b.aggregationBits.getTrueBitIndexes().length - a.aggregationBits.getTrueBitIndexes().length)
144
- .map(fastToPayloadAttestation);
154
+ .map(fastToPayloadAttestation)
155
+ .filter((attestation) => !byteArrayEquals(attestation.signature, G2_POINT_AT_INFINITY));
145
156
  }
146
157
 
147
158
  prune(clockSlot: Slot): void {
@@ -1,9 +1,10 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {ChainForkConfig} from "@lodestar/config";
3
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
4
4
  import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params";
5
+ import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
5
6
  import {Root, Slot, SubcommitteeIndex, SubnetID, altair} from "@lodestar/types";
6
- import {MapDef, toRootHex} from "@lodestar/utils";
7
+ import {MapDef, byteArrayEquals, toRootHex} from "@lodestar/utils";
7
8
  import {IClock} from "../../util/clock.js";
8
9
  import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";
9
10
  import {pruneBySlot, signatureFromBytesNoCheck} from "./utils.js";
@@ -110,10 +111,16 @@ export class SyncCommitteeMessagePool {
110
111
  return null;
111
112
  }
112
113
 
114
+ const signature = contribution.signature.toBytes();
115
+ // The point at infinity is not a valid contribution signature, do not serve such a contribution
116
+ if (byteArrayEquals(signature, G2_POINT_AT_INFINITY)) {
117
+ return null;
118
+ }
119
+
113
120
  return {
114
121
  ...contribution,
115
122
  aggregationBits: contribution.aggregationBits,
116
- signature: contribution.signature.toBytes(),
123
+ signature,
117
124
  };
118
125
  }
119
126
 
@@ -1,10 +1,10 @@
1
- import {Signature, aggregateSignatures} from "@chainsafe/lodestar-z/blst";
2
1
  import {BitArray} from "@chainsafe/ssz";
3
2
  import {ChainForkConfig} from "@lodestar/config";
3
+ import {Signature, aggregateSignatures} from "@lodestar/native/blst";
4
4
  import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
5
5
  import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition";
6
6
  import {Root, Slot, SubnetID, altair, ssz} from "@lodestar/types";
7
- import {Logger, MapDef, toRootHex} from "@lodestar/utils";
7
+ import {Logger, MapDef, byteArrayEquals, toRootHex} from "@lodestar/utils";
8
8
  import {Metrics} from "../../metrics/metrics.js";
9
9
  import {IClock} from "../../util/clock.js";
10
10
  import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js";
@@ -234,8 +234,18 @@ export function aggregate(
234
234
  }
235
235
 
236
236
  metrics?.opPool.syncContributionAndProofPool.getAggregateParticipants.set(participationCount);
237
+
238
+ const syncCommitteeSignature = aggregateSignatures(signatures).toBytes();
239
+ // The point at infinity is only a valid sync aggregate signature with empty participation bits
240
+ if (byteArrayEquals(syncCommitteeSignature, G2_POINT_AT_INFINITY)) {
241
+ return {
242
+ syncCommitteeBits: BitArray.fromBitLen(SYNC_COMMITTEE_SIZE),
243
+ syncCommitteeSignature,
244
+ };
245
+ }
246
+
237
247
  return {
238
248
  syncCommitteeBits,
239
- syncCommitteeSignature: aggregateSignatures(signatures).toBytes(),
249
+ syncCommitteeSignature,
240
250
  };
241
251
  }
@@ -1,6 +1,6 @@
1
- import {Signature} from "@chainsafe/lodestar-z/blst";
2
1
  import {BeaconConfig} from "@lodestar/config";
3
2
  import {DbBatch, Id, Repository} from "@lodestar/db";
3
+ import {Signature} from "@lodestar/native/blst";
4
4
  import {BLS_WITHDRAWAL_PREFIX, DOMAIN_BEACON_ATTESTER, DOMAIN_BEACON_PROPOSER} from "@lodestar/params";
5
5
  import {IBeaconStateView, computeStartSlotAtEpoch} from "@lodestar/state-transition";
6
6
  import {AttesterSlashing, Domain, Slot, capella, phase0} from "@lodestar/types";
@@ -48,7 +48,6 @@ export type IChainOptions = BlockProcessOpts &
48
48
  /** Max number of produced block roots (blinded or full) cached for broadcast validations */
49
49
  maxCachedProducedRoots?: number;
50
50
  initialCustodyGroupCount?: number;
51
- broadcastValidationStrictness?: string;
52
51
  minSameMessageSignatureSetsToBatch: number;
53
52
  archiveDateEpochs?: number;
54
53
  nHistoricalStatesFileDataStore?: boolean;
@@ -121,7 +120,6 @@ export const defaultChainOptions: IChainOptions = {
121
120
  // for attestation validation, having this value ensures we don't have to regen states most of the time
122
121
  maxSkipSlots: 32,
123
122
  disableProposerSlashings: false,
124
- broadcastValidationStrictness: "warn",
125
123
  // should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
126
124
  // batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
127
125
  // since this batch attestation work is designed to work with useWorker=true, make this the lowest value
@@ -96,6 +96,7 @@ export class PrepareNextSlotScheduler {
96
96
  const nextEpoch = computeEpochAtSlot(clockSlot) + 1;
97
97
  const isEpochTransition = prepareEpoch === nextEpoch;
98
98
  const fork = this.config.getForkName(prepareSlot);
99
+ const currentFork = this.config.getForkName(clockSlot);
99
100
 
100
101
  // Early return if we are pre-genesis
101
102
  // or we are pre-bellatrix and this is not an epoch transition
@@ -106,7 +107,7 @@ export class PrepareNextSlotScheduler {
106
107
  try {
107
108
  // At PREPARE_NEXT_SLOT_BPS (~67%) of the current slot we prepare payload for the next slot
108
109
  // or precompute epoch transition
109
- await sleep(this.config.getSlotComponentDurationMs(PREPARE_NEXT_SLOT_BPS), this.signal);
110
+ await sleep(this.config.getSlotComponentDurationMs(currentFork, PREPARE_NEXT_SLOT_BPS), this.signal);
110
111
 
111
112
  // calling updateHead() here before we produce a block to reduce reorg possibility
112
113
  const headBlock = this.chain.recomputeForkChoiceHead(ForkchoiceCaller.prepareNextSlot);
@@ -369,7 +370,7 @@ export class PrepareNextSlotScheduler {
369
370
  // skip when we're the next-slot proposer — don't compete with block-production prep.
370
371
  feeRecipient === undefined
371
372
  ) {
372
- const maxDurationMs = this.config.getSlotComponentDurationMs(BUILDER_PREVERIFY_LIMIT_BPS);
373
+ const maxDurationMs = this.config.getSlotComponentDurationMs(currentFork, BUILDER_PREVERIFY_LIMIT_BPS);
373
374
  const preVerifyTimer = this.metrics?.builderDepositPreVerify.duration.startTimer();
374
375
  const result = headState.preVerifyBuilderDepositsPreGloas(MAX_BUILDER_DEPOSITS_PER_SLOT, maxDurationMs);
375
376
  preVerifyTimer?.();
@@ -423,7 +424,10 @@ export class PrepareNextSlotScheduler {
423
424
  * later in the slot, connecting at PREPARE_NEXT_SLOT_BPS would go cold before bids are requested.
424
425
  */
425
426
  private checkBuilderStatusBeforeSlot(prepareSlot: Slot): void {
426
- const msBeforeSlot = this.config.getSlotComponentDurationMs(BUILDER_STATUS_CHECK_BEFORE_SLOT_BPS);
427
+ const msBeforeSlot = this.config.getSlotComponentDurationMs(
428
+ this.config.getForkName(prepareSlot - 1),
429
+ BUILDER_STATUS_CHECK_BEFORE_SLOT_BPS
430
+ );
427
431
  const msUntilCheck = -this.chain.clock.msFromSlot(prepareSlot) - msBeforeSlot;
428
432
  sleep(Math.max(0, msUntilCheck), this.signal)
429
433
  .then(() => this.chain.builderApiClient.checkStatus())
@@ -1,5 +1,12 @@
1
1
  import {EMPTY_SIGNATURE, IBeaconStateView, StateHashTreeRootSource} from "@lodestar/state-transition";
2
- import {BeaconBlock, BlindedBeaconBlock, Gwei, Root} from "@lodestar/types";
2
+ import {
3
+ BeaconBlock,
4
+ BlindedBeaconBlock,
5
+ Gwei,
6
+ Root,
7
+ SignedBeaconBlock,
8
+ SignedBlindedBeaconBlock,
9
+ } from "@lodestar/types";
3
10
  import {Metrics} from "../../metrics/index.js";
4
11
 
5
12
  /**
@@ -13,7 +20,7 @@ export function computeNewStateRoot(
13
20
  block: BeaconBlock | BlindedBeaconBlock
14
21
  ): {newStateRoot: Root; proposerReward: Gwei; postState: IBeaconStateView} {
15
22
  // Set signature to zero to re-use stateTransition() function which requires the SignedBeaconBlock type
16
- const signedBlock = {message: block, signature: EMPTY_SIGNATURE};
23
+ const signedBlock = {message: block, signature: EMPTY_SIGNATURE} as SignedBeaconBlock | SignedBlindedBeaconBlock;
17
24
  const {newStateRoot, proposerReward, postState, hashTreeRootTime} = state.computeNewStateRoot(
18
25
  {block: signedBlock},
19
26
  {metrics: metrics?.stateTransition}