@lodestar/beacon-node 1.46.0-dev.d9065a2b16 → 1.46.0-dev.de5f89eae1

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 (645) 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 +37 -15
  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.d.ts +1 -0
  19. package/lib/api/impl/config/constants.d.ts.map +1 -1
  20. package/lib/api/impl/config/constants.js +3 -1
  21. package/lib/api/impl/config/constants.js.map +1 -1
  22. package/lib/api/impl/config/index.js.map +1 -1
  23. package/lib/api/impl/debug/index.d.ts +1 -1
  24. package/lib/api/impl/debug/index.d.ts.map +1 -1
  25. package/lib/api/impl/debug/index.js.map +1 -1
  26. package/lib/api/impl/errors.js.map +1 -1
  27. package/lib/api/impl/events/index.d.ts +1 -1
  28. package/lib/api/impl/events/index.d.ts.map +1 -1
  29. package/lib/api/impl/events/index.js.map +1 -1
  30. package/lib/api/impl/lightclient/index.d.ts +1 -1
  31. package/lib/api/impl/lightclient/index.d.ts.map +1 -1
  32. package/lib/api/impl/lightclient/index.js.map +1 -1
  33. package/lib/api/impl/lodestar/attesterSlashing.js.map +1 -1
  34. package/lib/api/impl/lodestar/index.d.ts +1 -1
  35. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  36. package/lib/api/impl/lodestar/index.js.map +1 -1
  37. package/lib/api/impl/node/index.js.map +1 -1
  38. package/lib/api/impl/node/utils.js.map +1 -1
  39. package/lib/api/impl/proof/index.js.map +1 -1
  40. package/lib/api/impl/utils.js.map +1 -1
  41. package/lib/api/impl/validator/index.d.ts.map +1 -1
  42. package/lib/api/impl/validator/index.js +18 -11
  43. package/lib/api/impl/validator/index.js.map +1 -1
  44. package/lib/api/impl/validator/utils.d.ts +1 -1
  45. package/lib/api/impl/validator/utils.d.ts.map +1 -1
  46. package/lib/api/impl/validator/utils.js.map +1 -1
  47. package/lib/api/rest/activeSockets.js.map +1 -1
  48. package/lib/api/rest/base.js.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/chain/ColumnReconstructionTracker.js.map +1 -1
  52. package/lib/chain/GetBlobsTracker.js.map +1 -1
  53. package/lib/chain/archiveStore/archiveStore.js +1 -2
  54. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  55. package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
  56. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  57. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  58. package/lib/chain/archiveStore/historicalState/types.js +1 -2
  59. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  60. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  61. package/lib/chain/archiveStore/interface.js +1 -2
  62. package/lib/chain/archiveStore/interface.js.map +1 -1
  63. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
  64. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +1 -2
  65. package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
  66. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  67. package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
  68. package/lib/chain/archiveStore/utils/updateBackfillRange.js.map +1 -1
  69. package/lib/chain/balancesCache.js.map +1 -1
  70. package/lib/chain/beaconProposerCache.js.map +1 -1
  71. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  72. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  73. package/lib/chain/blocks/blockInput/errors.js +1 -2
  74. package/lib/chain/blocks/blockInput/errors.js.map +1 -1
  75. package/lib/chain/blocks/blockInput/types.js +2 -4
  76. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  77. package/lib/chain/blocks/blockInput/utils.js.map +1 -1
  78. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  79. package/lib/chain/blocks/importBlock.js +3 -3
  80. package/lib/chain/blocks/importBlock.js.map +1 -1
  81. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  82. package/lib/chain/blocks/importExecutionPayload.js +4 -6
  83. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  84. package/lib/chain/blocks/index.d.ts.map +1 -1
  85. package/lib/chain/blocks/index.js +6 -0
  86. package/lib/chain/blocks/index.js.map +1 -1
  87. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
  88. package/lib/chain/blocks/payloadEnvelopeInput/types.js +1 -2
  89. package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -1
  90. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  91. package/lib/chain/blocks/types.js +3 -6
  92. package/lib/chain/blocks/types.js.map +1 -1
  93. package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
  94. package/lib/chain/blocks/utils/chainSegment.js +31 -25
  95. package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
  96. package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
  97. package/lib/chain/blocks/utils/polarBearBanner.d.ts +2 -0
  98. package/lib/chain/blocks/utils/polarBearBanner.d.ts.map +1 -0
  99. package/lib/chain/blocks/utils/polarBearBanner.js +51 -0
  100. package/lib/chain/blocks/utils/polarBearBanner.js.map +1 -0
  101. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  102. package/lib/chain/blocks/verifyBlock.js +21 -1
  103. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  104. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  105. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  106. package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
  107. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  108. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  109. package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -1
  110. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  111. package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
  112. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
  113. package/lib/chain/bls/maybeBatch.js.map +1 -1
  114. package/lib/chain/bls/multithread/index.js.map +1 -1
  115. package/lib/chain/bls/multithread/jobItem.js +1 -2
  116. package/lib/chain/bls/multithread/jobItem.js.map +1 -1
  117. package/lib/chain/bls/multithread/types.js +1 -2
  118. package/lib/chain/bls/multithread/types.js.map +1 -1
  119. package/lib/chain/bls/multithread/utils.js.map +1 -1
  120. package/lib/chain/bls/multithread/worker.js.map +1 -1
  121. package/lib/chain/bls/singleThread.js.map +1 -1
  122. package/lib/chain/bls/utils.js.map +1 -1
  123. package/lib/chain/builderCircuitBreaker.js.map +1 -1
  124. package/lib/chain/chain.d.ts +7 -2
  125. package/lib/chain/chain.d.ts.map +1 -1
  126. package/lib/chain/chain.js +55 -0
  127. package/lib/chain/chain.js.map +1 -1
  128. package/lib/chain/emitter.d.ts +7 -1
  129. package/lib/chain/emitter.d.ts.map +1 -1
  130. package/lib/chain/emitter.js +6 -2
  131. package/lib/chain/emitter.js.map +1 -1
  132. package/lib/chain/errors/attestationError.js +1 -2
  133. package/lib/chain/errors/attestationError.js.map +1 -1
  134. package/lib/chain/errors/attesterSlashingError.js +1 -2
  135. package/lib/chain/errors/attesterSlashingError.js.map +1 -1
  136. package/lib/chain/errors/blobSidecarError.js +1 -2
  137. package/lib/chain/errors/blobSidecarError.js.map +1 -1
  138. package/lib/chain/errors/blockError.js +1 -2
  139. package/lib/chain/errors/blockError.js.map +1 -1
  140. package/lib/chain/errors/blsToExecutionChangeError.js +1 -2
  141. package/lib/chain/errors/blsToExecutionChangeError.js.map +1 -1
  142. package/lib/chain/errors/dataColumnSidecarError.js +1 -2
  143. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  144. package/lib/chain/errors/executionPayloadBid.d.ts +11 -4
  145. package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
  146. package/lib/chain/errors/executionPayloadBid.js +2 -2
  147. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  148. package/lib/chain/errors/executionPayloadEnvelope.js +1 -2
  149. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  150. package/lib/chain/errors/gossipValidation.js +2 -4
  151. package/lib/chain/errors/gossipValidation.js.map +1 -1
  152. package/lib/chain/errors/lightClientError.js +2 -4
  153. package/lib/chain/errors/lightClientError.js.map +1 -1
  154. package/lib/chain/errors/payloadAttestation.js +1 -2
  155. package/lib/chain/errors/payloadAttestation.js.map +1 -1
  156. package/lib/chain/errors/proposerPreferences.js +1 -2
  157. package/lib/chain/errors/proposerPreferences.js.map +1 -1
  158. package/lib/chain/errors/proposerSlashingError.js +1 -2
  159. package/lib/chain/errors/proposerSlashingError.js.map +1 -1
  160. package/lib/chain/errors/syncCommitteeError.js +1 -2
  161. package/lib/chain/errors/syncCommitteeError.js.map +1 -1
  162. package/lib/chain/errors/voluntaryExitError.js +1 -2
  163. package/lib/chain/errors/voluntaryExitError.js.map +1 -1
  164. package/lib/chain/forkChoice/index.js +1 -2
  165. package/lib/chain/forkChoice/index.js.map +1 -1
  166. package/lib/chain/initState.d.ts +1 -1
  167. package/lib/chain/initState.d.ts.map +1 -1
  168. package/lib/chain/initState.js.map +1 -1
  169. package/lib/chain/interface.d.ts +2 -0
  170. package/lib/chain/interface.d.ts.map +1 -1
  171. package/lib/chain/interface.js +1 -2
  172. package/lib/chain/interface.js.map +1 -1
  173. package/lib/chain/lightClient/index.d.ts +29 -0
  174. package/lib/chain/lightClient/index.d.ts.map +1 -1
  175. package/lib/chain/lightClient/index.js.map +1 -1
  176. package/lib/chain/lightClient/proofs.js.map +1 -1
  177. package/lib/chain/opPools/aggregatedAttestationPool.js +3 -5
  178. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  179. package/lib/chain/opPools/attestationPool.js.map +1 -1
  180. package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
  181. package/lib/chain/opPools/opPool.js.map +1 -1
  182. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  183. package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
  184. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  185. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  186. package/lib/chain/opPools/types.js +2 -4
  187. package/lib/chain/opPools/types.js.map +1 -1
  188. package/lib/chain/opPools/utils.js.map +1 -1
  189. package/lib/chain/options.d.ts +2 -0
  190. package/lib/chain/options.d.ts.map +1 -1
  191. package/lib/chain/options.js +1 -0
  192. package/lib/chain/options.js.map +1 -1
  193. package/lib/chain/prepareNextSlot.d.ts +2 -1
  194. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  195. package/lib/chain/prepareNextSlot.js +108 -30
  196. package/lib/chain/prepareNextSlot.js.map +1 -1
  197. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  198. package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -1
  199. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  200. package/lib/chain/produceBlock/produceBlockBody.js +22 -16
  201. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  202. package/lib/chain/produceBlock/validateBlobsAndKzgCommitments.js.map +1 -1
  203. package/lib/chain/regen/errors.js +1 -2
  204. package/lib/chain/regen/errors.js.map +1 -1
  205. package/lib/chain/regen/interface.js +2 -4
  206. package/lib/chain/regen/interface.js.map +1 -1
  207. package/lib/chain/regen/queued.js.map +1 -1
  208. package/lib/chain/regen/regen.js.map +1 -1
  209. package/lib/chain/reprocess.js +1 -2
  210. package/lib/chain/reprocess.js.map +1 -1
  211. package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
  212. package/lib/chain/seenCache/seenAttestationData.js +1 -2
  213. package/lib/chain/seenCache/seenAttestationData.js.map +1 -1
  214. package/lib/chain/seenCache/seenAttesters.js.map +1 -1
  215. package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
  216. package/lib/chain/seenCache/seenBlockProposers.d.ts +20 -4
  217. package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
  218. package/lib/chain/seenCache/seenBlockProposers.js +49 -2
  219. package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
  220. package/lib/chain/seenCache/seenCommittee.js.map +1 -1
  221. package/lib/chain/seenCache/seenCommitteeContribution.js.map +1 -1
  222. package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +6 -5
  223. package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
  224. package/lib/chain/seenCache/seenExecutionPayloadBids.js +16 -8
  225. package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
  226. package/lib/chain/seenCache/seenGossipBlockInput.d.ts +3 -3
  227. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  228. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  229. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
  230. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  231. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  232. package/lib/chain/serializeState.js.map +1 -1
  233. package/lib/chain/shufflingCache.js +1 -2
  234. package/lib/chain/shufflingCache.js.map +1 -1
  235. package/lib/chain/stateCache/datastore/db.js.map +1 -1
  236. package/lib/chain/stateCache/datastore/file.js.map +1 -1
  237. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  238. package/lib/chain/stateCache/mapMetrics.js.map +1 -1
  239. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +45 -1
  240. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  241. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  242. package/lib/chain/stateCache/types.js +1 -2
  243. package/lib/chain/stateCache/types.js.map +1 -1
  244. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  245. package/lib/chain/validation/attestation.js.map +1 -1
  246. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  247. package/lib/chain/validation/blobSidecar.js.map +1 -1
  248. package/lib/chain/validation/block.d.ts +4 -1
  249. package/lib/chain/validation/block.d.ts.map +1 -1
  250. package/lib/chain/validation/block.js +32 -18
  251. package/lib/chain/validation/block.js.map +1 -1
  252. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  253. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  254. package/lib/chain/validation/dataColumnSidecar.js +21 -16
  255. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  256. package/lib/chain/validation/executionPayloadBid.d.ts +0 -5
  257. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  258. package/lib/chain/validation/executionPayloadBid.js +75 -27
  259. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  260. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  261. package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
  262. package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
  263. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  264. package/lib/chain/validation/proposerPreferences.js.map +1 -1
  265. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  266. package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
  267. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  268. package/lib/chain/validation/signatureSets/selectionProof.js.map +1 -1
  269. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  270. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  271. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  272. package/lib/chain/validation/syncCommittee.js.map +1 -1
  273. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  274. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  275. package/lib/chain/validatorMonitor.js +1 -2
  276. package/lib/chain/validatorMonitor.js.map +1 -1
  277. package/lib/constants/network.js +2 -4
  278. package/lib/constants/network.js.map +1 -1
  279. package/lib/db/beacon.js.map +1 -1
  280. package/lib/db/buckets.d.ts +23 -23
  281. package/lib/db/buckets.d.ts.map +1 -1
  282. package/lib/db/buckets.js +1 -2
  283. package/lib/db/buckets.js.map +1 -1
  284. package/lib/db/repositories/attesterSlashing.js.map +1 -1
  285. package/lib/db/repositories/backfilledRanges.js.map +1 -1
  286. package/lib/db/repositories/blobSidecars.js.map +1 -1
  287. package/lib/db/repositories/blobSidecarsArchive.js.map +1 -1
  288. package/lib/db/repositories/block.js.map +1 -1
  289. package/lib/db/repositories/blockArchive.js.map +1 -1
  290. package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
  291. package/lib/db/repositories/blsToExecutionChange.js.map +1 -1
  292. package/lib/db/repositories/checkpointState.js.map +1 -1
  293. package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
  294. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  295. package/lib/db/repositories/executionPayloadEnvelope.js.map +1 -1
  296. package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
  297. package/lib/db/repositories/lightclientBestUpdate.js.map +1 -1
  298. package/lib/db/repositories/lightclientCheckpointHeader.js.map +1 -1
  299. package/lib/db/repositories/lightclientSyncCommittee.js.map +1 -1
  300. package/lib/db/repositories/lightclientSyncCommitteeWitness.js.map +1 -1
  301. package/lib/db/repositories/proposerSlashing.js.map +1 -1
  302. package/lib/db/repositories/stateArchive.js.map +1 -1
  303. package/lib/db/repositories/stateArchiveIndex.js.map +1 -1
  304. package/lib/db/repositories/voluntaryExit.js.map +1 -1
  305. package/lib/execution/builder/cache.js.map +1 -1
  306. package/lib/execution/builder/http.js +1 -2
  307. package/lib/execution/builder/http.js.map +1 -1
  308. package/lib/execution/builder/index.js.map +1 -1
  309. package/lib/execution/engine/disabled.js.map +1 -1
  310. package/lib/execution/engine/http.d.ts.map +1 -1
  311. package/lib/execution/engine/http.js.map +1 -1
  312. package/lib/execution/engine/index.js.map +1 -1
  313. package/lib/execution/engine/interface.d.ts +1 -1
  314. package/lib/execution/engine/interface.js +2 -4
  315. package/lib/execution/engine/interface.js.map +1 -1
  316. package/lib/execution/engine/jsonRpcHttpClient.d.ts +13 -10
  317. package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
  318. package/lib/execution/engine/jsonRpcHttpClient.js +1 -2
  319. package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
  320. package/lib/execution/engine/jwt.js.map +1 -1
  321. package/lib/execution/engine/mock.js.map +1 -1
  322. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  323. package/lib/execution/engine/types.js +1 -1
  324. package/lib/execution/engine/types.js.map +1 -1
  325. package/lib/execution/engine/utils.d.ts +1 -1
  326. package/lib/execution/engine/utils.d.ts.map +1 -1
  327. package/lib/execution/engine/utils.js.map +1 -1
  328. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  329. package/lib/metrics/metrics/beacon.js.map +1 -1
  330. package/lib/metrics/metrics/lodestar.d.ts +16 -2
  331. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  332. package/lib/metrics/metrics/lodestar.js +39 -1
  333. package/lib/metrics/metrics/lodestar.js.map +1 -1
  334. package/lib/metrics/metrics.js.map +1 -1
  335. package/lib/metrics/nodeJsMetrics.js.map +1 -1
  336. package/lib/metrics/server/http.d.ts +1 -1
  337. package/lib/metrics/server/http.d.ts.map +1 -1
  338. package/lib/metrics/server/http.js.map +1 -1
  339. package/lib/metrics/utils/avgMinMax.js.map +1 -1
  340. package/lib/metrics/utils/gauge.js.map +1 -1
  341. package/lib/metrics/utils/registryMetricCreator.js.map +1 -1
  342. package/lib/monitoring/clientStats.js.map +1 -1
  343. package/lib/monitoring/properties.js.map +1 -1
  344. package/lib/monitoring/service.js.map +1 -1
  345. package/lib/monitoring/system.d.ts.map +1 -1
  346. package/lib/monitoring/system.js.map +1 -1
  347. package/lib/monitoring/types.js +2 -4
  348. package/lib/monitoring/types.js.map +1 -1
  349. package/lib/network/core/events.d.ts.map +1 -1
  350. package/lib/network/core/events.js +2 -4
  351. package/lib/network/core/events.js.map +1 -1
  352. package/lib/network/core/metrics.d.ts +7 -6
  353. package/lib/network/core/metrics.d.ts.map +1 -1
  354. package/lib/network/core/metrics.js.map +1 -1
  355. package/lib/network/core/networkCore.d.ts +1 -1
  356. package/lib/network/core/networkCore.d.ts.map +1 -1
  357. package/lib/network/core/networkCore.js +12 -1
  358. package/lib/network/core/networkCore.js.map +1 -1
  359. package/lib/network/core/networkCoreWorker.js.map +1 -1
  360. package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
  361. package/lib/network/core/networkCoreWorkerHandler.js +20 -3
  362. package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
  363. package/lib/network/discv5/index.d.ts +1 -1
  364. package/lib/network/discv5/index.d.ts.map +1 -1
  365. package/lib/network/discv5/index.js.map +1 -1
  366. package/lib/network/discv5/utils.js +1 -2
  367. package/lib/network/discv5/utils.js.map +1 -1
  368. package/lib/network/discv5/worker.js.map +1 -1
  369. package/lib/network/events.d.ts.map +1 -1
  370. package/lib/network/events.js +2 -4
  371. package/lib/network/events.js.map +1 -1
  372. package/lib/network/forks.js.map +1 -1
  373. package/lib/network/gossip/encoding.js.map +1 -1
  374. package/lib/network/gossip/errors.js.map +1 -1
  375. package/lib/network/gossip/gossipsub.js.map +1 -1
  376. package/lib/network/gossip/interface.js +2 -4
  377. package/lib/network/gossip/interface.js.map +1 -1
  378. package/lib/network/gossip/metrics.d.ts +14 -12
  379. package/lib/network/gossip/metrics.d.ts.map +1 -1
  380. package/lib/network/gossip/metrics.js.map +1 -1
  381. package/lib/network/gossip/scoringParameters.d.ts +1 -1
  382. package/lib/network/gossip/scoringParameters.d.ts.map +1 -1
  383. package/lib/network/gossip/scoringParameters.js.map +1 -1
  384. package/lib/network/gossip/topic.d.ts +670 -25
  385. package/lib/network/gossip/topic.d.ts.map +1 -1
  386. package/lib/network/gossip/topic.js +3 -3
  387. package/lib/network/gossip/topic.js.map +1 -1
  388. package/lib/network/libp2p/error.js +1 -2
  389. package/lib/network/libp2p/error.js.map +1 -1
  390. package/lib/network/libp2p/index.js.map +1 -1
  391. package/lib/network/metadata.js +2 -4
  392. package/lib/network/metadata.js.map +1 -1
  393. package/lib/network/network.d.ts +2 -1
  394. package/lib/network/network.d.ts.map +1 -1
  395. package/lib/network/network.js +11 -1
  396. package/lib/network/network.js.map +1 -1
  397. package/lib/network/peers/client.js +1 -2
  398. package/lib/network/peers/client.js.map +1 -1
  399. package/lib/network/peers/datastore.d.ts +3 -0
  400. package/lib/network/peers/datastore.d.ts.map +1 -1
  401. package/lib/network/peers/datastore.js.map +1 -1
  402. package/lib/network/peers/discover.d.ts +7 -0
  403. package/lib/network/peers/discover.d.ts.map +1 -1
  404. package/lib/network/peers/discover.js +2 -4
  405. package/lib/network/peers/discover.js.map +1 -1
  406. package/lib/network/peers/peerManager.d.ts +1 -0
  407. package/lib/network/peers/peerManager.d.ts.map +1 -1
  408. package/lib/network/peers/peerManager.js.map +1 -1
  409. package/lib/network/peers/peersData.js +1 -2
  410. package/lib/network/peers/peersData.js.map +1 -1
  411. package/lib/network/peers/score/interface.js +2 -4
  412. package/lib/network/peers/score/interface.js.map +1 -1
  413. package/lib/network/peers/score/score.js.map +1 -1
  414. package/lib/network/peers/score/store.js.map +1 -1
  415. package/lib/network/peers/score/utils.js.map +1 -1
  416. package/lib/network/peers/utils/assertPeerRelevance.js +1 -2
  417. package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
  418. package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
  419. package/lib/network/peers/utils/getConnectedPeerIds.js.map +1 -1
  420. package/lib/network/peers/utils/prioritizePeers.js +1 -2
  421. package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
  422. package/lib/network/peers/utils/subnetMap.js.map +1 -1
  423. package/lib/network/processor/aggregatorTracker.js.map +1 -1
  424. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  425. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  426. package/lib/network/processor/gossipHandlers.js +8 -0
  427. package/lib/network/processor/gossipHandlers.js.map +1 -1
  428. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  429. package/lib/network/processor/gossipQueues/indexed.js.map +1 -1
  430. package/lib/network/processor/gossipQueues/linear.js.map +1 -1
  431. package/lib/network/processor/gossipQueues/types.js +2 -4
  432. package/lib/network/processor/gossipQueues/types.js.map +1 -1
  433. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  434. package/lib/network/processor/index.d.ts.map +1 -1
  435. package/lib/network/processor/index.js +4 -5
  436. package/lib/network/processor/index.js.map +1 -1
  437. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  438. package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
  439. package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
  440. package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
  441. package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
  442. package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
  443. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  444. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  445. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
  446. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
  447. package/lib/network/reqresp/handlers/index.js.map +1 -1
  448. package/lib/network/reqresp/handlers/lightClientBootstrap.js.map +1 -1
  449. package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js +1 -1
  450. package/lib/network/reqresp/handlers/lightClientFinalityUpdate.js.map +1 -1
  451. package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js +1 -1
  452. package/lib/network/reqresp/handlers/lightClientOptimisticUpdate.js.map +1 -1
  453. package/lib/network/reqresp/handlers/lightClientUpdatesByRange.d.ts.map +1 -1
  454. package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js +6 -2
  455. package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
  456. package/lib/network/reqresp/interface.js +1 -2
  457. package/lib/network/reqresp/interface.js.map +1 -1
  458. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  459. package/lib/network/reqresp/protocols.js +35 -9
  460. package/lib/network/reqresp/protocols.js.map +1 -1
  461. package/lib/network/reqresp/rateLimit.js +1 -1
  462. package/lib/network/reqresp/rateLimit.js.map +1 -1
  463. package/lib/network/reqresp/score.d.ts.map +1 -1
  464. package/lib/network/reqresp/score.js +20 -3
  465. package/lib/network/reqresp/score.js.map +1 -1
  466. package/lib/network/reqresp/types.js +2 -4
  467. package/lib/network/reqresp/types.js.map +1 -1
  468. package/lib/network/reqresp/utils/collect.js.map +1 -1
  469. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +1 -2
  470. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
  471. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +1 -1
  472. package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
  473. package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
  474. package/lib/network/statusCache.js.map +1 -1
  475. package/lib/network/subnets/attnetsService.js +1 -2
  476. package/lib/network/subnets/attnetsService.js.map +1 -1
  477. package/lib/network/subnets/interface.js.map +1 -1
  478. package/lib/network/subnets/syncnetsService.d.ts.map +1 -1
  479. package/lib/network/subnets/syncnetsService.js.map +1 -1
  480. package/lib/network/subnets/util.js.map +1 -1
  481. package/lib/network/util.js.map +1 -1
  482. package/lib/node/nodejs.d.ts +2 -2
  483. package/lib/node/nodejs.d.ts.map +1 -1
  484. package/lib/node/nodejs.js +1 -2
  485. package/lib/node/nodejs.js.map +1 -1
  486. package/lib/node/notifier.js.map +1 -1
  487. package/lib/node/utils/interop/deposits.js.map +1 -1
  488. package/lib/node/utils/interop/state.d.ts +1 -1
  489. package/lib/node/utils/interop/state.d.ts.map +1 -1
  490. package/lib/node/utils/interop/state.js.map +1 -1
  491. package/lib/node/utils/lightclient.js.map +1 -1
  492. package/lib/node/utils/state.js.map +1 -1
  493. package/lib/sync/backfill/backfill.d.ts +7 -0
  494. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  495. package/lib/sync/backfill/backfill.js +3 -6
  496. package/lib/sync/backfill/backfill.js.map +1 -1
  497. package/lib/sync/backfill/errors.js +1 -2
  498. package/lib/sync/backfill/errors.js.map +1 -1
  499. package/lib/sync/backfill/verify.js.map +1 -1
  500. package/lib/sync/constants.d.ts +6 -5
  501. package/lib/sync/constants.d.ts.map +1 -1
  502. package/lib/sync/constants.js +6 -5
  503. package/lib/sync/constants.js.map +1 -1
  504. package/lib/sync/interface.js +1 -2
  505. package/lib/sync/interface.js.map +1 -1
  506. package/lib/sync/range/batch.d.ts +10 -1
  507. package/lib/sync/range/batch.d.ts.map +1 -1
  508. package/lib/sync/range/batch.js +44 -16
  509. package/lib/sync/range/batch.js.map +1 -1
  510. package/lib/sync/range/chain.d.ts +10 -0
  511. package/lib/sync/range/chain.d.ts.map +1 -1
  512. package/lib/sync/range/chain.js +31 -17
  513. package/lib/sync/range/chain.js.map +1 -1
  514. package/lib/sync/range/range.d.ts.map +1 -1
  515. package/lib/sync/range/range.js +2 -4
  516. package/lib/sync/range/range.js.map +1 -1
  517. package/lib/sync/range/utils/batches.d.ts +18 -0
  518. package/lib/sync/range/utils/batches.d.ts.map +1 -1
  519. package/lib/sync/range/utils/batches.js +38 -0
  520. package/lib/sync/range/utils/batches.js.map +1 -1
  521. package/lib/sync/range/utils/chainTarget.js.map +1 -1
  522. package/lib/sync/range/utils/hashBlocks.js.map +1 -1
  523. package/lib/sync/range/utils/peerBalancer.js.map +1 -1
  524. package/lib/sync/range/utils/updateChains.js.map +1 -1
  525. package/lib/sync/sync.js.map +1 -1
  526. package/lib/sync/types.js +3 -6
  527. package/lib/sync/types.js.map +1 -1
  528. package/lib/sync/unknownBlock.d.ts +23 -0
  529. package/lib/sync/unknownBlock.d.ts.map +1 -1
  530. package/lib/sync/unknownBlock.js.map +1 -1
  531. package/lib/sync/utils/downloadByRange.d.ts +4 -4
  532. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  533. package/lib/sync/utils/downloadByRange.js +1 -2
  534. package/lib/sync/utils/downloadByRange.js.map +1 -1
  535. package/lib/sync/utils/downloadByRoot.d.ts +7 -7
  536. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  537. package/lib/sync/utils/downloadByRoot.js +1 -2
  538. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  539. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  540. package/lib/sync/utils/rateLimit.js.map +1 -1
  541. package/lib/sync/utils/remoteSyncType.d.ts.map +1 -1
  542. package/lib/sync/utils/remoteSyncType.js +2 -4
  543. package/lib/sync/utils/remoteSyncType.js.map +1 -1
  544. package/lib/util/address.js.map +1 -1
  545. package/lib/util/array.js.map +1 -1
  546. package/lib/util/asyncIterableToEvents.js +1 -2
  547. package/lib/util/asyncIterableToEvents.js.map +1 -1
  548. package/lib/util/binarySearch.js.map +1 -1
  549. package/lib/util/bitArray.js +1 -2
  550. package/lib/util/bitArray.js.map +1 -1
  551. package/lib/util/blobs.js.map +1 -1
  552. package/lib/util/bufferPool.js +1 -2
  553. package/lib/util/bufferPool.js.map +1 -1
  554. package/lib/util/chunkify.js.map +1 -1
  555. package/lib/util/clock.d.ts +2 -7
  556. package/lib/util/clock.d.ts.map +1 -1
  557. package/lib/util/clock.js +3 -9
  558. package/lib/util/clock.js.map +1 -1
  559. package/lib/util/dataColumns.js +2 -4
  560. package/lib/util/dataColumns.js.map +1 -1
  561. package/lib/util/dependentRoot.js.map +1 -1
  562. package/lib/util/enum.js.map +1 -1
  563. package/lib/util/error.js.map +1 -1
  564. package/lib/util/eventLoop.js.map +1 -1
  565. package/lib/util/execution.js +1 -2
  566. package/lib/util/execution.js.map +1 -1
  567. package/lib/util/file.js.map +1 -1
  568. package/lib/util/forkChoice.js.map +1 -1
  569. package/lib/util/forkName.js.map +1 -1
  570. package/lib/util/graffiti.js.map +1 -1
  571. package/lib/util/hex.js.map +1 -1
  572. package/lib/util/ip.js.map +1 -1
  573. package/lib/util/itTrigger.js.map +1 -1
  574. package/lib/util/map.js.map +1 -1
  575. package/lib/util/metadata.js.map +1 -1
  576. package/lib/util/multifork.js.map +1 -1
  577. package/lib/util/numpy.js.map +1 -1
  578. package/lib/util/peerId.js.map +1 -1
  579. package/lib/util/profile.js +1 -2
  580. package/lib/util/profile.js.map +1 -1
  581. package/lib/util/promises.js.map +1 -1
  582. package/lib/util/queue/errors.js +1 -2
  583. package/lib/util/queue/errors.js.map +1 -1
  584. package/lib/util/queue/fnQueue.js.map +1 -1
  585. package/lib/util/queue/itemQueue.d.ts.map +1 -1
  586. package/lib/util/queue/itemQueue.js.map +1 -1
  587. package/lib/util/queue/options.js +1 -2
  588. package/lib/util/queue/options.js.map +1 -1
  589. package/lib/util/serializedCache.js.map +1 -1
  590. package/lib/util/set.js.map +1 -1
  591. package/lib/util/shuffle.js.map +1 -1
  592. package/lib/util/sortBy.js.map +1 -1
  593. package/lib/util/sszBytes.js.map +1 -1
  594. package/lib/util/time.js.map +1 -1
  595. package/lib/util/timeSeries.js.map +1 -1
  596. package/lib/util/types.d.ts.map +1 -1
  597. package/lib/util/workerEvents.d.ts +8 -2
  598. package/lib/util/workerEvents.d.ts.map +1 -1
  599. package/lib/util/workerEvents.js +17 -5
  600. package/lib/util/workerEvents.js.map +1 -1
  601. package/lib/util/wrapError.js.map +1 -1
  602. package/package.json +17 -17
  603. package/src/api/impl/beacon/blocks/index.ts +65 -16
  604. package/src/api/impl/config/constants.ts +4 -0
  605. package/src/api/impl/validator/index.ts +20 -7
  606. package/src/chain/blocks/importBlock.ts +3 -2
  607. package/src/chain/blocks/importExecutionPayload.ts +8 -4
  608. package/src/chain/blocks/index.ts +7 -0
  609. package/src/chain/blocks/utils/chainSegment.ts +35 -28
  610. package/src/chain/blocks/utils/polarBearBanner.ts +50 -0
  611. package/src/chain/blocks/verifyBlock.ts +28 -2
  612. package/src/chain/chain.ts +60 -0
  613. package/src/chain/emitter.ts +7 -0
  614. package/src/chain/errors/executionPayloadBid.ts +12 -4
  615. package/src/chain/interface.ts +3 -0
  616. package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
  617. package/src/chain/options.ts +3 -0
  618. package/src/chain/prepareNextSlot.ts +141 -40
  619. package/src/chain/produceBlock/produceBlockBody.ts +27 -10
  620. package/src/chain/seenCache/seenBlockProposers.ts +72 -5
  621. package/src/chain/seenCache/seenExecutionPayloadBids.ts +22 -9
  622. package/src/chain/validation/block.ts +41 -19
  623. package/src/chain/validation/dataColumnSidecar.ts +27 -17
  624. package/src/chain/validation/executionPayloadBid.ts +92 -28
  625. package/src/execution/engine/interface.ts +1 -1
  626. package/src/execution/engine/types.ts +1 -1
  627. package/src/metrics/metrics/lodestar.ts +40 -1
  628. package/src/network/core/networkCore.ts +13 -1
  629. package/src/network/core/networkCoreWorkerHandler.ts +18 -3
  630. package/src/network/gossip/topic.ts +4 -2
  631. package/src/network/network.ts +16 -1
  632. package/src/network/processor/gossipHandlers.ts +7 -0
  633. package/src/network/processor/index.ts +2 -1
  634. package/src/network/reqresp/handlers/lightClientFinalityUpdate.ts +1 -1
  635. package/src/network/reqresp/handlers/lightClientOptimisticUpdate.ts +1 -1
  636. package/src/network/reqresp/handlers/lightClientUpdatesByRange.ts +6 -2
  637. package/src/network/reqresp/protocols.ts +39 -11
  638. package/src/network/reqresp/rateLimit.ts +1 -1
  639. package/src/network/reqresp/score.ts +22 -3
  640. package/src/sync/constants.ts +6 -5
  641. package/src/sync/range/batch.ts +50 -12
  642. package/src/sync/range/chain.ts +36 -16
  643. package/src/sync/range/utils/batches.ts +44 -0
  644. package/src/util/clock.ts +2 -7
  645. package/src/util/workerEvents.ts +18 -6
@@ -130,6 +130,7 @@ import {CPStateDatastore} from "./stateCache/datastore/types.js";
130
130
  import {FIFOBlockStateCache} from "./stateCache/fifoBlockStateCache.js";
131
131
  import {PersistentCheckpointStateCache} from "./stateCache/persistentCheckpointsCache.js";
132
132
  import {CheckpointStateCache} from "./stateCache/types.js";
133
+ import {validateApiProposerSlashing} from "./validation/proposerSlashing.js";
133
134
  import {ValidatorMonitor} from "./validatorMonitor.js";
134
135
 
135
136
  /**
@@ -200,6 +201,8 @@ export class BeaconChain implements IBeaconChain {
200
201
  readonly seenAggregatedAttestations: SeenAggregatedAttestations;
201
202
  readonly seenExecutionPayloadBids = new SeenExecutionPayloadBids();
202
203
  readonly seenBlockProposers = new SeenBlockProposers();
204
+ /** Proposer indexes with an in-flight proposer slashing production */
205
+ private readonly producingProposerSlashing = new Set<ValidatorIndex>();
203
206
  readonly seenSyncCommitteeMessages = new SeenSyncCommitteeMessages();
204
207
  readonly seenContributionAndProof: SeenContributionAndProof;
205
208
  readonly seenAttestationDatas: SeenAttestationDatas;
@@ -1163,6 +1166,63 @@ export class BeaconChain implements IBeaconChain {
1163
1166
  return this.payloadEnvelopeProcessor.processPayloadEnvelopeJob(payloadInput, opts);
1164
1167
  }
1165
1168
 
1169
+ processProposerEquivocation(blockSlot: Slot, proposerIndex: ValidatorIndex): void {
1170
+ this.produceProposerSlashing(blockSlot, proposerIndex).catch((e) => {
1171
+ this.logger.debug("Error producing proposer slashing", {slot: blockSlot, proposerIndex}, e as Error);
1172
+ });
1173
+ }
1174
+
1175
+ /** Produce a proposer slashing from two conflicting signed block headers observed for the same slot and proposer */
1176
+ private async produceProposerSlashing(blockSlot: Slot, proposerIndex: ValidatorIndex): Promise<void> {
1177
+ if (this.opts.disableProposerSlashings === true || this.producingProposerSlashing.has(proposerIndex)) {
1178
+ return;
1179
+ }
1180
+
1181
+ if (this.opPool.hasSeenProposerSlashing(proposerIndex)) {
1182
+ this.logger.debug("Not producing proposer slashing, already in the op pool", {
1183
+ slot: blockSlot,
1184
+ proposerIndex,
1185
+ });
1186
+ return;
1187
+ }
1188
+
1189
+ const headers = this.seenBlockProposers.getEquivocationHeaders(blockSlot, proposerIndex);
1190
+ if (headers === null) {
1191
+ return;
1192
+ }
1193
+
1194
+ this.producingProposerSlashing.add(proposerIndex);
1195
+ try {
1196
+ const [header1, header2] = headers;
1197
+ // ProposerSlashing uses the bigint variant of the signed block header, see types package for details
1198
+ const proposerSlashing: phase0.ProposerSlashing = {
1199
+ signedHeader1: {
1200
+ message: {...header1.message, slot: BigInt(header1.message.slot)},
1201
+ signature: header1.signature,
1202
+ },
1203
+ signedHeader2: {
1204
+ message: {...header2.message, slot: BigInt(header2.message.slot)},
1205
+ signature: header2.signature,
1206
+ },
1207
+ };
1208
+
1209
+ try {
1210
+ await validateApiProposerSlashing(this, proposerSlashing);
1211
+ } catch (e) {
1212
+ this.logger.debug("Produced proposer slashing is not valid", {slot: blockSlot, proposerIndex}, e as Error);
1213
+ return;
1214
+ }
1215
+
1216
+ this.opPool.insertProposerSlashing(proposerSlashing);
1217
+ this.emitter.emit(routes.events.EventType.proposerSlashing, proposerSlashing);
1218
+ this.emitter.emit(ChainEvent.publishProposerSlashing, proposerSlashing);
1219
+ this.metrics?.opPool.proposerSlashingsProduced.inc();
1220
+ this.logger.info("Produced proposer slashing from observed equivocation", {slot: blockSlot, proposerIndex});
1221
+ } finally {
1222
+ this.producingProposerSlashing.delete(proposerIndex);
1223
+ }
1224
+ }
1225
+
1166
1226
  getStatus(): Status {
1167
1227
  const head = this.forkChoice.getHead();
1168
1228
  const finalizedCheckpoint = this.forkChoice.getFinalizedCheckpoint();
@@ -50,6 +50,11 @@ export enum ChainEvent {
50
50
  * and are ready to be published.
51
51
  */
52
52
  publishBlobSidecars = "publishBlobSidecars",
53
+ /**
54
+ * This event signals that a proposer slashing has been produced from an observed equivocation
55
+ * and is ready to be published.
56
+ */
57
+ publishProposerSlashing = "publishProposerSlashing",
53
58
  /**
54
59
  * Trigger an update of status so reqresp by peers have current earliestAvailableSlot
55
60
  */
@@ -110,6 +115,8 @@ export type IChainEvents = ApiEvents & {
110
115
 
111
116
  [ChainEvent.publishBlobSidecars]: (sidecars: deneb.BlobSidecar[]) => void;
112
117
 
118
+ [ChainEvent.publishProposerSlashing]: (proposerSlashing: phase0.ProposerSlashing) => void;
119
+
113
120
  [ChainEvent.updateStatus]: () => void;
114
121
 
115
122
  // Sync events that are chain->chain. Initiated from network requests but do not cross the network
@@ -5,6 +5,7 @@ export enum ExecutionPayloadBidErrorCode {
5
5
  BUILDER_NOT_ELIGIBLE = "EXECUTION_PAYLOAD_BID_ERROR_BUILDER_NOT_ELIGIBLE",
6
6
  INVALID_BUILDER_VERSION = "EXECUTION_PAYLOAD_BID_ERROR_INVALID_BUILDER_VERSION",
7
7
  NON_ZERO_EXECUTION_PAYMENT = "EXECUTION_PAYLOAD_BID_ERROR_NON_ZERO_EXECUTION_PAYMENT",
8
+ INCOMPATIBLE_WITH_HEAD = "EXECUTION_PAYLOAD_BID_ERROR_INCOMPATIBLE_WITH_HEAD",
8
9
  BID_ALREADY_KNOWN = "EXECUTION_PAYLOAD_BID_ERROR_BID_ALREADY_KNOWN",
9
10
  BID_TOO_LOW = "EXECUTION_PAYLOAD_BID_ERROR_BID_TOO_LOW",
10
11
  BID_TOO_HIGH = "EXECUTION_PAYLOAD_BID_ERROR_BID_TOO_HIGH",
@@ -31,7 +32,14 @@ export type ExecutionPayloadBidErrorType =
31
32
  | {
32
33
  code: ExecutionPayloadBidErrorCode.NON_ZERO_EXECUTION_PAYMENT;
33
34
  builderIndex: BuilderIndex;
34
- executionPayment: number;
35
+ executionPayment: bigint;
36
+ }
37
+ | {
38
+ code: ExecutionPayloadBidErrorCode.INCOMPATIBLE_WITH_HEAD;
39
+ slot: Slot;
40
+ parentBlockRoot: RootHex;
41
+ parentBlockHash: RootHex;
42
+ headBlockRoot: RootHex;
35
43
  }
36
44
  | {
37
45
  code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN;
@@ -73,9 +81,9 @@ export type ExecutionPayloadBidErrorType =
73
81
  | {
74
82
  code: ExecutionPayloadBidErrorCode.PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH;
75
83
  builderIndex: BuilderIndex;
76
- bidGasLimit: number;
77
- parentGasLimit: number;
78
- targetGasLimit: number;
84
+ bidGasLimit: bigint;
85
+ parentGasLimit: bigint;
86
+ targetGasLimit: bigint;
79
87
  };
80
88
 
81
89
  export class ExecutionPayloadBidError extends GossipActionError<ExecutionPayloadBidErrorType> {}
@@ -262,6 +262,9 @@ export interface IBeaconChain {
262
262
  /** Process execution payload envelope: verify, import to fork choice, and persist to DB */
263
263
  processExecutionPayload(payloadInput: PayloadEnvelopeInput, opts?: ImportPayloadOpts): Promise<void>;
264
264
 
265
+ /** Produce and publish a proposer slashing from an observed equivocation. Does not throw, only logs errors */
266
+ processProposerEquivocation(blockSlot: Slot, proposerIndex: ValidatorIndex): void;
267
+
265
268
  getStatus(): Status;
266
269
 
267
270
  recomputeForkChoiceHead(caller: ForkchoiceCaller): ProtoBlock;
@@ -433,7 +433,7 @@ export class AggregatedAttestationPool {
433
433
  );
434
434
  } else {
435
435
  const attestationGroupsByIndex = this.attestationGroupByIndexByDataHexBySlot.get(bySlot);
436
- if (!attestationGroupsByIndex) throw Error(`No attestations for slot ${bySlot}`);
436
+ if (!attestationGroupsByIndex) return [];
437
437
  attestationGroupsArr = Array.from(attestationGroupsByIndex.values());
438
438
  }
439
439
 
@@ -37,6 +37,8 @@ export type IChainOptions = BlockProcessOpts &
37
37
  suggestedFeeRecipient: string;
38
38
  graffitiAppend?: boolean;
39
39
  maxSkipSlots?: number;
40
+ /** Do not produce proposer slashings from observed equivocations and do not include proposer slashings in produced blocks */
41
+ disableProposerSlashings?: boolean;
40
42
  /** Ensure blobs returned by the execution engine are valid */
41
43
  sanityCheckExecutionEngineBlobs?: boolean;
42
44
  /** Max number of produced blobs by local validators to cache */
@@ -122,6 +124,7 @@ export const defaultChainOptions: IChainOptions = {
122
124
  // for gossip block validation, it's unlikely we see a reorg with 32 slots
123
125
  // for attestation validation, having this value ensures we don't have to regen states most of the time
124
126
  maxSkipSlots: 32,
127
+ disableProposerSlashings: false,
125
128
  broadcastValidationStrictness: "warn",
126
129
  // should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
127
130
  // batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
@@ -1,19 +1,29 @@
1
1
  import {routes} from "@lodestar/api";
2
2
  import {ChainForkConfig} from "@lodestar/config";
3
- import {getSafeExecutionBlockHash} from "@lodestar/fork-choice";
4
- import {ForkPostBellatrix, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix, isForkPostGloas} from "@lodestar/params";
3
+ import {getFinalizedExecutionBlockHash, getSafeExecutionBlockHash} from "@lodestar/fork-choice";
5
4
  import {
5
+ ForkPostBellatrix,
6
+ ForkSeq,
7
+ SLOTS_PER_EPOCH,
8
+ isForkPostBellatrix,
9
+ isForkPostFulu,
10
+ isForkPostGloas,
11
+ } from "@lodestar/params";
12
+ import {
13
+ GLOAS_PREVERIFY_WINDOW_EPOCHS,
6
14
  IBeaconStateView,
7
15
  IBeaconStateViewBellatrix,
16
+ MAX_BUILDER_DEPOSITS_PER_SLOT,
8
17
  StateHashTreeRootSource,
9
18
  computeEpochAtSlot,
10
19
  computeTimeAtSlot,
11
20
  isStatePostBellatrix,
21
+ isStatePostFulu,
12
22
  isStatePostGloas,
13
23
  } from "@lodestar/state-transition";
14
- import {Bytes32, Slot} from "@lodestar/types";
24
+ import {Bytes32, Slot, ValidatorIndex} from "@lodestar/types";
15
25
  import {Logger, fromHex, isErrorAborted, sleep} from "@lodestar/utils";
16
- import {GENESIS_SLOT, ZERO_HASH_HEX} from "../constants/constants.js";
26
+ import {GENESIS_SLOT} from "../constants/constants.js";
17
27
  import {BuilderStatus} from "../execution/builder/http.js";
18
28
  import {Metrics} from "../metrics/index.js";
19
29
  import {ClockEvent} from "../util/clock.js";
@@ -30,6 +40,11 @@ export const PREPARE_NEXT_SLOT_BPS = 6667;
30
40
  /* We don't want to do more epoch transition than this */
31
41
  const PREPARE_EPOCH_LIMIT = 1;
32
42
 
43
+ /* Fraction of a slot (out of 10_000) the pre-Gloas builder-deposit pre-verify may spend per tick.
44
+ * 2000 = 20% of slot (2.4s on mainnet), within the spare window left after PREPARE_NEXT_SLOT_BPS.
45
+ * Expressed in bps so it scales with slot duration (mainnet vs minimal/devnet). */
46
+ const BUILDER_PREVERIFY_LIMIT_BPS = 2000;
47
+
33
48
  /**
34
49
  * At Bellatrix, if we are responsible for proposing in next slot, we want to prepare payload
35
50
  * 4s before the start of next slot at PREPARE_NEXT_SLOT_BPS of the current slot.
@@ -110,30 +125,38 @@ export class PrepareNextSlotScheduler {
110
125
  ? this.metrics?.precomputeNextEpochTransition.duration.startTimer()
111
126
  : null;
112
127
  const start = Date.now();
128
+ let feeRecipient: string | undefined;
113
129
  // No need to wait for this or the clock drift
114
- // Pre Bellatrix: we only do precompute state transition for the last slot of epoch
115
- // For Bellatrix, we always do the `processSlots()` to prepare payload for the next slot
116
- const prepareState = await this.chain.regen.getBlockSlotState(
117
- headBlock,
118
- prepareSlot,
119
- // the slot 0 of next epoch will likely use this Previous Root Checkpoint state for state transition so we transfer cache here
120
- // the resulting state with cache will be cached in Checkpoint State Cache which is used for the upcoming block processing
121
- // for other slots dontTransferCached=true because we don't run state transition on this state
122
- {dontTransferCache: !isEpochTransition},
123
- RegenCaller.precomputeEpoch
124
- );
125
-
126
130
  if (isForkPostBellatrix(fork)) {
127
- const proposerIndex = prepareState.getBeaconProposer(prepareSlot);
128
- const feeRecipient = this.chain.beaconProposerCache.get(proposerIndex);
129
- let updatedPrepareState = prepareState;
131
+ let preparedState: IBeaconStateView | undefined;
132
+
133
+ const getProposerIndex = async (): Promise<ValidatorIndex> => {
134
+ if (isForkPostFulu(fork)) {
135
+ // getBeaconProposer covers the current + next epoch; should not throw
136
+ // PROPOSER_EPOCH_MISMATCH here due to the PREPARE_EPOCH_LIMIT check above.
137
+ return this.chain.getHeadState().getBeaconProposer(prepareSlot);
138
+ }
139
+ // the slot 0 of next epoch will likely use this Previous Root Checkpoint state for state transition so we transfer cache here
140
+ // the resulting state with cache will be cached in Checkpoint State Cache which is used for the upcoming block processing
141
+ // for other slots dontTransferCached=true because we don't run state transition on this state
142
+ preparedState = await this.chain.regen.getBlockSlotState(
143
+ headBlock,
144
+ prepareSlot,
145
+ {dontTransferCache: !isEpochTransition},
146
+ RegenCaller.precomputeEpoch
147
+ );
148
+ return preparedState.getBeaconProposer(prepareSlot);
149
+ };
150
+
151
+ const proposerIndex = await getProposerIndex();
152
+ feeRecipient = this.chain.beaconProposerCache.get(proposerIndex);
130
153
 
131
154
  if (feeRecipient) {
132
155
  // If we are proposing next slot, we need to predict if we can proposer-boost-reorg or not
133
156
  const proposerHead = this.chain.predictProposerHead(clockSlot);
134
157
  const {slot: proposerHeadSlot, blockRoot: proposerHeadRoot} = proposerHead;
135
158
 
136
- // If we predict we can reorg, update prepareState with proposer head block
159
+ // If we predict we can reorg, we build on the proposer head (parent) block instead
137
160
  if (proposerHeadRoot !== headRoot || proposerHeadSlot !== headSlot) {
138
161
  this.logger.verbose("Weak head detected. May build on parent block instead", {
139
162
  proposerHeadSlot,
@@ -142,13 +165,6 @@ export class PrepareNextSlotScheduler {
142
165
  headRoot,
143
166
  });
144
167
  this.metrics?.weakHeadDetected.inc();
145
- updatedPrepareState = await this.chain.regen.getBlockSlotState(
146
- proposerHead,
147
- prepareSlot,
148
- // only transfer cache if epoch transition because that's the state we will use to stateTransition() the 1st block of epoch
149
- {dontTransferCache: !isEpochTransition},
150
- RegenCaller.predictProposerHead
151
- );
152
168
  updatedHead = proposerHead;
153
169
  }
154
170
 
@@ -165,30 +181,41 @@ export class PrepareNextSlotScheduler {
165
181
  }
166
182
  }
167
183
 
168
- if (!isStatePostBellatrix(updatedPrepareState)) {
184
+ // post-fulu we'll always reach here because preparedState is undefined
185
+ if (preparedState === undefined || updatedHead !== headBlock) {
186
+ preparedState = await this.chain.regen.getBlockSlotState(
187
+ updatedHead,
188
+ prepareSlot,
189
+ // only transfer cache if epoch transition because that's the state we will use to stateTransition() the 1st block of epoch
190
+ {dontTransferCache: !isEpochTransition},
191
+ updatedHead === headBlock ? RegenCaller.precomputeEpoch : RegenCaller.predictProposerHead
192
+ );
193
+ }
194
+
195
+ if (!isStatePostBellatrix(preparedState)) {
169
196
  throw new Error("Expected Bellatrix state for payload attributes");
170
197
  }
171
198
 
172
199
  let parentBlockHash: Bytes32;
173
200
  // Apply parent payload once here as it's reused by EL prep and SSE emit below
174
- let stateAfterParentPayload: IBeaconStateViewBellatrix = updatedPrepareState;
175
- if (isStatePostGloas(updatedPrepareState)) {
176
- // Spec: should_build_on_full(store, head) see produceBlockBody.ts for context.
201
+ let stateAfterParentPayload: IBeaconStateViewBellatrix = preparedState;
202
+ if (isStatePostGloas(preparedState)) {
203
+ // Spec: should_build_on_full(store, head, slot) - see produceBlockBody.ts for context.
177
204
  if (this.chain.forkChoice.shouldBuildOnFull(updatedHead, prepareSlot)) {
178
- parentBlockHash = updatedPrepareState.latestExecutionPayloadBid.blockHash;
205
+ parentBlockHash = preparedState.latestExecutionPayloadBid.blockHash;
179
206
  // Skip applying parent payload unless we're proposing the next slot or have to emit payload_attributes events
180
207
  if (feeRecipient !== undefined || this.chain.opts.emitPayloadAttributes === true) {
181
208
  const parentExecutionRequests = await this.chain.getParentExecutionRequests(
182
209
  updatedHead.slot,
183
210
  updatedHead.blockRoot
184
211
  );
185
- stateAfterParentPayload = updatedPrepareState.withParentPayloadApplied(parentExecutionRequests);
212
+ stateAfterParentPayload = preparedState.withParentPayloadApplied(parentExecutionRequests);
186
213
  }
187
214
  } else {
188
- parentBlockHash = updatedPrepareState.latestExecutionPayloadBid.parentBlockHash;
215
+ parentBlockHash = preparedState.latestExecutionPayloadBid.parentBlockHash;
189
216
  }
190
217
  } else {
191
- parentBlockHash = updatedPrepareState.latestExecutionPayloadHeader.blockHash;
218
+ parentBlockHash = preparedState.latestExecutionPayloadHeader.blockHash;
192
219
  }
193
220
 
194
221
  if (feeRecipient) {
@@ -196,9 +223,8 @@ export class PrepareNextSlotScheduler {
196
223
  computeTimeAtSlot(this.config, prepareSlot, this.chain.genesisTime) - Date.now() / 1000;
197
224
  this.metrics?.blockPayload.payloadAdvancePrepTime.observe(preparationTime);
198
225
 
199
- const safeBlockHash = getSafeExecutionBlockHash(this.chain.forkChoice);
200
- const finalizedBlockHash =
201
- this.chain.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
226
+ const safeBlockHash = getSafeExecutionBlockHash(this.chain.forkChoice, this.logger);
227
+ const finalizedBlockHash = getFinalizedExecutionBlockHash(this.chain.forkChoice, this.logger);
202
228
 
203
229
  // awaiting here instead of throwing an async call because there is no other task
204
230
  // left for scheduler and this gives nice semantics to catch and log errors in the
@@ -221,7 +247,7 @@ export class PrepareNextSlotScheduler {
221
247
  });
222
248
  }
223
249
 
224
- this.computeStateHashTreeRoot(updatedPrepareState, isEpochTransition);
250
+ this.computeStateHashTreeRoot(preparedState, isEpochTransition);
225
251
 
226
252
  // If emitPayloadAttributes is true emit a SSE payloadAttributes event for
227
253
  // every slot. Without the flag, only emit the event if we are proposing in the next slot.
@@ -239,7 +265,14 @@ export class PrepareNextSlotScheduler {
239
265
  this.chain.emitter.emit(routes.events.EventType.payloadAttributes, {data, version: fork});
240
266
  }
241
267
  } else {
242
- this.computeStateHashTreeRoot(prepareState, isEpochTransition);
268
+ // Pre-bellatrix only reaches here at an epoch transition to precompute the next epoch state
269
+ const preparedState = await this.chain.regen.getBlockSlotState(
270
+ headBlock,
271
+ prepareSlot,
272
+ {dontTransferCache: !isEpochTransition},
273
+ RegenCaller.precomputeEpoch
274
+ );
275
+ this.computeStateHashTreeRoot(preparedState, isEpochTransition);
243
276
  }
244
277
 
245
278
  // assuming there is no reorg, it caches the checkpoint state & helps avoid doing a full state transition in the next slot
@@ -262,6 +295,74 @@ export class PrepareNextSlotScheduler {
262
295
  });
263
296
 
264
297
  precomputeEpochTransitionTimer?.();
298
+
299
+ // Nothing more to do on an epoch-transition slot: that precompute already ran a full (>1s)
300
+ // epoch transition, so we don't pile the builder-deposit pre-verify (below) on top of it.
301
+ return;
302
+ }
303
+
304
+ // Pre-verify builder-deposit signatures in the GLOAS_PREVERIFY_WINDOW_EPOCHS epochs leading
305
+ // up to the Gloas fork, off the block-import hot path, so onboardBuildersFromPendingDeposits
306
+ // at the transition is mostly cache hits. Reached only on non-epoch-transition slots (the
307
+ // epoch-transition branch returned above). Runs on the head state — its pendingDeposits are
308
+ // what the fork transition derives from, and its epochCtx holds the shared, app-wide
309
+ // builderDepositSignatureCache.
310
+ const headState = this.chain.getHeadState();
311
+ if (isStatePostFulu(headState)) {
312
+ const gloasEpoch = this.config.GLOAS_FORK_EPOCH;
313
+ const finalizedEpoch = this.chain.forkChoice.getFinalizedCheckpoint().epoch;
314
+ if (finalizedEpoch >= gloasEpoch) {
315
+ // Gloas is finalized — the pre-verify cache has served its purpose; release its memory.
316
+ headState.clearPreGloasBuilderDepositCache();
317
+ } else {
318
+ const clockEpoch = computeEpochAtSlot(clockSlot);
319
+ if (
320
+ ForkSeq[fork] < ForkSeq.gloas && // only before the fork
321
+ clockEpoch >= gloasEpoch - GLOAS_PREVERIFY_WINDOW_EPOCHS && // Infinity when Gloas unscheduled → skip
322
+ clockEpoch < gloasEpoch &&
323
+ // skip when we're the next-slot proposer — don't compete with block-production prep.
324
+ feeRecipient === undefined
325
+ ) {
326
+ const maxDurationMs = this.config.getSlotComponentDurationMs(BUILDER_PREVERIFY_LIMIT_BPS);
327
+ const preVerifyTimer = this.metrics?.builderDepositPreVerify.duration.startTimer();
328
+ const result = headState.preVerifyBuilderDepositsPreGloas(MAX_BUILDER_DEPOSITS_PER_SLOT, maxDurationMs);
329
+ preVerifyTimer?.();
330
+
331
+ const preVerifyMetrics = this.metrics?.builderDepositPreVerify;
332
+ if (preVerifyMetrics) {
333
+ preVerifyMetrics.pendingDeposits.set(result.pendingDepositsCount);
334
+ preVerifyMetrics.cachedDeposits.set(result.totalCachedDeposits);
335
+ preVerifyMetrics.scannedDeposits.set(result.scannedPendingDeposits);
336
+ preVerifyMetrics.builderPubkeys.set(result.totalBuilderPubkeys);
337
+ if (result.validBuilderSignaturesCount > 0) {
338
+ preVerifyMetrics.validSignatures.inc({type: "builder"}, result.validBuilderSignaturesCount);
339
+ }
340
+ if (result.validValidatorSignaturesCount > 0) {
341
+ preVerifyMetrics.validSignatures.inc({type: "validator"}, result.validValidatorSignaturesCount);
342
+ }
343
+ if (result.invalidBuilderSignaturesCount > 0) {
344
+ preVerifyMetrics.invalidSignatures.inc({type: "builder"}, result.invalidBuilderSignaturesCount);
345
+ }
346
+ if (result.invalidValidatorSignaturesCount > 0) {
347
+ preVerifyMetrics.invalidSignatures.inc({type: "validator"}, result.invalidValidatorSignaturesCount);
348
+ }
349
+ }
350
+
351
+ // Always log (once per slot, only within the pre-fork window) so devnets show the
352
+ // pre-verify draining even on all-cache-hit ticks.
353
+ this.logger.verbose("PrepareNextSlotScheduler pre-verified deposit signatures", {
354
+ clockSlot,
355
+ validBuilderSignaturesCount: result.validBuilderSignaturesCount,
356
+ invalidBuilderSignaturesCount: result.invalidBuilderSignaturesCount,
357
+ validValidatorSignaturesCount: result.validValidatorSignaturesCount,
358
+ invalidValidatorSignaturesCount: result.invalidValidatorSignaturesCount,
359
+ scannedPendingDeposits: result.scannedPendingDeposits,
360
+ totalCachedDeposits: result.totalCachedDeposits,
361
+ totalBuilderPubkeys: result.totalBuilderPubkeys,
362
+ pendingDepositsCount: result.pendingDepositsCount,
363
+ });
364
+ }
365
+ }
265
366
  }
266
367
  } catch (e) {
267
368
  if (!isErrorAborted(e) && !isQueueErrorAborted(e)) {
@@ -1,5 +1,11 @@
1
+ import {BitArray} from "@chainsafe/ssz";
1
2
  import {ChainForkConfig} from "@lodestar/config";
2
- import {IForkChoice, ProtoBlock, getSafeExecutionBlockHash} from "@lodestar/fork-choice";
3
+ import {
4
+ IForkChoice,
5
+ ProtoBlock,
6
+ getFinalizedExecutionBlockHash,
7
+ getSafeExecutionBlockHash,
8
+ } from "@lodestar/fork-choice";
3
9
  import {
4
10
  BUILDER_INDEX_SELF_BUILD,
5
11
  ForkName,
@@ -10,6 +16,7 @@ import {
10
16
  ForkPostGloas,
11
17
  ForkPreGloas,
12
18
  ForkSeq,
19
+ INCLUSION_LIST_COMMITTEE_SIZE,
13
20
  isForkPostAltair,
14
21
  isForkPostBellatrix,
15
22
  isForkPostGloas,
@@ -49,6 +56,7 @@ import {
49
56
  electra,
50
57
  fulu,
51
58
  gloas,
59
+ heze,
52
60
  ssz,
53
61
  } from "@lodestar/types";
54
62
  import {GWEI_TO_WEI, Logger, byteArrayEquals, fromHex, sleep, toHex, toPubkeyHex, toRootHex} from "@lodestar/utils";
@@ -262,8 +270,8 @@ export async function produceBlockBody<T extends BlockType>(
262
270
  // TODO GLOAS: support non self-building here, the block type differentiation between
263
271
  // full and blinded no longer makes sense in gloas, it might be a good idea to move
264
272
  // this into a completely separate function and have pre/post gloas more separated
265
- const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
266
- const finalizedBlockHash = this.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
273
+ const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice, this.logger);
274
+ const finalizedBlockHash = getFinalizedExecutionBlockHash(this.forkChoice, this.logger);
267
275
  // TODO GLOAS: post-Gloas, proposer feeRecipient is also carried (signed) in
268
276
  // ProposerPreferencesPool. Consider using this unified cache instead
269
277
  // see https://github.com/ChainSafe/lodestar/issues/9379
@@ -276,7 +284,7 @@ export async function produceBlockBody<T extends BlockType>(
276
284
  let parentExecutionRequests: gloas.ExecutionRequests;
277
285
  // Apply parent payload once here as it's reused by EL prep and voluntary exit filtering below
278
286
  let stateAfterParentPayload: IBeaconStateViewBellatrix = currentState;
279
- // Spec: should_build_on_full(store, head). `parentBlock` is the proposer's head
287
+ // Spec: should_build_on_full(store, head, slot). `parentBlock` is the proposer's head
280
288
  // (set by chain.getProposerHead(slot)). Returns false when the PTC majority signalled
281
289
  // the blob data is not available or the payload was not timely, forcing a build on EMPTY (reorg).
282
290
  const isBuildingOnFull = this.forkChoice.shouldBuildOnFull(parentBlock, blockSlot);
@@ -349,10 +357,14 @@ export async function produceBlockBody<T extends BlockType>(
349
357
  builderIndex: BUILDER_INDEX_SELF_BUILD,
350
358
  slot: blockSlot,
351
359
  value: 0,
352
- executionPayment: 0,
360
+ executionPayment: 0n,
353
361
  blobKzgCommitments: blobsBundle.commitments,
354
362
  executionRequestsRoot: ssz.gloas.ExecutionRequests.hashTreeRoot(executionRequests as gloas.ExecutionRequests),
355
363
  };
364
+ if (ForkSeq[fork] >= ForkSeq.heze) {
365
+ // TODO HEZE: populate from inclusion list pool once IL aggregation is wired up.
366
+ (bid as heze.ExecutionPayloadBid).inclusionListBits = BitArray.fromBitLen(INCLUSION_LIST_COMMITTEE_SIZE);
367
+ }
356
368
  const signedBid: gloas.SignedExecutionPayloadBid = {
357
369
  message: bid,
358
370
  signature: G2_POINT_AT_INFINITY,
@@ -404,8 +416,8 @@ export async function produceBlockBody<T extends BlockType>(
404
416
  throw new Error("Expected Bellatrix state for execution block production");
405
417
  }
406
418
 
407
- const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice);
408
- const finalizedBlockHash = this.forkChoice.getFinalizedBlock().executionPayloadBlockHash ?? ZERO_HASH_HEX;
419
+ const safeBlockHash = getSafeExecutionBlockHash(this.forkChoice, this.logger);
420
+ const finalizedBlockHash = getFinalizedExecutionBlockHash(this.forkChoice, this.logger);
409
421
  const feeRecipient = requestedFeeRecipient ?? this.beaconProposerCache.getOrDefault(proposerIndex);
410
422
  const feeRecipientType = requestedFeeRecipient
411
423
  ? "requested"
@@ -927,6 +939,11 @@ function preparePayloadAttributes(
927
939
  );
928
940
  }
929
941
 
942
+ if (ForkSeq[fork] >= ForkSeq.heze) {
943
+ // TODO HEZE: populate from inclusion list pool once IL aggregation is wired up.
944
+ (payloadAttributes as heze.SSEPayloadAttributes["payloadAttributes"]).inclusionListTransactions = [];
945
+ }
946
+
930
947
  return payloadAttributes;
931
948
  }
932
949
 
@@ -949,7 +966,7 @@ function getProposerTargetGasLimit(
949
966
  prepareSlot: Slot,
950
967
  parentBlockRoot: Root,
951
968
  parentBlockHash: Bytes32
952
- ): number {
969
+ ): bigint {
953
970
  const parentBlockRootHex = toRootHex(parentBlockRoot);
954
971
  const parentBlock = chain.forkChoice.getBlockHexDefaultStatus(parentBlockRootHex);
955
972
  const dependentRootHex = (() => {
@@ -979,7 +996,7 @@ function getProposerTargetGasLimit(
979
996
  `Cannot resolve parent payload gas_limit for proposer targetGasLimit fallback parentBlockRoot=${parentBlockRootHex} parentBlockHash=${toRootHex(parentBlockHash)}`
980
997
  );
981
998
  }
982
- return parentPayloadVariant.executionPayloadGasLimit;
999
+ return BigInt(parentPayloadVariant.executionPayloadGasLimit);
983
1000
  }
984
1001
 
985
1002
  export async function produceCommonBlockBody<T extends BlockType>(
@@ -1025,7 +1042,7 @@ export async function produceCommonBlockBody<T extends BlockType>(
1025
1042
  graffiti,
1026
1043
  // Eth1 data voting is no longer required since electra
1027
1044
  eth1Data: currentState.eth1Data,
1028
- proposerSlashings,
1045
+ proposerSlashings: this.opts.disableProposerSlashings === true ? [] : proposerSlashings,
1029
1046
  attesterSlashings,
1030
1047
  attestations,
1031
1048
  // Since electra, deposits are processed by the execution layer,