@lodestar/beacon-node 1.42.0-dev.1d50253953 → 1.42.0-dev.2219bb0cb8

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 (494) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +45 -13
  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 +5 -1
  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 +38 -40
  9. package/lib/api/impl/beacon/state/index.js.map +1 -1
  10. package/lib/api/impl/beacon/state/utils.d.ts +4 -4
  11. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  12. package/lib/api/impl/beacon/state/utils.js +7 -10
  13. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  14. package/lib/api/impl/debug/index.js.map +1 -1
  15. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  16. package/lib/api/impl/lodestar/index.js +8 -6
  17. package/lib/api/impl/lodestar/index.js.map +1 -1
  18. package/lib/api/impl/proof/index.d.ts.map +1 -1
  19. package/lib/api/impl/proof/index.js +2 -6
  20. package/lib/api/impl/proof/index.js.map +1 -1
  21. package/lib/api/impl/validator/index.d.ts.map +1 -1
  22. package/lib/api/impl/validator/index.js +35 -29
  23. package/lib/api/impl/validator/index.js.map +1 -1
  24. package/lib/api/impl/validator/utils.d.ts +2 -2
  25. package/lib/api/impl/validator/utils.d.ts.map +1 -1
  26. package/lib/api/impl/validator/utils.js +3 -3
  27. package/lib/api/impl/validator/utils.js.map +1 -1
  28. package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
  29. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  30. package/lib/chain/ColumnReconstructionTracker.js +5 -5
  31. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  32. package/lib/chain/GetBlobsTracker.d.ts +2 -1
  33. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  34. package/lib/chain/GetBlobsTracker.js +14 -12
  35. package/lib/chain/GetBlobsTracker.js.map +1 -1
  36. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  37. package/lib/chain/archiveStore/archiveStore.js +1 -0
  38. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  39. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
  40. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
  41. package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
  42. package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
  43. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
  44. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  45. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
  46. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  47. package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
  48. package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
  49. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  50. package/lib/chain/archiveStore/historicalState/worker.js +1 -3
  51. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  52. package/lib/chain/archiveStore/interface.d.ts +1 -0
  53. package/lib/chain/archiveStore/interface.d.ts.map +1 -1
  54. package/lib/chain/balancesCache.d.ts +2 -2
  55. package/lib/chain/balancesCache.d.ts.map +1 -1
  56. package/lib/chain/balancesCache.js +4 -4
  57. package/lib/chain/balancesCache.js.map +1 -1
  58. package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
  59. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  60. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  61. package/lib/chain/blocks/blockInput/types.d.ts +5 -4
  62. package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
  63. package/lib/chain/blocks/blockInput/types.js +1 -0
  64. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  65. package/lib/chain/blocks/importBlock.d.ts +3 -3
  66. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  67. package/lib/chain/blocks/importBlock.js +37 -23
  68. package/lib/chain/blocks/importBlock.js.map +1 -1
  69. package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
  70. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  71. package/lib/chain/blocks/importExecutionPayload.js +87 -51
  72. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  73. package/lib/chain/blocks/index.d.ts.map +1 -1
  74. package/lib/chain/blocks/index.js +3 -2
  75. package/lib/chain/blocks/index.js.map +1 -1
  76. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
  77. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
  78. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
  79. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
  80. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
  81. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
  82. package/lib/chain/blocks/types.d.ts +21 -15
  83. package/lib/chain/blocks/types.d.ts.map +1 -1
  84. package/lib/chain/blocks/types.js.map +1 -1
  85. package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
  86. package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
  87. package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
  88. package/lib/chain/blocks/verifyBlock.d.ts +2 -2
  89. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  90. package/lib/chain/blocks/verifyBlock.js +4 -4
  91. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  92. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
  93. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  94. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +5 -4
  95. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  96. package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
  97. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  98. package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
  99. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  100. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
  101. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
  102. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
  103. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  104. package/lib/chain/chain.d.ts +16 -14
  105. package/lib/chain/chain.d.ts.map +1 -1
  106. package/lib/chain/chain.js +123 -66
  107. package/lib/chain/chain.js.map +1 -1
  108. package/lib/chain/emitter.d.ts +31 -9
  109. package/lib/chain/emitter.d.ts.map +1 -1
  110. package/lib/chain/emitter.js +12 -3
  111. package/lib/chain/emitter.js.map +1 -1
  112. package/lib/chain/errors/blockError.d.ts +15 -5
  113. package/lib/chain/errors/blockError.d.ts.map +1 -1
  114. package/lib/chain/errors/blockError.js +4 -0
  115. package/lib/chain/errors/blockError.js.map +1 -1
  116. package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
  117. package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
  118. package/lib/chain/errors/dataColumnSidecarError.js +7 -0
  119. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  120. package/lib/chain/forkChoice/index.d.ts +4 -4
  121. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  122. package/lib/chain/forkChoice/index.js +30 -24
  123. package/lib/chain/forkChoice/index.js.map +1 -1
  124. package/lib/chain/initState.d.ts +2 -2
  125. package/lib/chain/initState.d.ts.map +1 -1
  126. package/lib/chain/initState.js +1 -1
  127. package/lib/chain/initState.js.map +1 -1
  128. package/lib/chain/interface.d.ts +16 -14
  129. package/lib/chain/interface.d.ts.map +1 -1
  130. package/lib/chain/interface.js.map +1 -1
  131. package/lib/chain/lightClient/index.d.ts +2 -2
  132. package/lib/chain/lightClient/index.d.ts.map +1 -1
  133. package/lib/chain/lightClient/index.js +11 -4
  134. package/lib/chain/lightClient/index.js.map +1 -1
  135. package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
  136. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  137. package/lib/chain/opPools/aggregatedAttestationPool.js +13 -13
  138. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  139. package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
  140. package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
  141. package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
  142. package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
  143. package/lib/chain/opPools/opPool.d.ts +3 -3
  144. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  145. package/lib/chain/opPools/opPool.js +7 -7
  146. package/lib/chain/opPools/opPool.js.map +1 -1
  147. package/lib/chain/opPools/utils.d.ts +2 -2
  148. package/lib/chain/opPools/utils.d.ts.map +1 -1
  149. package/lib/chain/opPools/utils.js +1 -1
  150. package/lib/chain/opPools/utils.js.map +1 -1
  151. package/lib/chain/options.d.ts +1 -0
  152. package/lib/chain/options.d.ts.map +1 -1
  153. package/lib/chain/options.js +1 -0
  154. package/lib/chain/options.js.map +1 -1
  155. package/lib/chain/prepareNextSlot.d.ts +2 -2
  156. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  157. package/lib/chain/prepareNextSlot.js +10 -4
  158. package/lib/chain/prepareNextSlot.js.map +1 -1
  159. package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
  160. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  161. package/lib/chain/produceBlock/computeNewStateRoot.js +9 -10
  162. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  163. package/lib/chain/produceBlock/produceBlockBody.d.ts +7 -7
  164. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  165. package/lib/chain/produceBlock/produceBlockBody.js +32 -17
  166. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  167. package/lib/chain/regen/interface.d.ts +13 -13
  168. package/lib/chain/regen/interface.d.ts.map +1 -1
  169. package/lib/chain/regen/queued.d.ts +14 -14
  170. package/lib/chain/regen/queued.d.ts.map +1 -1
  171. package/lib/chain/regen/queued.js.map +1 -1
  172. package/lib/chain/regen/regen.d.ts +6 -5
  173. package/lib/chain/regen/regen.d.ts.map +1 -1
  174. package/lib/chain/regen/regen.js +6 -6
  175. package/lib/chain/regen/regen.js.map +1 -1
  176. package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
  177. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  178. package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
  179. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  180. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
  181. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  182. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
  183. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  184. package/lib/chain/serializeState.d.ts +2 -2
  185. package/lib/chain/serializeState.d.ts.map +1 -1
  186. package/lib/chain/serializeState.js +1 -1
  187. package/lib/chain/serializeState.js.map +1 -1
  188. package/lib/chain/shufflingCache.d.ts +2 -2
  189. package/lib/chain/shufflingCache.d.ts.map +1 -1
  190. package/lib/chain/shufflingCache.js +3 -4
  191. package/lib/chain/shufflingCache.js.map +1 -1
  192. package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
  193. package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
  194. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  195. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
  196. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  197. package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
  198. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  199. package/lib/chain/stateCache/types.d.ts +14 -14
  200. package/lib/chain/stateCache/types.d.ts.map +1 -1
  201. package/lib/chain/stateCache/types.js.map +1 -1
  202. package/lib/chain/validation/attesterSlashing.js +3 -3
  203. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  204. package/lib/chain/validation/blobSidecar.js +1 -1
  205. package/lib/chain/validation/blobSidecar.js.map +1 -1
  206. package/lib/chain/validation/block.d.ts.map +1 -1
  207. package/lib/chain/validation/block.js +28 -6
  208. package/lib/chain/validation/block.js.map +1 -1
  209. package/lib/chain/validation/blsToExecutionChange.js +2 -2
  210. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  211. package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
  212. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  213. package/lib/chain/validation/dataColumnSidecar.js +185 -6
  214. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  215. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  216. package/lib/chain/validation/executionPayloadBid.js +10 -7
  217. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  218. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  219. package/lib/chain/validation/executionPayloadEnvelope.js +7 -3
  220. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  221. package/lib/chain/validation/payloadAttestationMessage.js +5 -3
  222. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  223. package/lib/chain/validation/proposerSlashing.js +1 -1
  224. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  225. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
  226. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
  227. package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
  228. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  229. package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
  230. package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
  231. package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
  232. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  233. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
  234. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
  235. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  236. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
  237. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
  238. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
  239. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  240. package/lib/chain/validation/syncCommittee.d.ts +4 -4
  241. package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
  242. package/lib/chain/validation/syncCommittee.js +17 -12
  243. package/lib/chain/validation/syncCommittee.js.map +1 -1
  244. package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
  245. package/lib/chain/validation/syncCommitteeContributionAndProof.js +5 -2
  246. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  247. package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
  248. package/lib/chain/validation/voluntaryExit.js +3 -3
  249. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  250. package/lib/chain/validatorMonitor.d.ts +3 -3
  251. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  252. package/lib/chain/validatorMonitor.js +11 -9
  253. package/lib/chain/validatorMonitor.js.map +1 -1
  254. package/lib/db/buckets.d.ts +2 -2
  255. package/lib/db/buckets.d.ts.map +1 -1
  256. package/lib/db/buckets.js +2 -2
  257. package/lib/db/buckets.js.map +1 -1
  258. package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
  259. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  260. package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
  261. package/lib/db/repositories/dataColumnSidecar.js +4 -2
  262. package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
  263. package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
  264. package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
  265. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  266. package/lib/metrics/metrics/lodestar.d.ts +32 -4
  267. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  268. package/lib/metrics/metrics/lodestar.js +52 -15
  269. package/lib/metrics/metrics/lodestar.js.map +1 -1
  270. package/lib/network/gossip/encoding.d.ts.map +1 -1
  271. package/lib/network/gossip/encoding.js +15 -0
  272. package/lib/network/gossip/encoding.js.map +1 -1
  273. package/lib/network/interface.d.ts +7 -4
  274. package/lib/network/interface.d.ts.map +1 -1
  275. package/lib/network/libp2p/index.d.ts.map +1 -1
  276. package/lib/network/libp2p/index.js +22 -11
  277. package/lib/network/libp2p/index.js.map +1 -1
  278. package/lib/network/network.d.ts +7 -4
  279. package/lib/network/network.d.ts.map +1 -1
  280. package/lib/network/network.js +12 -3
  281. package/lib/network/network.js.map +1 -1
  282. package/lib/network/options.d.ts.map +1 -1
  283. package/lib/network/options.js +7 -2
  284. package/lib/network/options.js.map +1 -1
  285. package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
  286. package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
  287. package/lib/network/processor/extractSlotRootFns.js +25 -5
  288. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  289. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  290. package/lib/network/processor/gossipHandlers.js +269 -80
  291. package/lib/network/processor/gossipHandlers.js.map +1 -1
  292. package/lib/network/processor/index.d.ts +22 -7
  293. package/lib/network/processor/index.d.ts.map +1 -1
  294. package/lib/network/processor/index.js +313 -80
  295. package/lib/network/processor/index.js.map +1 -1
  296. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  297. package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
  298. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  299. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
  300. package/lib/network/reqresp/handlers/beaconBlocksByRange.js +2 -1
  301. package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
  302. package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
  303. package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +2 -0
  304. package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
  305. package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +2 -2
  306. package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
  307. package/lib/network/reqresp/handlers/blobSidecarsByRange.js +7 -3
  308. package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
  309. package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
  310. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +6 -0
  311. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
  312. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -2
  313. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  314. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +7 -3
  315. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  316. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
  317. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
  318. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +70 -0
  319. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
  320. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
  321. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
  322. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +23 -0
  323. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
  324. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  325. package/lib/network/reqresp/handlers/index.js +11 -1
  326. package/lib/network/reqresp/handlers/index.js.map +1 -1
  327. package/lib/network/reqresp/protocols.d.ts +2 -0
  328. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  329. package/lib/network/reqresp/protocols.js +10 -0
  330. package/lib/network/reqresp/protocols.js.map +1 -1
  331. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  332. package/lib/network/reqresp/rateLimit.js +8 -0
  333. package/lib/network/reqresp/rateLimit.js.map +1 -1
  334. package/lib/network/reqresp/score.d.ts.map +1 -1
  335. package/lib/network/reqresp/score.js +2 -0
  336. package/lib/network/reqresp/score.js.map +1 -1
  337. package/lib/network/reqresp/types.d.ts +10 -4
  338. package/lib/network/reqresp/types.d.ts.map +1 -1
  339. package/lib/network/reqresp/types.js +16 -4
  340. package/lib/network/reqresp/types.js.map +1 -1
  341. package/lib/node/nodejs.d.ts +2 -2
  342. package/lib/node/nodejs.d.ts.map +1 -1
  343. package/lib/node/nodejs.js +3 -3
  344. package/lib/node/nodejs.js.map +1 -1
  345. package/lib/node/notifier.d.ts.map +1 -1
  346. package/lib/node/notifier.js +3 -3
  347. package/lib/node/notifier.js.map +1 -1
  348. package/lib/sync/backfill/backfill.d.ts +2 -2
  349. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  350. package/lib/sync/backfill/backfill.js +2 -2
  351. package/lib/sync/backfill/backfill.js.map +1 -1
  352. package/lib/sync/unknownBlock.d.ts +3 -9
  353. package/lib/sync/unknownBlock.d.ts.map +1 -1
  354. package/lib/sync/unknownBlock.js +10 -43
  355. package/lib/sync/unknownBlock.js.map +1 -1
  356. package/lib/sync/utils/downloadByRange.d.ts +3 -3
  357. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  358. package/lib/sync/utils/downloadByRange.js +4 -2
  359. package/lib/sync/utils/downloadByRange.js.map +1 -1
  360. package/lib/sync/utils/downloadByRoot.d.ts +3 -3
  361. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  362. package/lib/sync/utils/downloadByRoot.js +10 -5
  363. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  364. package/lib/util/blobs.d.ts +3 -3
  365. package/lib/util/blobs.d.ts.map +1 -1
  366. package/lib/util/blobs.js +21 -10
  367. package/lib/util/blobs.js.map +1 -1
  368. package/lib/util/dataColumns.d.ts +18 -11
  369. package/lib/util/dataColumns.d.ts.map +1 -1
  370. package/lib/util/dataColumns.js +51 -17
  371. package/lib/util/dataColumns.js.map +1 -1
  372. package/lib/util/execution.d.ts +6 -2
  373. package/lib/util/execution.d.ts.map +1 -1
  374. package/lib/util/execution.js +49 -25
  375. package/lib/util/execution.js.map +1 -1
  376. package/lib/util/sszBytes.d.ts +25 -1
  377. package/lib/util/sszBytes.d.ts.map +1 -1
  378. package/lib/util/sszBytes.js +189 -2
  379. package/lib/util/sszBytes.js.map +1 -1
  380. package/lib/util/types.d.ts +2 -0
  381. package/lib/util/types.d.ts.map +1 -1
  382. package/lib/util/types.js +1 -0
  383. package/lib/util/types.js.map +1 -1
  384. package/package.json +16 -16
  385. package/src/api/impl/beacon/blocks/index.ts +62 -16
  386. package/src/api/impl/beacon/pool/index.ts +5 -1
  387. package/src/api/impl/beacon/state/index.ts +43 -55
  388. package/src/api/impl/beacon/state/utils.ts +11 -25
  389. package/src/api/impl/debug/index.ts +2 -2
  390. package/src/api/impl/lodestar/index.ts +8 -8
  391. package/src/api/impl/proof/index.ts +2 -9
  392. package/src/api/impl/validator/index.ts +38 -43
  393. package/src/api/impl/validator/utils.ts +4 -7
  394. package/src/chain/ColumnReconstructionTracker.ts +6 -5
  395. package/src/chain/GetBlobsTracker.ts +14 -12
  396. package/src/chain/archiveStore/archiveStore.ts +1 -0
  397. package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
  398. package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
  399. package/src/chain/archiveStore/historicalState/types.ts +2 -0
  400. package/src/chain/archiveStore/historicalState/worker.ts +1 -4
  401. package/src/chain/archiveStore/interface.ts +1 -0
  402. package/src/chain/balancesCache.ts +5 -11
  403. package/src/chain/blocks/blockInput/blockInput.ts +8 -8
  404. package/src/chain/blocks/blockInput/types.ts +5 -4
  405. package/src/chain/blocks/importBlock.ts +50 -31
  406. package/src/chain/blocks/importExecutionPayload.ts +98 -62
  407. package/src/chain/blocks/index.ts +3 -2
  408. package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
  409. package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
  410. package/src/chain/blocks/types.ts +26 -15
  411. package/src/chain/blocks/utils/checkpoint.ts +2 -2
  412. package/src/chain/blocks/verifyBlock.ts +5 -10
  413. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +10 -14
  414. package/src/chain/blocks/verifyBlocksSignatures.ts +10 -3
  415. package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
  416. package/src/chain/chain.ts +167 -98
  417. package/src/chain/emitter.ts +27 -9
  418. package/src/chain/errors/blockError.ts +11 -5
  419. package/src/chain/errors/dataColumnSidecarError.ts +32 -1
  420. package/src/chain/forkChoice/index.ts +35 -41
  421. package/src/chain/initState.ts +7 -2
  422. package/src/chain/interface.ts +21 -15
  423. package/src/chain/lightClient/index.ts +17 -18
  424. package/src/chain/opPools/aggregatedAttestationPool.ts +20 -21
  425. package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
  426. package/src/chain/opPools/opPool.ts +13 -14
  427. package/src/chain/opPools/utils.ts +3 -3
  428. package/src/chain/options.ts +2 -0
  429. package/src/chain/prepareNextSlot.ts +14 -8
  430. package/src/chain/produceBlock/computeNewStateRoot.ts +13 -16
  431. package/src/chain/produceBlock/produceBlockBody.ts +51 -48
  432. package/src/chain/regen/interface.ts +13 -17
  433. package/src/chain/regen/queued.ts +16 -20
  434. package/src/chain/regen/regen.ts +16 -17
  435. package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
  436. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
  437. package/src/chain/serializeState.ts +3 -3
  438. package/src/chain/shufflingCache.ts +5 -7
  439. package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
  440. package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
  441. package/src/chain/stateCache/types.ts +14 -18
  442. package/src/chain/validation/attesterSlashing.ts +3 -3
  443. package/src/chain/validation/blobSidecar.ts +1 -1
  444. package/src/chain/validation/block.ts +31 -10
  445. package/src/chain/validation/blsToExecutionChange.ts +2 -2
  446. package/src/chain/validation/dataColumnSidecar.ts +231 -8
  447. package/src/chain/validation/executionPayloadBid.ts +10 -10
  448. package/src/chain/validation/executionPayloadEnvelope.ts +7 -4
  449. package/src/chain/validation/payloadAttestationMessage.ts +6 -4
  450. package/src/chain/validation/proposerSlashing.ts +1 -1
  451. package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
  452. package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
  453. package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
  454. package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
  455. package/src/chain/validation/syncCommittee.ts +25 -20
  456. package/src/chain/validation/syncCommitteeContributionAndProof.ts +9 -10
  457. package/src/chain/validation/voluntaryExit.ts +3 -8
  458. package/src/chain/validatorMonitor.ts +15 -13
  459. package/src/db/buckets.ts +2 -2
  460. package/src/db/repositories/dataColumnSidecar.ts +4 -2
  461. package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
  462. package/src/metrics/metrics/lodestar.ts +57 -19
  463. package/src/network/gossip/encoding.ts +16 -0
  464. package/src/network/interface.ts +18 -4
  465. package/src/network/libp2p/index.ts +24 -13
  466. package/src/network/network.ts +39 -8
  467. package/src/network/options.ts +7 -2
  468. package/src/network/processor/extractSlotRootFns.ts +32 -6
  469. package/src/network/processor/gossipHandlers.ts +334 -94
  470. package/src/network/processor/index.ts +395 -92
  471. package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
  472. package/src/network/reqresp/handlers/beaconBlocksByRange.ts +3 -1
  473. package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
  474. package/src/network/reqresp/handlers/blobSidecarsByRange.ts +15 -3
  475. package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
  476. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +19 -3
  477. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +96 -0
  478. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +34 -0
  479. package/src/network/reqresp/handlers/index.ts +12 -0
  480. package/src/network/reqresp/protocols.ts +12 -0
  481. package/src/network/reqresp/rateLimit.ts +18 -0
  482. package/src/network/reqresp/score.ts +2 -0
  483. package/src/network/reqresp/types.ts +26 -5
  484. package/src/node/nodejs.ts +6 -5
  485. package/src/node/notifier.ts +5 -6
  486. package/src/sync/backfill/backfill.ts +3 -3
  487. package/src/sync/unknownBlock.ts +13 -53
  488. package/src/sync/utils/downloadByRange.ts +9 -7
  489. package/src/sync/utils/downloadByRoot.ts +16 -12
  490. package/src/util/blobs.ts +35 -15
  491. package/src/util/dataColumns.ts +69 -25
  492. package/src/util/execution.ts +49 -30
  493. package/src/util/sszBytes.ts +245 -3
  494. package/src/util/types.ts +6 -0
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import {PrivateKey} from "@libp2p/interface";
3
- import {CompositeTypeAny, TreeView, Type} from "@chainsafe/ssz";
3
+ import {Type} from "@chainsafe/ssz";
4
4
  import {BeaconConfig} from "@lodestar/config";
5
5
  import {
6
6
  CheckpointWithPayloadStatus,
@@ -14,36 +14,30 @@ import {LoggerNode} from "@lodestar/logger/node";
14
14
  import {
15
15
  BUILDER_INDEX_SELF_BUILD,
16
16
  EFFECTIVE_BALANCE_INCREMENT,
17
- ForkPostFulu,
17
+ type ForkPostFulu,
18
+ type ForkPostGloas,
18
19
  GENESIS_SLOT,
19
20
  SLOTS_PER_EPOCH,
20
- isForkPostElectra,
21
21
  isForkPostGloas,
22
22
  } from "@lodestar/params";
23
23
  import {
24
- BeaconStateAllForks,
25
- BeaconStateElectra,
26
- CachedBeaconStateAllForks,
27
- CachedBeaconStateGloas,
28
24
  EffectiveBalanceIncrements,
29
25
  EpochShuffling,
26
+ IBeaconStateView,
30
27
  PubkeyCache,
31
- computeAnchorCheckpoint,
32
- computeAttestationsRewards,
33
- computeBlockRewards,
34
28
  computeEndSlotAtEpoch,
35
29
  computeEpochAtSlot,
36
30
  computeStartSlotAtEpoch,
37
- computeSyncCommitteeRewards,
38
- getEffectiveBalanceIncrementsZeroInactive,
39
31
  getEffectiveBalancesFromStateBytes,
40
- processSlots,
32
+ isStatePostAltair,
33
+ isStatePostElectra,
34
+ isStatePostGloas,
41
35
  } from "@lodestar/state-transition";
42
36
  import {
43
37
  BeaconBlock,
44
38
  BlindedBeaconBlock,
45
39
  BlindedBeaconBlockBody,
46
- DataColumnSidecars,
40
+ DataColumnSidecar,
47
41
  Epoch,
48
42
  Root,
49
43
  RootHex,
@@ -106,7 +100,7 @@ import {
106
100
  } from "./opPools/index.js";
107
101
  import {IChainOptions} from "./options.js";
108
102
  import {PrepareNextSlotScheduler} from "./prepareNextSlot.js";
109
- import {computeEnvelopeStateRoot, computeNewStateRoot} from "./produceBlock/computeNewStateRoot.js";
103
+ import {computeNewStateRoot, computePayloadEnvelopeStateRoot} from "./produceBlock/computeNewStateRoot.js";
110
104
  import {AssembledBlockType, BlockType, ProduceFullGloas, ProduceResult} from "./produceBlock/index.js";
111
105
  import {BlockAttributes, produceBlockBody, produceCommonBlockBody} from "./produceBlock/produceBlockBody.js";
112
106
  import {QueuedStateRegenerator, RegenCaller} from "./regen/index.js";
@@ -283,7 +277,7 @@ export class BeaconChain implements IBeaconChain {
283
277
  clock?: IClock;
284
278
  metrics: Metrics | null;
285
279
  validatorMonitor: ValidatorMonitor | null;
286
- anchorState: CachedBeaconStateAllForks;
280
+ anchorState: IBeaconStateView;
287
281
  isAnchorStateFinalized: boolean;
288
282
  executionEngine: IExecutionEngine;
289
283
  executionBuilder?: IExecutionBuilder;
@@ -359,16 +353,16 @@ export class BeaconChain implements IBeaconChain {
359
353
 
360
354
  this.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
361
355
  {
362
- shuffling: anchorState.epochCtx.previousShuffling,
363
- decisionRoot: anchorState.epochCtx.previousDecisionRoot,
356
+ shuffling: anchorState.getPreviousShuffling(),
357
+ decisionRoot: anchorState.previousDecisionRoot,
364
358
  },
365
359
  {
366
- shuffling: anchorState.epochCtx.currentShuffling,
367
- decisionRoot: anchorState.epochCtx.currentDecisionRoot,
360
+ shuffling: anchorState.getCurrentShuffling(),
361
+ decisionRoot: anchorState.currentDecisionRoot,
368
362
  },
369
363
  {
370
- shuffling: anchorState.epochCtx.nextShuffling,
371
- decisionRoot: anchorState.epochCtx.nextDecisionRoot,
364
+ shuffling: anchorState.getNextShuffling(),
365
+ decisionRoot: anchorState.nextDecisionRoot,
372
366
  },
373
367
  ]);
374
368
 
@@ -377,7 +371,7 @@ export class BeaconChain implements IBeaconChain {
377
371
 
378
372
  const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
379
373
  const blockStateCache = new FIFOBlockStateCache(this.opts, {metrics});
380
- this.bufferPool = new BufferPool(anchorState.type.tree_serializedSize(anchorState.node), metrics);
374
+ this.bufferPool = new BufferPool(anchorState.serializedSize(), metrics);
381
375
 
382
376
  this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
383
377
  const checkpointStateCache: CheckpointStateCache = new PersistentCheckpointStateCache(
@@ -393,10 +387,10 @@ export class BeaconChain implements IBeaconChain {
393
387
  this.opts
394
388
  );
395
389
 
396
- const {checkpoint} = computeAnchorCheckpoint(config, anchorState);
390
+ const {checkpoint} = anchorState.computeAnchorCheckpoint();
397
391
  blockStateCache.add(anchorState);
398
392
  blockStateCache.setHeadState(anchorState);
399
- const payloadPresent = getCheckpointPayloadStatus(anchorState, checkpoint.epoch) === PayloadStatus.FULL;
393
+ const payloadPresent = getCheckpointPayloadStatus(config, anchorState, checkpoint.epoch) === PayloadStatus.FULL;
400
394
  checkpointStateCache.add(checkpoint, anchorState, payloadPresent);
401
395
 
402
396
  const forkChoice = initializeForkChoice(
@@ -513,7 +507,11 @@ export class BeaconChain implements IBeaconChain {
513
507
  }
514
508
 
515
509
  seenBlock(blockRoot: RootHex): boolean {
516
- return this.seenBlockInputCache.has(blockRoot) || this.forkChoice.hasBlockHex(blockRoot);
510
+ return this.seenBlockInputCache.hasBlock(blockRoot) || this.forkChoice.hasBlockHexUnsafe(blockRoot);
511
+ }
512
+
513
+ seenPayloadEnvelope(blockRoot: RootHex): boolean {
514
+ return this.seenPayloadEnvelopeInputCache.hasPayload(blockRoot) || this.forkChoice.hasPayloadHexUnsafe(blockRoot);
517
515
  }
518
516
 
519
517
  regenCanAcceptWork(): boolean {
@@ -557,7 +555,7 @@ export class BeaconChain implements IBeaconChain {
557
555
  await this.opPool.toPersisted(this.db);
558
556
  }
559
557
 
560
- getHeadState(): CachedBeaconStateAllForks {
558
+ getHeadState(): IBeaconStateView {
561
559
  // head state should always exist
562
560
  const head = this.forkChoice.getHead();
563
561
  const headState = this.regen.getClosestHeadState(head);
@@ -567,11 +565,11 @@ export class BeaconChain implements IBeaconChain {
567
565
  return headState;
568
566
  }
569
567
 
570
- async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<CachedBeaconStateAllForks> {
568
+ async getHeadStateAtCurrentEpoch(regenCaller: RegenCaller): Promise<IBeaconStateView> {
571
569
  return this.getHeadStateAtEpoch(this.clock.currentEpoch, regenCaller);
572
570
  }
573
571
 
574
- async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<CachedBeaconStateAllForks> {
572
+ async getHeadStateAtEpoch(epoch: Epoch, regenCaller: RegenCaller): Promise<IBeaconStateView> {
575
573
  // using getHeadState() means we'll use checkpointStateCache if it's available
576
574
  const headState = this.getHeadState();
577
575
  // head state is in the same epoch, or we pulled up head state already from past epoch
@@ -588,7 +586,7 @@ export class BeaconChain implements IBeaconChain {
588
586
  async getStateBySlot(
589
587
  slot: Slot,
590
588
  opts?: StateGetOpts
591
- ): Promise<{state: CachedBeaconStateAllForks; executionOptimistic: boolean; finalized: boolean} | null> {
589
+ ): Promise<{state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null> {
592
590
  const finalizedBlock = this.forkChoice.getFinalizedBlock();
593
591
 
594
592
  if (slot < finalizedBlock.slot) {
@@ -638,15 +636,17 @@ export class BeaconChain implements IBeaconChain {
638
636
  async getStateByStateRoot(
639
637
  stateRoot: RootHex,
640
638
  opts?: StateGetOpts
641
- ): Promise<{state: CachedBeaconStateAllForks | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
639
+ ): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
642
640
  if (opts?.allowRegen) {
643
641
  const state = await this.regen.getState(stateRoot, RegenCaller.restApi);
644
- const block = this.forkChoice.getBlockDefaultStatus(state.latestBlockHeader.hashTreeRoot());
642
+ const block = this.forkChoice.getBlockDefaultStatus(
643
+ ssz.phase0.BeaconBlockHeader.hashTreeRoot(state.latestBlockHeader)
644
+ );
645
645
  const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
646
646
  return {
647
647
  state,
648
648
  executionOptimistic: block != null && isOptimisticBlock(block),
649
- finalized: state.epochCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
649
+ finalized: state.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
650
650
  };
651
651
  }
652
652
 
@@ -657,12 +657,14 @@ export class BeaconChain implements IBeaconChain {
657
657
  // TODO: This is very inneficient for debug requests of serialized content, since it deserializes to serialize again
658
658
  const cachedStateCtx = this.regen.getStateSync(stateRoot);
659
659
  if (cachedStateCtx) {
660
- const block = this.forkChoice.getBlockDefaultStatus(cachedStateCtx.latestBlockHeader.hashTreeRoot());
660
+ const block = this.forkChoice.getBlockDefaultStatus(
661
+ ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
662
+ );
661
663
  const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
662
664
  return {
663
665
  state: cachedStateCtx,
664
666
  executionOptimistic: block != null && isOptimisticBlock(block),
665
- finalized: cachedStateCtx.epochCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
667
+ finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
666
668
  };
667
669
  }
668
670
 
@@ -689,17 +691,19 @@ export class BeaconChain implements IBeaconChain {
689
691
 
690
692
  getStateByCheckpoint(
691
693
  checkpoint: CheckpointWithPayloadStatus
692
- ): {state: BeaconStateAllForks; executionOptimistic: boolean; finalized: boolean} | null {
694
+ ): {state: IBeaconStateView; executionOptimistic: boolean; finalized: boolean} | null {
693
695
  // finalized or justified checkpoint states maynot be available with PersistentCheckpointStateCache, use getCheckpointStateOrBytes() api to get Uint8Array
694
696
  const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
695
697
  const cachedStateCtx = this.regen.getCheckpointStateSync(checkpointHexPayload);
696
698
  if (cachedStateCtx) {
697
- const block = this.forkChoice.getBlockDefaultStatus(cachedStateCtx.latestBlockHeader.hashTreeRoot());
699
+ const block = this.forkChoice.getBlockDefaultStatus(
700
+ ssz.phase0.BeaconBlockHeader.hashTreeRoot(cachedStateCtx.latestBlockHeader)
701
+ );
698
702
  const finalizedEpoch = this.forkChoice.getFinalizedCheckpoint().epoch;
699
703
  return {
700
704
  state: cachedStateCtx,
701
705
  executionOptimistic: block != null && isOptimisticBlock(block),
702
- finalized: cachedStateCtx.epochCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
706
+ finalized: cachedStateCtx.epoch <= finalizedEpoch && finalizedEpoch !== GENESIS_EPOCH,
703
707
  };
704
708
  }
705
709
 
@@ -708,7 +712,7 @@ export class BeaconChain implements IBeaconChain {
708
712
 
709
713
  async getStateOrBytesByCheckpoint(
710
714
  checkpoint: CheckpointWithPayloadStatus
711
- ): Promise<{state: CachedBeaconStateAllForks | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
715
+ ): Promise<{state: IBeaconStateView | Uint8Array; executionOptimistic: boolean; finalized: boolean} | null> {
712
716
  const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
713
717
  const cachedStateCtx = await this.regen.getCheckpointStateOrBytes(checkpointHexPayload);
714
718
  if (cachedStateCtx) {
@@ -858,20 +862,66 @@ export class BeaconChain implements IBeaconChain {
858
862
  return null;
859
863
  }
860
864
 
861
- async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecars> {
862
- const blockInput = this.seenBlockInputCache.get(blockRootHex);
863
- if (blockInput) {
864
- if (!isBlockInputColumns(blockInput)) {
865
- throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
865
+ async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
866
+ const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
867
+ if (payloadInput?.hasPayloadEnvelope()) {
868
+ const envelope = payloadInput.getPayloadEnvelope();
869
+ const serialized = this.serializedCache.get(envelope);
870
+ if (serialized) {
871
+ return serialized;
872
+ }
873
+ return ssz.gloas.SignedExecutionPayloadEnvelope.serialize(envelope);
874
+ }
875
+
876
+ return (
877
+ (await this.db.executionPayloadEnvelope.getBinary(fromHex(blockRootHex))) ??
878
+ (await this.db.executionPayloadEnvelopeArchive.getBinary(blockSlot)) ??
879
+ null
880
+ );
881
+ }
882
+
883
+ async getExecutionPayloadEnvelope(
884
+ blockSlot: Slot,
885
+ blockRootHex: string
886
+ ): Promise<gloas.SignedExecutionPayloadEnvelope | null> {
887
+ const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
888
+ if (payloadInput?.hasPayloadEnvelope()) {
889
+ return payloadInput.getPayloadEnvelope();
890
+ }
891
+
892
+ return (
893
+ (await this.db.executionPayloadEnvelope.get(fromHex(blockRootHex))) ??
894
+ (await this.db.executionPayloadEnvelopeArchive.get(blockSlot)) ??
895
+ null
896
+ );
897
+ }
898
+
899
+ async getDataColumnSidecars(blockSlot: Slot, blockRootHex: string): Promise<DataColumnSidecar[]> {
900
+ const fork = this.config.getForkName(blockSlot);
901
+
902
+ if (isForkPostGloas(fork)) {
903
+ // After gloas, columns are tracked in PayloadEnvelopeInput
904
+ const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
905
+ if (payloadInput) {
906
+ return payloadInput.getAllColumns();
907
+ }
908
+ } else {
909
+ // Before gloas, columns are tracked in BlockInput
910
+ const blockInput = this.seenBlockInputCache.get(blockRootHex);
911
+ if (blockInput) {
912
+ if (!isBlockInputColumns(blockInput)) {
913
+ throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
914
+ }
915
+ return blockInput.getAllColumns();
866
916
  }
867
- return blockInput.getAllColumns();
868
917
  }
918
+
869
919
  const sidecarsUnfinalized = await this.db.dataColumnSidecar.values(fromHex(blockRootHex));
870
920
  if (sidecarsUnfinalized.length > 0) {
871
- return sidecarsUnfinalized as DataColumnSidecars;
921
+ return sidecarsUnfinalized;
872
922
  }
873
923
  const sidecarsFinalized = await this.db.dataColumnSidecarArchive.values(blockSlot);
874
- return sidecarsFinalized as DataColumnSidecars;
924
+ return sidecarsFinalized;
875
925
  }
876
926
 
877
927
  async getSerializedDataColumnSidecars(
@@ -879,23 +929,45 @@ export class BeaconChain implements IBeaconChain {
879
929
  blockRootHex: string,
880
930
  indices: number[]
881
931
  ): Promise<(Uint8Array | undefined)[]> {
882
- const blockInput = this.seenBlockInputCache.get(blockRootHex);
883
- if (blockInput) {
884
- if (!isBlockInputColumns(blockInput)) {
885
- throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
932
+ const fork = this.config.getForkName(blockSlot);
933
+
934
+ if (isForkPostGloas(fork)) {
935
+ // After gloas, columns are tracked in PayloadEnvelopeInput
936
+ const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
937
+ if (payloadInput) {
938
+ return indices.map((index) => {
939
+ const sidecar = payloadInput.getColumn(index);
940
+ if (!sidecar) {
941
+ return undefined;
942
+ }
943
+ const serialized = this.serializedCache.get(sidecar);
944
+ if (serialized) {
945
+ return serialized;
946
+ }
947
+ return sszTypesFor(fork as ForkPostGloas).DataColumnSidecar.serialize(sidecar);
948
+ });
886
949
  }
887
- return indices.map((index) => {
888
- const sidecar = blockInput.getColumn(index);
889
- if (!sidecar) {
890
- return undefined;
891
- }
892
- const serialized = this.serializedCache.get(sidecar);
893
- if (serialized) {
894
- return serialized;
950
+ } else {
951
+ // Before gloas, columns are tracked in BlockInput
952
+ const blockInput = this.seenBlockInputCache.get(blockRootHex);
953
+ if (blockInput) {
954
+ if (!isBlockInputColumns(blockInput)) {
955
+ throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
895
956
  }
896
- return sszTypesFor(blockInput.forkName as ForkPostFulu).DataColumnSidecar.serialize(sidecar);
897
- });
957
+ return indices.map((index) => {
958
+ const sidecar = blockInput.getColumn(index);
959
+ if (!sidecar) {
960
+ return undefined;
961
+ }
962
+ const serialized = this.serializedCache.get(sidecar);
963
+ if (serialized) {
964
+ return serialized;
965
+ }
966
+ return sszTypesFor(blockInput.forkName as ForkPostFulu).DataColumnSidecar.serialize(sidecar);
967
+ });
968
+ }
898
969
  }
970
+
899
971
  const sidecarsUnfinalized = await this.db.dataColumnSidecar.getManyBinary(fromHex(blockRootHex), indices);
900
972
  if (sidecarsUnfinalized.some((sidecar) => sidecar != null)) {
901
973
  return sidecarsUnfinalized;
@@ -952,14 +1024,13 @@ export class BeaconChain implements IBeaconChain {
952
1024
  consensusBlockValue: Wei;
953
1025
  shouldOverrideBuilder?: boolean;
954
1026
  }> {
955
- const fork = this.config.getForkName(slot);
956
1027
  const state = await this.regen.getBlockSlotState(
957
1028
  parentBlock,
958
1029
  slot,
959
1030
  {dontTransferCache: true},
960
1031
  RegenCaller.produceBlock
961
1032
  );
962
- const proposerIndex = state.epochCtx.getBeaconProposer(slot);
1033
+ const proposerIndex = state.getBeaconProposer(slot);
963
1034
  const proposerPubKey = this.pubkeyCache.getOrThrow(proposerIndex).toBytes();
964
1035
 
965
1036
  const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
@@ -981,7 +1052,7 @@ export class BeaconChain implements IBeaconChain {
981
1052
  // The hashtree root computed here for debug log will get cached and hence won't introduce additional delays
982
1053
  const bodyRoot =
983
1054
  produceResult.type === BlockType.Full
984
- ? sszTypesFor(fork).BeaconBlockBody.hashTreeRoot(body)
1055
+ ? this.config.getForkTypes(slot).BeaconBlockBody.hashTreeRoot(body)
985
1056
  : this.config
986
1057
  .getPostBellatrixForkTypes(slot)
987
1058
  .BlindedBeaconBlockBody.hashTreeRoot(body as BlindedBeaconBlockBody);
@@ -999,14 +1070,15 @@ export class BeaconChain implements IBeaconChain {
999
1070
  body,
1000
1071
  } as AssembledBlockType<T>;
1001
1072
 
1002
- const {newStateRoot, proposerReward, postState} = computeNewStateRoot(this.metrics, state, block);
1073
+ const {newStateRoot, proposerReward, postBlockState} = computeNewStateRoot(this.metrics, state, block);
1003
1074
  block.stateRoot = newStateRoot;
1004
1075
  const blockRoot =
1005
1076
  produceResult.type === BlockType.Full
1006
- ? sszTypesFor(fork).BeaconBlock.hashTreeRoot(block)
1077
+ ? this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block)
1007
1078
  : this.config.getPostBellatrixForkTypes(slot).BlindedBeaconBlock.hashTreeRoot(block as BlindedBeaconBlock);
1008
1079
  const blockRootHex = toRootHex(blockRoot);
1009
1080
 
1081
+ const fork = this.config.getForkName(slot);
1010
1082
  if (isForkPostGloas(fork)) {
1011
1083
  // TODO GLOAS: we should retire BlockType post-gloas, may need a new enum for self vs non-self built
1012
1084
  if (produceResult.type !== BlockType.Full) {
@@ -1022,8 +1094,11 @@ export class BeaconChain implements IBeaconChain {
1022
1094
  slot,
1023
1095
  stateRoot: ZERO_HASH,
1024
1096
  };
1025
- const envelopeStateRoot = computeEnvelopeStateRoot(this.metrics, postState as CachedBeaconStateGloas, envelope);
1026
- gloasResult.envelopeStateRoot = envelopeStateRoot;
1097
+ if (!isStatePostGloas(postBlockState)) {
1098
+ throw Error(`Expected gloas+ post-state for execution payload envelope, got fork=${postBlockState.forkName}`);
1099
+ }
1100
+ const payloadEnvelopeStateRoot = computePayloadEnvelopeStateRoot(this.metrics, postBlockState, envelope);
1101
+ gloasResult.payloadEnvelopeStateRoot = payloadEnvelopeStateRoot;
1027
1102
  }
1028
1103
 
1029
1104
  // Track the produced block for consensus broadcast validations, later validation, etc.
@@ -1143,8 +1218,8 @@ export class BeaconChain implements IBeaconChain {
1143
1218
  * persist preState, postState and block for further investigation.
1144
1219
  */
1145
1220
  async persistInvalidStateRoot(
1146
- preState: CachedBeaconStateAllForks,
1147
- postState: CachedBeaconStateAllForks,
1221
+ preState: IBeaconStateView,
1222
+ postState: IBeaconStateView,
1148
1223
  block: SignedBeaconBlock
1149
1224
  ): Promise<void> {
1150
1225
  const blockSlot = block.message.slot;
@@ -1159,13 +1234,13 @@ export class BeaconChain implements IBeaconChain {
1159
1234
  `${logStr}_block`
1160
1235
  ),
1161
1236
  this.persistSszObject(
1162
- `preState_slot_${preState.slot}_${preState.type.typeName}`,
1237
+ `preState_slot_${preState.slot}_BeaconState`,
1163
1238
  preState.serialize(),
1164
1239
  preState.hashTreeRoot(),
1165
1240
  `${logStr}_pre_state`
1166
1241
  ),
1167
1242
  this.persistSszObject(
1168
- `postState_slot_${postState.slot}_${postState.type.typeName}`,
1243
+ `postState_slot_${postState.slot}_BeaconState`,
1169
1244
  postState.serialize(),
1170
1245
  postState.hashTreeRoot(),
1171
1246
  `${logStr}_post_state`
@@ -1185,12 +1260,6 @@ export class BeaconChain implements IBeaconChain {
1185
1260
  }
1186
1261
  }
1187
1262
 
1188
- persistInvalidSszView(view: TreeView<CompositeTypeAny>, suffix?: string): void {
1189
- if (this.opts.persistInvalidSszObjects) {
1190
- void this.persistSszObject(view.type.typeName, view.serialize(), view.hashTreeRoot(), suffix);
1191
- }
1192
- }
1193
-
1194
1263
  /**
1195
1264
  * Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
1196
1265
  * However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
@@ -1208,7 +1277,7 @@ export class BeaconChain implements IBeaconChain {
1208
1277
  this.shufflingCache.insertPromise(attEpoch, shufflingDependentRoot);
1209
1278
  const blockEpoch = computeEpochAtSlot(attHeadBlock.slot);
1210
1279
 
1211
- let state: CachedBeaconStateAllForks;
1280
+ let state: IBeaconStateView;
1212
1281
  if (blockEpoch < attEpoch - 1) {
1213
1282
  // thanks to one epoch look ahead, we don't need to dial up to attEpoch
1214
1283
  const targetSlot = computeStartSlotAtEpoch(attEpoch - 1);
@@ -1226,7 +1295,7 @@ export class BeaconChain implements IBeaconChain {
1226
1295
  }
1227
1296
  // resolve the promise to unblock other calls of the same epoch and dependent root
1228
1297
  this.shufflingCache.processState(state);
1229
- return state.epochCtx.getShufflingAtEpoch(attEpoch);
1298
+ return state.getShufflingAtEpoch(attEpoch);
1230
1299
  }
1231
1300
 
1232
1301
  /**
@@ -1236,7 +1305,7 @@ export class BeaconChain implements IBeaconChain {
1236
1305
  */
1237
1306
  private justifiedBalancesGetter(
1238
1307
  checkpoint: CheckpointWithPayloadStatus,
1239
- blockState: CachedBeaconStateAllForks
1308
+ blockState: IBeaconStateView
1240
1309
  ): EffectiveBalanceIncrements {
1241
1310
  this.metrics?.balancesCache.requests.inc();
1242
1311
 
@@ -1263,7 +1332,7 @@ export class BeaconChain implements IBeaconChain {
1263
1332
  });
1264
1333
  }
1265
1334
 
1266
- return getEffectiveBalanceIncrementsZeroInactive(state);
1335
+ return state.getEffectiveBalanceIncrementsZeroInactive();
1267
1336
  }
1268
1337
 
1269
1338
  /**
@@ -1275,8 +1344,8 @@ export class BeaconChain implements IBeaconChain {
1275
1344
  */
1276
1345
  private closestJustifiedBalancesStateToCheckpoint(
1277
1346
  checkpoint: CheckpointWithPayloadStatus,
1278
- blockState: CachedBeaconStateAllForks
1279
- ): {state: CachedBeaconStateAllForks; stateId: string; shouldWarn: boolean} {
1347
+ blockState: IBeaconStateView
1348
+ ): {state: IBeaconStateView; stateId: string; shouldWarn: boolean} {
1280
1349
  const checkpointHexPayload = fcCheckpointToHexPayload(checkpoint);
1281
1350
  const state = this.regen.getCheckpointStateSync(checkpointHexPayload);
1282
1351
  if (state) {
@@ -1356,13 +1425,10 @@ export class BeaconChain implements IBeaconChain {
1356
1425
  metrics.chain.blacklistedBlocks.set(this.blacklistedBlocks.size);
1357
1426
 
1358
1427
  const headState = this.getHeadState();
1359
- const fork = this.config.getForkName(headState.slot);
1360
-
1361
- if (isForkPostElectra(fork)) {
1362
- const headStateElectra = headState as BeaconStateElectra;
1363
- metrics.pendingDeposits.set(headStateElectra.pendingDeposits.length);
1364
- metrics.pendingPartialWithdrawals.set(headStateElectra.pendingPartialWithdrawals.length);
1365
- metrics.pendingConsolidations.set(headStateElectra.pendingConsolidations.length);
1428
+ if (isStatePostElectra(headState)) {
1429
+ metrics.pendingDeposits.set(headState.pendingDepositsCount);
1430
+ metrics.pendingPartialWithdrawals.set(headState.pendingPartialWithdrawalsCount);
1431
+ metrics.pendingConsolidations.set(headState.pendingConsolidationsCount);
1366
1432
  }
1367
1433
  }
1368
1434
 
@@ -1426,7 +1492,7 @@ export class BeaconChain implements IBeaconChain {
1426
1492
  this.logger.verbose("Fork choice justified", {epoch: cp.epoch, root: cp.rootHex});
1427
1493
  }
1428
1494
 
1429
- private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: CachedBeaconStateAllForks): void {
1495
+ private onCheckpoint(this: BeaconChain, _checkpoint: phase0.Checkpoint, state: IBeaconStateView): void {
1430
1496
  // Defer to not block other checkpoint event handlers, which can cause lightclient update delays
1431
1497
  callInNextEventLoop(() => {
1432
1498
  this.shufflingCache.processState(state);
@@ -1512,7 +1578,7 @@ export class BeaconChain implements IBeaconChain {
1512
1578
  if (stateOrBytes instanceof Uint8Array) {
1513
1579
  effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
1514
1580
  } else {
1515
- effectiveBalances = validatorIndices.map((index) => stateOrBytes.validators.get(index).effectiveBalance ?? 0);
1581
+ effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
1516
1582
  }
1517
1583
  }
1518
1584
 
@@ -1562,11 +1628,11 @@ export class BeaconChain implements IBeaconChain {
1562
1628
  throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
1563
1629
  }
1564
1630
 
1565
- preState = processSlots(preState, block.slot); // Dial preState's slot to block.slot
1631
+ preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
1566
1632
 
1567
1633
  const proposerRewards = this.regen.getStateSync(toRootHex(block.stateRoot))?.proposerRewards ?? undefined;
1568
1634
 
1569
- return computeBlockRewards(this.config, block, preState, proposerRewards);
1635
+ return preState.computeBlockRewards(block, proposerRewards);
1570
1636
  }
1571
1637
 
1572
1638
  async getAttestationsRewards(
@@ -1590,7 +1656,7 @@ export class BeaconChain implements IBeaconChain {
1590
1656
  throw Error(`State is not in cache for slot ${slot}`);
1591
1657
  }
1592
1658
 
1593
- const rewards = await computeAttestationsRewards(this.config, this.pubkeyCache, cachedState, validatorIds);
1659
+ const rewards = await cachedState.computeAttestationsRewards(validatorIds);
1594
1660
 
1595
1661
  return {rewards, executionOptimistic, finalized};
1596
1662
  }
@@ -1605,8 +1671,11 @@ export class BeaconChain implements IBeaconChain {
1605
1671
  throw Error(`Pre-state is unavailable given block's parent root ${toRootHex(block.parentRoot)}`);
1606
1672
  }
1607
1673
 
1608
- preState = processSlots(preState, block.slot); // Dial preState's slot to block.slot
1674
+ preState = preState.processSlots(block.slot); // Dial preState's slot to block.slot
1675
+ if (!isStatePostAltair(preState)) {
1676
+ throw new Error("Sync committee rewards are not supported before Altair");
1677
+ }
1609
1678
 
1610
- return computeSyncCommitteeRewards(this.config, this.pubkeyCache, block, preState, validatorIds);
1679
+ return preState.computeSyncCommitteeRewards(block, validatorIds ?? []);
1611
1680
  }
1612
1681
  }
@@ -2,8 +2,9 @@ import {EventEmitter} from "node:events";
2
2
  import {StrictEventEmitter} from "strict-event-emitter-types";
3
3
  import {routes} from "@lodestar/api";
4
4
  import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
5
- import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
6
- import {DataColumnSidecars, RootHex, deneb, phase0} from "@lodestar/types";
5
+ import {IBeaconStateView} from "@lodestar/state-transition";
6
+ import {DataColumnSidecar, RootHex, deneb, phase0} from "@lodestar/types";
7
+ import {SignedExecutionPayloadEnvelope} from "@lodestar/types/gloas";
7
8
  import {PeerIdStr} from "../util/peerId.js";
8
9
  import {BlockInputSource, IBlockInput} from "./blocks/blockInput/types.js";
9
10
 
@@ -54,13 +55,22 @@ export enum ChainEvent {
54
55
  */
55
56
  updateStatus = "updateStatus",
56
57
  /**
57
- * Trigger a BlockInputSync for blocks where the parentRoot is not known to fork choice
58
+ * Trigger BlockInputSync to find parent of a SignedBeaconBlock received
59
+ * Post-gloas, missing parent could be a SignedBeaconBlock and/or a SignedExecutionPayloadEnvelope
58
60
  */
59
- unknownParent = "unknownParent",
61
+ blockUnknownParent = "blockUnknownParent",
60
62
  /**
61
- * Trigger BlockInputSync for objects that correspond to a block that is not known to fork choice
63
+ * Trigger BlockInputSync to find a SignedBeaconBlock given a SignedExecutionPayloadEnvelop received
64
+ */
65
+ envelopeUnknownBlock = "envelopeUnknownBlock",
66
+ /**
67
+ * Trigger BlockInputSync to find a SignedBeaconBlock with specified block root.
62
68
  */
63
69
  unknownBlockRoot = "unknownBlockRoot",
70
+ /**
71
+ * Trigger BlockInputSync to find a SignedExecutionPayloadEnvelope with specified block root.
72
+ */
73
+ unknownEnvelopeBlockRoot = "unknownEnvelopeBlockRoot",
64
74
  /**
65
75
  * Trigger BlockInputSync for blocks that are partially received via gossip but are not complete by time the
66
76
  * cut-off window passes for waiting on gossip
@@ -75,20 +85,26 @@ export type ReorgEventData = routes.events.EventData[routes.events.EventType.cha
75
85
  type ApiEvents = {[K in routes.events.EventType]: (data: routes.events.EventData[K]) => void};
76
86
 
77
87
  export type ChainEventData = {
78
- [ChainEvent.unknownParent]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
88
+ [ChainEvent.blockUnknownParent]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
89
+ [ChainEvent.envelopeUnknownBlock]: {
90
+ envelope: SignedExecutionPayloadEnvelope;
91
+ peer?: PeerIdStr;
92
+ source: BlockInputSource;
93
+ };
79
94
  [ChainEvent.unknownBlockRoot]: {rootHex: RootHex; peer?: PeerIdStr; source: BlockInputSource};
80
95
  [ChainEvent.incompleteBlockInput]: {blockInput: IBlockInput; peer: PeerIdStr; source: BlockInputSource};
96
+ [ChainEvent.unknownEnvelopeBlockRoot]: {rootHex: RootHex; peer?: PeerIdStr; source: BlockInputSource};
81
97
  };
82
98
 
83
99
  export type IChainEvents = ApiEvents & {
84
- [ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state: CachedBeaconStateAllForks) => void;
100
+ [ChainEvent.checkpoint]: (checkpoint: phase0.Checkpoint, state: IBeaconStateView) => void;
85
101
 
86
102
  [ChainEvent.forkChoiceJustified]: (checkpoint: CheckpointWithPayloadStatus) => void;
87
103
  [ChainEvent.forkChoiceFinalized]: (checkpoint: CheckpointWithPayloadStatus) => void;
88
104
 
89
105
  [ChainEvent.updateTargetCustodyGroupCount]: (targetGroupCount: number) => void;
90
106
 
91
- [ChainEvent.publishDataColumns]: (sidecars: DataColumnSidecars) => void;
107
+ [ChainEvent.publishDataColumns]: (sidecars: DataColumnSidecar[]) => void;
92
108
 
93
109
  [ChainEvent.publishBlobSidecars]: (sidecars: deneb.BlobSidecar[]) => void;
94
110
 
@@ -96,9 +112,11 @@ export type IChainEvents = ApiEvents & {
96
112
 
97
113
  // Sync events that are chain->chain. Initiated from network requests but do not cross the network
98
114
  // barrier so are considered ChainEvent(s).
99
- [ChainEvent.unknownParent]: (data: ChainEventData[ChainEvent.unknownParent]) => void;
115
+ [ChainEvent.blockUnknownParent]: (data: ChainEventData[ChainEvent.blockUnknownParent]) => void;
116
+ [ChainEvent.envelopeUnknownBlock]: (data: ChainEventData[ChainEvent.envelopeUnknownBlock]) => void;
100
117
  [ChainEvent.unknownBlockRoot]: (data: ChainEventData[ChainEvent.unknownBlockRoot]) => void;
101
118
  [ChainEvent.incompleteBlockInput]: (data: ChainEventData[ChainEvent.incompleteBlockInput]) => void;
119
+ [ChainEvent.unknownEnvelopeBlockRoot]: (data: ChainEventData[ChainEvent.unknownEnvelopeBlockRoot]) => void;
102
120
  };
103
121
 
104
122
  /**