@lodestar/beacon-node 1.42.0-dev.5f2fffc2ce → 1.42.0-dev.6fa48cb5f2

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 (440) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +36 -17
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/pool/index.js +1 -1
  5. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  6. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  7. package/lib/api/impl/beacon/state/index.js +27 -32
  8. package/lib/api/impl/beacon/state/index.js.map +1 -1
  9. package/lib/api/impl/beacon/state/utils.d.ts +4 -4
  10. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  11. package/lib/api/impl/beacon/state/utils.js +7 -10
  12. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  13. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  14. package/lib/api/impl/lodestar/index.js +4 -6
  15. package/lib/api/impl/lodestar/index.js.map +1 -1
  16. package/lib/api/impl/proof/index.d.ts.map +1 -1
  17. package/lib/api/impl/proof/index.js +2 -6
  18. package/lib/api/impl/proof/index.js.map +1 -1
  19. package/lib/api/impl/validator/index.d.ts.map +1 -1
  20. package/lib/api/impl/validator/index.js +27 -27
  21. package/lib/api/impl/validator/index.js.map +1 -1
  22. package/lib/api/impl/validator/utils.d.ts +2 -2
  23. package/lib/api/impl/validator/utils.d.ts.map +1 -1
  24. package/lib/api/impl/validator/utils.js +3 -3
  25. package/lib/api/impl/validator/utils.js.map +1 -1
  26. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  27. package/lib/chain/archiveStore/archiveStore.js +1 -0
  28. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  29. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
  30. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
  31. package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
  32. package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
  33. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
  34. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  35. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
  36. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  37. package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
  38. package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
  39. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  40. package/lib/chain/archiveStore/historicalState/worker.js +1 -3
  41. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  42. package/lib/chain/archiveStore/interface.d.ts +1 -0
  43. package/lib/chain/archiveStore/interface.d.ts.map +1 -1
  44. package/lib/chain/balancesCache.d.ts +2 -2
  45. package/lib/chain/balancesCache.d.ts.map +1 -1
  46. package/lib/chain/balancesCache.js +4 -4
  47. package/lib/chain/balancesCache.js.map +1 -1
  48. package/lib/chain/blocks/blockInput/types.d.ts +4 -3
  49. package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
  50. package/lib/chain/blocks/blockInput/types.js +1 -0
  51. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  52. package/lib/chain/blocks/importBlock.d.ts +3 -3
  53. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  54. package/lib/chain/blocks/importBlock.js +27 -11
  55. package/lib/chain/blocks/importBlock.js.map +1 -1
  56. package/lib/chain/blocks/importExecutionPayload.d.ts +48 -0
  57. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
  58. package/lib/chain/blocks/importExecutionPayload.js +158 -0
  59. package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
  60. package/lib/chain/blocks/index.js +1 -1
  61. package/lib/chain/blocks/index.js.map +1 -1
  62. package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts +3 -0
  63. package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts.map +1 -0
  64. package/lib/chain/blocks/payloadEnvelopeInput/index.js +3 -0
  65. package/lib/chain/blocks/payloadEnvelopeInput/index.js.map +1 -0
  66. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +80 -0
  67. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
  68. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +248 -0
  69. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
  70. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +29 -0
  71. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -0
  72. package/lib/chain/blocks/payloadEnvelopeInput/types.js +11 -0
  73. package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -0
  74. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +15 -0
  75. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -0
  76. package/lib/chain/blocks/payloadEnvelopeProcessor.js +46 -0
  77. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -0
  78. package/lib/chain/blocks/types.d.ts +9 -2
  79. package/lib/chain/blocks/types.d.ts.map +1 -1
  80. package/lib/chain/blocks/types.js.map +1 -1
  81. package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
  82. package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
  83. package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
  84. package/lib/chain/blocks/verifyBlock.d.ts +2 -2
  85. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  86. package/lib/chain/blocks/verifyBlock.js +4 -4
  87. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  88. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +3 -3
  89. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  90. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -3
  91. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  92. package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
  93. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  94. package/lib/chain/blocks/verifyBlocksSignatures.js +1 -1
  95. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  96. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
  97. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
  98. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
  99. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  100. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts +12 -0
  101. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -0
  102. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +40 -0
  103. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -0
  104. package/lib/chain/chain.d.ts +19 -14
  105. package/lib/chain/chain.d.ts.map +1 -1
  106. package/lib/chain/chain.js +75 -42
  107. package/lib/chain/chain.js.map +1 -1
  108. package/lib/chain/emitter.d.ts +2 -2
  109. package/lib/chain/emitter.d.ts.map +1 -1
  110. package/lib/chain/errors/blockError.d.ts +4 -4
  111. package/lib/chain/errors/blockError.d.ts.map +1 -1
  112. package/lib/chain/errors/executionPayloadEnvelope.d.ts +12 -2
  113. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  114. package/lib/chain/errors/executionPayloadEnvelope.js +3 -1
  115. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  116. package/lib/chain/forkChoice/index.d.ts +4 -4
  117. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  118. package/lib/chain/forkChoice/index.js +27 -33
  119. package/lib/chain/forkChoice/index.js.map +1 -1
  120. package/lib/chain/initState.d.ts +2 -2
  121. package/lib/chain/initState.d.ts.map +1 -1
  122. package/lib/chain/initState.js +1 -1
  123. package/lib/chain/initState.js.map +1 -1
  124. package/lib/chain/interface.d.ts +17 -15
  125. package/lib/chain/interface.d.ts.map +1 -1
  126. package/lib/chain/lightClient/index.d.ts +2 -2
  127. package/lib/chain/lightClient/index.d.ts.map +1 -1
  128. package/lib/chain/lightClient/index.js +4 -4
  129. package/lib/chain/lightClient/index.js.map +1 -1
  130. package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
  131. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  132. package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
  133. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  134. package/lib/chain/opPools/opPool.d.ts +3 -3
  135. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  136. package/lib/chain/opPools/opPool.js +7 -7
  137. package/lib/chain/opPools/opPool.js.map +1 -1
  138. package/lib/chain/opPools/utils.d.ts +2 -2
  139. package/lib/chain/opPools/utils.d.ts.map +1 -1
  140. package/lib/chain/opPools/utils.js +2 -2
  141. package/lib/chain/opPools/utils.js.map +1 -1
  142. package/lib/chain/options.d.ts +1 -0
  143. package/lib/chain/options.d.ts.map +1 -1
  144. package/lib/chain/options.js +1 -0
  145. package/lib/chain/options.js.map +1 -1
  146. package/lib/chain/prepareNextSlot.d.ts +2 -2
  147. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  148. package/lib/chain/prepareNextSlot.js +3 -3
  149. package/lib/chain/prepareNextSlot.js.map +1 -1
  150. package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
  151. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  152. package/lib/chain/produceBlock/computeNewStateRoot.js +8 -4
  153. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  154. package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
  155. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  156. package/lib/chain/produceBlock/produceBlockBody.js +13 -17
  157. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  158. package/lib/chain/regen/interface.d.ts +15 -13
  159. package/lib/chain/regen/interface.d.ts.map +1 -1
  160. package/lib/chain/regen/interface.js +2 -0
  161. package/lib/chain/regen/interface.js.map +1 -1
  162. package/lib/chain/regen/queued.d.ts +14 -14
  163. package/lib/chain/regen/queued.d.ts.map +1 -1
  164. package/lib/chain/regen/queued.js.map +1 -1
  165. package/lib/chain/regen/regen.d.ts +6 -5
  166. package/lib/chain/regen/regen.d.ts.map +1 -1
  167. package/lib/chain/regen/regen.js +6 -6
  168. package/lib/chain/regen/regen.js.map +1 -1
  169. package/lib/chain/seenCache/index.d.ts +1 -1
  170. package/lib/chain/seenCache/index.d.ts.map +1 -1
  171. package/lib/chain/seenCache/index.js +1 -1
  172. package/lib/chain/seenCache/index.js.map +1 -1
  173. package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
  174. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  175. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +38 -0
  176. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -0
  177. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +76 -0
  178. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -0
  179. package/lib/chain/serializeState.d.ts +2 -2
  180. package/lib/chain/serializeState.d.ts.map +1 -1
  181. package/lib/chain/serializeState.js +1 -1
  182. package/lib/chain/serializeState.js.map +1 -1
  183. package/lib/chain/shufflingCache.d.ts +2 -2
  184. package/lib/chain/shufflingCache.d.ts.map +1 -1
  185. package/lib/chain/shufflingCache.js +3 -4
  186. package/lib/chain/shufflingCache.js.map +1 -1
  187. package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
  188. package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
  189. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  190. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
  191. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  192. package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
  193. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  194. package/lib/chain/stateCache/types.d.ts +14 -14
  195. package/lib/chain/stateCache/types.d.ts.map +1 -1
  196. package/lib/chain/stateCache/types.js.map +1 -1
  197. package/lib/chain/validation/attesterSlashing.js +3 -3
  198. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  199. package/lib/chain/validation/blobSidecar.js +1 -1
  200. package/lib/chain/validation/blobSidecar.js.map +1 -1
  201. package/lib/chain/validation/block.d.ts.map +1 -1
  202. package/lib/chain/validation/block.js +3 -3
  203. package/lib/chain/validation/block.js.map +1 -1
  204. package/lib/chain/validation/blsToExecutionChange.js +2 -2
  205. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  206. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  207. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  208. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  209. package/lib/chain/validation/executionPayloadBid.js +4 -4
  210. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  211. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  212. package/lib/chain/validation/executionPayloadEnvelope.js +29 -19
  213. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  214. package/lib/chain/validation/lightClientFinalityUpdate.js +1 -1
  215. package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
  216. package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -1
  217. package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
  218. package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
  219. package/lib/chain/validation/payloadAttestationMessage.js +1 -2
  220. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  221. package/lib/chain/validation/proposerSlashing.js +1 -1
  222. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  223. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
  224. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
  225. package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
  226. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  227. package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
  228. package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
  229. package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
  230. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  231. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
  232. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
  233. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  234. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
  235. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
  236. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
  237. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  238. package/lib/chain/validation/syncCommittee.d.ts +4 -4
  239. package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
  240. package/lib/chain/validation/syncCommittee.js +13 -12
  241. package/lib/chain/validation/syncCommittee.js.map +1 -1
  242. package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
  243. package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
  244. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  245. package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
  246. package/lib/chain/validation/voluntaryExit.js +3 -3
  247. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  248. package/lib/chain/validatorMonitor.d.ts +5 -4
  249. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  250. package/lib/chain/validatorMonitor.js +13 -8
  251. package/lib/chain/validatorMonitor.js.map +1 -1
  252. package/lib/execution/engine/interface.d.ts +2 -2
  253. package/lib/metrics/metrics/lodestar.d.ts +40 -4
  254. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  255. package/lib/metrics/metrics/lodestar.js +93 -15
  256. package/lib/metrics/metrics/lodestar.js.map +1 -1
  257. package/lib/network/gossip/encoding.d.ts.map +1 -1
  258. package/lib/network/gossip/encoding.js +15 -0
  259. package/lib/network/gossip/encoding.js.map +1 -1
  260. package/lib/network/gossip/topic.d.ts +727 -0
  261. package/lib/network/gossip/topic.d.ts.map +1 -1
  262. package/lib/network/interface.d.ts +4 -2
  263. package/lib/network/interface.d.ts.map +1 -1
  264. package/lib/network/libp2p/index.d.ts.map +1 -1
  265. package/lib/network/libp2p/index.js +5 -0
  266. package/lib/network/libp2p/index.js.map +1 -1
  267. package/lib/network/network.d.ts +4 -2
  268. package/lib/network/network.d.ts.map +1 -1
  269. package/lib/network/network.js +11 -5
  270. package/lib/network/network.js.map +1 -1
  271. package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
  272. package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
  273. package/lib/network/processor/extractSlotRootFns.js +15 -5
  274. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  275. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  276. package/lib/network/processor/gossipHandlers.js +39 -9
  277. package/lib/network/processor/gossipHandlers.js.map +1 -1
  278. package/lib/network/processor/index.d.ts +12 -7
  279. package/lib/network/processor/index.d.ts.map +1 -1
  280. package/lib/network/processor/index.js +99 -78
  281. package/lib/network/processor/index.js.map +1 -1
  282. package/lib/network/reqresp/ReqRespBeaconNode.d.ts +1 -1
  283. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  284. package/lib/network/reqresp/ReqRespBeaconNode.js +10 -1
  285. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  286. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
  287. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
  288. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
  289. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
  290. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
  291. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
  292. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
  293. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
  294. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  295. package/lib/network/reqresp/handlers/index.js +11 -1
  296. package/lib/network/reqresp/handlers/index.js.map +1 -1
  297. package/lib/network/reqresp/protocols.d.ts +2 -0
  298. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  299. package/lib/network/reqresp/protocols.js +10 -0
  300. package/lib/network/reqresp/protocols.js.map +1 -1
  301. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  302. package/lib/network/reqresp/rateLimit.js +8 -0
  303. package/lib/network/reqresp/rateLimit.js.map +1 -1
  304. package/lib/network/reqresp/score.d.ts.map +1 -1
  305. package/lib/network/reqresp/score.js +2 -0
  306. package/lib/network/reqresp/score.js.map +1 -1
  307. package/lib/network/reqresp/types.d.ts +8 -2
  308. package/lib/network/reqresp/types.d.ts.map +1 -1
  309. package/lib/network/reqresp/types.js +7 -1
  310. package/lib/network/reqresp/types.js.map +1 -1
  311. package/lib/node/nodejs.d.ts +2 -2
  312. package/lib/node/nodejs.d.ts.map +1 -1
  313. package/lib/node/nodejs.js +1 -4
  314. package/lib/node/nodejs.js.map +1 -1
  315. package/lib/node/notifier.d.ts.map +1 -1
  316. package/lib/node/notifier.js +3 -3
  317. package/lib/node/notifier.js.map +1 -1
  318. package/lib/sync/backfill/backfill.d.ts +3 -3
  319. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  320. package/lib/sync/backfill/backfill.js +3 -3
  321. package/lib/sync/backfill/backfill.js.map +1 -1
  322. package/lib/sync/constants.d.ts +1 -1
  323. package/lib/sync/constants.js +1 -1
  324. package/lib/sync/unknownBlock.d.ts +3 -9
  325. package/lib/sync/unknownBlock.d.ts.map +1 -1
  326. package/lib/sync/unknownBlock.js +8 -41
  327. package/lib/sync/unknownBlock.js.map +1 -1
  328. package/lib/util/sszBytes.d.ts +4 -1
  329. package/lib/util/sszBytes.d.ts.map +1 -1
  330. package/lib/util/sszBytes.js +69 -12
  331. package/lib/util/sszBytes.js.map +1 -1
  332. package/lib/util/types.d.ts +2 -0
  333. package/lib/util/types.d.ts.map +1 -1
  334. package/lib/util/types.js +1 -0
  335. package/lib/util/types.js.map +1 -1
  336. package/package.json +16 -16
  337. package/src/api/impl/beacon/blocks/index.ts +37 -18
  338. package/src/api/impl/beacon/pool/index.ts +1 -1
  339. package/src/api/impl/beacon/state/index.ts +29 -41
  340. package/src/api/impl/beacon/state/utils.ts +11 -25
  341. package/src/api/impl/lodestar/index.ts +4 -8
  342. package/src/api/impl/proof/index.ts +2 -9
  343. package/src/api/impl/validator/index.ts +29 -41
  344. package/src/api/impl/validator/utils.ts +4 -7
  345. package/src/chain/archiveStore/archiveStore.ts +1 -0
  346. package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
  347. package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
  348. package/src/chain/archiveStore/historicalState/types.ts +2 -0
  349. package/src/chain/archiveStore/historicalState/worker.ts +1 -4
  350. package/src/chain/archiveStore/interface.ts +1 -0
  351. package/src/chain/balancesCache.ts +5 -11
  352. package/src/chain/blocks/blockInput/types.ts +4 -3
  353. package/src/chain/blocks/importBlock.ts +47 -16
  354. package/src/chain/blocks/importExecutionPayload.ts +236 -0
  355. package/src/chain/blocks/index.ts +1 -1
  356. package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
  357. package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +336 -0
  358. package/src/chain/blocks/payloadEnvelopeInput/types.ts +33 -0
  359. package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
  360. package/src/chain/blocks/types.ts +10 -2
  361. package/src/chain/blocks/utils/checkpoint.ts +2 -2
  362. package/src/chain/blocks/verifyBlock.ts +5 -10
  363. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +5 -10
  364. package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
  365. package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
  366. package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
  367. package/src/chain/chain.ts +112 -70
  368. package/src/chain/emitter.ts +2 -2
  369. package/src/chain/errors/blockError.ts +4 -4
  370. package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
  371. package/src/chain/forkChoice/index.ts +33 -52
  372. package/src/chain/initState.ts +7 -2
  373. package/src/chain/interface.ts +18 -16
  374. package/src/chain/lightClient/index.ts +9 -22
  375. package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
  376. package/src/chain/opPools/opPool.ts +13 -14
  377. package/src/chain/opPools/utils.ts +4 -4
  378. package/src/chain/options.ts +2 -0
  379. package/src/chain/prepareNextSlot.ts +6 -8
  380. package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
  381. package/src/chain/produceBlock/produceBlockBody.ts +23 -50
  382. package/src/chain/regen/interface.ts +15 -17
  383. package/src/chain/regen/queued.ts +16 -20
  384. package/src/chain/regen/regen.ts +16 -17
  385. package/src/chain/seenCache/index.ts +1 -1
  386. package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
  387. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +106 -0
  388. package/src/chain/serializeState.ts +3 -3
  389. package/src/chain/shufflingCache.ts +5 -7
  390. package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
  391. package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
  392. package/src/chain/stateCache/types.ts +14 -18
  393. package/src/chain/validation/attesterSlashing.ts +3 -3
  394. package/src/chain/validation/blobSidecar.ts +1 -1
  395. package/src/chain/validation/block.ts +2 -4
  396. package/src/chain/validation/blsToExecutionChange.ts +2 -2
  397. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  398. package/src/chain/validation/executionPayloadBid.ts +3 -7
  399. package/src/chain/validation/executionPayloadEnvelope.ts +36 -29
  400. package/src/chain/validation/lightClientFinalityUpdate.ts +1 -1
  401. package/src/chain/validation/lightClientOptimisticUpdate.ts +1 -1
  402. package/src/chain/validation/payloadAttestationMessage.ts +2 -4
  403. package/src/chain/validation/proposerSlashing.ts +1 -1
  404. package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
  405. package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
  406. package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
  407. package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
  408. package/src/chain/validation/syncCommittee.ts +21 -20
  409. package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
  410. package/src/chain/validation/voluntaryExit.ts +3 -8
  411. package/src/chain/validatorMonitor.ts +23 -12
  412. package/src/execution/engine/interface.ts +2 -2
  413. package/src/metrics/metrics/lodestar.ts +100 -19
  414. package/src/network/gossip/encoding.ts +16 -0
  415. package/src/network/interface.ts +15 -2
  416. package/src/network/libp2p/index.ts +5 -0
  417. package/src/network/network.ts +34 -6
  418. package/src/network/processor/extractSlotRootFns.ts +19 -6
  419. package/src/network/processor/gossipHandlers.ts +45 -8
  420. package/src/network/processor/index.ts +110 -89
  421. package/src/network/reqresp/ReqRespBeaconNode.ts +14 -1
  422. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
  423. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
  424. package/src/network/reqresp/handlers/index.ts +12 -0
  425. package/src/network/reqresp/protocols.ts +12 -0
  426. package/src/network/reqresp/rateLimit.ts +18 -0
  427. package/src/network/reqresp/score.ts +2 -0
  428. package/src/network/reqresp/types.ts +13 -0
  429. package/src/node/nodejs.ts +3 -5
  430. package/src/node/notifier.ts +4 -10
  431. package/src/sync/backfill/backfill.ts +4 -4
  432. package/src/sync/constants.ts +1 -1
  433. package/src/sync/unknownBlock.ts +10 -50
  434. package/src/util/sszBytes.ts +90 -10
  435. package/src/util/types.ts +6 -0
  436. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +0 -15
  437. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +0 -1
  438. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +0 -28
  439. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +0 -1
  440. package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +0 -34
@@ -1,13 +1,7 @@
1
1
  import {BeaconConfig} from "@lodestar/config";
2
2
  import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
3
3
  import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params";
4
- import {
5
- CachedBeaconStateAllForks,
6
- computeEpochAtSlot,
7
- computeStartSlotAtEpoch,
8
- isExecutionCachedStateType,
9
- isMergeTransitionComplete,
10
- } from "@lodestar/state-transition";
4
+ import {IBeaconStateView, computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
11
5
  import {Epoch} from "@lodestar/types";
12
6
  import {ErrorAborted, Logger, prettyBytes, prettyBytesShort, sleep} from "@lodestar/utils";
13
7
  import {IBeaconChain} from "../chain/index.js";
@@ -161,7 +155,7 @@ function timeToNextHalfSlot(config: BeaconConfig, chain: IBeaconChain, isFirstTi
161
155
  function getHeadExecutionInfo(
162
156
  config: BeaconConfig,
163
157
  clockEpoch: Epoch,
164
- headState: CachedBeaconStateAllForks,
158
+ headState: IBeaconStateView,
165
159
  headInfo: ProtoBlock
166
160
  ): string[] {
167
161
  if (clockEpoch < config.BELLATRIX_FORK_EPOCH) {
@@ -171,8 +165,8 @@ function getHeadExecutionInfo(
171
165
  const executionStatusStr = headInfo.executionStatus.toLowerCase();
172
166
 
173
167
  // Add execution status to notifier only if head is on/post bellatrix
174
- if (isExecutionCachedStateType(headState)) {
175
- if (isMergeTransitionComplete(headState)) {
168
+ if (headState.isExecutionStateType) {
169
+ if (headState.isMergeTransitionComplete) {
176
170
  const executionPayloadHashInfo =
177
171
  headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadBlockHash : "empty";
178
172
  const executionPayloadNumberInfo =
@@ -2,7 +2,7 @@ import {EventEmitter} from "node:events";
2
2
  import {StrictEventEmitter} from "strict-event-emitter-types";
3
3
  import {BeaconConfig, ChainForkConfig} from "@lodestar/config";
4
4
  import {SLOTS_PER_EPOCH} from "@lodestar/params";
5
- import {BeaconStateAllForks, blockToHeader, computeAnchorCheckpoint} from "@lodestar/state-transition";
5
+ import {IBeaconStateView, blockToHeader} from "@lodestar/state-transition";
6
6
  import {Root, SignedBeaconBlock, Slot, phase0, ssz} from "@lodestar/types";
7
7
  import {ErrorAborted, Logger, byteArrayEquals, sleep, toRootHex} from "@lodestar/utils";
8
8
  import {IBeaconChain} from "../../chain/index.js";
@@ -29,7 +29,7 @@ export type BackfillSyncModules = {
29
29
  config: BeaconConfig;
30
30
  logger: Logger;
31
31
  metrics: Metrics | null;
32
- anchorState: BeaconStateAllForks;
32
+ anchorState: IBeaconStateView;
33
33
  wsCheckpoint?: phase0.Checkpoint;
34
34
  signal: AbortSignal;
35
35
  };
@@ -127,7 +127,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
127
127
  private wsValidated = false;
128
128
 
129
129
  /**
130
- * From https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/weak-subjectivity.md
130
+ * From https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/phase0/weak-subjectivity.md
131
131
  *
132
132
  *
133
133
  * If
@@ -231,7 +231,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
231
231
  ): Promise<T> {
232
232
  const {config, anchorState, db, wsCheckpoint, logger} = modules;
233
233
 
234
- const {checkpoint: anchorCp} = computeAnchorCheckpoint(config, anchorState);
234
+ const {checkpoint: anchorCp} = anchorState.computeAnchorCheckpoint();
235
235
  const anchorSlot = anchorState.latestBlockHeader.slot;
236
236
  const syncAnchor = {
237
237
  anchorBlock: null,
@@ -59,7 +59,7 @@ export const BATCH_BUFFER_SIZE = Math.ceil(10 / EPOCHS_PER_BATCH);
59
59
 
60
60
  /**
61
61
  * Maximum number of concurrent requests to perform with a SyncChain.
62
- * This is according to the spec https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md
62
+ * This is according to the spec https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/phase0/p2p-interface.md
63
63
  */
64
64
  export const MAX_CONCURRENT_REQUESTS = 2;
65
65
 
@@ -64,7 +64,7 @@ enum FetchResult {
64
64
  *
65
65
  * - publishBlock
66
66
  * - gossipHandlers
67
- * - searchUnknownSlotRoot
67
+ * - searchUnknownBlock
68
68
  * = produceSyncCommitteeContribution
69
69
  * = validateGossipFnRetryUnknownRoot
70
70
  * * submitPoolAttestationsV2
@@ -481,7 +481,7 @@ export class BlockInputSync {
481
481
  * From a set of shuffled peers:
482
482
  * - fetch the block
483
483
  * - from deneb, fetch all missing blobs
484
- * - from peerDAS, fetch sampled colmns
484
+ * - from peerDAS, fetch sampled columns
485
485
  * TODO: this means we only have block root, and nothing else. Consider to reflect this in the function name
486
486
  * prefulu, will attempt a max of `MAX_ATTEMPTS_PER_BLOCK` on different peers, postfulu we may attempt more as defined in `getMaxDownloadAttempts()` function
487
487
  * Also verifies the received block root + returns the peer that provided the block for future downscoring.
@@ -489,10 +489,7 @@ export class BlockInputSync {
489
489
  private async fetchBlockInput(cacheItem: BlockInputSyncCacheItem): Promise<PendingBlockInput> {
490
490
  const rootHex = getBlockInputSyncCacheItemRootHex(cacheItem);
491
491
  const excludedPeers = new Set<PeerIdStr>();
492
- const defaultPendingColumns =
493
- this.config.getForkSeq(this.chain.clock.currentSlot) >= ForkSeq.fulu
494
- ? new Set(this.network.custodyConfig.sampledColumns)
495
- : null;
492
+ const defaultPendingColumns = new Set(this.network.custodyConfig.sampledColumns);
496
493
 
497
494
  const fetchStartSec = Date.now() / 1000;
498
495
  let slot = isPendingBlockInput(cacheItem) ? cacheItem.blockInput.slot : undefined;
@@ -506,14 +503,10 @@ export class BlockInputSync {
506
503
  isPendingBlockInput(cacheItem) && isBlockInputColumns(cacheItem.blockInput)
507
504
  ? new Set(cacheItem.blockInput.getMissingSampledColumnMeta().missing)
508
505
  : defaultPendingColumns;
509
- // pendingDataColumns is null pre-fulu
510
506
  const peerMeta = this.peerBalancer.bestPeerForPendingColumns(pendingColumns, excludedPeers);
511
507
  if (peerMeta === null) {
512
508
  // no more peer with needed columns to try, throw error
513
- let message = `Error fetching UnknownBlockRoot slot=${slot} root=${rootHex} after ${i}: cannot find peer`;
514
- if (pendingColumns) {
515
- message += ` with needed columns=${prettyPrintIndices(Array.from(pendingColumns))}`;
516
- }
509
+ const message = `Error fetching UnknownBlockRoot slot=${slot} root=${rootHex} after ${i}: cannot find peer with needed columns=${prettyPrintIndices(Array.from(pendingColumns))}`;
517
510
  this.metrics?.blockInputSync.fetchTimeSec.observe(
518
511
  {result: FetchResult.FailureTriedAllPeers},
519
512
  Date.now() / 1000 - fetchStartSec
@@ -650,7 +643,7 @@ export class BlockInputSync {
650
643
  // TODO(fulu): why is this commented out here?
651
644
  //
652
645
  // this.knownBadBlocks.add(block.blockRootHex);
653
- // for (const peerIdStr of block.peerIdStrs) {
646
+ // for (const peerIdStr of block.peerIdStrings) {
654
647
  // // TODO: Refactor peerRpcScores to work with peerIdStr only
655
648
  // this.network.reportPeer(peerIdStr, PeerAction.LowToleranceError, "BadBlockByRoot");
656
649
  // }
@@ -729,11 +722,11 @@ export class UnknownBlockPeerBalancer {
729
722
  }
730
723
 
731
724
  /**
732
- * called from fetchUnknownBlockRoot() where we only have block root and nothing else
725
+ * called from fetchBlockInput() where we only have block root and nothing else
733
726
  * excludedPeers are the peers that we requested already so we don't want to try again
734
727
  * pendingColumns is empty for prefulu, or the 1st time we we download a block by root
735
728
  */
736
- bestPeerForPendingColumns(pendingColumns: Set<number> | null, excludedPeers: Set<PeerIdStr>): PeerSyncMeta | null {
729
+ bestPeerForPendingColumns(pendingColumns: Set<number>, excludedPeers: Set<PeerIdStr>): PeerSyncMeta | null {
737
730
  const eligiblePeers = this.filterPeers(pendingColumns, excludedPeers);
738
731
  if (eligiblePeers.length === 0) {
739
732
  return null;
@@ -750,37 +743,6 @@ export class UnknownBlockPeerBalancer {
750
743
  return this.peersMeta.get(bestPeerId) ?? null;
751
744
  }
752
745
 
753
- /**
754
- * called from fetchUnavailableBlockInput() where we have either BlockInput or NullBlockInput
755
- * excludedPeers are the peers that we requested already so we don't want to try again
756
- */
757
- bestPeerForBlockInput(blockInput: IBlockInput, excludedPeers: Set<PeerIdStr>): PeerSyncMeta | null {
758
- const eligiblePeers: PeerIdStr[] = [];
759
-
760
- if (isBlockInputColumns(blockInput)) {
761
- const pendingDataColumns: Set<number> = new Set(blockInput.getMissingSampledColumnMeta().missing);
762
- // there could be no pending column in case when block is still missing
763
- eligiblePeers.push(...this.filterPeers(pendingDataColumns, excludedPeers));
764
- } else {
765
- // prefulu
766
- eligiblePeers.push(...this.filterPeers(null, excludedPeers));
767
- }
768
-
769
- if (eligiblePeers.length === 0) {
770
- return null;
771
- }
772
-
773
- const sortedEligiblePeers = sortBy(
774
- shuffle(eligiblePeers),
775
- // prefer peers with least active req
776
- (peerId) => this.activeRequests.get(peerId) ?? 0
777
- );
778
-
779
- const bestPeerId = sortedEligiblePeers[0];
780
- this.onRequest(bestPeerId);
781
- return this.peersMeta.get(bestPeerId) ?? null;
782
- }
783
-
784
746
  /**
785
747
  * Consumers don't need to call this method directly, it is called internally by bestPeer*() methods
786
748
  * make this public for testing
@@ -804,8 +766,7 @@ export class UnknownBlockPeerBalancer {
804
766
  return totalActiveRequests;
805
767
  }
806
768
 
807
- // pendingDataColumns could be null for prefulu
808
- private filterPeers(pendingDataColumns: Set<number> | null, excludedPeers: Set<PeerIdStr>): PeerIdStr[] {
769
+ private filterPeers(pendingDataColumns: Set<number>, excludedPeers: Set<PeerIdStr>): PeerIdStr[] {
809
770
  let maxColumnCount = 0;
810
771
  const considerPeers: {peerId: PeerIdStr; columnCount: number}[] = [];
811
772
  for (const [peerId, syncMeta] of this.peersMeta.entries()) {
@@ -820,13 +781,12 @@ export class UnknownBlockPeerBalancer {
820
781
  continue;
821
782
  }
822
783
 
823
- if (pendingDataColumns === null || pendingDataColumns.size === 0) {
824
- // prefulu, no pending columns
784
+ if (pendingDataColumns.size === 0) {
825
785
  considerPeers.push({peerId, columnCount: 0});
826
786
  continue;
827
787
  }
828
788
 
829
- // postfulu, find peers that have custody columns that we need
789
+ // find peers that have custody columns that we need
830
790
  const {custodyColumns: peerColumns} = syncMeta;
831
791
  // check if the peer has all needed columns
832
792
  // get match
@@ -8,6 +8,7 @@ import {
8
8
  ForkSeq,
9
9
  MAX_COMMITTEES_PER_SLOT,
10
10
  isForkPostElectra,
11
+ isForkPostGloas,
11
12
  } from "@lodestar/params";
12
13
  import {BLSSignature, CommitteeIndex, RootHex, Slot, ValidatorIndex, ssz} from "@lodestar/types";
13
14
 
@@ -398,23 +399,102 @@ export function getSlotFromBlobSidecarSerialized(data: Uint8Array): Slot | null
398
399
  }
399
400
 
400
401
  /**
402
+ * Pre-Gloas DataColumnSidecar:
401
403
  * {
402
- index: ColumnIndex [ fixed - 8 bytes],
403
- column: DataColumn BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_CELL * <some non fixed length>,
404
- kzgCommitments: denebSsz.BlobKzgCommitments,
405
- kzgProofs: denebSsz.KZGProofs,
406
- signedBlockHeader: phase0Ssz.SignedBeaconBlockHeader,
407
- kzgCommitmentsInclusionProof: KzgCommitmentsInclusionProof,
404
+ * index: ColumnIndex [fixed - 8 bytes],
405
+ * column: DataColumn (offset - 4 bytes),
406
+ * kzgCommitments: (offset - 4 bytes),
407
+ * kzgProofs: (offset - 4 bytes),
408
+ * signedBlockHeader: (offset - 4 bytes) -> slot at variable offset after fixed header
409
+ * kzgCommitmentsInclusionProof: (offset - 4 bytes),
410
+ * }
411
+ * Post-Gloas DataColumnSidecar:
412
+ * {
413
+ * index: ColumnIndex [8 bytes],
414
+ * column: DataColumn (offset - 4 bytes),
415
+ * kzgProofs: (offset - 4 bytes),
416
+ * slot: Slot [8 bytes] - at offset 16,
417
+ * beaconBlockRoot: Root [32 bytes] - at offset 24,
418
+ * }
419
+ */
420
+ const SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR_PRE_GLOAS = 20;
421
+ const SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR_POST_GLOAS = 16;
422
+ const BEACON_BLOCK_ROOT_POSITION_IN_GLOAS_DATA_COLUMN_SIDECAR = 24;
423
+
424
+ export function getSlotFromDataColumnSidecarSerialized(data: Uint8Array, fork: ForkName): Slot | null {
425
+ const offset = isForkPostGloas(fork)
426
+ ? SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR_POST_GLOAS
427
+ : SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR_PRE_GLOAS;
428
+
429
+ if (data.length < offset + SLOT_SIZE) {
430
+ return null;
408
431
  }
432
+
433
+ return getSlotFromOffset(data, offset);
434
+ }
435
+
436
+ export function getBeaconBlockRootFromDataColumnSidecarSerialized(data: Uint8Array): RootHex | null {
437
+ if (data.length < BEACON_BLOCK_ROOT_POSITION_IN_GLOAS_DATA_COLUMN_SIDECAR + ROOT_SIZE) {
438
+ return null;
439
+ }
440
+
441
+ blockRootBuf.set(
442
+ data.subarray(
443
+ BEACON_BLOCK_ROOT_POSITION_IN_GLOAS_DATA_COLUMN_SIDECAR,
444
+ BEACON_BLOCK_ROOT_POSITION_IN_GLOAS_DATA_COLUMN_SIDECAR + ROOT_SIZE
445
+ )
446
+ );
447
+ return "0x" + blockRootBuf.toString("hex");
448
+ }
449
+
450
+ /**
451
+ * SignedExecutionPayloadEnvelope SSZ Layout:
452
+ * ├─ 4 bytes: message offset (points to byte 100)
453
+ * ├─ 96 bytes: signature
454
+ * └─ ExecutionPayloadEnvelope (starts at byte 100):
455
+ * ├─ 4 bytes: payload offset
456
+ * ├─ 4 bytes: executionRequests offset
457
+ * ├─ 8 bytes: builderIndex (offset 108-115)
458
+ * ├─ 32 bytes: beaconBlockRoot (offset 116-147)
459
+ * ├─ 8 bytes: slot (offset 148-155)
460
+ * └─ 32 bytes: stateRoot (offset 156-187)
409
461
  */
462
+ const SIGNED_EXECUTION_PAYLOAD_ENVELOPE_MESSAGE_OFFSET = 4;
463
+ const SIGNED_EXECUTION_PAYLOAD_ENVELOPE_SIGNATURE_SIZE = 96;
464
+ const EXECUTION_PAYLOAD_ENVELOPE_PAYLOAD_OFFSET = 4;
465
+ const EXECUTION_PAYLOAD_ENVELOPE_REQUESTS_OFFSET = 4;
466
+ const EXECUTION_PAYLOAD_ENVELOPE_BUILDER_INDEX_SIZE = 8;
467
+
468
+ const BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE =
469
+ SIGNED_EXECUTION_PAYLOAD_ENVELOPE_MESSAGE_OFFSET +
470
+ SIGNED_EXECUTION_PAYLOAD_ENVELOPE_SIGNATURE_SIZE +
471
+ EXECUTION_PAYLOAD_ENVELOPE_PAYLOAD_OFFSET +
472
+ EXECUTION_PAYLOAD_ENVELOPE_REQUESTS_OFFSET +
473
+ EXECUTION_PAYLOAD_ENVELOPE_BUILDER_INDEX_SIZE; // 116
474
+
475
+ const SLOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE =
476
+ BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE + ROOT_SIZE; // 148
477
+
478
+ export function getSlotFromExecutionPayloadEnvelopeSerialized(data: Uint8Array): Slot | null {
479
+ if (data.length < SLOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE + SLOT_SIZE) {
480
+ return null;
481
+ }
410
482
 
411
- const SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR = 20;
412
- export function getSlotFromDataColumnSidecarSerialized(data: Uint8Array): Slot | null {
413
- if (data.length < SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR + SLOT_SIZE) {
483
+ return getSlotFromOffset(data, SLOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE);
484
+ }
485
+
486
+ export function getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized(data: Uint8Array): RootHex | null {
487
+ if (data.length < BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE + ROOT_SIZE) {
414
488
  return null;
415
489
  }
416
490
 
417
- return getSlotFromOffset(data, SLOT_BYTES_POSITION_IN_SIGNED_DATA_COLUMN_SIDECAR);
491
+ blockRootBuf.set(
492
+ data.subarray(
493
+ BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE,
494
+ BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE + ROOT_SIZE
495
+ )
496
+ );
497
+ return "0x" + blockRootBuf.toString("hex");
418
498
  }
419
499
 
420
500
  /**
package/src/util/types.ts CHANGED
@@ -29,3 +29,9 @@ export type BlobSidecarsByRootRequest = ValueOf<ReturnType<typeof BlobSidecarsBy
29
29
  export const DataColumnSidecarsByRootRequestType = (config: BeaconConfig) =>
30
30
  new ListCompositeType(ssz.fulu.DataColumnsByRootIdentifier, config.MAX_REQUEST_BLOCKS_DENEB);
31
31
  export type DataColumnSidecarsByRootRequest = ValueOf<ReturnType<typeof DataColumnSidecarsByRootRequestType>>;
32
+
33
+ export const ExecutionPayloadEnvelopesByRootRequestType = (config: BeaconConfig) =>
34
+ new ListCompositeType(ssz.Root, config.MAX_REQUEST_PAYLOADS);
35
+ export type ExecutionPayloadEnvelopesByRootRequest = ValueOf<
36
+ ReturnType<typeof ExecutionPayloadEnvelopesByRootRequestType>
37
+ >;
@@ -1,15 +0,0 @@
1
- import { RootHex, Slot } from "@lodestar/types";
2
- /**
3
- * Cache to prevent processing multiple execution payload envelopes for the same block root.
4
- * Only one builder qualifies to submit an execution payload for a given slot.
5
- * We only keep track of envelopes of unfinalized slots.
6
- * [IGNORE] The node has not seen another valid `SignedExecutionPayloadEnvelope` for this block root.
7
- */
8
- export declare class SeenExecutionPayloadEnvelopes {
9
- private readonly slotByBlockRoot;
10
- private finalizedSlot;
11
- isKnown(blockRoot: RootHex): boolean;
12
- add(blockRoot: RootHex, slot: Slot): void;
13
- prune(finalizedSlot: Slot): void;
14
- }
15
- //# sourceMappingURL=seenExecutionPayloadEnvelope.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seenExecutionPayloadEnvelope.d.ts","sourceRoot":"","sources":["../../../src/chain/seenCache/seenExecutionPayloadEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAE9C;;;;;GAKG;AACH,qBAAa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA4B;IAC5D,OAAO,CAAC,aAAa,CAAW;IAEhC,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAEnC;IAED,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAMxC;IAED,KAAK,CAAC,aAAa,EAAE,IAAI,GAAG,IAAI,CAQ/B;CACF"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Cache to prevent processing multiple execution payload envelopes for the same block root.
3
- * Only one builder qualifies to submit an execution payload for a given slot.
4
- * We only keep track of envelopes of unfinalized slots.
5
- * [IGNORE] The node has not seen another valid `SignedExecutionPayloadEnvelope` for this block root.
6
- */
7
- export class SeenExecutionPayloadEnvelopes {
8
- slotByBlockRoot = new Map();
9
- finalizedSlot = 0;
10
- isKnown(blockRoot) {
11
- return this.slotByBlockRoot.has(blockRoot);
12
- }
13
- add(blockRoot, slot) {
14
- if (slot < this.finalizedSlot) {
15
- throw Error(`slot ${slot} < finalizedSlot ${this.finalizedSlot}`);
16
- }
17
- this.slotByBlockRoot.set(blockRoot, slot);
18
- }
19
- prune(finalizedSlot) {
20
- this.finalizedSlot = finalizedSlot;
21
- for (const [blockRoot, slot] of this.slotByBlockRoot.entries()) {
22
- if (slot < finalizedSlot) {
23
- this.slotByBlockRoot.delete(blockRoot);
24
- }
25
- }
26
- }
27
- }
28
- //# sourceMappingURL=seenExecutionPayloadEnvelope.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seenExecutionPayloadEnvelope.js","sourceRoot":"","sources":["../../../src/chain/seenCache/seenExecutionPayloadEnvelope.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,6BAA6B;IACvB,eAAe,GAAG,IAAI,GAAG,EAAiB,CAAC;IACpD,aAAa,GAAS,CAAC,CAAC;IAEhC,OAAO,CAAC,SAAkB,EAAW;QACnC,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAAA,CAC5C;IAED,GAAG,CAAC,SAAkB,EAAE,IAAU,EAAQ;QACxC,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC,QAAQ,IAAI,oBAAoB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAAA,CAC3C;IAED,KAAK,CAAC,aAAmB,EAAQ;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/D,IAAI,IAAI,GAAG,aAAa,EAAE,CAAC;gBACzB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IAAA,CACF;CACF"}
@@ -1,34 +0,0 @@
1
- import {RootHex, Slot} from "@lodestar/types";
2
-
3
- /**
4
- * Cache to prevent processing multiple execution payload envelopes for the same block root.
5
- * Only one builder qualifies to submit an execution payload for a given slot.
6
- * We only keep track of envelopes of unfinalized slots.
7
- * [IGNORE] The node has not seen another valid `SignedExecutionPayloadEnvelope` for this block root.
8
- */
9
- export class SeenExecutionPayloadEnvelopes {
10
- private readonly slotByBlockRoot = new Map<RootHex, Slot>();
11
- private finalizedSlot: Slot = 0;
12
-
13
- isKnown(blockRoot: RootHex): boolean {
14
- return this.slotByBlockRoot.has(blockRoot);
15
- }
16
-
17
- add(blockRoot: RootHex, slot: Slot): void {
18
- if (slot < this.finalizedSlot) {
19
- throw Error(`slot ${slot} < finalizedSlot ${this.finalizedSlot}`);
20
- }
21
-
22
- this.slotByBlockRoot.set(blockRoot, slot);
23
- }
24
-
25
- prune(finalizedSlot: Slot): void {
26
- this.finalizedSlot = finalizedSlot;
27
-
28
- for (const [blockRoot, slot] of this.slotByBlockRoot.entries()) {
29
- if (slot < finalizedSlot) {
30
- this.slotByBlockRoot.delete(blockRoot);
31
- }
32
- }
33
- }
34
- }