@lodestar/beacon-node 1.41.0-dev.f2caa915ab → 1.41.0-dev.f7a5f4ddda

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 (728) hide show
  1. package/lib/api/impl/api.js.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.d.ts +1 -1
  3. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  4. package/lib/api/impl/beacon/blocks/index.js +3 -2
  5. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  6. package/lib/api/impl/beacon/blocks/utils.js.map +1 -1
  7. package/lib/api/impl/beacon/index.js.map +1 -1
  8. package/lib/api/impl/beacon/pool/index.d.ts +1 -1
  9. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  10. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  11. package/lib/api/impl/beacon/rewards/index.d.ts +1 -1
  12. package/lib/api/impl/beacon/rewards/index.d.ts.map +1 -1
  13. package/lib/api/impl/beacon/rewards/index.js.map +1 -1
  14. package/lib/api/impl/beacon/state/index.d.ts +1 -1
  15. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  16. package/lib/api/impl/beacon/state/index.js.map +1 -1
  17. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  18. package/lib/api/impl/config/constants.js.map +1 -1
  19. package/lib/api/impl/config/index.js.map +1 -1
  20. package/lib/api/impl/debug/index.d.ts +1 -1
  21. package/lib/api/impl/debug/index.d.ts.map +1 -1
  22. package/lib/api/impl/debug/index.js.map +1 -1
  23. package/lib/api/impl/errors.d.ts.map +1 -1
  24. package/lib/api/impl/errors.js.map +1 -1
  25. package/lib/api/impl/events/index.d.ts +1 -1
  26. package/lib/api/impl/events/index.d.ts.map +1 -1
  27. package/lib/api/impl/events/index.js.map +1 -1
  28. package/lib/api/impl/lightclient/index.d.ts +1 -1
  29. package/lib/api/impl/lightclient/index.d.ts.map +1 -1
  30. package/lib/api/impl/lightclient/index.js.map +1 -1
  31. package/lib/api/impl/lodestar/index.d.ts +1 -1
  32. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  33. package/lib/api/impl/lodestar/index.js.map +1 -1
  34. package/lib/api/impl/node/index.js.map +1 -1
  35. package/lib/api/impl/node/utils.js.map +1 -1
  36. package/lib/api/impl/proof/index.js.map +1 -1
  37. package/lib/api/impl/utils.js.map +1 -1
  38. package/lib/api/impl/validator/index.d.ts.map +1 -1
  39. package/lib/api/impl/validator/index.js +30 -12
  40. package/lib/api/impl/validator/index.js.map +1 -1
  41. package/lib/api/impl/validator/utils.d.ts +1 -1
  42. package/lib/api/impl/validator/utils.d.ts.map +1 -1
  43. package/lib/api/impl/validator/utils.js.map +1 -1
  44. package/lib/api/rest/activeSockets.d.ts.map +1 -1
  45. package/lib/api/rest/activeSockets.js.map +1 -1
  46. package/lib/api/rest/base.d.ts.map +1 -1
  47. package/lib/api/rest/base.js.map +1 -1
  48. package/lib/api/rest/index.d.ts.map +1 -1
  49. package/lib/api/rest/index.js.map +1 -1
  50. package/lib/api/rest/swaggerUI.js.map +1 -1
  51. package/lib/bun-wrappers/prometheus-gc-stats.js.map +1 -1
  52. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  53. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  54. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  55. package/lib/chain/GetBlobsTracker.js.map +1 -1
  56. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  57. package/lib/chain/archiveStore/archiveStore.js +2 -1
  58. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  59. package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
  60. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  61. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  62. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  63. package/lib/chain/archiveStore/historicalState/types.js +2 -1
  64. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  65. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  66. package/lib/chain/archiveStore/interface.js +2 -1
  67. package/lib/chain/archiveStore/interface.js.map +1 -1
  68. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +1 -1
  69. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
  70. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +2 -1
  71. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
  72. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +3 -8
  73. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  74. package/lib/chain/archiveStore/utils/archiveBlocks.js +1 -1
  75. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  76. package/lib/chain/archiveStore/utils/archivePayloads.js.map +1 -1
  77. package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
  78. package/lib/chain/archiveStore/utils/updateBackfillRange.js +1 -1
  79. package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +1 -1
  80. package/lib/chain/balancesCache.d.ts.map +1 -1
  81. package/lib/chain/balancesCache.js.map +1 -1
  82. package/lib/chain/beaconProposerCache.d.ts.map +1 -1
  83. package/lib/chain/beaconProposerCache.js.map +1 -1
  84. package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -0
  85. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  86. package/lib/chain/blocks/blockInput/blockInput.js +24 -0
  87. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  88. package/lib/chain/blocks/blockInput/errors.js +2 -1
  89. package/lib/chain/blocks/blockInput/errors.js.map +1 -1
  90. package/lib/chain/blocks/blockInput/types.d.ts +16 -0
  91. package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
  92. package/lib/chain/blocks/blockInput/types.js +4 -2
  93. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  94. package/lib/chain/blocks/blockInput/utils.js.map +1 -1
  95. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  96. package/lib/chain/blocks/importBlock.js +27 -4
  97. package/lib/chain/blocks/importBlock.js.map +1 -1
  98. package/lib/chain/blocks/index.d.ts.map +1 -1
  99. package/lib/chain/blocks/index.js.map +1 -1
  100. package/lib/chain/blocks/types.js +6 -3
  101. package/lib/chain/blocks/types.js.map +1 -1
  102. package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
  103. package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
  104. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  105. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  106. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  107. package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
  108. package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -1
  109. package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
  110. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  111. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  112. package/lib/chain/blocks/writeBlockInputToDb.d.ts +12 -3
  113. package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
  114. package/lib/chain/blocks/writeBlockInputToDb.js +92 -98
  115. package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
  116. package/lib/chain/bls/maybeBatch.js.map +1 -1
  117. package/lib/chain/bls/multithread/index.d.ts.map +1 -1
  118. package/lib/chain/bls/multithread/index.js.map +1 -1
  119. package/lib/chain/bls/multithread/jobItem.js +2 -1
  120. package/lib/chain/bls/multithread/jobItem.js.map +1 -1
  121. package/lib/chain/bls/multithread/types.js +2 -1
  122. package/lib/chain/bls/multithread/types.js.map +1 -1
  123. package/lib/chain/bls/multithread/utils.js.map +1 -1
  124. package/lib/chain/bls/multithread/worker.js.map +1 -1
  125. package/lib/chain/bls/singleThread.d.ts.map +1 -1
  126. package/lib/chain/bls/singleThread.js.map +1 -1
  127. package/lib/chain/bls/utils.js.map +1 -1
  128. package/lib/chain/chain.d.ts +4 -4
  129. package/lib/chain/chain.d.ts.map +1 -1
  130. package/lib/chain/chain.js +13 -12
  131. package/lib/chain/chain.js.map +1 -1
  132. package/lib/chain/emitter.d.ts +4 -6
  133. package/lib/chain/emitter.d.ts.map +1 -1
  134. package/lib/chain/emitter.js +2 -1
  135. package/lib/chain/emitter.js.map +1 -1
  136. package/lib/chain/errors/attestationError.d.ts.map +1 -1
  137. package/lib/chain/errors/attestationError.js +2 -1
  138. package/lib/chain/errors/attestationError.js.map +1 -1
  139. package/lib/chain/errors/attesterSlashingError.js +2 -1
  140. package/lib/chain/errors/attesterSlashingError.js.map +1 -1
  141. package/lib/chain/errors/blobSidecarError.js +2 -1
  142. package/lib/chain/errors/blobSidecarError.js.map +1 -1
  143. package/lib/chain/errors/blockError.d.ts.map +1 -1
  144. package/lib/chain/errors/blockError.js +2 -1
  145. package/lib/chain/errors/blockError.js.map +1 -1
  146. package/lib/chain/errors/blsToExecutionChangeError.js +2 -1
  147. package/lib/chain/errors/blsToExecutionChangeError.js.map +1 -1
  148. package/lib/chain/errors/dataColumnSidecarError.js +2 -1
  149. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  150. package/lib/chain/errors/executionPayloadBid.d.ts +1 -1
  151. package/lib/chain/errors/executionPayloadBid.js +2 -1
  152. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  153. package/lib/chain/errors/executionPayloadEnvelope.d.ts +2 -2
  154. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  155. package/lib/chain/errors/executionPayloadEnvelope.js +2 -1
  156. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  157. package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
  158. package/lib/chain/errors/gossipValidation.js +4 -2
  159. package/lib/chain/errors/gossipValidation.js.map +1 -1
  160. package/lib/chain/errors/lightClientError.js +4 -2
  161. package/lib/chain/errors/lightClientError.js.map +1 -1
  162. package/lib/chain/errors/payloadAttestation.d.ts +1 -1
  163. package/lib/chain/errors/payloadAttestation.js +2 -1
  164. package/lib/chain/errors/payloadAttestation.js.map +1 -1
  165. package/lib/chain/errors/proposerSlashingError.js +2 -1
  166. package/lib/chain/errors/proposerSlashingError.js.map +1 -1
  167. package/lib/chain/errors/syncCommitteeError.js +2 -1
  168. package/lib/chain/errors/syncCommitteeError.js.map +1 -1
  169. package/lib/chain/errors/voluntaryExitError.js +2 -1
  170. package/lib/chain/errors/voluntaryExitError.js.map +1 -1
  171. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  172. package/lib/chain/forkChoice/index.js +32 -25
  173. package/lib/chain/forkChoice/index.js.map +1 -1
  174. package/lib/chain/initState.d.ts +1 -1
  175. package/lib/chain/initState.d.ts.map +1 -1
  176. package/lib/chain/initState.js.map +1 -1
  177. package/lib/chain/interface.js +2 -1
  178. package/lib/chain/interface.js.map +1 -1
  179. package/lib/chain/lightClient/index.d.ts +0 -29
  180. package/lib/chain/lightClient/index.d.ts.map +1 -1
  181. package/lib/chain/lightClient/index.js.map +1 -1
  182. package/lib/chain/lightClient/proofs.js.map +1 -1
  183. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  184. package/lib/chain/opPools/aggregatedAttestationPool.js +5 -3
  185. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  186. package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
  187. package/lib/chain/opPools/attestationPool.js.map +1 -1
  188. package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
  189. package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
  190. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  191. package/lib/chain/opPools/opPool.js.map +1 -1
  192. package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
  193. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  194. package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
  195. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  196. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  197. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  198. package/lib/chain/opPools/types.js +4 -2
  199. package/lib/chain/opPools/types.js.map +1 -1
  200. package/lib/chain/opPools/utils.js.map +1 -1
  201. package/lib/chain/prepareNextSlot.d.ts +1 -2
  202. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  203. package/lib/chain/prepareNextSlot.js.map +1 -1
  204. package/lib/chain/produceBlock/computeNewStateRoot.d.ts +0 -1
  205. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  206. package/lib/chain/produceBlock/computeNewStateRoot.js +4 -3
  207. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  208. package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -1
  209. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  210. package/lib/chain/produceBlock/produceBlockBody.js +7 -5
  211. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  212. package/lib/chain/produceBlock/validateBlobsAndKzgCommitments.js.map +1 -1
  213. package/lib/chain/regen/errors.d.ts.map +1 -1
  214. package/lib/chain/regen/errors.js +2 -1
  215. package/lib/chain/regen/errors.js.map +1 -1
  216. package/lib/chain/regen/interface.js +4 -2
  217. package/lib/chain/regen/interface.js.map +1 -1
  218. package/lib/chain/regen/queued.d.ts.map +1 -1
  219. package/lib/chain/regen/queued.js +4 -1
  220. package/lib/chain/regen/queued.js.map +1 -1
  221. package/lib/chain/regen/regen.d.ts.map +1 -1
  222. package/lib/chain/regen/regen.js +6 -2
  223. package/lib/chain/regen/regen.js.map +1 -1
  224. package/lib/chain/reprocess.d.ts.map +1 -1
  225. package/lib/chain/reprocess.js +2 -1
  226. package/lib/chain/reprocess.js.map +1 -1
  227. package/lib/chain/seenCache/seenAggregateAndProof.d.ts.map +1 -1
  228. package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
  229. package/lib/chain/seenCache/seenAttestationData.d.ts.map +1 -1
  230. package/lib/chain/seenCache/seenAttestationData.js +2 -1
  231. package/lib/chain/seenCache/seenAttestationData.js.map +1 -1
  232. package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
  233. package/lib/chain/seenCache/seenAttesters.js.map +1 -1
  234. package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
  235. package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
  236. package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
  237. package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
  238. package/lib/chain/seenCache/seenCommittee.d.ts.map +1 -1
  239. package/lib/chain/seenCache/seenCommittee.js.map +1 -1
  240. package/lib/chain/seenCache/seenCommitteeContribution.d.ts.map +1 -1
  241. package/lib/chain/seenCache/seenCommitteeContribution.js.map +1 -1
  242. package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
  243. package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
  244. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +1 -1
  245. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +1 -1
  246. package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -3
  247. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  248. package/lib/chain/seenCache/seenGossipBlockInput.js +21 -8
  249. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  250. package/lib/chain/serializeState.js +1 -0
  251. package/lib/chain/serializeState.js.map +1 -1
  252. package/lib/chain/shufflingCache.d.ts.map +1 -1
  253. package/lib/chain/shufflingCache.js +2 -1
  254. package/lib/chain/shufflingCache.js.map +1 -1
  255. package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
  256. package/lib/chain/stateCache/datastore/db.js.map +1 -1
  257. package/lib/chain/stateCache/datastore/file.d.ts.map +1 -1
  258. package/lib/chain/stateCache/datastore/file.js.map +1 -1
  259. package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
  260. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  261. package/lib/chain/stateCache/mapMetrics.d.ts.map +1 -1
  262. package/lib/chain/stateCache/mapMetrics.js.map +1 -1
  263. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +1 -41
  264. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  265. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  266. package/lib/chain/stateCache/types.js +2 -1
  267. package/lib/chain/stateCache/types.js.map +1 -1
  268. package/lib/chain/validation/aggregateAndProof.js +1 -1
  269. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  270. package/lib/chain/validation/attestation.js +3 -3
  271. package/lib/chain/validation/attestation.js.map +1 -1
  272. package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
  273. package/lib/chain/validation/attesterSlashing.js +8 -1
  274. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  275. package/lib/chain/validation/blobSidecar.js +2 -2
  276. package/lib/chain/validation/blobSidecar.js.map +1 -1
  277. package/lib/chain/validation/block.d.ts.map +1 -1
  278. package/lib/chain/validation/block.js +6 -3
  279. package/lib/chain/validation/block.js.map +1 -1
  280. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  281. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  282. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  283. package/lib/chain/validation/executionPayloadBid.js +1 -2
  284. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  285. package/lib/chain/validation/executionPayloadEnvelope.js +4 -4
  286. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  287. package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
  288. package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
  289. package/lib/chain/validation/payloadAttestationMessage.js +1 -2
  290. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  291. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  292. package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
  293. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  294. package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
  295. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  296. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  297. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  298. package/lib/chain/validation/syncCommittee.js.map +1 -1
  299. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  300. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  301. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  302. package/lib/chain/validatorMonitor.js +2 -1
  303. package/lib/chain/validatorMonitor.js.map +1 -1
  304. package/lib/constants/network.js +4 -2
  305. package/lib/constants/network.js.map +1 -1
  306. package/lib/db/beacon.d.ts.map +1 -1
  307. package/lib/db/beacon.js.map +1 -1
  308. package/lib/db/buckets.d.ts +23 -23
  309. package/lib/db/buckets.d.ts.map +1 -1
  310. package/lib/db/buckets.js +2 -1
  311. package/lib/db/buckets.js.map +1 -1
  312. package/lib/db/index.d.ts +1 -0
  313. package/lib/db/index.d.ts.map +1 -1
  314. package/lib/db/index.js +1 -0
  315. package/lib/db/index.js.map +1 -1
  316. package/lib/db/repositories/attesterSlashing.d.ts.map +1 -1
  317. package/lib/db/repositories/attesterSlashing.js.map +1 -1
  318. package/lib/db/repositories/backfilledRanges.d.ts.map +1 -1
  319. package/lib/db/repositories/backfilledRanges.js.map +1 -1
  320. package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
  321. package/lib/db/repositories/blobSidecars.js.map +1 -1
  322. package/lib/db/repositories/blobSidecarsArchive.d.ts.map +1 -1
  323. package/lib/db/repositories/blobSidecarsArchive.js.map +1 -1
  324. package/lib/db/repositories/block.d.ts.map +1 -1
  325. package/lib/db/repositories/block.js.map +1 -1
  326. package/lib/db/repositories/blockArchive.d.ts.map +1 -1
  327. package/lib/db/repositories/blockArchive.js.map +1 -1
  328. package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
  329. package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
  330. package/lib/db/repositories/blsToExecutionChange.d.ts.map +1 -1
  331. package/lib/db/repositories/blsToExecutionChange.js.map +1 -1
  332. package/lib/db/repositories/checkpointState.d.ts.map +1 -1
  333. package/lib/db/repositories/checkpointState.js.map +1 -1
  334. package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
  335. package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
  336. package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
  337. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  338. package/lib/db/repositories/executionPayloadEnvelope.d.ts.map +1 -1
  339. package/lib/db/repositories/executionPayloadEnvelope.js.map +1 -1
  340. package/lib/db/repositories/executionPayloadEnvelopeArchive.d.ts.map +1 -1
  341. package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
  342. package/lib/db/repositories/lightclientBestUpdate.d.ts.map +1 -1
  343. package/lib/db/repositories/lightclientBestUpdate.js.map +1 -1
  344. package/lib/db/repositories/lightclientCheckpointHeader.d.ts.map +1 -1
  345. package/lib/db/repositories/lightclientCheckpointHeader.js.map +1 -1
  346. package/lib/db/repositories/lightclientSyncCommittee.d.ts.map +1 -1
  347. package/lib/db/repositories/lightclientSyncCommittee.js.map +1 -1
  348. package/lib/db/repositories/lightclientSyncCommitteeWitness.d.ts.map +1 -1
  349. package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
  350. package/lib/db/repositories/proposerSlashing.d.ts.map +1 -1
  351. package/lib/db/repositories/proposerSlashing.js.map +1 -1
  352. package/lib/db/repositories/stateArchive.d.ts.map +1 -1
  353. package/lib/db/repositories/stateArchive.js.map +1 -1
  354. package/lib/db/repositories/stateArchiveIndex.js.map +1 -1
  355. package/lib/db/repositories/voluntaryExit.d.ts.map +1 -1
  356. package/lib/db/repositories/voluntaryExit.js.map +1 -1
  357. package/lib/execution/builder/cache.d.ts.map +1 -1
  358. package/lib/execution/builder/cache.js.map +1 -1
  359. package/lib/execution/builder/http.d.ts.map +1 -1
  360. package/lib/execution/builder/http.js +2 -1
  361. package/lib/execution/builder/http.js.map +1 -1
  362. package/lib/execution/builder/index.js.map +1 -1
  363. package/lib/execution/builder/utils.js.map +1 -1
  364. package/lib/execution/engine/disabled.d.ts.map +1 -1
  365. package/lib/execution/engine/disabled.js.map +1 -1
  366. package/lib/execution/engine/http.d.ts.map +1 -1
  367. package/lib/execution/engine/http.js.map +1 -1
  368. package/lib/execution/engine/index.js.map +1 -1
  369. package/lib/execution/engine/interface.js +4 -2
  370. package/lib/execution/engine/interface.js.map +1 -1
  371. package/lib/execution/engine/jsonRpcHttpClient.d.ts +10 -15
  372. package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
  373. package/lib/execution/engine/jsonRpcHttpClient.js +2 -1
  374. package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
  375. package/lib/execution/engine/jwt.js.map +1 -1
  376. package/lib/execution/engine/mock.d.ts.map +1 -1
  377. package/lib/execution/engine/mock.js.map +1 -1
  378. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  379. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  380. package/lib/execution/engine/types.js.map +1 -1
  381. package/lib/execution/engine/utils.d.ts +1 -1
  382. package/lib/execution/engine/utils.d.ts.map +1 -1
  383. package/lib/execution/engine/utils.js.map +1 -1
  384. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  385. package/lib/metrics/metrics/beacon.js.map +1 -1
  386. package/lib/metrics/metrics/lodestar.d.ts +2 -1
  387. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  388. package/lib/metrics/metrics/lodestar.js +4 -0
  389. package/lib/metrics/metrics/lodestar.js.map +1 -1
  390. package/lib/metrics/metrics.js.map +1 -1
  391. package/lib/metrics/nodeJsMetrics.js.map +1 -1
  392. package/lib/metrics/server/http.d.ts +1 -1
  393. package/lib/metrics/server/http.d.ts.map +1 -1
  394. package/lib/metrics/server/http.js.map +1 -1
  395. package/lib/metrics/utils/avgMinMax.d.ts.map +1 -1
  396. package/lib/metrics/utils/avgMinMax.js.map +1 -1
  397. package/lib/metrics/utils/gauge.d.ts.map +1 -1
  398. package/lib/metrics/utils/gauge.js.map +1 -1
  399. package/lib/metrics/utils/registryMetricCreator.d.ts.map +1 -1
  400. package/lib/metrics/utils/registryMetricCreator.js.map +1 -1
  401. package/lib/monitoring/clientStats.js.map +1 -1
  402. package/lib/monitoring/properties.d.ts.map +1 -1
  403. package/lib/monitoring/properties.js.map +1 -1
  404. package/lib/monitoring/service.d.ts.map +1 -1
  405. package/lib/monitoring/service.js.map +1 -1
  406. package/lib/monitoring/system.d.ts.map +1 -1
  407. package/lib/monitoring/system.js.map +1 -1
  408. package/lib/monitoring/types.js +4 -2
  409. package/lib/monitoring/types.js.map +1 -1
  410. package/lib/network/core/events.d.ts +1 -3
  411. package/lib/network/core/events.d.ts.map +1 -1
  412. package/lib/network/core/events.js +4 -2
  413. package/lib/network/core/events.js.map +1 -1
  414. package/lib/network/core/metrics.d.ts +6 -7
  415. package/lib/network/core/metrics.d.ts.map +1 -1
  416. package/lib/network/core/metrics.js.map +1 -1
  417. package/lib/network/core/networkCore.d.ts +1 -1
  418. package/lib/network/core/networkCore.d.ts.map +1 -1
  419. package/lib/network/core/networkCore.js.map +1 -1
  420. package/lib/network/core/networkCoreWorker.js.map +1 -1
  421. package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
  422. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  423. package/lib/network/discv5/index.d.ts +1 -3
  424. package/lib/network/discv5/index.d.ts.map +1 -1
  425. package/lib/network/discv5/index.js.map +1 -1
  426. package/lib/network/discv5/utils.js +2 -1
  427. package/lib/network/discv5/utils.js.map +1 -1
  428. package/lib/network/discv5/worker.js.map +1 -1
  429. package/lib/network/events.d.ts +1 -3
  430. package/lib/network/events.d.ts.map +1 -1
  431. package/lib/network/events.js +4 -2
  432. package/lib/network/events.js.map +1 -1
  433. package/lib/network/forks.js.map +1 -1
  434. package/lib/network/gossip/encoding.d.ts.map +1 -1
  435. package/lib/network/gossip/encoding.js.map +1 -1
  436. package/lib/network/gossip/errors.d.ts.map +1 -1
  437. package/lib/network/gossip/errors.js.map +1 -1
  438. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  439. package/lib/network/gossip/gossipsub.js.map +1 -1
  440. package/lib/network/gossip/interface.js +4 -2
  441. package/lib/network/gossip/interface.js.map +1 -1
  442. package/lib/network/gossip/metrics.d.ts +12 -14
  443. package/lib/network/gossip/metrics.d.ts.map +1 -1
  444. package/lib/network/gossip/metrics.js.map +1 -1
  445. package/lib/network/gossip/scoringParameters.d.ts +1 -1
  446. package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
  447. package/lib/network/gossip/scoringParameters.js.map +1 -1
  448. package/lib/network/gossip/topic.d.ts +2867 -2920
  449. package/lib/network/gossip/topic.d.ts.map +1 -1
  450. package/lib/network/gossip/topic.js.map +1 -1
  451. package/lib/network/libp2p/error.js +2 -1
  452. package/lib/network/libp2p/error.js.map +1 -1
  453. package/lib/network/libp2p/index.js.map +1 -1
  454. package/lib/network/metadata.d.ts.map +1 -1
  455. package/lib/network/metadata.js +4 -2
  456. package/lib/network/metadata.js.map +1 -1
  457. package/lib/network/network.d.ts +1 -1
  458. package/lib/network/network.d.ts.map +1 -1
  459. package/lib/network/network.js +1 -1
  460. package/lib/network/network.js.map +1 -1
  461. package/lib/network/peers/client.js +2 -1
  462. package/lib/network/peers/client.js.map +1 -1
  463. package/lib/network/peers/datastore.d.ts +0 -3
  464. package/lib/network/peers/datastore.d.ts.map +1 -1
  465. package/lib/network/peers/datastore.js.map +1 -1
  466. package/lib/network/peers/discover.d.ts +0 -7
  467. package/lib/network/peers/discover.d.ts.map +1 -1
  468. package/lib/network/peers/discover.js +4 -2
  469. package/lib/network/peers/discover.js.map +1 -1
  470. package/lib/network/peers/peerManager.d.ts +0 -1
  471. package/lib/network/peers/peerManager.d.ts.map +1 -1
  472. package/lib/network/peers/peerManager.js.map +1 -1
  473. package/lib/network/peers/peersData.d.ts.map +1 -1
  474. package/lib/network/peers/peersData.js +2 -1
  475. package/lib/network/peers/peersData.js.map +1 -1
  476. package/lib/network/peers/score/interface.js +4 -2
  477. package/lib/network/peers/score/interface.js.map +1 -1
  478. package/lib/network/peers/score/score.d.ts.map +1 -1
  479. package/lib/network/peers/score/score.js.map +1 -1
  480. package/lib/network/peers/score/store.d.ts.map +1 -1
  481. package/lib/network/peers/score/store.js.map +1 -1
  482. package/lib/network/peers/score/utils.js.map +1 -1
  483. package/lib/network/peers/utils/assertPeerRelevance.js +2 -1
  484. package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
  485. package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
  486. package/lib/network/peers/utils/getConnectedPeerIds.js.map +1 -1
  487. package/lib/network/peers/utils/prioritizePeers.js +2 -1
  488. package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
  489. package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
  490. package/lib/network/peers/utils/subnetMap.js.map +1 -1
  491. package/lib/network/processor/aggregatorTracker.d.ts.map +1 -1
  492. package/lib/network/processor/aggregatorTracker.js.map +1 -1
  493. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  494. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  495. package/lib/network/processor/gossipHandlers.js +1 -0
  496. package/lib/network/processor/gossipHandlers.js.map +1 -1
  497. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  498. package/lib/network/processor/gossipQueues/indexed.d.ts.map +1 -1
  499. package/lib/network/processor/gossipQueues/indexed.js.map +1 -1
  500. package/lib/network/processor/gossipQueues/linear.d.ts.map +1 -1
  501. package/lib/network/processor/gossipQueues/linear.js.map +1 -1
  502. package/lib/network/processor/gossipQueues/types.js +4 -2
  503. package/lib/network/processor/gossipQueues/types.js.map +1 -1
  504. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  505. package/lib/network/processor/index.d.ts.map +1 -1
  506. package/lib/network/processor/index.js +4 -2
  507. package/lib/network/processor/index.js.map +1 -1
  508. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  509. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  510. package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
  511. package/lib/network/reqresp/handlers/beaconBlocksByRange.js +3 -2
  512. package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
  513. package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
  514. package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
  515. package/lib/network/reqresp/handlers/blobSidecarsByRange.js +3 -2
  516. package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
  517. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +1 -1
  518. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
  519. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  520. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -2
  521. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  522. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -1
  523. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  524. package/lib/network/reqresp/handlers/index.js.map +1 -1
  525. package/lib/network/reqresp/handlers/lightClientBootstrap.js.map +1 -1
  526. package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js.map +1 -1
  527. package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js.map +1 -1
  528. package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
  529. package/lib/network/reqresp/interface.js +2 -1
  530. package/lib/network/reqresp/interface.js.map +1 -1
  531. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  532. package/lib/network/reqresp/protocols.js.map +1 -1
  533. package/lib/network/reqresp/rateLimit.js.map +1 -1
  534. package/lib/network/reqresp/score.js.map +1 -1
  535. package/lib/network/reqresp/types.js +4 -2
  536. package/lib/network/reqresp/types.js.map +1 -1
  537. package/lib/network/reqresp/utils/collect.d.ts +1 -1
  538. package/lib/network/reqresp/utils/collect.js.map +1 -1
  539. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
  540. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -1
  541. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
  542. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +1 -1
  543. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
  544. package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
  545. package/lib/network/statusCache.d.ts.map +1 -1
  546. package/lib/network/statusCache.js.map +1 -1
  547. package/lib/network/subnets/attnetsService.d.ts.map +1 -1
  548. package/lib/network/subnets/attnetsService.js +2 -1
  549. package/lib/network/subnets/attnetsService.js.map +1 -1
  550. package/lib/network/subnets/interface.js.map +1 -1
  551. package/lib/network/subnets/syncnetsService.d.ts.map +1 -1
  552. package/lib/network/subnets/syncnetsService.js.map +1 -1
  553. package/lib/network/subnets/util.js.map +1 -1
  554. package/lib/network/util.js.map +1 -1
  555. package/lib/node/nodejs.d.ts +2 -2
  556. package/lib/node/nodejs.d.ts.map +1 -1
  557. package/lib/node/nodejs.js +2 -1
  558. package/lib/node/nodejs.js.map +1 -1
  559. package/lib/node/notifier.js.map +1 -1
  560. package/lib/node/utils/interop/deposits.js.map +1 -1
  561. package/lib/node/utils/interop/state.d.ts +1 -1
  562. package/lib/node/utils/interop/state.d.ts.map +1 -1
  563. package/lib/node/utils/interop/state.js.map +1 -1
  564. package/lib/node/utils/lightclient.js.map +1 -1
  565. package/lib/node/utils/state.js.map +1 -1
  566. package/lib/sync/backfill/backfill.d.ts +1 -10
  567. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  568. package/lib/sync/backfill/backfill.js +6 -3
  569. package/lib/sync/backfill/backfill.js.map +1 -1
  570. package/lib/sync/backfill/errors.js +2 -1
  571. package/lib/sync/backfill/errors.js.map +1 -1
  572. package/lib/sync/backfill/verify.js.map +1 -1
  573. package/lib/sync/interface.js +2 -1
  574. package/lib/sync/interface.js.map +1 -1
  575. package/lib/sync/range/batch.d.ts.map +1 -1
  576. package/lib/sync/range/batch.js +4 -2
  577. package/lib/sync/range/batch.js.map +1 -1
  578. package/lib/sync/range/chain.d.ts +0 -10
  579. package/lib/sync/range/chain.d.ts.map +1 -1
  580. package/lib/sync/range/chain.js +2 -1
  581. package/lib/sync/range/chain.js.map +1 -1
  582. package/lib/sync/range/range.d.ts +1 -3
  583. package/lib/sync/range/range.d.ts.map +1 -1
  584. package/lib/sync/range/range.js +4 -2
  585. package/lib/sync/range/range.js.map +1 -1
  586. package/lib/sync/range/utils/batches.js.map +1 -1
  587. package/lib/sync/range/utils/chainTarget.js.map +1 -1
  588. package/lib/sync/range/utils/hashBlocks.js.map +1 -1
  589. package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -1
  590. package/lib/sync/range/utils/peerBalancer.js.map +1 -1
  591. package/lib/sync/range/utils/updateChains.js.map +1 -1
  592. package/lib/sync/sync.d.ts.map +1 -1
  593. package/lib/sync/sync.js.map +1 -1
  594. package/lib/sync/types.js +4 -2
  595. package/lib/sync/types.js.map +1 -1
  596. package/lib/sync/unknownBlock.d.ts +0 -14
  597. package/lib/sync/unknownBlock.d.ts.map +1 -1
  598. package/lib/sync/unknownBlock.js.map +1 -1
  599. package/lib/sync/utils/downloadByRange.d.ts +4 -4
  600. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  601. package/lib/sync/utils/downloadByRange.js +2 -1
  602. package/lib/sync/utils/downloadByRange.js.map +1 -1
  603. package/lib/sync/utils/downloadByRoot.d.ts +8 -8
  604. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  605. package/lib/sync/utils/downloadByRoot.js +2 -1
  606. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  607. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  608. package/lib/sync/utils/remoteSyncType.d.ts +1 -1
  609. package/lib/sync/utils/remoteSyncType.d.ts.map +1 -1
  610. package/lib/sync/utils/remoteSyncType.js +4 -2
  611. package/lib/sync/utils/remoteSyncType.js.map +1 -1
  612. package/lib/util/address.js.map +1 -1
  613. package/lib/util/array.d.ts.map +1 -1
  614. package/lib/util/array.js.map +1 -1
  615. package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
  616. package/lib/util/asyncIterableToEvents.js +2 -1
  617. package/lib/util/asyncIterableToEvents.js.map +1 -1
  618. package/lib/util/binarySearch.d.ts.map +1 -1
  619. package/lib/util/binarySearch.js.map +1 -1
  620. package/lib/util/bitArray.js +2 -1
  621. package/lib/util/bitArray.js.map +1 -1
  622. package/lib/util/blobs.js.map +1 -1
  623. package/lib/util/bufferPool.d.ts.map +1 -1
  624. package/lib/util/bufferPool.js +2 -1
  625. package/lib/util/bufferPool.js.map +1 -1
  626. package/lib/util/chunkify.js.map +1 -1
  627. package/lib/util/clock.d.ts.map +1 -1
  628. package/lib/util/clock.js +2 -1
  629. package/lib/util/clock.js.map +1 -1
  630. package/lib/util/dataColumns.d.ts.map +1 -1
  631. package/lib/util/dataColumns.js +4 -2
  632. package/lib/util/dataColumns.js.map +1 -1
  633. package/lib/util/dependentRoot.js.map +1 -1
  634. package/lib/util/enum.js.map +1 -1
  635. package/lib/util/error.js.map +1 -1
  636. package/lib/util/eventLoop.js.map +1 -1
  637. package/lib/util/execution.js +2 -1
  638. package/lib/util/execution.js.map +1 -1
  639. package/lib/util/file.js.map +1 -1
  640. package/lib/util/forkChoice.js.map +1 -1
  641. package/lib/util/forkName.js.map +1 -1
  642. package/lib/util/graffiti.js.map +1 -1
  643. package/lib/util/hex.js.map +1 -1
  644. package/lib/util/ip.js.map +1 -1
  645. package/lib/util/itTrigger.d.ts.map +1 -1
  646. package/lib/util/itTrigger.js.map +1 -1
  647. package/lib/util/map.d.ts.map +1 -1
  648. package/lib/util/map.js.map +1 -1
  649. package/lib/util/metadata.js.map +1 -1
  650. package/lib/util/multifork.js.map +1 -1
  651. package/lib/util/numpy.js.map +1 -1
  652. package/lib/util/peerId.js.map +1 -1
  653. package/lib/util/profile.js +2 -1
  654. package/lib/util/profile.js.map +1 -1
  655. package/lib/util/promises.js.map +1 -1
  656. package/lib/util/queue/errors.js +2 -1
  657. package/lib/util/queue/errors.js.map +1 -1
  658. package/lib/util/queue/fnQueue.d.ts.map +1 -1
  659. package/lib/util/queue/fnQueue.js.map +1 -1
  660. package/lib/util/queue/itemQueue.d.ts.map +1 -1
  661. package/lib/util/queue/itemQueue.js.map +1 -1
  662. package/lib/util/queue/options.js +2 -1
  663. package/lib/util/queue/options.js.map +1 -1
  664. package/lib/util/serializedCache.d.ts +4 -4
  665. package/lib/util/serializedCache.d.ts.map +1 -1
  666. package/lib/util/serializedCache.js +6 -4
  667. package/lib/util/serializedCache.js.map +1 -1
  668. package/lib/util/set.d.ts.map +1 -1
  669. package/lib/util/set.js.map +1 -1
  670. package/lib/util/shuffle.js.map +1 -1
  671. package/lib/util/sortBy.js.map +1 -1
  672. package/lib/util/sszBytes.js.map +1 -1
  673. package/lib/util/time.js.map +1 -1
  674. package/lib/util/timeSeries.d.ts.map +1 -1
  675. package/lib/util/timeSeries.js.map +1 -1
  676. package/lib/util/types.d.ts.map +1 -1
  677. package/lib/util/workerEvents.d.ts +1 -1
  678. package/lib/util/workerEvents.d.ts.map +1 -1
  679. package/lib/util/workerEvents.js.map +1 -1
  680. package/lib/util/wrapError.js.map +1 -1
  681. package/package.json +28 -28
  682. package/src/api/impl/beacon/blocks/index.ts +3 -2
  683. package/src/api/impl/validator/index.ts +26 -12
  684. package/src/chain/archiveStore/archiveStore.ts +5 -5
  685. package/src/chain/archiveStore/utils/archiveBlocks.ts +4 -5
  686. package/src/chain/archiveStore/utils/updateBackfillRange.ts +1 -1
  687. package/src/chain/blocks/blockInput/blockInput.ts +35 -0
  688. package/src/chain/blocks/blockInput/types.ts +17 -0
  689. package/src/chain/blocks/importBlock.ts +35 -4
  690. package/src/chain/blocks/verifyBlocksSanityChecks.ts +7 -2
  691. package/src/chain/blocks/writeBlockInputToDb.ts +105 -104
  692. package/src/chain/chain.ts +31 -19
  693. package/src/chain/emitter.ts +3 -3
  694. package/src/chain/errors/executionPayloadBid.ts +1 -1
  695. package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
  696. package/src/chain/errors/payloadAttestation.ts +1 -1
  697. package/src/chain/forkChoice/index.ts +39 -21
  698. package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
  699. package/src/chain/produceBlock/computeNewStateRoot.ts +4 -3
  700. package/src/chain/produceBlock/produceBlockBody.ts +1 -2
  701. package/src/chain/regen/queued.ts +7 -2
  702. package/src/chain/regen/regen.ts +9 -3
  703. package/src/chain/seenCache/seenGossipBlockInput.ts +38 -10
  704. package/src/chain/validation/aggregateAndProof.ts +1 -1
  705. package/src/chain/validation/attestation.ts +3 -3
  706. package/src/chain/validation/attesterSlashing.ts +9 -0
  707. package/src/chain/validation/blobSidecar.ts +2 -2
  708. package/src/chain/validation/block.ts +9 -4
  709. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  710. package/src/chain/validation/executionPayloadBid.ts +1 -2
  711. package/src/chain/validation/executionPayloadEnvelope.ts +4 -4
  712. package/src/chain/validation/payloadAttestationMessage.ts +1 -2
  713. package/src/db/index.ts +1 -0
  714. package/src/metrics/metrics/lodestar.ts +4 -0
  715. package/src/network/network.ts +2 -1
  716. package/src/network/processor/gossipHandlers.ts +6 -1
  717. package/src/network/processor/gossipValidatorFn.ts +1 -1
  718. package/src/network/reqresp/ReqRespBeaconNode.ts +1 -1
  719. package/src/network/reqresp/handlers/beaconBlocksByRange.ts +4 -3
  720. package/src/network/reqresp/handlers/blobSidecarsByRange.ts +3 -2
  721. package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +1 -1
  722. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -3
  723. package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +2 -2
  724. package/src/network/reqresp/utils/collect.ts +1 -1
  725. package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +1 -1
  726. package/src/sync/utils/downloadByRoot.ts +1 -1
  727. package/src/sync/utils/remoteSyncType.ts +1 -1
  728. package/src/util/serializedCache.ts +7 -5
@@ -1,5 +1,6 @@
1
1
  import {routes} from "@lodestar/api";
2
2
  import {ApiError, ApplicationMethods} from "@lodestar/api/server";
3
+ import {PayloadStatus} from "@lodestar/fork-choice";
3
4
  import {
4
5
  BUILDER_INDEX_SELF_BUILD,
5
6
  ForkPostBellatrix,
@@ -205,7 +206,7 @@ export function getBeaconBlockApi({
205
206
  case routes.beacon.BroadcastValidation.consensus: {
206
207
  // check if this beacon node produced the block else run validations
207
208
  if (!blockLocallyProduced) {
208
- const parentBlock = chain.forkChoice.getBlock(signedBlock.message.parentRoot);
209
+ const parentBlock = chain.forkChoice.getBlockDefaultStatus(signedBlock.message.parentRoot);
209
210
  if (parentBlock === null) {
210
211
  chain.emitter.emit(ChainEvent.unknownParent, {
211
212
  blockInput: blockForImport,
@@ -650,7 +651,7 @@ export function getBeaconBlockApi({
650
651
  }
651
652
 
652
653
  // TODO GLOAS: review checks, do we want to implement `broadcast_validation`?
653
- const block = chain.forkChoice.getBlockHex(blockRootHex);
654
+ const block = chain.forkChoice.getBlockHex(blockRootHex, PayloadStatus.EMPTY);
654
655
  if (block === null) {
655
656
  throw new ApiError(404, `Block not found for beacon block root ${blockRootHex}`);
656
657
  }
@@ -1,6 +1,6 @@
1
1
  import {routes} from "@lodestar/api";
2
2
  import {ApplicationMethods} from "@lodestar/api/server";
3
- import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
3
+ import {ExecutionStatus, PayloadStatus, ProtoBlock} from "@lodestar/fork-choice";
4
4
  import {
5
5
  BUILDER_INDEX_SELF_BUILD,
6
6
  ForkName,
@@ -389,7 +389,7 @@ export function getValidatorApi(
389
389
  */
390
390
 
391
391
  function notOnOptimisticBlockRoot(beaconBlockRoot: Root): void {
392
- const protoBeaconBlock = chain.forkChoice.getBlock(beaconBlockRoot);
392
+ const protoBeaconBlock = chain.forkChoice.getBlockDefaultStatus(beaconBlockRoot);
393
393
  if (!protoBeaconBlock) {
394
394
  throw new ApiError(404, `Block not in forkChoice, beaconBlockRoot=${toRootHex(beaconBlockRoot)}`);
395
395
  }
@@ -401,7 +401,7 @@ export function getValidatorApi(
401
401
  }
402
402
 
403
403
  function notOnOutOfRangeData(beaconBlockRoot: Root): void {
404
- const protoBeaconBlock = chain.forkChoice.getBlock(beaconBlockRoot);
404
+ const protoBeaconBlock = chain.forkChoice.getBlockDefaultStatus(beaconBlockRoot);
405
405
  if (!protoBeaconBlock) {
406
406
  throw new ApiError(404, `Block not in forkChoice, beaconBlockRoot=${toRootHex(beaconBlockRoot)}`);
407
407
  }
@@ -989,8 +989,30 @@ export function getValidatorApi(
989
989
  const headBlockRoot = fromHex(headBlockRootHex);
990
990
  const fork = config.getForkName(slot);
991
991
 
992
+ const beaconBlockRoot =
993
+ slot >= headSlot
994
+ ? // When attesting to the head slot or later, always use the head of the chain.
995
+ headBlockRoot
996
+ : // Permit attesting to slots *prior* to the current head. This is desirable when
997
+ // the VC and BN are out-of-sync due to time issues or overloading.
998
+ getBlockRootAtSlot(headState, slot);
999
+
992
1000
  let index: CommitteeIndex;
993
- if (isForkPostElectra(fork)) {
1001
+ if (isForkPostGloas(fork)) {
1002
+ const canonicalBlock = chain.forkChoice.getCanonicalBlockByRoot(beaconBlockRoot);
1003
+ if (!canonicalBlock) {
1004
+ // This should never happen
1005
+ throw Error(`Block not found in fork choice for slot=${slot}, root=${toRootHex(beaconBlockRoot)}`);
1006
+ }
1007
+ // After Gloas, attestation.data.index signals payload status in fork-choice:
1008
+ // - 0 = EMPTY / not present, 1 = FULL / present
1009
+ // - same-slot attestations must always use index = 0
1010
+ if (canonicalBlock.slot !== slot) {
1011
+ index = canonicalBlock.payloadStatus === PayloadStatus.FULL ? 1 : 0;
1012
+ } else {
1013
+ index = 0;
1014
+ }
1015
+ } else if (isForkPostElectra(fork)) {
994
1016
  index = 0;
995
1017
  } else {
996
1018
  if (committeeIndex === undefined) {
@@ -999,14 +1021,6 @@ export function getValidatorApi(
999
1021
  index = committeeIndex;
1000
1022
  }
1001
1023
 
1002
- const beaconBlockRoot =
1003
- slot >= headSlot
1004
- ? // When attesting to the head slot or later, always use the head of the chain.
1005
- headBlockRoot
1006
- : // Permit attesting to slots *prior* to the current head. This is desirable when
1007
- // the VC and BN are out-of-sync due to time issues or overloading.
1008
- getBlockRootAtSlot(headState, slot);
1009
-
1010
1024
  const targetSlot = computeStartSlotAtEpoch(attEpoch);
1011
1025
  const targetRoot =
1012
1026
  targetSlot >= headSlot
@@ -1,4 +1,4 @@
1
- import {CheckpointWithHex} from "@lodestar/fork-choice";
1
+ import {CheckpointWithPayloadStatus} from "@lodestar/fork-choice";
2
2
  import {LoggerNode} from "@lodestar/logger/node";
3
3
  import {ForkSeq} from "@lodestar/params";
4
4
  import {Checkpoint} from "@lodestar/types/phase0";
@@ -44,7 +44,7 @@ export enum ArchiveStoreTask {
44
44
  */
45
45
  export class ArchiveStore {
46
46
  private archiveMode: ArchiveMode;
47
- private jobQueue: JobItemQueue<[CheckpointWithHex], void>;
47
+ private jobQueue: JobItemQueue<[CheckpointWithPayloadStatus], void>;
48
48
 
49
49
  private archiveDataEpochs?: number;
50
50
  private readonly statesArchiverStrategy: StateArchiveStrategy;
@@ -67,7 +67,7 @@ export class ArchiveStore {
67
67
  this.archiveMode = opts.archiveMode;
68
68
  this.archiveDataEpochs = opts.archiveDataEpochs;
69
69
 
70
- this.jobQueue = new JobItemQueue<[CheckpointWithHex], void>(this.processFinalizedCheckpoint, {
70
+ this.jobQueue = new JobItemQueue<[CheckpointWithPayloadStatus], void>(this.processFinalizedCheckpoint, {
71
71
  maxLength: PROCESS_FINALIZED_CHECKPOINT_QUEUE_LENGTH,
72
72
  signal,
73
73
  });
@@ -168,7 +168,7 @@ export class ArchiveStore {
168
168
  //-------------------------------------------------------------------------
169
169
  // Event handlers
170
170
  //-------------------------------------------------------------------------
171
- private onFinalizedCheckpoint = (finalized: CheckpointWithHex): void => {
171
+ private onFinalizedCheckpoint = (finalized: CheckpointWithPayloadStatus): void => {
172
172
  this.jobQueue.push(finalized).catch((e) => {
173
173
  if (!isQueueErrorAborted(e)) {
174
174
  this.logger.error("Error queuing finalized checkpoint", {epoch: finalized.epoch}, e as Error);
@@ -189,7 +189,7 @@ export class ArchiveStore {
189
189
  });
190
190
  };
191
191
 
192
- private processFinalizedCheckpoint = async (finalized: CheckpointWithHex): Promise<void> => {
192
+ private processFinalizedCheckpoint = async (finalized: CheckpointWithPayloadStatus): Promise<void> => {
193
193
  try {
194
194
  const finalizedEpoch = finalized.epoch;
195
195
  const finalizedFork = this.chain.config.getForkSeqAtEpoch(finalizedEpoch);
@@ -1,10 +1,10 @@
1
1
  import path from "node:path";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
3
  import {KeyValue} from "@lodestar/db";
4
- import {IForkChoice} from "@lodestar/fork-choice";
4
+ import {CheckpointWithPayloadStatus, IForkChoice} from "@lodestar/fork-choice";
5
5
  import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
6
6
  import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
7
- import {Epoch, RootHex, Slot} from "@lodestar/types";
7
+ import {Epoch, Slot} from "@lodestar/types";
8
8
  import {Logger, fromAsync, fromHex, prettyPrintIndices, toRootHex} from "@lodestar/utils";
9
9
  import {IBeaconDb} from "../../../db/index.js";
10
10
  import {BlockArchiveBatchPutBinaryItem} from "../../../db/repositories/index.js";
@@ -19,7 +19,6 @@ const BLOCK_BATCH_SIZE = 256;
19
19
  const BLOB_SIDECAR_BATCH_SIZE = 32;
20
20
 
21
21
  type BlockRootSlot = {slot: Slot; root: Uint8Array};
22
- type CheckpointHex = {epoch: Epoch; rootHex: RootHex};
23
22
 
24
23
  /**
25
24
  * Persist orphaned block to disk
@@ -53,7 +52,7 @@ export async function archiveBlocks(
53
52
  forkChoice: IForkChoice,
54
53
  lightclientServer: LightClientServer | undefined,
55
54
  logger: Logger,
56
- finalizedCheckpoint: CheckpointHex,
55
+ finalizedCheckpoint: CheckpointWithPayloadStatus,
57
56
  currentEpoch: Epoch,
58
57
  archiveDataEpochs?: number,
59
58
  persistOrphanedBlocks?: boolean,
@@ -62,7 +61,7 @@ export async function archiveBlocks(
62
61
  // Use fork choice to determine the blocks to archive and delete
63
62
  // getAllAncestorBlocks response includes the finalized block, so it's also moved to the cold db
64
63
  const {ancestors: finalizedCanonicalBlocks, nonAncestors: finalizedNonCanonicalBlocks} =
65
- forkChoice.getAllAncestorAndNonAncestorBlocks(finalizedCheckpoint.rootHex);
64
+ forkChoice.getAllAncestorAndNonAncestorBlocks(finalizedCheckpoint.rootHex, finalizedCheckpoint.payloadStatus);
66
65
 
67
66
  // NOTE: The finalized block will be exactly the first block of `epoch` or previous
68
67
  const finalizedPostDeneb = finalizedCheckpoint.epoch >= config.DENEB_FORK_EPOCH;
@@ -20,7 +20,7 @@ export async function updateBackfillRange(
20
20
  try {
21
21
  // Mark the sequence in backfill db from finalized block's slot till anchor slot as
22
22
  // filled.
23
- const finalizedBlockFC = chain.forkChoice.getBlockHex(finalized.rootHex);
23
+ const finalizedBlockFC = chain.forkChoice.getBlockHexDefaultStatus(finalized.rootHex);
24
24
  if (finalizedBlockFC && finalizedBlockFC.slot > chain.anchorStateLatestBlockSlot) {
25
25
  await db.backfilledRanges.put(finalizedBlockFC.slot, chain.anchorStateLatestBlockSlot);
26
26
 
@@ -105,6 +105,7 @@ abstract class AbstractBlockInput<F extends ForkName = ForkName, TData extends D
105
105
  }
106
106
 
107
107
  abstract addBlock(props: AddBlock<F>): void;
108
+ abstract getSerializedCacheKeys(): object[];
108
109
 
109
110
  hasBlock(): boolean {
110
111
  return this.state.hasBlock;
@@ -243,6 +244,10 @@ export class BlockInputPreData extends AbstractBlockInput<ForkPreDeneb, null> {
243
244
  );
244
245
  }
245
246
  }
247
+
248
+ getSerializedCacheKeys(): object[] {
249
+ return [this.state.block];
250
+ }
246
251
  }
247
252
 
248
253
  // Blobs DA
@@ -526,6 +531,20 @@ export class BlockInputBlobs extends AbstractBlockInput<ForkBlobsDA, deneb.BlobS
526
531
  getBlobs(): deneb.BlobSidecars {
527
532
  return this.getAllBlobsWithSource().map(({blobSidecar}) => blobSidecar);
528
533
  }
534
+
535
+ getSerializedCacheKeys(): object[] {
536
+ const objects: object[] = [];
537
+
538
+ if (this.state.hasBlock) {
539
+ objects.push(this.state.block);
540
+ }
541
+
542
+ for (const {blobSidecar} of this.blobsCache.values()) {
543
+ objects.push(blobSidecar);
544
+ }
545
+
546
+ return objects;
547
+ }
529
548
  }
530
549
 
531
550
  function blockAndBlobArePaired(block: SignedBeaconBlock<ForkBlobsDA>, blobSidecar: deneb.BlobSidecar): boolean {
@@ -906,6 +925,18 @@ export class BlockInputColumns extends AbstractBlockInput<ForkColumnsDA, fulu.Da
906
925
  }
907
926
  return Promise.resolve(this.getSampledColumns());
908
927
  }
928
+
929
+ getSerializedCacheKeys(): object[] {
930
+ const objects: object[] = [];
931
+
932
+ if (this.state.hasBlock) {
933
+ objects.push(this.state.block);
934
+ }
935
+
936
+ objects.push(...this.getAllColumns());
937
+
938
+ return objects;
939
+ }
909
940
  }
910
941
 
911
942
  type BlockInputNoDataState = {
@@ -967,4 +998,8 @@ export class BlockInputNoData extends AbstractBlockInput<ForkPostGloas, null> {
967
998
  return (this.state.block.message.body as gloas.BeaconBlockBody).signedExecutionPayloadBid.message
968
999
  .blobKzgCommitments;
969
1000
  }
1001
+
1002
+ getSerializedCacheKeys(): object[] {
1003
+ return [this.state.block];
1004
+ }
970
1005
  }
@@ -100,6 +100,18 @@ export type MissingColumnMeta = {
100
100
  versionedHashes: VersionedHashes;
101
101
  };
102
102
 
103
+ /**
104
+ * Minimal interface required to write data columns to the DB.
105
+ * Used by `writeDataColumnsToDb` and designed to be reusable across forks (e.g. Fulu, Gloas).
106
+ */
107
+ export interface IDataColumnsInput {
108
+ readonly slot: Slot;
109
+ readonly blockRootHex: string;
110
+ getCustodyColumns(): fulu.DataColumnSidecars;
111
+ hasComputedAllData(): boolean;
112
+ waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<fulu.DataColumnSidecars>;
113
+ }
114
+
103
115
  /**
104
116
  * This is used to validate that BlockInput implementations follow some minimal subset of operations
105
117
  * and that adding a new implementation won't break consumers that rely on this subset.
@@ -139,6 +151,11 @@ export interface IBlockInput<F extends ForkName = ForkName, TData extends DAData
139
151
 
140
152
  /** Only safe to call when `hasBlockAndAllData` is true */
141
153
  getTimeComplete(): number;
154
+ /**
155
+ * Return object references used as keys in `SerializedCache` that can be safely removed
156
+ * once this block input lifecycle has completed.
157
+ */
158
+ getSerializedCacheKeys(): object[];
142
159
 
143
160
  waitForBlock(timeout: number, signal?: AbortSignal): Promise<SignedBeaconBlock<F>>;
144
161
  waitForAllData(timeout: number, signal?: AbortSignal): Promise<TData>;
@@ -20,7 +20,7 @@ import {
20
20
  isStartSlotOfEpoch,
21
21
  isStateValidatorsNodesPopulated,
22
22
  } from "@lodestar/state-transition";
23
- import {Attestation, BeaconBlock, altair, capella, electra, phase0, ssz} from "@lodestar/types";
23
+ import {Attestation, BeaconBlock, altair, capella, electra, isGloasBeaconBlock, phase0, ssz} from "@lodestar/types";
24
24
  import {isErrorAborted, toRootHex} from "@lodestar/utils";
25
25
  import {ZERO_HASH_HEX} from "../../constants/index.js";
26
26
  import {callInNextEventLoop} from "../../util/eventLoop.js";
@@ -95,7 +95,7 @@ export async function importBlock(
95
95
  // Without this, a supernode syncing from behind can accumulate many blocks worth of column
96
96
  // data in memory (up to 128 columns per block) causing OOM before persistence catches up.
97
97
  await this.unfinalizedBlockWrites.waitForSpace();
98
- this.unfinalizedBlockWrites.push([blockInput]).catch((e) => {
98
+ this.unfinalizedBlockWrites.push(blockInput).catch((e) => {
99
99
  if (!isQueueErrorAborted(e)) {
100
100
  this.logger.error("Error pushing block to unfinalized write queue", {slot: blockSlot}, e as Error);
101
101
  }
@@ -230,6 +230,32 @@ export async function importBlock(
230
230
  }
231
231
  }
232
232
 
233
+ // 4.5. Import payload attestations to fork choice (Gloas)
234
+ //
235
+ if (isGloasBeaconBlock(block.message)) {
236
+ for (const payloadAttestation of block.message.body.payloadAttestations) {
237
+ try {
238
+ // Extract PTC indices from aggregation bits
239
+ const ptcIndices: number[] = [];
240
+ for (let i = 0; i < payloadAttestation.aggregationBits.bitLen; i++) {
241
+ if (payloadAttestation.aggregationBits.get(i)) {
242
+ ptcIndices.push(i);
243
+ }
244
+ }
245
+
246
+ if (ptcIndices.length > 0) {
247
+ this.forkChoice.notifyPtcMessages(
248
+ toRootHex(payloadAttestation.data.beaconBlockRoot),
249
+ ptcIndices,
250
+ payloadAttestation.data.payloadPresent
251
+ );
252
+ }
253
+ } catch (e) {
254
+ this.logger.warn("Error processing PayloadAttestation from block", {slot: blockSlot}, e as Error);
255
+ }
256
+ }
257
+ }
258
+
233
259
  // 5. Compute head. If new head, immediately stateCache.setHeadState()
234
260
 
235
261
  const oldHead = this.forkChoice.getHead();
@@ -345,7 +371,7 @@ export async function importBlock(
345
371
  // 3) Proposer boost reorg related flag is turned on (this is checked inside the function)
346
372
  // 4) Block meets the criteria of being re-orged out (this is also checked inside the function)
347
373
  const result = this.forkChoice.shouldOverrideForkChoiceUpdate(
348
- blockSummary.blockRoot,
374
+ blockSummary,
349
375
  this.clock.secFromSlot(currentSlot),
350
376
  currentSlot
351
377
  );
@@ -441,7 +467,12 @@ export async function importBlock(
441
467
  this.metrics?.currentActiveValidators.set(activeValidatorsCount);
442
468
  this.metrics?.currentValidators.set({status: "active"}, activeValidatorsCount);
443
469
 
444
- const parentBlockSummary = this.forkChoice.getBlock(checkpointState.latestBlockHeader.parentRoot);
470
+ const parentBlockSummary = isGloasBeaconBlock(block.message)
471
+ ? this.forkChoice.getBlockHexAndBlockHash(
472
+ toRootHex(checkpointState.latestBlockHeader.parentRoot),
473
+ toRootHex(block.message.body.signedExecutionPayloadBid.message.parentBlockHash)
474
+ )
475
+ : this.forkChoice.getBlockDefaultStatus(checkpointState.latestBlockHeader.parentRoot);
445
476
 
446
477
  if (parentBlockSummary) {
447
478
  const justifiedCheckpoint = checkpointState.currentJustifiedCheckpoint;
@@ -1,7 +1,7 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
2
  import {IForkChoice, ProtoBlock} from "@lodestar/fork-choice";
3
3
  import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
4
- import {RootHex, Slot} from "@lodestar/types";
4
+ import {RootHex, Slot, isGloasBeaconBlock} from "@lodestar/types";
5
5
  import {toRootHex} from "@lodestar/utils";
6
6
  import {IClock} from "../../util/clock.js";
7
7
  import {BlockError, BlockErrorCode} from "../errors/index.js";
@@ -90,7 +90,12 @@ export function verifyBlocksSanityChecks(
90
90
  } else {
91
91
  // When importing a block segment, only the first NON-IGNORED block must be known to the fork-choice.
92
92
  const parentRoot = toRootHex(block.message.parentRoot);
93
- parentBlock = chain.forkChoice.getBlockHex(parentRoot);
93
+ parentBlock = isGloasBeaconBlock(block.message)
94
+ ? chain.forkChoice.getBlockHexAndBlockHash(
95
+ parentRoot,
96
+ toRootHex(block.message.body.signedExecutionPayloadBid.message.parentBlockHash)
97
+ )
98
+ : chain.forkChoice.getBlockHexDefaultStatus(parentRoot);
94
99
  if (!parentBlock) {
95
100
  throw new BlockError(block, {code: BlockErrorCode.PARENT_UNKNOWN, parentRoot});
96
101
  }
@@ -1,7 +1,9 @@
1
- import {fulu} from "@lodestar/types";
2
- import {prettyPrintIndices, toRootHex} from "@lodestar/utils";
1
+ import {ForkPostDeneb, isForkPostDeneb} from "@lodestar/params";
2
+ import {SignedBeaconBlock} from "@lodestar/types";
3
+ import {fromHex, toRootHex} from "@lodestar/utils";
4
+ import {getBlobKzgCommitments} from "../../util/dataColumns.js";
3
5
  import {BeaconChain} from "../chain.js";
4
- import {IBlockInput, isBlockInputBlobs, isBlockInputColumns} from "./blockInput/index.js";
6
+ import {IBlockInput, IDataColumnsInput, isBlockInputBlobs, isBlockInputColumns} from "./blockInput/index.js";
5
7
  import {BLOB_AVAILABILITY_TIMEOUT} from "./verifyBlocksDataAvailability.js";
6
8
 
7
9
  /**
@@ -10,129 +12,128 @@ import {BLOB_AVAILABILITY_TIMEOUT} from "./verifyBlocksDataAvailability.js";
10
12
  *
11
13
  * This operation may be performed before, during or after importing to the fork-choice. As long as errors
12
14
  * are handled properly for eventual consistency.
15
+ *
16
+ * Block+blobs (pre-fulu) and data columns (fulu+) are written in parallel.
13
17
  */
14
- export async function writeBlockInputToDb(this: BeaconChain, blocksInputs: IBlockInput[]): Promise<void> {
15
- const fnPromises: Promise<void>[] = [];
16
- // track slots for logging
17
- const slots: number[] = [];
18
-
19
- for (const blockInput of blocksInputs) {
20
- const block = blockInput.getBlock();
21
- const slot = block.message.slot;
22
- slots.push(slot);
23
- const blockRoot = this.config.getForkTypes(block.message.slot).BeaconBlock.hashTreeRoot(block.message);
24
- const blockRootHex = toRootHex(blockRoot);
25
- const blockBytes = this.serializedCache.get(block);
26
- if (blockBytes) {
27
- // skip serializing data if we already have it
28
- this.metrics?.importBlock.persistBlockWithSerializedDataCount.inc();
29
- fnPromises.push(this.db.block.putBinary(this.db.block.getId(block), blockBytes));
30
- } else {
31
- this.metrics?.importBlock.persistBlockNoSerializedDataCount.inc();
32
- fnPromises.push(this.db.block.add(block));
33
- }
18
+ export async function writeBlockInputToDb(this: BeaconChain, blockInput: IBlockInput): Promise<void> {
19
+ const promises: Promise<void>[] = [writeBlockAndBlobsToDb.call(this, blockInput)];
34
20
 
35
- this.logger.debug("Persist block to hot DB", {
36
- slot: block.message.slot,
37
- root: blockRootHex,
38
- inputType: blockInput.type,
39
- });
21
+ if (isBlockInputColumns(blockInput)) {
22
+ promises.push(writeDataColumnsToDb.call(this, blockInput));
23
+ }
40
24
 
41
- if (!blockInput.hasAllData()) {
42
- await blockInput.waitForAllData(BLOB_AVAILABILITY_TIMEOUT);
43
- }
25
+ await Promise.all(promises);
26
+ this.logger.debug("Persisted blockInput to db", {slot: blockInput.slot, root: blockInput.blockRootHex});
27
+ }
44
28
 
45
- // NOTE: Old data is pruned on archive
46
- if (isBlockInputColumns(blockInput)) {
47
- if (!blockInput.hasComputedAllData()) {
48
- // Supernodes may only have a subset of the data columns by the time the block begins to be imported
49
- // because full data availability can be assumed after NUMBER_OF_COLUMNS / 2 columns are available.
50
- // Here, however, all data columns must be fully available/reconstructed before persisting to the DB.
51
- await blockInput.waitForComputedAllData(BLOB_AVAILABILITY_TIMEOUT).catch(() => {
52
- this.logger.debug("Failed to wait for computed all data", {slot, blockRoot: blockRootHex});
53
- });
54
- }
29
+ async function writeBlockAndBlobsToDb(this: BeaconChain, blockInput: IBlockInput): Promise<void> {
30
+ const block = blockInput.getBlock();
31
+ const slot = block.message.slot;
32
+ const blockRoot = this.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block.message);
33
+ const blockRootHex = toRootHex(blockRoot);
34
+ const numBlobs = isForkPostDeneb(blockInput.forkName)
35
+ ? getBlobKzgCommitments(blockInput.forkName, block as SignedBeaconBlock<ForkPostDeneb>).length
36
+ : undefined;
37
+ const fnPromises: Promise<void>[] = [];
55
38
 
56
- const {custodyColumns} = this.custodyConfig;
57
- const blobsLen = (block.message as fulu.BeaconBlock).body.blobKzgCommitments.length;
58
- let dataColumnsLen: number;
59
- if (blobsLen === 0) {
60
- dataColumnsLen = 0;
61
- } else {
62
- dataColumnsLen = custodyColumns.length;
63
- }
39
+ const blockBytes = this.serializedCache.get(block);
40
+ if (blockBytes) {
41
+ // skip serializing data if we already have it
42
+ this.metrics?.importBlock.persistBlockWithSerializedDataCount.inc();
43
+ fnPromises.push(this.db.block.putBinary(this.db.block.getId(block), blockBytes));
44
+ } else {
45
+ this.metrics?.importBlock.persistBlockNoSerializedDataCount.inc();
46
+ fnPromises.push(this.db.block.add(block));
47
+ }
64
48
 
65
- const dataColumnSidecars = blockInput.getCustodyColumns();
66
- if (dataColumnSidecars.length !== dataColumnsLen) {
67
- this.logger.debug(
68
- `Invalid dataColumnSidecars=${dataColumnSidecars.length} for custody expected custodyColumnsLen=${dataColumnsLen}`
69
- );
70
- }
49
+ this.logger.debug("Persist block to hot DB", {slot, root: blockRootHex, inputType: blockInput.type, numBlobs});
71
50
 
72
- const binaryPuts = [];
73
- const nonbinaryPuts = [];
74
- for (const dataColumnSidecar of dataColumnSidecars) {
75
- // skip reserializing column if we already have it
76
- const serialized = this.serializedCache.get(dataColumnSidecar);
77
- if (serialized) {
78
- binaryPuts.push({key: dataColumnSidecar.index, value: serialized});
79
- } else {
80
- nonbinaryPuts.push(dataColumnSidecar);
51
+ if (isBlockInputBlobs(blockInput)) {
52
+ fnPromises.push(
53
+ (async () => {
54
+ if (!blockInput.hasAllData()) {
55
+ await blockInput.waitForAllData(BLOB_AVAILABILITY_TIMEOUT);
81
56
  }
82
- }
83
- fnPromises.push(this.db.dataColumnSidecar.putManyBinary(blockRoot, binaryPuts));
84
- fnPromises.push(this.db.dataColumnSidecar.putMany(blockRoot, nonbinaryPuts));
85
- this.logger.debug("Persisted dataColumnSidecars to hot DB", {
86
- slot: block.message.slot,
87
- root: blockRootHex,
88
- dataColumnSidecars: dataColumnSidecars.length,
89
- numBlobs: blobsLen,
90
- custodyColumns: custodyColumns.length,
91
- });
92
- } else if (isBlockInputBlobs(blockInput)) {
93
- const blobSidecars = blockInput.getBlobs();
94
- fnPromises.push(this.db.blobSidecars.add({blockRoot, slot: block.message.slot, blobSidecars}));
95
- this.logger.debug("Persisted blobSidecars to hot DB", {
96
- blobsLen: blobSidecars.length,
97
- slot: block.message.slot,
98
- root: blockRootHex,
99
- });
100
- }
57
+ const blobSidecars = blockInput.getBlobs();
58
+ await this.db.blobSidecars.add({blockRoot, slot, blobSidecars});
59
+ this.logger.debug("Persisted blobSidecars to hot DB", {
60
+ slot,
61
+ root: blockRootHex,
62
+ numBlobs: blobSidecars.length,
63
+ });
64
+ })()
65
+ );
66
+ }
67
+
68
+ await Promise.all(fnPromises);
69
+ }
70
+
71
+ /**
72
+ * Persists data columns to DB for a given block. Accepts a narrow sub-interface of IBlockInput
73
+ * so it can be reused across forks (e.g. Fulu, Gloas).
74
+ *
75
+ * NOTE: Old data is pruned on archive.
76
+ */
77
+ export async function writeDataColumnsToDb(this: BeaconChain, blockInput: IDataColumnsInput): Promise<void> {
78
+ const {slot, blockRootHex} = blockInput;
79
+ const blockRoot = fromHex(blockRootHex);
101
80
 
102
- await Promise.all(fnPromises);
103
- this.logger.debug("Persisted blocksInput to db", {
104
- blocksInput: blocksInputs.length,
105
- slots: prettyPrintIndices(slots),
81
+ if (!blockInput.hasComputedAllData()) {
82
+ // Supernodes may only have a subset of the data columns by the time the block begins to be imported
83
+ // because full data availability can be assumed after NUMBER_OF_COLUMNS / 2 columns are available.
84
+ // Here, however, all data columns must be fully available/reconstructed before persisting to the DB.
85
+ await blockInput.waitForComputedAllData(BLOB_AVAILABILITY_TIMEOUT).catch(() => {
86
+ this.logger.debug("Failed to wait for computed all data", {slot, blockRoot: blockRootHex});
106
87
  });
107
88
  }
89
+
90
+ const {custodyColumns} = this.custodyConfig;
91
+ const dataColumnSidecars = blockInput.getCustodyColumns();
92
+
93
+ const binaryPuts: {key: number; value: Uint8Array}[] = [];
94
+ const nonbinaryPuts = [];
95
+ for (const dataColumnSidecar of dataColumnSidecars) {
96
+ // skip reserializing column if we already have it
97
+ const serialized = this.serializedCache.get(dataColumnSidecar);
98
+ if (serialized) {
99
+ binaryPuts.push({key: dataColumnSidecar.index, value: serialized});
100
+ } else {
101
+ nonbinaryPuts.push(dataColumnSidecar);
102
+ }
103
+ }
104
+
105
+ await Promise.all([
106
+ this.db.dataColumnSidecar.putManyBinary(blockRoot, binaryPuts),
107
+ this.db.dataColumnSidecar.putMany(blockRoot, nonbinaryPuts),
108
+ ]);
109
+
110
+ this.logger.debug("Persisted dataColumnSidecars to hot DB", {
111
+ slot,
112
+ root: blockRootHex,
113
+ dataColumnSidecars: dataColumnSidecars.length,
114
+ custodyColumns: custodyColumns.length,
115
+ numBlobs: dataColumnSidecars[0]?.column.length,
116
+ });
108
117
  }
109
118
 
110
- export async function persistBlockInputs(this: BeaconChain, blockInputs: IBlockInput[]): Promise<void> {
119
+ export async function persistBlockInput(this: BeaconChain, blockInput: IBlockInput): Promise<void> {
111
120
  await writeBlockInputToDb
112
- .call(this, blockInputs)
121
+ .call(this, blockInput)
113
122
  .catch((e) => {
114
123
  this.logger.debug(
115
124
  "Error persisting block input in hot db",
116
125
  {
117
- count: blockInputs.length,
118
- slot: blockInputs[0].slot,
119
- root: blockInputs[0].blockRootHex,
126
+ slot: blockInput.slot,
127
+ root: blockInput.blockRootHex,
120
128
  },
121
129
  e
122
130
  );
123
131
  })
124
132
  .finally(() => {
125
- for (const blockInput of blockInputs) {
126
- this.seenBlockInputCache.prune(blockInput.blockRootHex);
127
- }
128
- // Without forcefully clearing this cache, we would rely on WeakMap to evict memory which is not reliable.
129
- // Clear here (after the DB write) so that writeBlockInputToDb can still use the cached serialized bytes.
130
- this.serializedCache.clear();
131
- if (blockInputs.length === 1) {
132
- this.logger.debug("Pruned block input", {
133
- slot: blockInputs[0].slot,
134
- root: blockInputs[0].blockRootHex,
135
- });
136
- }
133
+ this.seenBlockInputCache.prune(blockInput.blockRootHex);
134
+ this.logger.debug("Pruned block input", {
135
+ slot: blockInput.slot,
136
+ root: blockInput.blockRootHex,
137
+ });
137
138
  });
138
139
  }