@lodestar/beacon-node 2.1.0-dev.48a9458cd6 → 2.1.0-dev.4b0199a2eb

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 (371) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +1 -3
  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 +8 -0
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  8. package/lib/api/impl/beacon/state/index.js +3 -2
  9. package/lib/api/impl/beacon/state/index.js.map +1 -1
  10. package/lib/api/impl/beacon/state/utils.js +1 -1
  11. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  12. package/lib/api/impl/config/constants.d.ts +0 -1
  13. package/lib/api/impl/config/constants.d.ts.map +1 -1
  14. package/lib/api/impl/config/constants.js +1 -3
  15. package/lib/api/impl/config/constants.js.map +1 -1
  16. package/lib/api/impl/debug/index.d.ts.map +1 -1
  17. package/lib/api/impl/debug/index.js +0 -3
  18. package/lib/api/impl/debug/index.js.map +1 -1
  19. package/lib/api/impl/errors.d.ts +7 -0
  20. package/lib/api/impl/errors.d.ts.map +1 -1
  21. package/lib/api/impl/errors.js +9 -0
  22. package/lib/api/impl/errors.js.map +1 -1
  23. package/lib/api/impl/validator/index.d.ts.map +1 -1
  24. package/lib/api/impl/validator/index.js +4 -94
  25. package/lib/api/impl/validator/index.js.map +1 -1
  26. package/lib/api/rest/base.d.ts.map +1 -1
  27. package/lib/api/rest/base.js +5 -2
  28. package/lib/api/rest/base.js.map +1 -1
  29. package/lib/chain/ColumnReconstructionTracker.d.ts +3 -0
  30. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  31. package/lib/chain/ColumnReconstructionTracker.js +3 -1
  32. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  33. package/lib/chain/GetBlobsTracker.d.ts +3 -0
  34. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  35. package/lib/chain/GetBlobsTracker.js +3 -1
  36. package/lib/chain/GetBlobsTracker.js.map +1 -1
  37. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  38. package/lib/chain/blocks/importBlock.js +14 -5
  39. package/lib/chain/blocks/importBlock.js.map +1 -1
  40. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  41. package/lib/chain/blocks/importExecutionPayload.js +7 -56
  42. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  43. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
  44. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
  45. package/lib/chain/blocks/types.d.ts +0 -4
  46. package/lib/chain/blocks/types.d.ts.map +1 -1
  47. package/lib/chain/blocks/types.js +0 -5
  48. package/lib/chain/blocks/types.js.map +1 -1
  49. package/lib/chain/chain.d.ts +3 -3
  50. package/lib/chain/chain.d.ts.map +1 -1
  51. package/lib/chain/chain.js +30 -10
  52. package/lib/chain/chain.js.map +1 -1
  53. package/lib/chain/errors/dataColumnSidecarError.d.ts +7 -0
  54. package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
  55. package/lib/chain/errors/dataColumnSidecarError.js +1 -0
  56. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  57. package/lib/chain/errors/executionPayloadBid.d.ts +0 -15
  58. package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
  59. package/lib/chain/errors/executionPayloadBid.js +0 -3
  60. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  61. package/lib/chain/errors/index.d.ts +0 -1
  62. package/lib/chain/errors/index.d.ts.map +1 -1
  63. package/lib/chain/errors/index.js +0 -1
  64. package/lib/chain/errors/index.js.map +1 -1
  65. package/lib/chain/forkChoice/index.d.ts +11 -2
  66. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  67. package/lib/chain/forkChoice/index.js +180 -13
  68. package/lib/chain/forkChoice/index.js.map +1 -1
  69. package/lib/chain/forkChoiceExecutionEngine.d.ts +1 -2
  70. package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -1
  71. package/lib/chain/forkChoiceExecutionEngine.js +0 -3
  72. package/lib/chain/forkChoiceExecutionEngine.js.map +1 -1
  73. package/lib/chain/interface.d.ts +3 -3
  74. package/lib/chain/interface.d.ts.map +1 -1
  75. package/lib/chain/interface.js.map +1 -1
  76. package/lib/chain/opPools/index.d.ts +0 -1
  77. package/lib/chain/opPools/index.d.ts.map +1 -1
  78. package/lib/chain/opPools/index.js +0 -1
  79. package/lib/chain/opPools/index.js.map +1 -1
  80. package/lib/chain/opPools/opPool.d.ts +9 -3
  81. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  82. package/lib/chain/opPools/opPool.js +22 -16
  83. package/lib/chain/opPools/opPool.js.map +1 -1
  84. package/lib/chain/options.d.ts.map +1 -1
  85. package/lib/chain/options.js +1 -2
  86. package/lib/chain/options.js.map +1 -1
  87. package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -3
  88. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  89. package/lib/chain/produceBlock/produceBlockBody.js +3 -33
  90. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  91. package/lib/chain/regen/interface.d.ts +0 -1
  92. package/lib/chain/regen/interface.d.ts.map +1 -1
  93. package/lib/chain/regen/interface.js +0 -1
  94. package/lib/chain/regen/interface.js.map +1 -1
  95. package/lib/chain/seenCache/index.d.ts +1 -0
  96. package/lib/chain/seenCache/index.d.ts.map +1 -1
  97. package/lib/chain/seenCache/index.js +1 -0
  98. package/lib/chain/seenCache/index.js.map +1 -1
  99. package/lib/chain/seenCache/seenBlockProposers.d.ts +3 -0
  100. package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
  101. package/lib/chain/seenCache/seenBlockProposers.js +6 -2
  102. package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
  103. package/lib/chain/seenCache/seenDataColumnSidecars.d.ts +17 -0
  104. package/lib/chain/seenCache/seenDataColumnSidecars.d.ts.map +1 -0
  105. package/lib/chain/seenCache/seenDataColumnSidecars.js +61 -0
  106. package/lib/chain/seenCache/seenDataColumnSidecars.js.map +1 -0
  107. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -2
  108. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  109. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +28 -2
  110. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  111. package/lib/chain/validation/attestation.d.ts.map +1 -1
  112. package/lib/chain/validation/attestation.js +4 -2
  113. package/lib/chain/validation/attestation.js.map +1 -1
  114. package/lib/chain/validation/block.d.ts.map +1 -1
  115. package/lib/chain/validation/block.js +20 -7
  116. package/lib/chain/validation/block.js.map +1 -1
  117. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  118. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  119. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  120. package/lib/chain/validation/executionPayloadBid.js +1 -34
  121. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  122. package/lib/chain/validation/index.d.ts +0 -1
  123. package/lib/chain/validation/index.d.ts.map +1 -1
  124. package/lib/chain/validation/index.js +0 -1
  125. package/lib/chain/validation/index.js.map +1 -1
  126. package/lib/chain/validation/proposerSlashing.js +5 -1
  127. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  128. package/lib/chain/validation/voluntaryExit.js +2 -2
  129. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  130. package/lib/execution/builder/validateBid.d.ts.map +1 -1
  131. package/lib/execution/builder/validateBid.js +1 -14
  132. package/lib/execution/builder/validateBid.js.map +1 -1
  133. package/lib/execution/engine/disabled.d.ts +0 -1
  134. package/lib/execution/engine/disabled.d.ts.map +1 -1
  135. package/lib/execution/engine/disabled.js +0 -3
  136. package/lib/execution/engine/disabled.js.map +1 -1
  137. package/lib/execution/engine/http.d.ts +2 -8
  138. package/lib/execution/engine/http.d.ts.map +1 -1
  139. package/lib/execution/engine/http.js +4 -27
  140. package/lib/execution/engine/http.js.map +1 -1
  141. package/lib/execution/engine/interface.d.ts +2 -13
  142. package/lib/execution/engine/interface.d.ts.map +1 -1
  143. package/lib/execution/engine/interface.js.map +1 -1
  144. package/lib/execution/engine/jsonRpcTransport.d.ts +2 -3
  145. package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
  146. package/lib/execution/engine/jsonRpcTransport.js +9 -33
  147. package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
  148. package/lib/execution/engine/mock.d.ts +0 -1
  149. package/lib/execution/engine/mock.d.ts.map +1 -1
  150. package/lib/execution/engine/mock.js +3 -25
  151. package/lib/execution/engine/mock.js.map +1 -1
  152. package/lib/execution/engine/payloadIdCache.d.ts +1 -4
  153. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  154. package/lib/execution/engine/payloadIdCache.js +2 -16
  155. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  156. package/lib/execution/engine/restTransport.d.ts +1 -2
  157. package/lib/execution/engine/restTransport.d.ts.map +1 -1
  158. package/lib/execution/engine/restTransport.js +0 -3
  159. package/lib/execution/engine/restTransport.js.map +1 -1
  160. package/lib/execution/engine/transport.d.ts +2 -3
  161. package/lib/execution/engine/transport.d.ts.map +1 -1
  162. package/lib/execution/engine/types.d.ts +0 -24
  163. package/lib/execution/engine/types.d.ts.map +1 -1
  164. package/lib/execution/engine/types.js +0 -12
  165. package/lib/execution/engine/types.js.map +1 -1
  166. package/lib/index.d.ts +1 -0
  167. package/lib/index.d.ts.map +1 -1
  168. package/lib/index.js +1 -0
  169. package/lib/index.js.map +1 -1
  170. package/lib/metrics/metrics/beacon.d.ts +0 -16
  171. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  172. package/lib/metrics/metrics/beacon.js +0 -35
  173. package/lib/metrics/metrics/beacon.js.map +1 -1
  174. package/lib/metrics/metrics/lodestar.d.ts +0 -9
  175. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  176. package/lib/metrics/metrics/lodestar.js +0 -20
  177. package/lib/metrics/metrics/lodestar.js.map +1 -1
  178. package/lib/network/core/networkCore.d.ts +1 -3
  179. package/lib/network/core/networkCore.d.ts.map +1 -1
  180. package/lib/network/core/networkCore.js +1 -3
  181. package/lib/network/core/networkCore.js.map +1 -1
  182. package/lib/network/forks.d.ts +2 -2
  183. package/lib/network/forks.d.ts.map +1 -1
  184. package/lib/network/forks.js +3 -3
  185. package/lib/network/forks.js.map +1 -1
  186. package/lib/network/gossip/interface.d.ts +2 -8
  187. package/lib/network/gossip/interface.d.ts.map +1 -1
  188. package/lib/network/gossip/interface.js +0 -1
  189. package/lib/network/gossip/interface.js.map +1 -1
  190. package/lib/network/gossip/scoringParameters.js +19 -14
  191. package/lib/network/gossip/scoringParameters.js.map +1 -1
  192. package/lib/network/gossip/topic.d.ts +17 -29
  193. package/lib/network/gossip/topic.d.ts.map +1 -1
  194. package/lib/network/gossip/topic.js +1 -13
  195. package/lib/network/gossip/topic.js.map +1 -1
  196. package/lib/network/interface.d.ts +1 -2
  197. package/lib/network/interface.d.ts.map +1 -1
  198. package/lib/network/network.d.ts +2 -8
  199. package/lib/network/network.d.ts.map +1 -1
  200. package/lib/network/network.js +16 -45
  201. package/lib/network/network.js.map +1 -1
  202. package/lib/network/options.d.ts +0 -1
  203. package/lib/network/options.d.ts.map +1 -1
  204. package/lib/network/options.js +0 -1
  205. package/lib/network/options.js.map +1 -1
  206. package/lib/network/peers/discover.d.ts +1 -0
  207. package/lib/network/peers/discover.d.ts.map +1 -1
  208. package/lib/network/peers/discover.js +44 -48
  209. package/lib/network/peers/discover.js.map +1 -1
  210. package/lib/network/peers/score/store.d.ts.map +1 -1
  211. package/lib/network/peers/score/store.js +1 -2
  212. package/lib/network/peers/score/store.js.map +1 -1
  213. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  214. package/lib/network/processor/gossipHandlers.js +76 -50
  215. package/lib/network/processor/gossipHandlers.js.map +1 -1
  216. package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
  217. package/lib/network/processor/gossipQueues/index.js +0 -6
  218. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  219. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  220. package/lib/network/processor/gossipValidatorFn.js +1 -5
  221. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  222. package/lib/network/processor/index.d.ts.map +1 -1
  223. package/lib/network/processor/index.js +0 -1
  224. package/lib/network/processor/index.js.map +1 -1
  225. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  226. package/lib/network/reqresp/ReqRespBeaconNode.js +0 -6
  227. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  228. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  229. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -1
  230. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  231. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  232. package/lib/network/reqresp/handlers/index.js +0 -5
  233. package/lib/network/reqresp/handlers/index.js.map +1 -1
  234. package/lib/network/reqresp/protocols.d.ts +0 -1
  235. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  236. package/lib/network/reqresp/protocols.js +0 -5
  237. package/lib/network/reqresp/protocols.js.map +1 -1
  238. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  239. package/lib/network/reqresp/rateLimit.js +0 -4
  240. package/lib/network/reqresp/rateLimit.js.map +1 -1
  241. package/lib/network/reqresp/types.d.ts +2 -5
  242. package/lib/network/reqresp/types.d.ts.map +1 -1
  243. package/lib/network/reqresp/types.js +0 -3
  244. package/lib/network/reqresp/types.js.map +1 -1
  245. package/lib/sync/range/chain.d.ts.map +1 -1
  246. package/lib/sync/range/chain.js +1 -0
  247. package/lib/sync/range/chain.js.map +1 -1
  248. package/lib/sync/range/range.d.ts.map +1 -1
  249. package/lib/sync/range/range.js +5 -1
  250. package/lib/sync/range/range.js.map +1 -1
  251. package/lib/sync/unknownBlock.d.ts.map +1 -1
  252. package/lib/sync/unknownBlock.js +14 -1
  253. package/lib/sync/unknownBlock.js.map +1 -1
  254. package/lib/sync/utils/downloadByRange.d.ts +6 -0
  255. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  256. package/lib/sync/utils/downloadByRange.js +17 -8
  257. package/lib/sync/utils/downloadByRange.js.map +1 -1
  258. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  259. package/lib/sync/utils/downloadByRoot.js +1 -1
  260. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  261. package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
  262. package/lib/sync/utils/pendingBlocksTree.js +6 -1
  263. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  264. package/lib/util/dataColumns.d.ts +2 -1
  265. package/lib/util/dataColumns.d.ts.map +1 -1
  266. package/lib/util/dataColumns.js +7 -2
  267. package/lib/util/dataColumns.js.map +1 -1
  268. package/lib/util/execution.d.ts +2 -1
  269. package/lib/util/execution.d.ts.map +1 -1
  270. package/lib/util/execution.js +7 -2
  271. package/lib/util/execution.js.map +1 -1
  272. package/package.json +18 -21
  273. package/src/api/impl/beacon/blocks/index.ts +1 -5
  274. package/src/api/impl/beacon/pool/index.ts +11 -0
  275. package/src/api/impl/beacon/state/index.ts +3 -7
  276. package/src/api/impl/beacon/state/utils.ts +1 -1
  277. package/src/api/impl/config/constants.ts +0 -4
  278. package/src/api/impl/debug/index.ts +0 -4
  279. package/src/api/impl/errors.ts +10 -0
  280. package/src/api/impl/validator/index.ts +2 -123
  281. package/src/api/rest/base.ts +4 -2
  282. package/src/chain/ColumnReconstructionTracker.ts +5 -1
  283. package/src/chain/GetBlobsTracker.ts +5 -0
  284. package/src/chain/blocks/importBlock.ts +14 -7
  285. package/src/chain/blocks/importExecutionPayload.ts +7 -74
  286. package/src/chain/blocks/payloadEnvelopeInput/types.ts +8 -1
  287. package/src/chain/blocks/types.ts +0 -5
  288. package/src/chain/chain.ts +34 -9
  289. package/src/chain/errors/dataColumnSidecarError.ts +8 -0
  290. package/src/chain/errors/executionPayloadBid.ts +0 -18
  291. package/src/chain/errors/index.ts +0 -1
  292. package/src/chain/forkChoice/index.ts +233 -13
  293. package/src/chain/forkChoiceExecutionEngine.ts +1 -5
  294. package/src/chain/interface.ts +2 -2
  295. package/src/chain/opPools/index.ts +0 -1
  296. package/src/chain/opPools/opPool.ts +27 -16
  297. package/src/chain/options.ts +1 -2
  298. package/src/chain/produceBlock/produceBlockBody.ts +12 -66
  299. package/src/chain/regen/interface.ts +0 -1
  300. package/src/chain/seenCache/index.ts +1 -0
  301. package/src/chain/seenCache/seenBlockProposers.ts +12 -2
  302. package/src/chain/seenCache/seenDataColumnSidecars.ts +69 -0
  303. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +28 -2
  304. package/src/chain/validation/attestation.ts +4 -2
  305. package/src/chain/validation/block.ts +19 -7
  306. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  307. package/src/chain/validation/executionPayloadBid.ts +2 -49
  308. package/src/chain/validation/index.ts +0 -1
  309. package/src/chain/validation/proposerSlashing.ts +5 -1
  310. package/src/chain/validation/voluntaryExit.ts +2 -2
  311. package/src/execution/builder/validateBid.ts +2 -23
  312. package/src/execution/engine/disabled.ts +0 -4
  313. package/src/execution/engine/http.ts +5 -40
  314. package/src/execution/engine/interface.ts +2 -24
  315. package/src/execution/engine/jsonRpcTransport.ts +9 -46
  316. package/src/execution/engine/mock.ts +3 -26
  317. package/src/execution/engine/payloadIdCache.ts +4 -25
  318. package/src/execution/engine/restTransport.ts +1 -15
  319. package/src/execution/engine/transport.ts +2 -5
  320. package/src/execution/engine/types.ts +0 -35
  321. package/src/index.ts +1 -0
  322. package/src/metrics/metrics/beacon.ts +0 -37
  323. package/src/metrics/metrics/lodestar.ts +0 -21
  324. package/src/network/core/networkCore.ts +1 -3
  325. package/src/network/forks.ts +7 -3
  326. package/src/network/gossip/interface.ts +0 -5
  327. package/src/network/gossip/scoringParameters.ts +23 -14
  328. package/src/network/gossip/topic.ts +0 -14
  329. package/src/network/interface.ts +0 -2
  330. package/src/network/network.ts +20 -55
  331. package/src/network/options.ts +0 -2
  332. package/src/network/peers/discover.ts +42 -52
  333. package/src/network/peers/score/store.ts +1 -2
  334. package/src/network/processor/gossipHandlers.ts +135 -69
  335. package/src/network/processor/gossipQueues/index.ts +0 -6
  336. package/src/network/processor/gossipValidatorFn.ts +0 -5
  337. package/src/network/processor/index.ts +0 -1
  338. package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
  339. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -1
  340. package/src/network/reqresp/handlers/index.ts +0 -5
  341. package/src/network/reqresp/protocols.ts +0 -6
  342. package/src/network/reqresp/rateLimit.ts +0 -4
  343. package/src/network/reqresp/types.ts +0 -6
  344. package/src/sync/range/chain.ts +1 -0
  345. package/src/sync/range/range.ts +7 -1
  346. package/src/sync/unknownBlock.ts +20 -1
  347. package/src/sync/utils/downloadByRange.ts +30 -7
  348. package/src/sync/utils/downloadByRoot.ts +12 -9
  349. package/src/sync/utils/pendingBlocksTree.ts +6 -1
  350. package/src/util/dataColumns.ts +13 -1
  351. package/src/util/execution.ts +16 -1
  352. package/lib/chain/errors/inclusionList.d.ts +0 -60
  353. package/lib/chain/errors/inclusionList.d.ts.map +0 -1
  354. package/lib/chain/errors/inclusionList.js +0 -19
  355. package/lib/chain/errors/inclusionList.js.map +0 -1
  356. package/lib/chain/opPools/inclusionListStore.d.ts +0 -66
  357. package/lib/chain/opPools/inclusionListStore.d.ts.map +0 -1
  358. package/lib/chain/opPools/inclusionListStore.js +0 -174
  359. package/lib/chain/opPools/inclusionListStore.js.map +0 -1
  360. package/lib/chain/validation/inclusionList.d.ts +0 -14
  361. package/lib/chain/validation/inclusionList.d.ts.map +0 -1
  362. package/lib/chain/validation/inclusionList.js +0 -150
  363. package/lib/chain/validation/inclusionList.js.map +0 -1
  364. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +0 -10
  365. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +0 -1
  366. package/lib/network/reqresp/handlers/inclusionListsByIndices.js +0 -30
  367. package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +0 -1
  368. package/src/chain/errors/inclusionList.ts +0 -38
  369. package/src/chain/opPools/inclusionListStore.ts +0 -211
  370. package/src/chain/validation/inclusionList.ts +0 -192
  371. package/src/network/reqresp/handlers/inclusionListsByIndices.ts +0 -44
@@ -35,6 +35,7 @@ export enum DataColumnSidecarErrorCode {
35
35
 
36
36
  // following errors are adapted from the block errors
37
37
  ALREADY_KNOWN = "DATA_COLUMN_SIDECAR_ERROR_ALREADY_KNOWN",
38
+ REPEAT_PROPOSAL = "DATA_COLUMN_SIDECAR_ERROR_REPEAT_PROPOSAL",
38
39
  FUTURE_SLOT = "DATA_COLUMN_SIDECAR_ERROR_FUTURE_SLOT",
39
40
  WOULD_REVERT_FINALIZED_SLOT = "DATA_COLUMN_SIDECAR_ERROR_WOULD_REVERT_FINALIZED_SLOT",
40
41
  PARENT_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_PARENT_UNKNOWN",
@@ -79,6 +80,13 @@ export type DataColumnSidecarErrorType =
79
80
  limit: number;
80
81
  }
81
82
  | {code: DataColumnSidecarErrorCode.ALREADY_KNOWN; columnIndex: number; slot: Slot}
83
+ | {
84
+ code: DataColumnSidecarErrorCode.REPEAT_PROPOSAL;
85
+ slot: Slot;
86
+ proposerIndex: number;
87
+ columnIndex: number;
88
+ root: RootHex;
89
+ }
82
90
  | {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}
83
91
  | {code: DataColumnSidecarErrorCode.WOULD_REVERT_FINALIZED_SLOT; blockSlot: Slot; finalizedSlot: Slot}
84
92
  | {
@@ -21,9 +21,6 @@ export enum ExecutionPayloadBidErrorCode {
21
21
  NO_MATCHING_PROPOSER_PREFERENCES = "EXECUTION_PAYLOAD_BID_ERROR_NO_MATCHING_PROPOSER_PREFERENCES",
22
22
  PROPOSER_PREFERENCES_FEE_RECIPIENT_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_PROPOSER_PREFERENCES_FEE_RECIPIENT_MISMATCH",
23
23
  PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH",
24
- INCLUSION_LIST_BITS_NOT_INCLUSIVE = "EXECUTION_PAYLOAD_BID_ERROR_INCLUSION_LIST_BITS_NOT_INCLUSIVE",
25
- UNKNOWN_INCLUSION_LIST_DEPENDENT_ROOT = "EXECUTION_PAYLOAD_BID_ERROR_UNKNOWN_INCLUSION_LIST_DEPENDENT_ROOT",
26
- BEFORE_INCLUSION_LIST_DEADLINE = "EXECUTION_PAYLOAD_BID_ERROR_BEFORE_INCLUSION_LIST_DEADLINE",
27
24
  BEFORE_PAYLOAD_ATTESTATION_DEADLINE = "EXECUTION_PAYLOAD_BID_ERROR_BEFORE_PAYLOAD_ATTESTATION_DEADLINE",
28
25
  }
29
26
 
@@ -91,21 +88,6 @@ export type ExecutionPayloadBidErrorType =
91
88
  bidFeeRecipient: string;
92
89
  expectedFeeRecipient: string;
93
90
  }
94
- | {
95
- code: ExecutionPayloadBidErrorCode.INCLUSION_LIST_BITS_NOT_INCLUSIVE;
96
- builderIndex: BuilderIndex;
97
- slot: Slot;
98
- }
99
- | {
100
- code: ExecutionPayloadBidErrorCode.UNKNOWN_INCLUSION_LIST_DEPENDENT_ROOT;
101
- slot: Slot;
102
- parentBlockRoot: RootHex;
103
- }
104
- | {
105
- code: ExecutionPayloadBidErrorCode.BEFORE_INCLUSION_LIST_DEADLINE;
106
- builderIndex: BuilderIndex;
107
- slot: Slot;
108
- }
109
91
  | {
110
92
  code: ExecutionPayloadBidErrorCode.BEFORE_PAYLOAD_ATTESTATION_DEADLINE;
111
93
  builderIndex: BuilderIndex;
@@ -7,7 +7,6 @@ export * from "./envelopeReconstructionError.js";
7
7
  export * from "./executionPayloadBid.js";
8
8
  export * from "./executionPayloadEnvelope.js";
9
9
  export * from "./gossipValidation.js";
10
- export * from "./inclusionList.js";
11
10
  export * from "./payloadAttestation.js";
12
11
  export * from "./proposerPreferences.js";
13
12
  export * from "./proposerSlashingError.js";
@@ -5,28 +5,33 @@ import {
5
5
  ForkChoice,
6
6
  ForkChoiceStateGetter,
7
7
  ForkChoiceStore,
8
+ IForkChoice,
8
9
  JustifiedBalancesGetter,
10
+ NativeForkChoice,
9
11
  PayloadStatus,
10
12
  ProtoArray,
11
13
  ProtoBlock,
12
14
  ForkChoiceOpts as RawForkChoiceOpts,
13
15
  } from "@lodestar/fork-choice";
14
- import {ZERO_HASH_HEX} from "@lodestar/params";
16
+ import {ForkSeq, SLOTS_PER_HISTORICAL_ROOT, ZERO_HASH_HEX, isForkPostGloas} from "@lodestar/params";
15
17
  import {
16
18
  DataAvailabilityStatus,
17
19
  IBeaconStateView,
20
+ ZERO_HASH,
18
21
  computeEpochAtSlot,
19
22
  computeStartSlotAtEpoch,
20
23
  isStatePostBellatrix,
21
24
  isStatePostGloas,
22
25
  } from "@lodestar/state-transition";
23
- import {Slot, ssz} from "@lodestar/types";
24
- import {Logger, toRootHex} from "@lodestar/utils";
26
+ import {Slot, phase0, ssz} from "@lodestar/types";
27
+ import {Logger, fromHex, toRootHex} from "@lodestar/utils";
25
28
  import {GENESIS_SLOT} from "../../constants/index.js";
26
29
  import {Metrics} from "../../metrics/index.js";
27
30
  import {ChainEvent, ChainEventEmitter} from "../emitter.js";
28
31
 
29
32
  export type ForkChoiceOpts = RawForkChoiceOpts & {
33
+ /** Use the native (Zig) fork choice store instead of the proto-array */
34
+ nativeForkChoice?: boolean;
30
35
  // for testing only
31
36
  forkchoiceConstructor?: typeof ForkChoice;
32
37
  };
@@ -58,7 +63,22 @@ export function initializeForkChoice(
58
63
  stateGetter: ForkChoiceStateGetter,
59
64
  metrics: Metrics | null,
60
65
  logger?: Logger
61
- ): ForkChoice {
66
+ ): IForkChoice {
67
+ if (opts.nativeForkChoice) {
68
+ return initializeNativeForkChoice(
69
+ config,
70
+ emitter,
71
+ currentSlot,
72
+ state,
73
+ isFinalizedState,
74
+ opts,
75
+ justifiedBalancesGetter,
76
+ stateGetter,
77
+ metrics,
78
+ logger
79
+ );
80
+ }
81
+
62
82
  return isFinalizedState
63
83
  ? initializeForkChoiceFromFinalizedState(
64
84
  config,
@@ -115,7 +135,7 @@ export function initializeForkChoiceFromFinalizedState(
115
135
  // production code use ForkChoice constructor directly
116
136
  const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
117
137
 
118
- const isForkPostGloas = computeEpochAtSlot(state.slot) >= config.GLOAS_FORK_EPOCH;
138
+ const isPostGloasAnchor = isStatePostGloas(state) && isForkPostGloas(config.getForkName(blockHeader.slot));
119
139
 
120
140
  return new forkchoiceConstructor(
121
141
  config,
@@ -164,15 +184,20 @@ export function initializeForkChoiceFromFinalizedState(
164
184
  // TODO GLOAS: executionPayloadNumber/GasLimit are not tracked in BeaconState post-gloas
165
185
  // (EIP-7732 removed latestExecutionPayloadHeader). Using 0 as unavailable fallback —
166
186
  // see initializeForkChoiceFromUnfinalizedState for the same caveat on validation.
187
+ // A pre-Gloas anchor's gas limit is kept in the state's bid by the upgrade.
167
188
  executionPayloadNumber: isStatePostGloas(state) ? 0 : state.payloadBlockNumber,
168
- executionPayloadGasLimit: isStatePostGloas(state) ? 0 : state.latestExecutionPayloadHeader.gasLimit,
189
+ executionPayloadGasLimit: isPostGloasAnchor
190
+ ? 0
191
+ : isStatePostGloas(state)
192
+ ? Number(state.latestExecutionPayloadBid.gasLimit)
193
+ : state.latestExecutionPayloadHeader.gasLimit,
169
194
  executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
170
195
  }
171
196
  : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
172
197
 
173
198
  dataAvailabilityStatus: DataAvailabilityStatus.PreData,
174
- payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL,
175
- parentBlockHash: isStatePostGloas(state) ? toRootHex(state.latestBlockHash) : null,
199
+ payloadStatus: isPostGloasAnchor ? PayloadStatus.PENDING : PayloadStatus.FULL,
200
+ parentBlockHash: isPostGloasAnchor ? toRootHex(state.latestBlockHash) : null,
176
201
  },
177
202
  currentSlot
178
203
  ),
@@ -183,6 +208,198 @@ export function initializeForkChoiceFromFinalizedState(
183
208
  );
184
209
  }
185
210
 
211
+ /**
212
+ * Initialize the native fork choice. A finalized anchor is both the justified and the finalized
213
+ * checkpoint, as in the spec's `get_forkchoice_store`. An unfinalized one keeps its state's
214
+ * checkpoints, with stand-ins for the ancestors that connect it to them: nothing is reported as
215
+ * finalized that the chain has not finalized.
216
+ */
217
+ export function initializeNativeForkChoice(
218
+ config: ChainForkConfig,
219
+ emitter: ChainEventEmitter,
220
+ currentSlot: Slot,
221
+ state: IBeaconStateView,
222
+ isFinalizedState: boolean,
223
+ opts: ForkChoiceOpts,
224
+ justifiedBalancesGetter: JustifiedBalancesGetter,
225
+ stateGetter: ForkChoiceStateGetter,
226
+ metrics: Metrics | null,
227
+ logger?: Logger
228
+ ): NativeForkChoice {
229
+ const {blockHeader, checkpoint} = state.computeAnchorCheckpoint();
230
+ const anchorRoot = toRootHex(checkpoint.root);
231
+ const isPostGloas = isStatePostGloas(state);
232
+ // A state upgraded to Gloas through skipped slots still holds a pre-Gloas block, which carried its own payload
233
+ const isPostGloasAnchor = isPostGloas && config.getForkSeq(blockHeader.slot) >= ForkSeq.gloas;
234
+ const bid = isPostGloasAnchor ? state.latestExecutionPayloadBid : null;
235
+ const hasPayload = isStatePostBellatrix(state) && state.isExecutionStateType && state.isMergeTransitionComplete;
236
+ // The state caches the bid of its latest block, except at genesis: the genesis block carries no bid
237
+ const anchorBid = blockHeader.slot === GENESIS_SLOT ? null : bid;
238
+
239
+ // The store aliases no root to genesis, so a checkpoint the chain never moved off genesis is
240
+ // given the genesis block root. Only possible while that root is still in the state's history.
241
+ const withGenesisRoot = (cp: phase0.Checkpoint): phase0.Checkpoint => {
242
+ if (!ssz.Root.equals(cp.root, ZERO_HASH)) return cp;
243
+ if (state.slot > GENESIS_SLOT + SLOTS_PER_HISTORICAL_ROOT) {
244
+ throw Error(
245
+ `The native fork choice cannot start from an unfinalized state at slot ${state.slot} of a chain that never justified a checkpoint: the genesis block root has left the state's block roots. Start without --chain.nativeForkChoice`
246
+ );
247
+ }
248
+ return {epoch: cp.epoch, root: state.getBlockRootAtSlot(GENESIS_SLOT)};
249
+ };
250
+ const justifiedCheckpoint = isFinalizedState ? checkpoint : withGenesisRoot(state.currentJustifiedCheckpoint);
251
+ const finalizedCheckpoint = isFinalizedState ? checkpoint : withGenesisRoot(state.finalizedCheckpoint);
252
+ const justifiedRoot = toRootHex(justifiedCheckpoint.root);
253
+ const finalizedRoot = toRootHex(finalizedCheckpoint.root);
254
+
255
+ if (!isFinalizedState) {
256
+ logger?.warn("Initializing fork choice from unfinalized state", {
257
+ currentSlot,
258
+ stateSlot: state.slot,
259
+ headSlot: blockHeader.slot,
260
+ headRoot: anchorRoot,
261
+ finalizedEpoch: finalizedCheckpoint.epoch,
262
+ finalizedRoot,
263
+ justifiedEpoch: justifiedCheckpoint.epoch,
264
+ justifiedRoot,
265
+ });
266
+ }
267
+
268
+ const store = new ForkChoiceStore(
269
+ currentSlot,
270
+ justifiedCheckpoint,
271
+ finalizedCheckpoint,
272
+ // For an unfinalized anchor this is not the justified state, but no other state is at hand
273
+ state.getEffectiveBalanceIncrementsZeroInactive(),
274
+ justifiedBalancesGetter,
275
+ stateGetter,
276
+ {
277
+ onJustified: (cp) => emitter.emit(ChainEvent.forkChoiceJustified, cp),
278
+ onFinalized: (cp) => emitter.emit(ChainEvent.forkChoiceFinalized, cp),
279
+ onFastConfirmation: ({block, slot, currentSlot}) =>
280
+ emitter.emit(routes.events.EventType.fastConfirmation, {block, slot, currentSlot}),
281
+ onPtcQuorum: (data) => emitter.emit(ChainEvent.forkChoicePtcQuorum, data),
282
+ }
283
+ );
284
+
285
+ const checkpoints = {
286
+ justifiedEpoch: justifiedCheckpoint.epoch,
287
+ justifiedRoot,
288
+ finalizedEpoch: finalizedCheckpoint.epoch,
289
+ finalizedRoot,
290
+ unrealizedJustifiedEpoch: justifiedCheckpoint.epoch,
291
+ unrealizedJustifiedRoot: justifiedRoot,
292
+ unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
293
+ unrealizedFinalizedRoot: finalizedRoot,
294
+ };
295
+
296
+ const block: ProtoBlock = {
297
+ slot: blockHeader.slot,
298
+ parentRoot: toRootHex(blockHeader.parentRoot),
299
+ stateRoot: toRootHex(blockHeader.stateRoot),
300
+ blockRoot: anchorRoot,
301
+ targetRoot: anchorRoot,
302
+ timeliness: true,
303
+ ptcTimeliness: true,
304
+ importedTimely: true,
305
+ proposerIndex: blockHeader.proposerIndex,
306
+ ...checkpoints,
307
+
308
+ ...(hasPayload
309
+ ? {
310
+ executionPayloadBlockHash: isPostGloas
311
+ ? toRootHex(state.latestBlockHash)
312
+ : toRootHex(state.latestExecutionPayloadHeader.blockHash),
313
+ // TODO GLOAS: not tracked in BeaconState post-gloas, see initializeForkChoiceFromFinalizedState
314
+ executionPayloadNumber: isPostGloas ? 0 : state.payloadBlockNumber,
315
+ // The upgrade to Gloas keeps a pre-Gloas block's payload gas limit in the state's bid
316
+ executionPayloadGasLimit: isPostGloasAnchor
317
+ ? 0
318
+ : isPostGloas
319
+ ? Number(state.latestExecutionPayloadBid.gasLimit)
320
+ : state.latestExecutionPayloadHeader.gasLimit,
321
+ executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
322
+ }
323
+ : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
324
+
325
+ dataAvailabilityStatus: DataAvailabilityStatus.PreData,
326
+ payloadStatus: isPostGloasAnchor ? PayloadStatus.PENDING : PayloadStatus.FULL,
327
+ parentBlockHash: bid === null ? null : toRootHex(bid.parentBlockHash),
328
+ };
329
+
330
+ // Ancestors of the anchor known by root only: the finalized block, the justified block, the
331
+ // anchor's parent, and for the anchor's epoch and the one before the checkpoint block, which the
332
+ // chain can still justify and which current votes target, and the block before it, the
333
+ // dependent root of the next epoch's duties. Their slots are upper bounds and their payloads
334
+ // unknown, so they carry none.
335
+ const unfinalizedAncestors: ProtoBlock[] = [];
336
+ if (!isFinalizedState) {
337
+ const finalizedSlot = computeStartSlotAtEpoch(finalizedCheckpoint.epoch);
338
+ const candidates: [string, Slot][] = [
339
+ [finalizedRoot, finalizedSlot],
340
+ [justifiedRoot, computeStartSlotAtEpoch(justifiedCheckpoint.epoch)],
341
+ [block.parentRoot, blockHeader.slot - 1],
342
+ ];
343
+ const anchorEpoch = computeEpochAtSlot(state.slot);
344
+ for (const epoch of [anchorEpoch - 1, anchorEpoch]) {
345
+ const checkpointSlot = computeStartSlotAtEpoch(epoch);
346
+ for (const slot of [checkpointSlot - 1, checkpointSlot]) {
347
+ if (slot > finalizedSlot && slot < blockHeader.slot) {
348
+ candidates.push([toRootHex(state.getBlockRootAtSlot(slot)), slot]);
349
+ }
350
+ }
351
+ }
352
+ // Roots repeat over skipped slots: a block keeps the lowest slot it is known at
353
+ candidates.sort((a, b) => a[1] - b[1]);
354
+ for (const [blockRoot, slot] of candidates) {
355
+ const isKnown = blockRoot === anchorRoot || unfinalizedAncestors.some((b) => b.blockRoot === blockRoot);
356
+ if (isKnown || blockRoot === ZERO_HASH_HEX) continue;
357
+ const isGloas = config.getForkSeq(slot) >= ForkSeq.gloas;
358
+ const targetSlot = computeStartSlotAtEpoch(computeEpochAtSlot(slot));
359
+ unfinalizedAncestors.push({
360
+ slot,
361
+ blockRoot,
362
+ parentRoot: unfinalizedAncestors.at(-1)?.blockRoot ?? ZERO_HASH_HEX,
363
+ stateRoot: ZERO_HASH_HEX,
364
+ targetRoot: targetSlot === slot ? blockRoot : toRootHex(state.getBlockRootAtSlot(targetSlot)),
365
+ timeliness: false,
366
+ ptcTimeliness: false,
367
+ importedTimely: false,
368
+ proposerIndex: 0,
369
+ ...checkpoints,
370
+ executionPayloadBlockHash: null,
371
+ executionStatus: ExecutionStatus.PreMerge,
372
+ dataAvailabilityStatus: DataAvailabilityStatus.PreData,
373
+ payloadStatus: isGloas ? PayloadStatus.PENDING : PayloadStatus.FULL,
374
+ parentBlockHash: isGloas ? ZERO_HASH_HEX : null,
375
+ });
376
+ }
377
+ }
378
+
379
+ return new NativeForkChoice(
380
+ config,
381
+ store,
382
+ {
383
+ block,
384
+ stateSlot: state.slot,
385
+ genesisTime: state.genesisTime,
386
+ genesisValidatorsRoot: state.genesisValidatorsRoot,
387
+ justifiedCheckpoint: isFinalizedState ? state.currentJustifiedCheckpoint : justifiedCheckpoint,
388
+ finalizedCheckpoint: isFinalizedState ? state.finalizedCheckpoint : finalizedCheckpoint,
389
+ unfinalizedAncestors: isFinalizedState ? undefined : unfinalizedAncestors,
390
+ payloadBlockHash: isPostGloasAnchor
391
+ ? (anchorBid?.blockHash ?? null)
392
+ : block.executionPayloadBlockHash === null
393
+ ? null
394
+ : fromHex(block.executionPayloadBlockHash),
395
+ bidParentBlockHash: anchorBid?.parentBlockHash ?? null,
396
+ },
397
+ metrics,
398
+ opts,
399
+ logger
400
+ );
401
+ }
402
+
186
403
  /**
187
404
  * Initialize forkchoice from an unfinalized state.
188
405
  */
@@ -217,7 +434,7 @@ export function initializeForkChoiceFromUnfinalizedState(
217
434
  // this is not the justified state, but there is no other ways to get justified balances
218
435
  const justifiedBalances = unfinalizedState.getEffectiveBalanceIncrementsZeroInactive();
219
436
 
220
- const isForkPostGloas = computeEpochAtSlot(unfinalizedState.slot) >= config.GLOAS_FORK_EPOCH;
437
+ const isPostGloasAnchor = isStatePostGloas(unfinalizedState) && isForkPostGloas(config.getForkName(blockHeader.slot));
221
438
 
222
439
  const store = new ForkChoiceStore(
223
440
  currentSlot,
@@ -270,17 +487,20 @@ export function initializeForkChoiceFromUnfinalizedState(
270
487
  // PENDING/EMPTY convention), so gossip bids that reference the head's *own* payload
271
488
  // hash won't match this variant anyway and will IGNORE until `onExecutionPayload`
272
489
  // upgrades the head to FULL with real values.
490
+ // A pre-Gloas anchor's gas limit is kept in the state's bid by the upgrade.
273
491
  executionPayloadNumber: isStatePostGloas(unfinalizedState) ? 0 : unfinalizedState.payloadBlockNumber,
274
- executionPayloadGasLimit: isStatePostGloas(unfinalizedState)
492
+ executionPayloadGasLimit: isPostGloasAnchor
275
493
  ? 0
276
- : unfinalizedState.latestExecutionPayloadHeader.gasLimit,
494
+ : isStatePostGloas(unfinalizedState)
495
+ ? Number(unfinalizedState.latestExecutionPayloadBid.gasLimit)
496
+ : unfinalizedState.latestExecutionPayloadHeader.gasLimit,
277
497
  executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
278
498
  }
279
499
  : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
280
500
 
281
501
  dataAvailabilityStatus: DataAvailabilityStatus.PreData,
282
- payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL,
283
- parentBlockHash: isStatePostGloas(unfinalizedState) ? toRootHex(unfinalizedState.latestBlockHash) : null,
502
+ payloadStatus: isPostGloasAnchor ? PayloadStatus.PENDING : PayloadStatus.FULL,
503
+ parentBlockHash: isPostGloasAnchor ? toRootHex(unfinalizedState.latestBlockHash) : null,
284
504
  };
285
505
 
286
506
  const parentSlot = blockHeader.slot - 1;
@@ -7,7 +7,7 @@ import {
7
7
  LVHVerdictResult,
8
8
  } from "@lodestar/fork-choice";
9
9
  import {ForkName, ForkPostFulu} from "@lodestar/params";
10
- import {RootHex, bellatrix} from "@lodestar/types";
10
+ import {RootHex} from "@lodestar/types";
11
11
  import {BlobAndProofV2} from "@lodestar/types/fulu";
12
12
  import {LogDataBasic, Logger} from "@lodestar/utils";
13
13
  import {ExecutionPayloadBodyV2} from "../execution/engine/types.js";
@@ -109,10 +109,6 @@ export class ForkChoiceExecutionEngine {
109
109
  return this.engine.getPayload(...args);
110
110
  }
111
111
 
112
- getInclusionList(): Promise<bellatrix.Transactions> {
113
- return this.engine.getInclusionList();
114
- }
115
-
116
112
  getPayloadBodiesByHashV2(blockHashes: DATA[]): Promise<(ExecutionPayloadBodyV2 | null)[]> {
117
113
  return this.engine.getPayloadBodiesByHashV2(blockHashes);
118
114
  }
@@ -50,7 +50,6 @@ import {
50
50
  AttestationPool,
51
51
  DeferredVoluntaryExitPool,
52
52
  ExecutionPayloadBidPool,
53
- InclusionListStore,
54
53
  OpPool,
55
54
  PayloadAttestationPool,
56
55
  ProposerPreferencesPool,
@@ -68,6 +67,7 @@ import {
68
67
  SeenAttesters,
69
68
  SeenBlockProposers,
70
69
  SeenContributionAndProof,
70
+ SeenDataColumnSidecars,
71
71
  SeenExecutionPayloadBids,
72
72
  SeenPayloadAttesters,
73
73
  SeenSyncCommitteeMessages,
@@ -136,7 +136,6 @@ export interface IBeaconChain {
136
136
  readonly executionPayloadBidPool: ExecutionPayloadBidPool;
137
137
  readonly payloadAttestationPool: PayloadAttestationPool;
138
138
  readonly proposerPreferencesPool: ProposerPreferencesPool;
139
- readonly inclusionListStore: InclusionListStore;
140
139
  readonly opPool: OpPool;
141
140
  readonly deferredVoluntaryExitPool: DeferredVoluntaryExitPool;
142
141
 
@@ -147,6 +146,7 @@ export interface IBeaconChain {
147
146
  readonly seenAggregatedAttestations: SeenAggregatedAttestations;
148
147
  readonly seenExecutionPayloadBids: SeenExecutionPayloadBids;
149
148
  readonly seenBlockProposers: SeenBlockProposers;
149
+ readonly seenDataColumnSidecars: SeenDataColumnSidecars;
150
150
  readonly seenSyncCommitteeMessages: SeenSyncCommitteeMessages;
151
151
  readonly seenContributionAndProof: SeenContributionAndProof;
152
152
  readonly seenAttestationDatas: SeenAttestationDatas;
@@ -2,7 +2,6 @@ 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";
6
5
  export {OpPool} from "./opPool.js";
7
6
  export {PayloadAttestationPool} from "./payloadAttestationPool.js";
8
7
  export {ProposerPreferencesPool} from "./proposerPreferencesPool.js";
@@ -1,6 +1,7 @@
1
1
  import {BeaconConfig} from "@lodestar/config";
2
2
  import {
3
3
  BLS_WITHDRAWAL_PREFIX,
4
+ FAR_FUTURE_EPOCH,
4
5
  ForkName,
5
6
  ForkSeq,
6
7
  MAX_ATTESTER_SLASHINGS,
@@ -17,6 +18,7 @@ import {
17
18
  getAttesterSlashableIndices,
18
19
  getAttesterSlashingSignatureSets,
19
20
  getProposerSlashingSignatureSets,
21
+ getValidatorFromStateBytes,
20
22
  } from "@lodestar/state-transition";
21
23
  import {
22
24
  AttesterSlashing,
@@ -389,12 +391,19 @@ export class OpPool {
389
391
  }
390
392
 
391
393
  /**
392
- * Prune all types of transactions given the latest head state
394
+ * Prune all types of transactions given the latest head state and the finalized checkpoint state.
395
+ * `finalizedState` is only needed to prune voluntary exits, and may be null when there are none.
393
396
  */
394
- pruneAll(headBlock: SignedBeaconBlock, headState: IBeaconStateView): void {
397
+ pruneAll(
398
+ headBlock: SignedBeaconBlock,
399
+ headState: IBeaconStateView,
400
+ finalizedState: IBeaconStateView | Uint8Array | null
401
+ ): void {
395
402
  this.pruneAttesterSlashings(headState);
396
403
  this.pruneProposerSlashings(headState);
397
- this.pruneVoluntaryExits(headState);
404
+ if (finalizedState !== null) {
405
+ this.pruneVoluntaryExits(finalizedState);
406
+ }
398
407
  this.pruneBlsToExecutionChanges(headBlock, headState);
399
408
  }
400
409
 
@@ -438,21 +447,23 @@ export class OpPool {
438
447
 
439
448
  /**
440
449
  * Call after finalizing
441
- * Prune if validator has already exited at or before the finalized checkpoint of the head.
450
+ * Prune if validator has already exited in the finalized state, so an exit included only in a block that is later
451
+ * orphaned stays in the pool. The finalized state may be serialized bytes if it is not in memory.
452
+ *
453
+ * Exits are not pruned by fork: from Deneb the signature domain is fixed to Capella (EIP-7044), so a fork transition
454
+ * cannot invalidate an exit verified at a Deneb+ state. Exits verified with a pre-Capella domain before crossing into
455
+ * Deneb are not handled, as only chains that cross the Deneb fork are affected.
442
456
  */
443
- private pruneVoluntaryExits(headState: IBeaconStateView): void {
444
- const headStateFork = this.config.getForkSeq(headState.slot);
445
- const finalizedEpoch = headState.finalizedCheckpoint.epoch;
446
-
457
+ private pruneVoluntaryExits(finalizedState: IBeaconStateView | Uint8Array): void {
447
458
  for (const [key, voluntaryExit] of this.voluntaryExits.entries()) {
448
- // VoluntaryExit messages signed in the previous fork become invalid and can never be included in any future
449
- // block, so just drop as the head state advances into the next fork.
450
- if (this.config.getForkSeq(computeStartSlotAtEpoch(voluntaryExit.message.epoch)) < headStateFork) {
451
- this.voluntaryExits.delete(key);
452
- }
453
-
454
- // TODO: Improve this simplistic condition
455
- if (voluntaryExit.message.epoch <= finalizedEpoch) {
459
+ const {validatorIndex} = voluntaryExit.message;
460
+ const finalizedValidator =
461
+ finalizedState instanceof Uint8Array
462
+ ? getValidatorFromStateBytes(this.config, finalizedState, validatorIndex)
463
+ : validatorIndex < finalizedState.validatorCount
464
+ ? finalizedState.getValidator(validatorIndex)
465
+ : null;
466
+ if (finalizedValidator !== null && finalizedValidator.exitEpoch !== FAR_FUTURE_EPOCH) {
456
467
  this.voluntaryExits.delete(key);
457
468
  }
458
469
  }
@@ -123,8 +123,6 @@ export const defaultChainOptions: IChainOptions = {
123
123
  maxSkipSlots: 32,
124
124
  disableProposerSlashings: false,
125
125
  // should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
126
- // batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
127
- // since this batch attestation work is designed to work with useWorker=true, make this the lowest value
128
126
  minSameMessageSignatureSetsToBatch: 2,
129
127
  // as of Feb 2025, this option turned out to be very useful:
130
128
  // - it allows to share a persisted checkpoint state to other nodes
@@ -132,6 +130,7 @@ export const defaultChainOptions: IChainOptions = {
132
130
  // - it helps debug easier when network is unfinalized
133
131
  nHistoricalStatesFileDataStore: true,
134
132
  nativeStateTransition: true,
133
+ nativeForkChoice: false,
135
134
  maxBlockStates: DEFAULT_MAX_BLOCK_STATES,
136
135
  maxCPStateEpochsInMemory: DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
137
136
  maxCPStateEpochsOnDisk: DEFAULT_MAX_CP_STATE_ON_DISK,