@lodestar/beacon-node 2.1.0-dev.475f7d67bc → 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 (378) 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 +6 -3
  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 -3
  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/seenGossipBlockInput.js +1 -1
  108. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  109. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -2
  110. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  111. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +28 -2
  112. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  113. package/lib/chain/validation/attestation.d.ts.map +1 -1
  114. package/lib/chain/validation/attestation.js +4 -2
  115. package/lib/chain/validation/attestation.js.map +1 -1
  116. package/lib/chain/validation/block.d.ts.map +1 -1
  117. package/lib/chain/validation/block.js +20 -7
  118. package/lib/chain/validation/block.js.map +1 -1
  119. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  120. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  121. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  122. package/lib/chain/validation/executionPayloadBid.js +1 -34
  123. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  124. package/lib/chain/validation/index.d.ts +0 -1
  125. package/lib/chain/validation/index.d.ts.map +1 -1
  126. package/lib/chain/validation/index.js +0 -1
  127. package/lib/chain/validation/index.js.map +1 -1
  128. package/lib/chain/validation/proposerSlashing.js +5 -1
  129. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  130. package/lib/chain/validation/voluntaryExit.js +2 -2
  131. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  132. package/lib/execution/builder/validateBid.d.ts.map +1 -1
  133. package/lib/execution/builder/validateBid.js +1 -14
  134. package/lib/execution/builder/validateBid.js.map +1 -1
  135. package/lib/execution/engine/disabled.d.ts +0 -1
  136. package/lib/execution/engine/disabled.d.ts.map +1 -1
  137. package/lib/execution/engine/disabled.js +0 -3
  138. package/lib/execution/engine/disabled.js.map +1 -1
  139. package/lib/execution/engine/http.d.ts +2 -8
  140. package/lib/execution/engine/http.d.ts.map +1 -1
  141. package/lib/execution/engine/http.js +4 -27
  142. package/lib/execution/engine/http.js.map +1 -1
  143. package/lib/execution/engine/interface.d.ts +2 -13
  144. package/lib/execution/engine/interface.d.ts.map +1 -1
  145. package/lib/execution/engine/interface.js.map +1 -1
  146. package/lib/execution/engine/jsonRpcTransport.d.ts +2 -3
  147. package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
  148. package/lib/execution/engine/jsonRpcTransport.js +9 -33
  149. package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
  150. package/lib/execution/engine/mock.d.ts +0 -1
  151. package/lib/execution/engine/mock.d.ts.map +1 -1
  152. package/lib/execution/engine/mock.js +3 -25
  153. package/lib/execution/engine/mock.js.map +1 -1
  154. package/lib/execution/engine/payloadIdCache.d.ts +1 -4
  155. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  156. package/lib/execution/engine/payloadIdCache.js +2 -16
  157. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  158. package/lib/execution/engine/restTransport.d.ts +1 -2
  159. package/lib/execution/engine/restTransport.d.ts.map +1 -1
  160. package/lib/execution/engine/restTransport.js +0 -3
  161. package/lib/execution/engine/restTransport.js.map +1 -1
  162. package/lib/execution/engine/transport.d.ts +2 -3
  163. package/lib/execution/engine/transport.d.ts.map +1 -1
  164. package/lib/execution/engine/types.d.ts +0 -24
  165. package/lib/execution/engine/types.d.ts.map +1 -1
  166. package/lib/execution/engine/types.js +0 -12
  167. package/lib/execution/engine/types.js.map +1 -1
  168. package/lib/index.d.ts +1 -0
  169. package/lib/index.d.ts.map +1 -1
  170. package/lib/index.js +1 -0
  171. package/lib/index.js.map +1 -1
  172. package/lib/metrics/metrics/beacon.d.ts +0 -16
  173. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  174. package/lib/metrics/metrics/beacon.js +0 -35
  175. package/lib/metrics/metrics/beacon.js.map +1 -1
  176. package/lib/metrics/metrics/lodestar.d.ts +0 -9
  177. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  178. package/lib/metrics/metrics/lodestar.js +0 -20
  179. package/lib/metrics/metrics/lodestar.js.map +1 -1
  180. package/lib/network/core/networkCore.d.ts +1 -3
  181. package/lib/network/core/networkCore.d.ts.map +1 -1
  182. package/lib/network/core/networkCore.js +1 -3
  183. package/lib/network/core/networkCore.js.map +1 -1
  184. package/lib/network/forks.d.ts +2 -2
  185. package/lib/network/forks.d.ts.map +1 -1
  186. package/lib/network/forks.js +3 -3
  187. package/lib/network/forks.js.map +1 -1
  188. package/lib/network/gossip/interface.d.ts +2 -8
  189. package/lib/network/gossip/interface.d.ts.map +1 -1
  190. package/lib/network/gossip/interface.js +0 -1
  191. package/lib/network/gossip/interface.js.map +1 -1
  192. package/lib/network/gossip/scoringParameters.js +19 -14
  193. package/lib/network/gossip/scoringParameters.js.map +1 -1
  194. package/lib/network/gossip/topic.d.ts +17 -29
  195. package/lib/network/gossip/topic.d.ts.map +1 -1
  196. package/lib/network/gossip/topic.js +1 -13
  197. package/lib/network/gossip/topic.js.map +1 -1
  198. package/lib/network/interface.d.ts +1 -2
  199. package/lib/network/interface.d.ts.map +1 -1
  200. package/lib/network/network.d.ts +2 -8
  201. package/lib/network/network.d.ts.map +1 -1
  202. package/lib/network/network.js +16 -45
  203. package/lib/network/network.js.map +1 -1
  204. package/lib/network/options.d.ts +0 -1
  205. package/lib/network/options.d.ts.map +1 -1
  206. package/lib/network/options.js +0 -1
  207. package/lib/network/options.js.map +1 -1
  208. package/lib/network/peers/discover.d.ts +1 -0
  209. package/lib/network/peers/discover.d.ts.map +1 -1
  210. package/lib/network/peers/discover.js +44 -48
  211. package/lib/network/peers/discover.js.map +1 -1
  212. package/lib/network/peers/score/store.d.ts.map +1 -1
  213. package/lib/network/peers/score/store.js +1 -2
  214. package/lib/network/peers/score/store.js.map +1 -1
  215. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  216. package/lib/network/processor/gossipHandlers.js +85 -57
  217. package/lib/network/processor/gossipHandlers.js.map +1 -1
  218. package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
  219. package/lib/network/processor/gossipQueues/index.js +0 -6
  220. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  221. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  222. package/lib/network/processor/gossipValidatorFn.js +1 -5
  223. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  224. package/lib/network/processor/index.d.ts.map +1 -1
  225. package/lib/network/processor/index.js +0 -1
  226. package/lib/network/processor/index.js.map +1 -1
  227. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  228. package/lib/network/reqresp/ReqRespBeaconNode.js +0 -6
  229. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  230. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  231. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -1
  232. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  233. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  234. package/lib/network/reqresp/handlers/index.js +0 -5
  235. package/lib/network/reqresp/handlers/index.js.map +1 -1
  236. package/lib/network/reqresp/protocols.d.ts +0 -1
  237. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  238. package/lib/network/reqresp/protocols.js +0 -5
  239. package/lib/network/reqresp/protocols.js.map +1 -1
  240. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  241. package/lib/network/reqresp/rateLimit.js +0 -4
  242. package/lib/network/reqresp/rateLimit.js.map +1 -1
  243. package/lib/network/reqresp/types.d.ts +2 -5
  244. package/lib/network/reqresp/types.d.ts.map +1 -1
  245. package/lib/network/reqresp/types.js +0 -3
  246. package/lib/network/reqresp/types.js.map +1 -1
  247. package/lib/sync/range/chain.d.ts.map +1 -1
  248. package/lib/sync/range/chain.js +1 -0
  249. package/lib/sync/range/chain.js.map +1 -1
  250. package/lib/sync/range/range.d.ts.map +1 -1
  251. package/lib/sync/range/range.js +5 -1
  252. package/lib/sync/range/range.js.map +1 -1
  253. package/lib/sync/unknownBlock.d.ts.map +1 -1
  254. package/lib/sync/unknownBlock.js +14 -1
  255. package/lib/sync/unknownBlock.js.map +1 -1
  256. package/lib/sync/utils/downloadByRange.d.ts +6 -0
  257. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  258. package/lib/sync/utils/downloadByRange.js +17 -8
  259. package/lib/sync/utils/downloadByRange.js.map +1 -1
  260. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  261. package/lib/sync/utils/downloadByRoot.js +1 -1
  262. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  263. package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
  264. package/lib/sync/utils/pendingBlocksTree.js +6 -1
  265. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  266. package/lib/util/dataColumns.d.ts +2 -1
  267. package/lib/util/dataColumns.d.ts.map +1 -1
  268. package/lib/util/dataColumns.js +7 -2
  269. package/lib/util/dataColumns.js.map +1 -1
  270. package/lib/util/execution.d.ts +2 -1
  271. package/lib/util/execution.d.ts.map +1 -1
  272. package/lib/util/execution.js +7 -2
  273. package/lib/util/execution.js.map +1 -1
  274. package/lib/util/sszBytes.d.ts.map +1 -1
  275. package/lib/util/sszBytes.js +6 -4
  276. package/lib/util/sszBytes.js.map +1 -1
  277. package/package.json +18 -21
  278. package/src/api/impl/beacon/blocks/index.ts +1 -5
  279. package/src/api/impl/beacon/pool/index.ts +11 -0
  280. package/src/api/impl/beacon/state/index.ts +3 -7
  281. package/src/api/impl/beacon/state/utils.ts +1 -1
  282. package/src/api/impl/config/constants.ts +0 -4
  283. package/src/api/impl/debug/index.ts +0 -4
  284. package/src/api/impl/errors.ts +10 -0
  285. package/src/api/impl/validator/index.ts +2 -123
  286. package/src/api/rest/base.ts +9 -3
  287. package/src/chain/ColumnReconstructionTracker.ts +5 -1
  288. package/src/chain/GetBlobsTracker.ts +5 -0
  289. package/src/chain/blocks/importBlock.ts +14 -7
  290. package/src/chain/blocks/importExecutionPayload.ts +7 -74
  291. package/src/chain/blocks/payloadEnvelopeInput/types.ts +8 -1
  292. package/src/chain/blocks/types.ts +0 -5
  293. package/src/chain/chain.ts +34 -9
  294. package/src/chain/errors/dataColumnSidecarError.ts +8 -0
  295. package/src/chain/errors/executionPayloadBid.ts +0 -18
  296. package/src/chain/errors/index.ts +0 -1
  297. package/src/chain/forkChoice/index.ts +233 -13
  298. package/src/chain/forkChoiceExecutionEngine.ts +1 -5
  299. package/src/chain/interface.ts +2 -2
  300. package/src/chain/opPools/index.ts +0 -1
  301. package/src/chain/opPools/opPool.ts +27 -16
  302. package/src/chain/options.ts +1 -3
  303. package/src/chain/produceBlock/produceBlockBody.ts +12 -66
  304. package/src/chain/regen/interface.ts +0 -1
  305. package/src/chain/seenCache/index.ts +1 -0
  306. package/src/chain/seenCache/seenBlockProposers.ts +12 -2
  307. package/src/chain/seenCache/seenDataColumnSidecars.ts +69 -0
  308. package/src/chain/seenCache/seenGossipBlockInput.ts +1 -1
  309. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +28 -2
  310. package/src/chain/validation/attestation.ts +4 -2
  311. package/src/chain/validation/block.ts +19 -7
  312. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  313. package/src/chain/validation/executionPayloadBid.ts +2 -49
  314. package/src/chain/validation/index.ts +0 -1
  315. package/src/chain/validation/proposerSlashing.ts +5 -1
  316. package/src/chain/validation/voluntaryExit.ts +2 -2
  317. package/src/execution/builder/validateBid.ts +2 -23
  318. package/src/execution/engine/disabled.ts +0 -4
  319. package/src/execution/engine/http.ts +5 -40
  320. package/src/execution/engine/interface.ts +2 -24
  321. package/src/execution/engine/jsonRpcTransport.ts +9 -46
  322. package/src/execution/engine/mock.ts +3 -26
  323. package/src/execution/engine/payloadIdCache.ts +4 -25
  324. package/src/execution/engine/restTransport.ts +1 -15
  325. package/src/execution/engine/transport.ts +2 -5
  326. package/src/execution/engine/types.ts +0 -35
  327. package/src/index.ts +1 -0
  328. package/src/metrics/metrics/beacon.ts +0 -37
  329. package/src/metrics/metrics/lodestar.ts +0 -21
  330. package/src/network/core/networkCore.ts +1 -3
  331. package/src/network/forks.ts +7 -3
  332. package/src/network/gossip/interface.ts +0 -5
  333. package/src/network/gossip/scoringParameters.ts +23 -14
  334. package/src/network/gossip/topic.ts +0 -14
  335. package/src/network/interface.ts +0 -2
  336. package/src/network/network.ts +20 -55
  337. package/src/network/options.ts +0 -2
  338. package/src/network/peers/discover.ts +42 -52
  339. package/src/network/peers/score/store.ts +1 -2
  340. package/src/network/processor/gossipHandlers.ts +147 -76
  341. package/src/network/processor/gossipQueues/index.ts +0 -6
  342. package/src/network/processor/gossipValidatorFn.ts +0 -5
  343. package/src/network/processor/index.ts +0 -1
  344. package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
  345. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -1
  346. package/src/network/reqresp/handlers/index.ts +0 -5
  347. package/src/network/reqresp/protocols.ts +0 -6
  348. package/src/network/reqresp/rateLimit.ts +0 -4
  349. package/src/network/reqresp/types.ts +0 -6
  350. package/src/sync/range/chain.ts +1 -0
  351. package/src/sync/range/range.ts +7 -1
  352. package/src/sync/unknownBlock.ts +20 -1
  353. package/src/sync/utils/downloadByRange.ts +30 -7
  354. package/src/sync/utils/downloadByRoot.ts +12 -9
  355. package/src/sync/utils/pendingBlocksTree.ts +6 -1
  356. package/src/util/dataColumns.ts +13 -1
  357. package/src/util/execution.ts +16 -1
  358. package/src/util/sszBytes.ts +7 -8
  359. package/lib/chain/errors/inclusionList.d.ts +0 -60
  360. package/lib/chain/errors/inclusionList.d.ts.map +0 -1
  361. package/lib/chain/errors/inclusionList.js +0 -19
  362. package/lib/chain/errors/inclusionList.js.map +0 -1
  363. package/lib/chain/opPools/inclusionListStore.d.ts +0 -66
  364. package/lib/chain/opPools/inclusionListStore.d.ts.map +0 -1
  365. package/lib/chain/opPools/inclusionListStore.js +0 -174
  366. package/lib/chain/opPools/inclusionListStore.js.map +0 -1
  367. package/lib/chain/validation/inclusionList.d.ts +0 -14
  368. package/lib/chain/validation/inclusionList.d.ts.map +0 -1
  369. package/lib/chain/validation/inclusionList.js +0 -150
  370. package/lib/chain/validation/inclusionList.js.map +0 -1
  371. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +0 -10
  372. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +0 -1
  373. package/lib/network/reqresp/handlers/inclusionListsByIndices.js +0 -30
  374. package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +0 -1
  375. package/src/chain/errors/inclusionList.ts +0 -38
  376. package/src/chain/opPools/inclusionListStore.ts +0 -211
  377. package/src/chain/validation/inclusionList.ts +0 -192
  378. package/src/network/reqresp/handlers/inclusionListsByIndices.ts +0 -44
@@ -12,7 +12,11 @@ import {
12
12
  isForkPostElectra,
13
13
  isForkPostGloas,
14
14
  } from "@lodestar/params";
15
- import {computeTimeAtSlot, signedBlockToSignedHeader} from "@lodestar/state-transition";
15
+ import {
16
+ computeTimeAtSlot,
17
+ getBlockHeaderProposerSignatureSetByHeaderSlot,
18
+ signedBlockToSignedHeader,
19
+ } from "@lodestar/state-transition";
16
20
  import {
17
21
  Root,
18
22
  RootHex,
@@ -25,6 +29,7 @@ import {
25
29
  gloas,
26
30
  isGloasBeaconBlock,
27
31
  isGloasDataColumnSidecar,
32
+ phase0,
28
33
  ssz,
29
34
  sszTypesFor,
30
35
  } from "@lodestar/types";
@@ -38,7 +43,6 @@ import {
38
43
  } from "../../chain/blocks/blockInput/index.js";
39
44
  import {PayloadError, PayloadErrorCode} from "../../chain/blocks/importExecutionPayload.js";
40
45
  import {PayloadEnvelopeInput, PayloadEnvelopeInputSource} from "../../chain/blocks/payloadEnvelopeInput/index.js";
41
- import {InclusionListSource} from "../../chain/blocks/types.js";
42
46
  import {ChainEvent} from "../../chain/emitter.js";
43
47
  import {
44
48
  AttestationError,
@@ -66,7 +70,6 @@ import {
66
70
  validateGossipExecutionPayloadEnvelope,
67
71
  validateGossipExecutionPayloadEnvelopeSerialized,
68
72
  } from "../../chain/validation/executionPayloadEnvelope.js";
69
- import {InclusionListValidationResult, validateGossipInclusionList} from "../../chain/validation/inclusionList.js";
70
73
  import {
71
74
  AggregateAndProofValidationResult,
72
75
  GossipAttestation,
@@ -183,7 +186,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
183
186
  blockRootHex: RootHex,
184
187
  fork: ForkName,
185
188
  peerIdStr: string,
186
- seenTimestampSec: number
189
+ seenTimestampSec: number,
190
+ opts?: {unvalidated?: boolean}
187
191
  ): BlockInput {
188
192
  const blockInput = chain.seenBlockInputCache.getByBlock({
189
193
  block: signedBlock,
@@ -196,15 +200,18 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
196
200
  // Also seed the payload-envelope cache, so we have PayloadEnvelopeInput even through "PARENT_BLOCK_UNKNOWN" error
197
201
  // see https://github.com/ChainSafe/lodestar/issues/9475
198
202
  if (isForkPostGloas(fork)) {
199
- chain.seenPayloadEnvelopeInputCache.add({
200
- blockRootHex,
201
- block: signedBlock as SignedBeaconBlock<ForkPostGloas>,
202
- forkName: fork,
203
- sampledColumns: chain.custodyConfig.sampledColumns,
204
- custodyColumns: chain.custodyConfig.custodyColumns,
205
- seenTimestampSec,
206
- source: PayloadEnvelopeInputSource.gossip,
207
- });
203
+ chain.seenPayloadEnvelopeInputCache.add(
204
+ {
205
+ blockRootHex,
206
+ block: signedBlock as SignedBeaconBlock<ForkPostGloas>,
207
+ forkName: fork,
208
+ sampledColumns: chain.custodyConfig.sampledColumns,
209
+ custodyColumns: chain.custodyConfig.custodyColumns,
210
+ seenTimestampSec,
211
+ source: PayloadEnvelopeInputSource.gossip,
212
+ },
213
+ opts
214
+ );
208
215
  }
209
216
 
210
217
  return blockInput;
@@ -300,7 +307,9 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
300
307
  }
301
308
  chain.seenBlockProposers.add(slot, proposerIndex, blockRootHex);
302
309
 
303
- const blockInput = cacheSignatureVerifiedBlock(signedBlock, blockRootHex, fork, peerIdStr, seenTimestampSec);
310
+ const blockInput = cacheSignatureVerifiedBlock(signedBlock, blockRootHex, fork, peerIdStr, seenTimestampSec, {
311
+ unvalidated: true,
312
+ });
304
313
  chain.emitter.emit(ChainEvent.blockUnknownParent, {
305
314
  blockInput,
306
315
  peer: peerIdStr,
@@ -374,6 +383,28 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
374
383
  }
375
384
  }
376
385
 
386
+ // The block input may have been pruned before the block was imported
387
+ if (
388
+ chain.seenDataColumnSidecars.isKnown(
389
+ slot,
390
+ dataColumnBlockHeader.proposerIndex,
391
+ dataColumnSidecar.index,
392
+ blockRootHex
393
+ )
394
+ ) {
395
+ metrics?.peerDas.dataColumnSidecarProcessingSkip.inc();
396
+ throw new DataColumnSidecarGossipError(GossipAction.IGNORE, {
397
+ code: DataColumnSidecarErrorCode.ALREADY_KNOWN,
398
+ columnIndex: dataColumnSidecar.index,
399
+ slot,
400
+ });
401
+ }
402
+
403
+ if (isRepeatColumnProposal(chain, dataColumnSidecar, blockRootHex)) {
404
+ await observeRepeatColumnProposal(chain, dataColumnSidecar, blockRootHex);
405
+ throw repeatColumnProposalError(dataColumnSidecar, blockRootHex);
406
+ }
407
+
377
408
  const verificationTimer = metrics?.peerDas.dataColumnSidecarGossipVerificationTime.startTimer();
378
409
 
379
410
  const delaySec = chain.clock.secFromSlot(slot, seenTimestampSec);
@@ -382,6 +413,17 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
382
413
 
383
414
  try {
384
415
  await validateGossipFuluDataColumnSidecar(chain, dataColumnSidecar, gossipSubnet, metrics);
416
+ observeColumnBlockHeader(chain, dataColumnSidecar.signedBlockHeader, blockRootHex);
417
+ // Another block root may have been seen for the same tuple while validating
418
+ if (isRepeatColumnProposal(chain, dataColumnSidecar, blockRootHex)) {
419
+ throw repeatColumnProposalError(dataColumnSidecar, blockRootHex);
420
+ }
421
+ chain.seenDataColumnSidecars.add(
422
+ slot,
423
+ dataColumnBlockHeader.proposerIndex,
424
+ dataColumnSidecar.index,
425
+ blockRootHex
426
+ );
385
427
  const blockInput = chain.seenBlockInputCache.getByColumn({
386
428
  blockRootHex,
387
429
  columnSidecar: dataColumnSidecar,
@@ -575,7 +617,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
575
617
  const delaySec = seenTimestampSec - computeTimeAtSlot(config, slot, chain.genesisTime);
576
618
  metrics?.gossipBlock.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
577
619
  chain.validatorMonitor?.registerBeaconBlock(OpSource.gossip, delaySec, signedBlock.message);
578
- if (!blockInput.hasBlockAndAllData()) {
620
+ const missingData = !blockInput.hasBlockAndAllData();
621
+ if (missingData) {
579
622
  chain.logger.debug("Received gossip block, attempting fetch of unavailable data", blockInput.getLogMeta());
580
623
  // The data is not yet fully available, immediately trigger an aggressive pull via unknown block sync
581
624
  chain.emitter.emit(ChainEvent.incompleteBlockInput, {
@@ -668,8 +711,13 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
668
711
  }
669
712
  metrics?.gossipBlock.processBlockErrors.inc({error: e instanceof BlockError ? e.type.code : "NOT_BLOCK_ERROR"});
670
713
  logger[logLevel]("Error processing block", {slot, root: blockInput.blockRootHex, peer: peerIdStr}, e as Error);
671
- // TODO(fulu): Revisit when we prune block inputs
672
- chain.seenBlockInputCache.prune(blockInput.blockRootHex);
714
+ // BlockInputSync retries the import of a block with missing data from this same BlockInput, pruning it here
715
+ // would put later gossip columns into a new BlockInput that is never imported. The entry is released once the
716
+ // block is persisted, BlockInputSync removes it, on finalization or by the cache size limit
717
+ if (!missingData) {
718
+ // TODO(fulu): Revisit when we prune block inputs
719
+ chain.seenBlockInputCache.prune(blockInput.blockRootHex);
720
+ }
673
721
  });
674
722
  }
675
723
 
@@ -685,7 +733,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
685
733
  const signedBlock = sszDeserialize(topic, serializedData);
686
734
  try {
687
735
  const blockInput = await validateBeaconBlock(signedBlock, topic.boundary.fork, peerIdStr, seenTimestampSec);
688
- // Runs after the validation result is reported, except with `network.useWorker: false`
736
+ // Runs after the validation result is reported
689
737
  callAfterIO(() => {
690
738
  try {
691
739
  chain.serializedCache.set(signedBlock, serializedData);
@@ -707,7 +755,12 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
707
755
  e.type.code === BlockErrorCode.REPEAT_PROPOSAL &&
708
756
  // Only a signature-verified sibling recorded in the seen cache is imported. The cache holds at most two
709
757
  // roots per proposer and slot, which bounds full imports over gossip to one alternate
710
- chain.seenBlockProposers.hasBlockRoot(signedBlock.message.slot, e.type.proposerIndex, e.type.root) &&
758
+ chain.seenBlockProposers.hasBlockSignature(
759
+ signedBlock.message.slot,
760
+ e.type.proposerIndex,
761
+ e.type.root,
762
+ signedBlock.signature
763
+ ) &&
711
764
  // A sibling with an unknown parent cannot be imported, sync fetches it if its branch becomes relevant
712
765
  chain.forkChoice.getBlockHexDefaultStatus(toRootHex(signedBlock.message.parentRoot)) !== null &&
713
766
  (!isGloasBeaconBlock(signedBlock.message) ||
@@ -721,7 +774,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
721
774
  e.type.root,
722
775
  topic.boundary.fork,
723
776
  peerIdStr,
724
- seenTimestampSec
777
+ seenTimestampSec,
778
+ {unvalidated: false}
725
779
  );
726
780
  // We're returning IGNORE (thrown below), so this block is not forwarded to peers. Unlike the
727
781
  // happy path there is no rush to forward, so we don't need to wrap in callInNextEventLoop.
@@ -1295,20 +1349,25 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
1295
1349
  try {
1296
1350
  const delaySec = chain.clock.secFromSlot(payloadAttestationMessage.data.slot, seenTimestampSec);
1297
1351
  metrics?.gossipPayloadAttestationMessage.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
1298
- const nextSlotProposer = chain.getHeadState().getBeaconProposer(payloadAttestationMessage.data.slot + 1);
1299
- const isNextSlotProposer = chain.beaconProposerCache.has(nextSlotProposer);
1300
-
1301
- if (isNextSlotProposer) {
1302
- try {
1352
+ try {
1353
+ const nextSlotProposer = chain.getHeadState().getBeaconProposer(payloadAttestationMessage.data.slot + 1);
1354
+ if (chain.beaconProposerCache.has(nextSlotProposer)) {
1303
1355
  const insertOutcome = chain.payloadAttestationPool.add(
1304
1356
  payloadAttestationMessage,
1305
1357
  validationResult.attDataRootHex,
1306
1358
  validationResult.validatorCommitteeIndices
1307
1359
  );
1308
1360
  metrics?.opPool.payloadAttestationPool.gossipInsertOutcome.inc({insertOutcome});
1309
- } catch (e) {
1310
- logger.debug("Error adding to payloadAttestation pool", {}, e as Error);
1311
1361
  }
1362
+ } catch (e) {
1363
+ logger.debug(
1364
+ "Error adding to payloadAttestation pool",
1365
+ {
1366
+ slot: payloadAttestationMessage.data.slot,
1367
+ root: toRootHex(payloadAttestationMessage.data.beaconBlockRoot),
1368
+ },
1369
+ e as Error
1370
+ );
1312
1371
  }
1313
1372
 
1314
1373
  // Gossip accepts adjacent slots within the clock disparity but fork choice only counts the current slot
@@ -1405,55 +1464,6 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
1405
1464
  }
1406
1465
  });
1407
1466
  },
1408
-
1409
- [GossipType.inclusion_list]: async ({
1410
- gossipData,
1411
- topic,
1412
- seenTimestampSec,
1413
- }: GossipHandlerParamGeneric<GossipType.inclusion_list>) => {
1414
- const {serializedData} = gossipData;
1415
- const signedInclusionList = sszDeserialize(topic, serializedData);
1416
- const {slot} = signedInclusionList.message;
1417
-
1418
- metrics?.inclusionListsReceived.inc({source: InclusionListSource.gossip});
1419
- metrics?.inclusionListTransactionsReceived.inc(
1420
- {source: InclusionListSource.gossip},
1421
- signedInclusionList.message.transactions.length
1422
- );
1423
-
1424
- const timer = metrics?.inclusionListsValidationTime.startTimer();
1425
- let validationResult: InclusionListValidationResult;
1426
- try {
1427
- validationResult = await validateGossipInclusionList(chain, signedInclusionList);
1428
- } finally {
1429
- timer?.({source: InclusionListSource.gossip});
1430
- }
1431
- const {committeeIndices, totalBytes} = validationResult;
1432
-
1433
- // Handler - deferred to next event loop so the validation result propagates first
1434
- callInNextEventLoop(() => {
1435
- try {
1436
- metrics?.inclusionListsValid.inc({source: InclusionListSource.gossip});
1437
- metrics?.inclusionListsValidSize.inc(totalBytes);
1438
- // A list received before its slot is timely, the spec delays it until the slot starts. Only gossip
1439
- // validation bounds how early a list can be. Late lists are still stored, marked untimely
1440
- const secFromSlot = chain.clock.secFromSlot(slot, seenTimestampSec);
1441
- metrics?.inclusionListArrivalTime.observe(secFromSlot);
1442
- const isTimely = secFromSlot * 1000 < config.getInclusionListDueMs(config.getForkName(slot));
1443
-
1444
- const insertOutcome = chain.inclusionListStore.process(signedInclusionList, committeeIndices, isTimely);
1445
- metrics?.inclusionListStore.insertOutcome.inc({insertOutcome});
1446
- metrics?.inclusionListStore.size.set(chain.inclusionListStore.size);
1447
-
1448
- chain.emitter.emit(routes.events.EventType.inclusionList, {
1449
- version: config.getForkName(slot),
1450
- data: signedInclusionList,
1451
- });
1452
- } catch (e) {
1453
- logger.debug("Error handling gossip inclusion list", {slot}, e as Error);
1454
- }
1455
- });
1456
- },
1457
1467
  };
1458
1468
  }
1459
1469
 
@@ -1645,3 +1655,64 @@ function getCutoffTimeMs(
1645
1655
  0
1646
1656
  );
1647
1657
  }
1658
+
1659
+ /**
1660
+ * [IGNORE] The sidecar is the first sidecar for the tuple (block_header.slot, block_header.proposer_index, sidecar.index)
1661
+ * with valid header signature, sidecar inclusion proof, and kzg proof
1662
+ */
1663
+ function isRepeatColumnProposal(
1664
+ chain: IBeaconChain,
1665
+ dataColumnSidecar: fulu.DataColumnSidecar,
1666
+ blockRootHex: RootHex
1667
+ ): boolean {
1668
+ const {slot, proposerIndex} = dataColumnSidecar.signedBlockHeader.message;
1669
+ return chain.seenDataColumnSidecars.isRepeatProposal(slot, proposerIndex, dataColumnSidecar.index, blockRootHex);
1670
+ }
1671
+
1672
+ function repeatColumnProposalError(
1673
+ dataColumnSidecar: fulu.DataColumnSidecar,
1674
+ blockRootHex: RootHex
1675
+ ): DataColumnSidecarGossipError {
1676
+ const {slot, proposerIndex} = dataColumnSidecar.signedBlockHeader.message;
1677
+ return new DataColumnSidecarGossipError(GossipAction.IGNORE, {
1678
+ code: DataColumnSidecarErrorCode.REPEAT_PROPOSAL,
1679
+ slot,
1680
+ proposerIndex,
1681
+ columnIndex: dataColumnSidecar.index,
1682
+ root: blockRootHex,
1683
+ });
1684
+ }
1685
+
1686
+ function observeColumnBlockHeader(
1687
+ chain: IBeaconChain,
1688
+ signedBlockHeader: phase0.SignedBeaconBlockHeader,
1689
+ blockRootHex: RootHex
1690
+ ): void {
1691
+ const {slot, proposerIndex} = signedBlockHeader.message;
1692
+ chain.seenBlockProposers.observeBlockRoot(slot, proposerIndex, blockRootHex, signedBlockHeader);
1693
+ if (chain.seenBlockProposers.isEquivocating(slot, proposerIndex)) {
1694
+ chain.processProposerEquivocation(slot, proposerIndex);
1695
+ }
1696
+ }
1697
+
1698
+ async function observeRepeatColumnProposal(
1699
+ chain: IBeaconChain,
1700
+ dataColumnSidecar: fulu.DataColumnSidecar,
1701
+ blockRootHex: RootHex
1702
+ ): Promise<void> {
1703
+ const {signedBlockHeader} = dataColumnSidecar;
1704
+ const {slot, proposerIndex} = signedBlockHeader.message;
1705
+ // Only needed as slashing evidence, so verify at most one conflicting header per slot and proposer
1706
+ if (
1707
+ chain.seenBlockProposers.hasBlockRoot(slot, proposerIndex, blockRootHex) ||
1708
+ chain.seenBlockProposers.isEquivocating(slot, proposerIndex) ||
1709
+ !chain.seenDataColumnSidecars.markEvidenceCheck(slot, proposerIndex)
1710
+ ) {
1711
+ return;
1712
+ }
1713
+
1714
+ const signatureSet = getBlockHeaderProposerSignatureSetByHeaderSlot(chain.config, signedBlockHeader);
1715
+ if (await chain.bls.verifySignatureSets([signatureSet])) {
1716
+ observeColumnBlockHeader(chain, signedBlockHeader, blockRootHex);
1717
+ }
1718
+ }
@@ -82,12 +82,6 @@ const linearGossipQueueOpts: {
82
82
  type: QueueType.FIFO,
83
83
  dropOpts: {type: DropType.count, count: 1},
84
84
  },
85
- [GossipType.inclusion_list]: {
86
- // 16 committee members, two lists each under the first-or-second-message rule, 32 per slot
87
- maxLength: 1024,
88
- type: QueueType.FIFO,
89
- dropOpts: {type: DropType.count, count: 1},
90
- },
91
85
  };
92
86
 
93
87
  const indexedGossipQueueOpts: {
@@ -13,7 +13,6 @@ import {
13
13
  GossipAction,
14
14
  GossipActionError,
15
15
  GossipErrorCode,
16
- InclusionListErrorCode,
17
16
  PayloadAttestationErrorCode,
18
17
  ProposerPreferencesErrorCode,
19
18
  ProposerSlashingErrorCode,
@@ -83,10 +82,6 @@ const gossipRejectPeerAction: Record<GossipType, RejectPeerActionRule> = {
83
82
  default: PeerAction.MidToleranceError,
84
83
  byCode: {[PayloadAttestationErrorCode.INVALID_SIGNATURE]: PeerAction.Fatal},
85
84
  },
86
- [GossipType.inclusion_list]: {
87
- default: PeerAction.MidToleranceError,
88
- byCode: {[InclusionListErrorCode.INVALID_SIGNATURE]: PeerAction.Fatal},
89
- },
90
85
  [GossipType.execution_payload_bid]: {
91
86
  default: PeerAction.HighToleranceError,
92
87
  byCode: {[ExecutionPayloadBidErrorCode.INVALID_SIGNATURE]: PeerAction.Fatal},
@@ -139,7 +139,6 @@ const executeGossipWorkOrderObj: Record<GossipType, WorkOpts> = {
139
139
  [GossipType.payload_attestation_message]: {},
140
140
  [GossipType.execution_payload_bid]: {},
141
141
  [GossipType.proposer_preferences]: {},
142
- [GossipType.inclusion_list]: {},
143
142
  };
144
143
  const executeGossipWorkOrder = Object.keys(executeGossipWorkOrderObj) as (keyof typeof executeGossipWorkOrderObj)[];
145
144
 
@@ -304,13 +304,6 @@ export class ReqRespBeaconNode extends ReqResp {
304
304
  );
305
305
  }
306
306
 
307
- if (ForkSeq[fork] >= ForkSeq.heze) {
308
- protocolsAtFork.push([
309
- protocols.InclusionListsByIndices(fork, this.config),
310
- this.getHandler(ReqRespMethod.InclusionListsByIndices),
311
- ]);
312
- }
313
-
314
307
  return protocolsAtFork;
315
308
  }
316
309
 
@@ -226,5 +226,8 @@ export function validateDataColumnSidecarsByRangeRequest(
226
226
  count = config.MAX_REQUEST_BLOCKS_DENEB;
227
227
  }
228
228
 
229
- return {startSlot, count, columns};
229
+ // Spec: sidecars MUST be sent in (slot, column_index) order, so serve each requested column once, ascending
230
+ const sortedColumns = Array.from(new Set(columns)).sort((a, b) => a - b);
231
+
232
+ return {startSlot, count, columns: sortedColumns};
230
233
  }
@@ -16,7 +16,6 @@ import {onDataColumnSidecarsByRange} from "./dataColumnSidecarsByRange.js";
16
16
  import {onDataColumnSidecarsByRoot} from "./dataColumnSidecarsByRoot.js";
17
17
  import {onExecutionPayloadEnvelopesByRange} from "./executionPayloadEnvelopesByRange.js";
18
18
  import {onExecutionPayloadEnvelopesByRoot} from "./executionPayloadEnvelopesByRoot.js";
19
- import {onInclusionListsByIndices} from "./inclusionListsByIndices.js";
20
19
  import {onLightClientBootstrap} from "./lightClientBootstrap.js";
21
20
  import {onLightClientFinalityUpdate} from "./lightClientFinalityUpdate.js";
22
21
  import {onLightClientOptimisticUpdate} from "./lightClientOptimisticUpdate.js";
@@ -126,10 +125,6 @@ export function getReqRespHandlers({db, chain}: {db: IBeaconDb; chain: IBeaconCh
126
125
  },
127
126
  [ReqRespMethod.LightClientFinalityUpdate]: () => onLightClientFinalityUpdate(chain),
128
127
  [ReqRespMethod.LightClientOptimisticUpdate]: () => onLightClientOptimisticUpdate(chain),
129
- [ReqRespMethod.InclusionListsByIndices]: (req, peerId, peerClient) => {
130
- const body = deserializeRequestBody(ssz.heze.InclusionListsByIndicesRequest, req.data);
131
- return onInclusionListsByIndices(body, chain, peerId, peerClient);
132
- },
133
128
  };
134
129
 
135
130
  return (method) => handlers[method];
@@ -101,12 +101,6 @@ export const ExecutionPayloadEnvelopesByRange = toProtocol({
101
101
  contextBytesType: ContextBytesType.ForkDigest,
102
102
  });
103
103
 
104
- export const InclusionListsByIndices = toProtocol({
105
- method: ReqRespMethod.InclusionListsByIndices,
106
- version: Version.V1,
107
- contextBytesType: ContextBytesType.ForkDigest,
108
- });
109
-
110
104
  export const LightClientBootstrap = toProtocol({
111
105
  method: ReqRespMethod.LightClientBootstrap,
112
106
  version: Version.V1,
@@ -93,10 +93,6 @@ export const rateLimitQuotas: (fork: ForkName, config: BeaconConfig) => Record<R
93
93
  // Allow 2 per slot and a very safe bound until there's more testing of real usage.
94
94
  byPeer: {quota: 2, quotaTimeMs: config.getSlotDurationMs(fork)},
95
95
  },
96
- [ReqRespMethod.InclusionListsByIndices]: {
97
- // Peers only backfill what gossip missed, so a small per-slot allowance is enough
98
- byPeer: {quota: 5, quotaTimeMs: config.getSlotDurationMs(fork)},
99
- },
100
96
  [ReqRespMethod.LightClientOptimisticUpdate]: {
101
97
  // Optimistic updates should not be requested more than once per slot.
102
98
  // Allow 2 per slot and a very safe bound until there's more testing of real usage.
@@ -15,7 +15,6 @@ import {
15
15
  altair,
16
16
  fulu,
17
17
  gloas,
18
- heze,
19
18
  phase0,
20
19
  ssz,
21
20
  sszTypesFor,
@@ -49,7 +48,6 @@ export enum ReqRespMethod {
49
48
  LightClientUpdatesByRange = "light_client_updates_by_range",
50
49
  LightClientFinalityUpdate = "light_client_finality_update",
51
50
  LightClientOptimisticUpdate = "light_client_optimistic_update",
52
- InclusionListsByIndices = "inclusion_lists_by_indices",
53
51
  }
54
52
 
55
53
  // To typesafe events to network
@@ -69,7 +67,6 @@ export type RequestBodyByMethod = {
69
67
  [ReqRespMethod.LightClientUpdatesByRange]: altair.LightClientUpdatesByRange;
70
68
  [ReqRespMethod.LightClientFinalityUpdate]: null;
71
69
  [ReqRespMethod.LightClientOptimisticUpdate]: null;
72
- [ReqRespMethod.InclusionListsByIndices]: heze.InclusionListsByIndicesRequest;
73
70
  };
74
71
 
75
72
  type ResponseBodyByMethod = {
@@ -90,7 +87,6 @@ type ResponseBodyByMethod = {
90
87
  [ReqRespMethod.LightClientUpdatesByRange]: LightClientUpdate;
91
88
  [ReqRespMethod.LightClientFinalityUpdate]: LightClientFinalityUpdate;
92
89
  [ReqRespMethod.LightClientOptimisticUpdate]: LightClientOptimisticUpdate;
93
- [ReqRespMethod.InclusionListsByIndices]: heze.SignedInclusionList;
94
90
  };
95
91
 
96
92
  /** Request SSZ type for each method and ForkName */
@@ -119,7 +115,6 @@ export const requestSszTypeByMethod: (
119
115
  [ReqRespMethod.LightClientUpdatesByRange]: ssz.altair.LightClientUpdatesByRange,
120
116
  [ReqRespMethod.LightClientFinalityUpdate]: null,
121
117
  [ReqRespMethod.LightClientOptimisticUpdate]: null,
122
- [ReqRespMethod.InclusionListsByIndices]: ssz.heze.InclusionListsByIndicesRequest,
123
118
  });
124
119
 
125
120
  export type ResponseTypeGetter<T> = (fork: ForkName, version: number) => Type<T>;
@@ -150,7 +145,6 @@ export const responseSszTypeByMethod: {[K in ReqRespMethod]: ResponseTypeGetter<
150
145
  [ReqRespMethod.ExecutionPayloadEnvelopesByRange]: () => ssz.gloas.SignedExecutionPayloadEnvelope,
151
146
  [ReqRespMethod.LightClientOptimisticUpdate]: (fork) =>
152
147
  sszTypesFor(onlyPostAltairFork(fork)).LightClientOptimisticUpdate,
153
- [ReqRespMethod.InclusionListsByIndices]: () => ssz.heze.SignedInclusionList,
154
148
  };
155
149
 
156
150
  function onlyPostAltairFork(fork: ForkName): ForkPostAltair {
@@ -627,6 +627,7 @@ export class SyncChain {
627
627
  case DownloadByRangeErrorCode.INVALID_ENVELOPE_BLOCK_HASH:
628
628
  case DownloadByRangeErrorCode.INVALID_ENVELOPE_SLOT:
629
629
  case DownloadByRangeErrorCode.INVALID_CHAIN_SEGMENT:
630
+ case DownloadByRangeErrorCode.TOO_MANY_KZG_COMMITMENTS:
630
631
  case DataColumnSidecarErrorCode.INCORRECT_KZG_COMMITMENTS_COUNT:
631
632
  case DataColumnSidecarErrorCode.INCORRECT_KZG_PROOF_COUNT:
632
633
  case DataColumnSidecarErrorCode.INVALID_KZG_PROOF_BATCH:
@@ -1,6 +1,7 @@
1
1
  import {EventEmitter} from "node:events";
2
2
  import {StrictEventEmitter} from "strict-event-emitter-types";
3
3
  import {BeaconConfig} from "@lodestar/config";
4
+ import {isForkPostGloas} from "@lodestar/params";
4
5
  import {IBeaconStateViewGloas, computeStartSlotAtEpoch, isStatePostGloas} from "@lodestar/state-transition";
5
6
  import {Epoch, Status, fulu, ssz} from "@lodestar/types";
6
7
  import {Logger, byteArrayEquals, prettyPrintIndices, toHex, toRootHex} from "@lodestar/utils";
@@ -434,7 +435,12 @@ export class RangeSync extends (EventEmitter as {new (): RangeSyncEmitter}) {
434
435
  // the batch then downloads the head's payload as dangling parent and validates it against the bid
435
436
  const headState = this.chain.getHeadState();
436
437
  let parentPayload: ParentPayload | undefined;
437
- if (isStatePostGloas(headState) && headState.latestBlockHeader.slot > 0) {
438
+ // A pre-Gloas head block in a state upgraded to Gloas carried its own payload, no envelope follows it
439
+ if (
440
+ isStatePostGloas(headState) &&
441
+ headState.latestBlockHeader.slot > 0 &&
442
+ isForkPostGloas(this.config.getForkName(headState.latestBlockHeader.slot))
443
+ ) {
438
444
  const header = ssz.phase0.BeaconBlockHeader.clone(headState.latestBlockHeader);
439
445
  if (byteArrayEquals(header.stateRoot, ssz.Root.defaultValue())) {
440
446
  header.stateRoot = headState.hashTreeRoot();
@@ -928,6 +928,19 @@ export class BlockInputSync {
928
928
  const connectedPeers = this.network.getConnectedPeers();
929
929
  const hasConnectedPeers = connectedPeers.length > 0;
930
930
 
931
+ // Gossip, getBlobs or column reconstruction can complete a pending block's data through the shared BlockInput.
932
+ // With only half the columns the block stays pending, its fetch asks a peer for the rest before reconstructing
933
+ for (const block of this.pendingBlocks.values()) {
934
+ if (
935
+ isPendingBlockInput(block) &&
936
+ block.status === PendingBlockInputStatus.pending &&
937
+ block.blockInput.hasBlockAndAllData() &&
938
+ (!isBlockInputColumns(block.blockInput) || block.blockInput.hasComputedAllData())
939
+ ) {
940
+ block.status = PendingBlockInputStatus.downloaded;
941
+ }
942
+ }
943
+
931
944
  const {unknowns, ancestors} = getUnknownAndAncestorBlocks(this.pendingBlocks);
932
945
  let processedBlocks = 0;
933
946
  let shouldRerunBlockSearch = false;
@@ -2201,7 +2214,13 @@ export class BlockInputSync {
2201
2214
  const cacheItemRootHex = getBlockInputSyncCacheItemRootHex(cacheItem);
2202
2215
  // pruning may have dropped it mid-fetch
2203
2216
  if (this.pendingBlocks.has(cacheItemRootHex)) {
2204
- this.pendingBlocks.set(cacheItemRootHex, cacheItem);
2217
+ // A partial download stays fetching while the next peer is asked, a pending entry would be fetched again
2218
+ this.pendingBlocks.set(
2219
+ cacheItemRootHex,
2220
+ cacheItem.status === PendingBlockInputStatus.pending
2221
+ ? {...cacheItem, status: PendingBlockInputStatus.fetching}
2222
+ : cacheItem
2223
+ );
2205
2224
  }
2206
2225
 
2207
2226
  if (cacheItem.status === PendingBlockInputStatus.downloaded) {
@@ -1,5 +1,14 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
- import {ForkName, ForkPostFulu, ForkPostGloas, isForkPostFulu, isForkPostGloas} from "@lodestar/params";
2
+ import {
3
+ ForkName,
4
+ ForkPostDeneb,
5
+ ForkPostFulu,
6
+ ForkPostGloas,
7
+ isForkPostDeneb,
8
+ isForkPostFulu,
9
+ isForkPostGloas,
10
+ } from "@lodestar/params";
11
+ import {computeEpochAtSlot} from "@lodestar/state-transition";
3
12
  import {
4
13
  ColumnIndex,
5
14
  DataColumnSidecar,
@@ -28,6 +37,7 @@ import {INetwork} from "../../network/index.js";
28
37
  import {CustodyConfig, getBlobKzgCommitments} from "../../util/dataColumns.js";
29
38
  import {PeerIdStr} from "../../util/peerId.js";
30
39
  import {WarnResult} from "../../util/wrapError.js";
40
+ import {getRateLimitedUntilMs} from "./rateLimit.js";
31
41
 
32
42
  export type DownloadByRangeRequests = {
33
43
  blocksRequest?: phase0.BeaconBlocksByRangeRequest;
@@ -327,6 +337,8 @@ export async function downloadByRange({
327
337
  parentPayloadRequest,
328
338
  });
329
339
  } catch (err) {
340
+ // Rethrow rate limit errors as is, so range sync can back off from the peer instead of counting a failed download
341
+ if (getRateLimitedUntilMs(err) !== null) throw err;
330
342
  throw new DownloadByRangeError({
331
343
  code: DownloadByRangeErrorCode.REQ_RESP_ERROR,
332
344
  reason: (err as Error).message,
@@ -697,6 +709,15 @@ export function validateBlockByRangeResponse(
697
709
 
698
710
  for (let i = 0; i < blocks.length; i++) {
699
711
  const block = blocks[i];
712
+ const slot = block.message.slot;
713
+ const fork = config.getForkName(slot);
714
+ if (isForkPostDeneb(fork)) {
715
+ const count = getBlobKzgCommitments(fork, block as SignedBeaconBlock<ForkPostDeneb>).length;
716
+ const limit = config.getMaxBlobsPerBlock(computeEpochAtSlot(slot));
717
+ if (count > limit) {
718
+ throw new DownloadByRangeError({code: DownloadByRangeErrorCode.TOO_MANY_KZG_COMMITMENTS, slot, count, limit});
719
+ }
720
+ }
700
721
  const blockRoot = type.hashTreeRoot(block.message);
701
722
  response.push({block, blockRoot});
702
723
 
@@ -825,12 +846,7 @@ export async function validateColumnsByRangeResponse(
825
846
  }
826
847
 
827
848
  seenSlotColumns.set(columnSidecar.index, columnSidecar);
828
- if (currentSlot !== slot) {
829
- // a new slot has started, reset index
830
- currentIndex = -1;
831
- } else {
832
- currentIndex = columnSidecar.index;
833
- }
849
+ currentIndex = columnSidecar.index;
834
850
  currentSlot = slot;
835
851
  }
836
852
 
@@ -1030,6 +1046,7 @@ export enum DownloadByRangeErrorCode {
1030
1046
 
1031
1047
  PARENT_ROOT_MISMATCH = "DOWNLOAD_BY_RANGE_ERROR_PARENT_ROOT_MISMATCH",
1032
1048
  EXTRA_BLOCKS = "DOWNLOAD_BY_RANGE_ERROR_EXTRA_BLOCKS",
1049
+ TOO_MANY_KZG_COMMITMENTS = "DOWNLOAD_BY_RANGE_ERROR_TOO_MANY_KZG_COMMITMENTS",
1033
1050
  OUT_OF_RANGE_BLOCKS = "DOWNLOAD_BY_RANGE_OUT_OF_RANGE_BLOCKS",
1034
1051
  OUT_OF_ORDER_BLOCKS = "DOWNLOAD_BY_RANGE_OUT_OF_ORDER_BLOCKS",
1035
1052
 
@@ -1072,6 +1089,12 @@ export type DownloadByRangeErrorType =
1072
1089
  columnSidecarCount: number;
1073
1090
  payloadEnvelopeCount: number;
1074
1091
  }
1092
+ | {
1093
+ code: DownloadByRangeErrorCode.TOO_MANY_KZG_COMMITMENTS;
1094
+ slot: Slot;
1095
+ count: number;
1096
+ limit: number;
1097
+ }
1075
1098
  | {
1076
1099
  code: DownloadByRangeErrorCode.OUT_OF_RANGE_BLOCKS;
1077
1100
  slot: number;