@lodestar/beacon-node 1.42.0-dev.5f2fffc2ce → 1.42.0-dev.687ecdc8cd

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 (439) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +36 -17
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/pool/index.js +1 -1
  5. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  6. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  7. package/lib/api/impl/beacon/state/index.js +27 -32
  8. package/lib/api/impl/beacon/state/index.js.map +1 -1
  9. package/lib/api/impl/beacon/state/utils.d.ts +4 -4
  10. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  11. package/lib/api/impl/beacon/state/utils.js +7 -10
  12. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  13. package/lib/api/impl/lodestar/index.d.ts.map +1 -1
  14. package/lib/api/impl/lodestar/index.js +4 -6
  15. package/lib/api/impl/lodestar/index.js.map +1 -1
  16. package/lib/api/impl/proof/index.d.ts.map +1 -1
  17. package/lib/api/impl/proof/index.js +2 -6
  18. package/lib/api/impl/proof/index.js.map +1 -1
  19. package/lib/api/impl/validator/index.d.ts.map +1 -1
  20. package/lib/api/impl/validator/index.js +27 -27
  21. package/lib/api/impl/validator/index.js.map +1 -1
  22. package/lib/api/impl/validator/utils.d.ts +2 -2
  23. package/lib/api/impl/validator/utils.d.ts.map +1 -1
  24. package/lib/api/impl/validator/utils.js +3 -3
  25. package/lib/api/impl/validator/utils.js.map +1 -1
  26. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  27. package/lib/chain/archiveStore/archiveStore.js +1 -0
  28. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  29. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -7
  30. package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
  31. package/lib/chain/archiveStore/historicalState/getHistoricalState.js +8 -26
  32. package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
  33. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
  34. package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
  35. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
  36. package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
  37. package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
  38. package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
  39. package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
  40. package/lib/chain/archiveStore/historicalState/worker.js +1 -3
  41. package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
  42. package/lib/chain/archiveStore/interface.d.ts +1 -0
  43. package/lib/chain/archiveStore/interface.d.ts.map +1 -1
  44. package/lib/chain/balancesCache.d.ts +2 -2
  45. package/lib/chain/balancesCache.d.ts.map +1 -1
  46. package/lib/chain/balancesCache.js +4 -4
  47. package/lib/chain/balancesCache.js.map +1 -1
  48. package/lib/chain/blocks/blockInput/types.d.ts +4 -3
  49. package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
  50. package/lib/chain/blocks/blockInput/types.js +1 -0
  51. package/lib/chain/blocks/blockInput/types.js.map +1 -1
  52. package/lib/chain/blocks/importBlock.d.ts +3 -3
  53. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  54. package/lib/chain/blocks/importBlock.js +39 -23
  55. package/lib/chain/blocks/importBlock.js.map +1 -1
  56. package/lib/chain/blocks/importExecutionPayload.d.ts +48 -0
  57. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -0
  58. package/lib/chain/blocks/importExecutionPayload.js +167 -0
  59. package/lib/chain/blocks/importExecutionPayload.js.map +1 -0
  60. package/lib/chain/blocks/index.d.ts.map +1 -1
  61. package/lib/chain/blocks/index.js +3 -2
  62. package/lib/chain/blocks/index.js.map +1 -1
  63. package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts +3 -0
  64. package/lib/chain/blocks/payloadEnvelopeInput/index.d.ts.map +1 -0
  65. package/lib/chain/blocks/payloadEnvelopeInput/index.js +3 -0
  66. package/lib/chain/blocks/payloadEnvelopeInput/index.js.map +1 -0
  67. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +80 -0
  68. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -0
  69. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +248 -0
  70. package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -0
  71. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +29 -0
  72. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -0
  73. package/lib/chain/blocks/payloadEnvelopeInput/types.js +11 -0
  74. package/lib/chain/blocks/payloadEnvelopeInput/types.js.map +1 -0
  75. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +15 -0
  76. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -0
  77. package/lib/chain/blocks/payloadEnvelopeProcessor.js +46 -0
  78. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -0
  79. package/lib/chain/blocks/types.d.ts +28 -15
  80. package/lib/chain/blocks/types.d.ts.map +1 -1
  81. package/lib/chain/blocks/types.js.map +1 -1
  82. package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
  83. package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
  84. package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
  85. package/lib/chain/blocks/verifyBlock.d.ts +2 -2
  86. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  87. package/lib/chain/blocks/verifyBlock.js +4 -4
  88. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  89. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +5 -5
  90. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  91. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -4
  92. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  93. package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
  94. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  95. package/lib/chain/blocks/verifyBlocksSignatures.js +1 -1
  96. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  97. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
  98. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
  99. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
  100. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  101. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts +12 -0
  102. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -0
  103. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +40 -0
  104. package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -0
  105. package/lib/chain/chain.d.ts +19 -14
  106. package/lib/chain/chain.d.ts.map +1 -1
  107. package/lib/chain/chain.js +75 -42
  108. package/lib/chain/chain.js.map +1 -1
  109. package/lib/chain/emitter.d.ts +2 -2
  110. package/lib/chain/emitter.d.ts.map +1 -1
  111. package/lib/chain/errors/blockError.d.ts +4 -4
  112. package/lib/chain/errors/blockError.d.ts.map +1 -1
  113. package/lib/chain/errors/executionPayloadEnvelope.d.ts +12 -2
  114. package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
  115. package/lib/chain/errors/executionPayloadEnvelope.js +3 -1
  116. package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
  117. package/lib/chain/forkChoice/index.d.ts +4 -4
  118. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  119. package/lib/chain/forkChoice/index.js +27 -33
  120. package/lib/chain/forkChoice/index.js.map +1 -1
  121. package/lib/chain/initState.d.ts +2 -2
  122. package/lib/chain/initState.d.ts.map +1 -1
  123. package/lib/chain/initState.js +1 -1
  124. package/lib/chain/initState.js.map +1 -1
  125. package/lib/chain/interface.d.ts +17 -15
  126. package/lib/chain/interface.d.ts.map +1 -1
  127. package/lib/chain/lightClient/index.d.ts +2 -2
  128. package/lib/chain/lightClient/index.d.ts.map +1 -1
  129. package/lib/chain/lightClient/index.js +4 -4
  130. package/lib/chain/lightClient/index.js.map +1 -1
  131. package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
  132. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  133. package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
  134. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  135. package/lib/chain/opPools/opPool.d.ts +3 -3
  136. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  137. package/lib/chain/opPools/opPool.js +7 -7
  138. package/lib/chain/opPools/opPool.js.map +1 -1
  139. package/lib/chain/opPools/utils.d.ts +2 -2
  140. package/lib/chain/opPools/utils.d.ts.map +1 -1
  141. package/lib/chain/opPools/utils.js +2 -2
  142. package/lib/chain/opPools/utils.js.map +1 -1
  143. package/lib/chain/options.d.ts +1 -0
  144. package/lib/chain/options.d.ts.map +1 -1
  145. package/lib/chain/options.js +1 -0
  146. package/lib/chain/options.js.map +1 -1
  147. package/lib/chain/prepareNextSlot.d.ts +2 -2
  148. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  149. package/lib/chain/prepareNextSlot.js +3 -3
  150. package/lib/chain/prepareNextSlot.js.map +1 -1
  151. package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
  152. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  153. package/lib/chain/produceBlock/computeNewStateRoot.js +8 -4
  154. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  155. package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
  156. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  157. package/lib/chain/produceBlock/produceBlockBody.js +13 -17
  158. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  159. package/lib/chain/regen/interface.d.ts +15 -13
  160. package/lib/chain/regen/interface.d.ts.map +1 -1
  161. package/lib/chain/regen/interface.js +2 -0
  162. package/lib/chain/regen/interface.js.map +1 -1
  163. package/lib/chain/regen/queued.d.ts +14 -14
  164. package/lib/chain/regen/queued.d.ts.map +1 -1
  165. package/lib/chain/regen/queued.js.map +1 -1
  166. package/lib/chain/regen/regen.d.ts +6 -5
  167. package/lib/chain/regen/regen.d.ts.map +1 -1
  168. package/lib/chain/regen/regen.js +6 -6
  169. package/lib/chain/regen/regen.js.map +1 -1
  170. package/lib/chain/seenCache/index.d.ts +1 -1
  171. package/lib/chain/seenCache/index.d.ts.map +1 -1
  172. package/lib/chain/seenCache/index.js +1 -1
  173. package/lib/chain/seenCache/index.js.map +1 -1
  174. package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
  175. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  176. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +38 -0
  177. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -0
  178. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +76 -0
  179. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -0
  180. package/lib/chain/serializeState.d.ts +2 -2
  181. package/lib/chain/serializeState.d.ts.map +1 -1
  182. package/lib/chain/serializeState.js +1 -1
  183. package/lib/chain/serializeState.js.map +1 -1
  184. package/lib/chain/shufflingCache.d.ts +2 -2
  185. package/lib/chain/shufflingCache.d.ts.map +1 -1
  186. package/lib/chain/shufflingCache.js +3 -4
  187. package/lib/chain/shufflingCache.js.map +1 -1
  188. package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
  189. package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
  190. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  191. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
  192. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  193. package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
  194. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  195. package/lib/chain/stateCache/types.d.ts +14 -14
  196. package/lib/chain/stateCache/types.d.ts.map +1 -1
  197. package/lib/chain/stateCache/types.js.map +1 -1
  198. package/lib/chain/validation/attesterSlashing.js +3 -3
  199. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  200. package/lib/chain/validation/blobSidecar.js +1 -1
  201. package/lib/chain/validation/blobSidecar.js.map +1 -1
  202. package/lib/chain/validation/block.d.ts.map +1 -1
  203. package/lib/chain/validation/block.js +3 -3
  204. package/lib/chain/validation/block.js.map +1 -1
  205. package/lib/chain/validation/blsToExecutionChange.js +2 -2
  206. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  207. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  208. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  209. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  210. package/lib/chain/validation/executionPayloadBid.js +4 -4
  211. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  212. package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
  213. package/lib/chain/validation/executionPayloadEnvelope.js +29 -19
  214. package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
  215. package/lib/chain/validation/lightClientFinalityUpdate.js +1 -1
  216. package/lib/chain/validation/lightClientFinalityUpdate.js.map +1 -1
  217. package/lib/chain/validation/lightClientOptimisticUpdate.js +1 -1
  218. package/lib/chain/validation/lightClientOptimisticUpdate.js.map +1 -1
  219. package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
  220. package/lib/chain/validation/payloadAttestationMessage.js +1 -2
  221. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  222. package/lib/chain/validation/proposerSlashing.js +1 -1
  223. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  224. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -2
  225. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
  226. package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
  227. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  228. package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
  229. package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
  230. package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
  231. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  232. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
  233. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
  234. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  235. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
  236. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
  237. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
  238. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  239. package/lib/chain/validation/syncCommittee.d.ts +4 -4
  240. package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
  241. package/lib/chain/validation/syncCommittee.js +13 -12
  242. package/lib/chain/validation/syncCommittee.js.map +1 -1
  243. package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
  244. package/lib/chain/validation/syncCommitteeContributionAndProof.js +1 -1
  245. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  246. package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
  247. package/lib/chain/validation/voluntaryExit.js +3 -3
  248. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  249. package/lib/chain/validatorMonitor.d.ts +5 -4
  250. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  251. package/lib/chain/validatorMonitor.js +13 -8
  252. package/lib/chain/validatorMonitor.js.map +1 -1
  253. package/lib/execution/engine/interface.d.ts +2 -2
  254. package/lib/metrics/metrics/lodestar.d.ts +40 -4
  255. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  256. package/lib/metrics/metrics/lodestar.js +93 -15
  257. package/lib/metrics/metrics/lodestar.js.map +1 -1
  258. package/lib/network/gossip/encoding.d.ts.map +1 -1
  259. package/lib/network/gossip/encoding.js +15 -0
  260. package/lib/network/gossip/encoding.js.map +1 -1
  261. package/lib/network/interface.d.ts +4 -2
  262. package/lib/network/interface.d.ts.map +1 -1
  263. package/lib/network/libp2p/index.d.ts.map +1 -1
  264. package/lib/network/libp2p/index.js +5 -0
  265. package/lib/network/libp2p/index.js.map +1 -1
  266. package/lib/network/network.d.ts +4 -2
  267. package/lib/network/network.d.ts.map +1 -1
  268. package/lib/network/network.js +11 -5
  269. package/lib/network/network.js.map +1 -1
  270. package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
  271. package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
  272. package/lib/network/processor/extractSlotRootFns.js +15 -5
  273. package/lib/network/processor/extractSlotRootFns.js.map +1 -1
  274. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  275. package/lib/network/processor/gossipHandlers.js +39 -9
  276. package/lib/network/processor/gossipHandlers.js.map +1 -1
  277. package/lib/network/processor/index.d.ts +12 -7
  278. package/lib/network/processor/index.d.ts.map +1 -1
  279. package/lib/network/processor/index.js +99 -78
  280. package/lib/network/processor/index.js.map +1 -1
  281. package/lib/network/reqresp/ReqRespBeaconNode.d.ts +1 -1
  282. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  283. package/lib/network/reqresp/ReqRespBeaconNode.js +10 -1
  284. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  285. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
  286. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
  287. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
  288. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
  289. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
  290. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
  291. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
  292. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
  293. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  294. package/lib/network/reqresp/handlers/index.js +11 -1
  295. package/lib/network/reqresp/handlers/index.js.map +1 -1
  296. package/lib/network/reqresp/protocols.d.ts +2 -0
  297. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  298. package/lib/network/reqresp/protocols.js +10 -0
  299. package/lib/network/reqresp/protocols.js.map +1 -1
  300. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  301. package/lib/network/reqresp/rateLimit.js +8 -0
  302. package/lib/network/reqresp/rateLimit.js.map +1 -1
  303. package/lib/network/reqresp/score.d.ts.map +1 -1
  304. package/lib/network/reqresp/score.js +2 -0
  305. package/lib/network/reqresp/score.js.map +1 -1
  306. package/lib/network/reqresp/types.d.ts +8 -2
  307. package/lib/network/reqresp/types.d.ts.map +1 -1
  308. package/lib/network/reqresp/types.js +7 -1
  309. package/lib/network/reqresp/types.js.map +1 -1
  310. package/lib/node/nodejs.d.ts +2 -2
  311. package/lib/node/nodejs.d.ts.map +1 -1
  312. package/lib/node/nodejs.js +1 -4
  313. package/lib/node/nodejs.js.map +1 -1
  314. package/lib/node/notifier.d.ts.map +1 -1
  315. package/lib/node/notifier.js +3 -3
  316. package/lib/node/notifier.js.map +1 -1
  317. package/lib/sync/backfill/backfill.d.ts +3 -3
  318. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  319. package/lib/sync/backfill/backfill.js +3 -3
  320. package/lib/sync/backfill/backfill.js.map +1 -1
  321. package/lib/sync/constants.d.ts +1 -1
  322. package/lib/sync/constants.js +1 -1
  323. package/lib/sync/unknownBlock.d.ts +3 -9
  324. package/lib/sync/unknownBlock.d.ts.map +1 -1
  325. package/lib/sync/unknownBlock.js +8 -41
  326. package/lib/sync/unknownBlock.js.map +1 -1
  327. package/lib/util/sszBytes.d.ts +4 -1
  328. package/lib/util/sszBytes.d.ts.map +1 -1
  329. package/lib/util/sszBytes.js +69 -12
  330. package/lib/util/sszBytes.js.map +1 -1
  331. package/lib/util/types.d.ts +2 -0
  332. package/lib/util/types.d.ts.map +1 -1
  333. package/lib/util/types.js +1 -0
  334. package/lib/util/types.js.map +1 -1
  335. package/package.json +16 -16
  336. package/src/api/impl/beacon/blocks/index.ts +37 -18
  337. package/src/api/impl/beacon/pool/index.ts +1 -1
  338. package/src/api/impl/beacon/state/index.ts +29 -41
  339. package/src/api/impl/beacon/state/utils.ts +11 -25
  340. package/src/api/impl/lodestar/index.ts +4 -8
  341. package/src/api/impl/proof/index.ts +2 -9
  342. package/src/api/impl/validator/index.ts +29 -41
  343. package/src/api/impl/validator/utils.ts +4 -7
  344. package/src/chain/archiveStore/archiveStore.ts +1 -0
  345. package/src/chain/archiveStore/historicalState/getHistoricalState.ts +10 -39
  346. package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
  347. package/src/chain/archiveStore/historicalState/types.ts +2 -0
  348. package/src/chain/archiveStore/historicalState/worker.ts +1 -4
  349. package/src/chain/archiveStore/interface.ts +1 -0
  350. package/src/chain/balancesCache.ts +5 -11
  351. package/src/chain/blocks/blockInput/types.ts +4 -3
  352. package/src/chain/blocks/importBlock.ts +59 -27
  353. package/src/chain/blocks/importExecutionPayload.ts +247 -0
  354. package/src/chain/blocks/index.ts +3 -2
  355. package/src/chain/blocks/payloadEnvelopeInput/index.ts +2 -0
  356. package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +336 -0
  357. package/src/chain/blocks/payloadEnvelopeInput/types.ts +33 -0
  358. package/src/chain/blocks/payloadEnvelopeProcessor.ts +61 -0
  359. package/src/chain/blocks/types.ts +34 -15
  360. package/src/chain/blocks/utils/checkpoint.ts +2 -2
  361. package/src/chain/blocks/verifyBlock.ts +5 -10
  362. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -14
  363. package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
  364. package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
  365. package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +55 -0
  366. package/src/chain/chain.ts +112 -70
  367. package/src/chain/emitter.ts +2 -2
  368. package/src/chain/errors/blockError.ts +4 -4
  369. package/src/chain/errors/executionPayloadEnvelope.ts +6 -2
  370. package/src/chain/forkChoice/index.ts +33 -52
  371. package/src/chain/initState.ts +7 -2
  372. package/src/chain/interface.ts +18 -16
  373. package/src/chain/lightClient/index.ts +9 -22
  374. package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
  375. package/src/chain/opPools/opPool.ts +13 -14
  376. package/src/chain/opPools/utils.ts +4 -4
  377. package/src/chain/options.ts +2 -0
  378. package/src/chain/prepareNextSlot.ts +6 -8
  379. package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
  380. package/src/chain/produceBlock/produceBlockBody.ts +23 -50
  381. package/src/chain/regen/interface.ts +15 -17
  382. package/src/chain/regen/queued.ts +16 -20
  383. package/src/chain/regen/regen.ts +16 -17
  384. package/src/chain/seenCache/index.ts +1 -1
  385. package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
  386. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +106 -0
  387. package/src/chain/serializeState.ts +3 -3
  388. package/src/chain/shufflingCache.ts +5 -7
  389. package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
  390. package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
  391. package/src/chain/stateCache/types.ts +14 -18
  392. package/src/chain/validation/attesterSlashing.ts +3 -3
  393. package/src/chain/validation/blobSidecar.ts +1 -1
  394. package/src/chain/validation/block.ts +2 -4
  395. package/src/chain/validation/blsToExecutionChange.ts +2 -2
  396. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  397. package/src/chain/validation/executionPayloadBid.ts +3 -7
  398. package/src/chain/validation/executionPayloadEnvelope.ts +36 -29
  399. package/src/chain/validation/lightClientFinalityUpdate.ts +1 -1
  400. package/src/chain/validation/lightClientOptimisticUpdate.ts +1 -1
  401. package/src/chain/validation/payloadAttestationMessage.ts +2 -4
  402. package/src/chain/validation/proposerSlashing.ts +1 -1
  403. package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
  404. package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
  405. package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
  406. package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
  407. package/src/chain/validation/syncCommittee.ts +21 -20
  408. package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
  409. package/src/chain/validation/voluntaryExit.ts +3 -8
  410. package/src/chain/validatorMonitor.ts +23 -12
  411. package/src/execution/engine/interface.ts +2 -2
  412. package/src/metrics/metrics/lodestar.ts +100 -19
  413. package/src/network/gossip/encoding.ts +16 -0
  414. package/src/network/interface.ts +15 -2
  415. package/src/network/libp2p/index.ts +5 -0
  416. package/src/network/network.ts +34 -6
  417. package/src/network/processor/extractSlotRootFns.ts +19 -6
  418. package/src/network/processor/gossipHandlers.ts +45 -8
  419. package/src/network/processor/index.ts +110 -89
  420. package/src/network/reqresp/ReqRespBeaconNode.ts +14 -1
  421. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
  422. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
  423. package/src/network/reqresp/handlers/index.ts +12 -0
  424. package/src/network/reqresp/protocols.ts +12 -0
  425. package/src/network/reqresp/rateLimit.ts +18 -0
  426. package/src/network/reqresp/score.ts +2 -0
  427. package/src/network/reqresp/types.ts +13 -0
  428. package/src/node/nodejs.ts +3 -5
  429. package/src/node/notifier.ts +4 -10
  430. package/src/sync/backfill/backfill.ts +4 -4
  431. package/src/sync/constants.ts +1 -1
  432. package/src/sync/unknownBlock.ts +10 -50
  433. package/src/util/sszBytes.ts +90 -10
  434. package/src/util/types.ts +6 -0
  435. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts +0 -15
  436. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.d.ts.map +0 -1
  437. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js +0 -28
  438. package/lib/chain/seenCache/seenExecutionPayloadEnvelope.js.map +0 -1
  439. package/src/chain/seenCache/seenExecutionPayloadEnvelope.ts +0 -34
@@ -1,5 +1,5 @@
1
1
  import {SYNC_COMMITTEE_SUBNET_COUNT, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
2
- import {CachedBeaconStateAllForks} from "@lodestar/state-transition";
2
+ import {IBeaconStateView} from "@lodestar/state-transition";
3
3
  import {SubnetID, altair} from "@lodestar/types";
4
4
  import {toRootHex} from "@lodestar/utils";
5
5
  import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
@@ -15,12 +15,12 @@ export async function validateGossipSyncCommittee(
15
15
  chain: IBeaconChain,
16
16
  syncCommittee: altair.SyncCommitteeMessage,
17
17
  subnet: SubnetID
18
- ): Promise<{indexInSubcommittee: IndexInSubcommittee}> {
18
+ ): Promise<{indicesInSubcommittee: IndexInSubcommittee[]}> {
19
19
  const {slot, validatorIndex, beaconBlockRoot} = syncCommittee;
20
20
  const messageRoot = toRootHex(beaconBlockRoot);
21
21
 
22
22
  const headState = chain.getHeadState();
23
- const indexInSubcommittee = validateGossipSyncCommitteeExceptSig(chain, headState, subnet, syncCommittee);
23
+ const indicesInSubcommittee = validateGossipSyncCommitteeExceptSig(chain, headState, subnet, syncCommittee);
24
24
 
25
25
  // [IGNORE] The signature's slot is for the current slot, i.e. sync_committee_signature.slot == current_slot.
26
26
  // > Checked in validateGossipSyncCommitteeExceptSig()
@@ -68,12 +68,12 @@ export async function validateGossipSyncCommittee(
68
68
  // Register this valid item as seen
69
69
  chain.seenSyncCommitteeMessages.add(slot, subnet, validatorIndex, messageRoot);
70
70
 
71
- return {indexInSubcommittee};
71
+ return {indicesInSubcommittee};
72
72
  }
73
73
 
74
74
  export async function validateApiSyncCommittee(
75
75
  chain: IBeaconChain,
76
- headState: CachedBeaconStateAllForks,
76
+ headState: IBeaconStateView,
77
77
  syncCommittee: altair.SyncCommitteeMessage
78
78
  ): Promise<void> {
79
79
  const prioritizeBls = true;
@@ -85,7 +85,7 @@ export async function validateApiSyncCommittee(
85
85
  */
86
86
  async function validateSyncCommitteeSigOnly(
87
87
  chain: IBeaconChain,
88
- headState: CachedBeaconStateAllForks,
88
+ headState: IBeaconStateView,
89
89
  syncCommittee: altair.SyncCommitteeMessage,
90
90
  prioritizeBls = false
91
91
  ): Promise<void> {
@@ -102,10 +102,10 @@ async function validateSyncCommitteeSigOnly(
102
102
  */
103
103
  export function validateGossipSyncCommitteeExceptSig(
104
104
  chain: IBeaconChain,
105
- headState: CachedBeaconStateAllForks,
105
+ headState: IBeaconStateView,
106
106
  subnet: SubnetID,
107
107
  data: Pick<altair.SyncCommitteeMessage, "slot" | "validatorIndex">
108
- ): IndexInSubcommittee {
108
+ ): IndexInSubcommittee[] {
109
109
  const {slot, validatorIndex} = data;
110
110
  // [IGNORE] The signature's slot is for the current slot, i.e. sync_committee_signature.slot == current_slot.
111
111
  // (with a MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance)
@@ -127,39 +127,40 @@ export function validateGossipSyncCommitteeExceptSig(
127
127
 
128
128
  // [REJECT] The subnet_id is valid for the given validator, i.e. subnet_id in compute_subnets_for_sync_committee(state, sync_committee_signature.validator_index).
129
129
  // Note this validation implies the validator is part of the broader current sync committee along with the correct subcommittee.
130
- const indexInSubcommittee = getIndexInSubcommittee(headState, subnet, data);
131
- if (indexInSubcommittee === null) {
130
+ const indicesInSubcommittee = getIndicesInSubcommittee(headState, subnet, data);
131
+ if (indicesInSubcommittee === null) {
132
132
  throw new SyncCommitteeError(GossipAction.REJECT, {
133
133
  code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
134
134
  validatorIndex,
135
135
  });
136
136
  }
137
137
 
138
- return indexInSubcommittee;
138
+ return indicesInSubcommittee;
139
139
  }
140
140
 
141
141
  /**
142
- * Returns the IndexInSubcommittee of the given `subnet`.
143
- * Returns `null` if not part of the sync committee or not part of the given `subnet`
142
+ * Returns all IndexInSubcommittee positions of the given `subnet`.
143
+ * Returns `null` if not part of the sync committee or not part of the given `subnet`.
144
+ * A validator may appear multiple times in the same subcommittee.
144
145
  */
145
- function getIndexInSubcommittee(
146
- headState: CachedBeaconStateAllForks,
146
+ function getIndicesInSubcommittee(
147
+ headState: IBeaconStateView,
147
148
  subnet: SubnetID,
148
149
  data: Pick<altair.SyncCommitteeMessage, "slot" | "validatorIndex">
149
- ): IndexInSubcommittee | null {
150
- const syncCommittee = headState.epochCtx.getIndexedSyncCommittee(data.slot);
150
+ ): IndexInSubcommittee[] | null {
151
+ const syncCommittee = headState.getIndexedSyncCommittee(data.slot);
151
152
  const indexesInCommittee = syncCommittee.validatorIndexMap.get(data.validatorIndex);
152
153
  if (indexesInCommittee === undefined) {
153
154
  // Not part of the sync committee
154
155
  return null;
155
156
  }
156
157
 
158
+ const indices: IndexInSubcommittee[] = [];
157
159
  for (const indexInCommittee of indexesInCommittee) {
158
160
  if (Math.floor(indexInCommittee / SYNC_COMMITTEE_SUBNET_SIZE) === subnet) {
159
- return indexInCommittee % SYNC_COMMITTEE_SUBNET_SIZE;
161
+ indices.push(indexInCommittee % SYNC_COMMITTEE_SUBNET_SIZE);
160
162
  }
161
163
  }
162
164
 
163
- // Not part of this specific subnet
164
- return null;
165
+ return indices.length > 0 ? indices : null;
165
166
  }
@@ -1,5 +1,5 @@
1
1
  import {SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
2
- import {CachedBeaconStateAltair, isSyncCommitteeAggregator} from "@lodestar/state-transition";
2
+ import {IBeaconStateView, isSyncCommitteeAggregator} from "@lodestar/state-transition";
3
3
  import {ValidatorIndex, altair} from "@lodestar/types";
4
4
  import {GossipAction, SyncCommitteeError, SyncCommitteeErrorCode} from "../errors/index.js";
5
5
  import {IBeaconChain} from "../interface.js";
@@ -53,7 +53,7 @@ export async function validateSyncCommitteeGossipContributionAndProof(
53
53
  }
54
54
 
55
55
  // [REJECT] The contribution has participants -- that is, any(contribution.aggregation_bits)
56
- const syncCommitteeParticipantIndices = getContributionIndices(headState as CachedBeaconStateAltair, contribution);
56
+ const syncCommitteeParticipantIndices = getContributionIndices(headState, contribution);
57
57
  if (syncCommitteeParticipantIndices.length === 0) {
58
58
  throw new SyncCommitteeError(GossipAction.REJECT, {
59
59
  code: SyncCommitteeErrorCode.NO_PARTICIPANT,
@@ -83,12 +83,7 @@ export async function validateSyncCommitteeGossipContributionAndProof(
83
83
 
84
84
  // [REJECT] The aggregate signature is valid for the message beacon_block_root and aggregate pubkey derived from
85
85
  // the participation info in aggregation_bits for the subcommittee specified by the contribution.subcommittee_index.
86
- getSyncCommitteeContributionSignatureSet(
87
- chain.config,
88
- headState as CachedBeaconStateAltair,
89
- contribution,
90
- syncCommitteeParticipantIndices
91
- ),
86
+ getSyncCommitteeContributionSignatureSet(chain.config, headState, contribution, syncCommitteeParticipantIndices),
92
87
  ];
93
88
 
94
89
  if (!(await chain.bls.verifySignatureSets(signatureSets, {batchable: true}))) {
@@ -109,12 +104,12 @@ export async function validateSyncCommitteeGossipContributionAndProof(
109
104
  * - pubkeyCache
110
105
  */
111
106
  function getContributionIndices(
112
- state: CachedBeaconStateAltair,
107
+ state: IBeaconStateView,
113
108
  contribution: altair.SyncCommitteeContribution
114
109
  ): ValidatorIndex[] {
115
110
  const startIndex = contribution.subcommitteeIndex * SYNC_COMMITTEE_SUBNET_SIZE;
116
111
 
117
- const syncCommittee = state.epochCtx.getIndexedSyncCommittee(contribution.slot);
112
+ const syncCommittee = state.getIndexedSyncCommittee(contribution.slot);
118
113
  // The bits in contribution.aggregationBits select validatorIndexes in the subcommittee starting at startIndex
119
114
  const subcommitteeValidatorIndices = syncCommittee.validatorIndices.slice(
120
115
  startIndex,
@@ -1,9 +1,4 @@
1
- import {
2
- BeaconStateView,
3
- VoluntaryExitValidity,
4
- getVoluntaryExitSignatureSet,
5
- getVoluntaryExitValidity,
6
- } from "@lodestar/state-transition";
1
+ import {VoluntaryExitValidity, getVoluntaryExitSignatureSet} from "@lodestar/state-transition";
7
2
  import {phase0} from "@lodestar/types";
8
3
  import {
9
4
  GossipAction,
@@ -53,14 +48,14 @@ async function validateVoluntaryExit(
53
48
 
54
49
  // [REJECT] All of the conditions within process_voluntary_exit pass validation.
55
50
  // verifySignature = false, verified in batch below
56
- const validity = getVoluntaryExitValidity(chain.config.getForkSeq(state.slot), state, voluntaryExit, false);
51
+ const validity = state.getVoluntaryExitValidity(voluntaryExit, false);
57
52
  if (validity !== VoluntaryExitValidity.valid) {
58
53
  throw new VoluntaryExitError(GossipAction.REJECT, {
59
54
  code: voluntaryExitValidityToErrorCode(validity),
60
55
  });
61
56
  }
62
57
 
63
- const signatureSet = getVoluntaryExitSignatureSet(chain.config, new BeaconStateView(state), voluntaryExit);
58
+ const signatureSet = getVoluntaryExitSignatureSet(chain.config, state, voluntaryExit);
64
59
  if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
65
60
  throw new VoluntaryExitError(GossipAction.REJECT, {
66
61
  code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
@@ -1,13 +1,11 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
2
  import {ForkSeq, MIN_ATTESTATION_INCLUSION_DELAY, SLOTS_PER_EPOCH} from "@lodestar/params";
3
3
  import {
4
- CachedBeaconStateAllForks,
5
- CachedBeaconStateAltair,
4
+ IBeaconStateView,
6
5
  ParticipationFlags,
7
6
  computeEpochAtSlot,
8
7
  computeStartSlotAtEpoch,
9
8
  computeTimeAtSlot,
10
- getBlockRootAtSlot,
11
9
  getCurrentSlot,
12
10
  parseAttesterFlags,
13
11
  parseParticipationFlags,
@@ -23,6 +21,7 @@ import {
23
21
  ValidatorIndex,
24
22
  altair,
25
23
  deneb,
24
+ gloas,
26
25
  } from "@lodestar/types";
27
26
  import {LogData, LogHandler, LogLevel, Logger, MapDef, MapDefMax, prettyPrintIndices, toRootHex} from "@lodestar/utils";
28
27
  import {GENESIS_SLOT} from "../constants/constants.js";
@@ -61,6 +60,11 @@ export type ValidatorMonitor = {
61
60
  ): void;
62
61
  registerBeaconBlock(src: OpSource, delaySec: Seconds, block: BeaconBlock): void;
63
62
  registerBlobSidecar(src: OpSource, seenTimestampSec: Seconds, blob: deneb.BlobSidecar): void;
63
+ registerExecutionPayloadEnvelope(
64
+ src: OpSource,
65
+ delaySec: Seconds,
66
+ envelope: gloas.SignedExecutionPayloadEnvelope
67
+ ): void;
64
68
  registerImportedBlock(block: BeaconBlock, data: {proposerBalanceDelta: number}): void;
65
69
  onPoolSubmitUnaggregatedAttestation(
66
70
  seenTimestampSec: number,
@@ -96,7 +100,7 @@ export type ValidatorMonitor = {
96
100
  syncAggregate: altair.SyncAggregate,
97
101
  syncCommitteeIndices: Uint32Array
98
102
  ): void;
99
- onceEveryEndOfEpoch(state: CachedBeaconStateAllForks): void;
103
+ onceEveryEndOfEpoch(state: IBeaconStateView): void;
100
104
  scrapeMetrics(slotClock: Slot): void;
101
105
  /** Returns the list of validator indices currently being monitored */
102
106
  getMonitoredValidatorIndices(): ValidatorIndex[];
@@ -450,6 +454,10 @@ export function createValidatorMonitor(
450
454
  //TODO: freetheblobs
451
455
  },
452
456
 
457
+ registerExecutionPayloadEnvelope(_src, _delaySec, _envelope) {
458
+ // TODO GLOAS: implement execution payload envelope monitoring
459
+ },
460
+
453
461
  registerImportedBlock(block, {proposerBalanceDelta}) {
454
462
  const validator = validators.get(block.proposerIndex);
455
463
  if (validator) {
@@ -726,16 +734,19 @@ export function createValidatorMonitor(
726
734
  return;
727
735
  }
728
736
 
737
+ if (validators.size === 0) {
738
+ return;
739
+ }
740
+
729
741
  const rootCache = new RootHexCache(headState);
730
742
 
731
743
  if (config.getForkSeq(headState.slot) >= ForkSeq.altair) {
732
- const {previousEpochParticipation} = headState as CachedBeaconStateAltair;
733
744
  const prevEpochStartSlot = computeStartSlotAtEpoch(prevEpoch);
734
- const prevEpochTargetRoot = toRootHex(getBlockRootAtSlot(headState, prevEpochStartSlot));
745
+ const prevEpochTargetRoot = toRootHex(headState.getBlockRootAtSlot(prevEpochStartSlot));
735
746
 
736
747
  // Check attestation performance
737
748
  for (const [index, validator] of validators.entries()) {
738
- const flags = parseParticipationFlags(previousEpochParticipation.get(index));
749
+ const flags = parseParticipationFlags(headState.getPreviousEpochParticipation(index));
739
750
  const attestationSummary = validator.attestations.get(prevEpoch)?.get(prevEpochTargetRoot);
740
751
  const summary = renderAttestationSummary(config, rootCache, attestationSummary, flags);
741
752
  validatorMonitorMetrics?.prevEpochAttestationSummary.inc({summary});
@@ -747,9 +758,9 @@ export function createValidatorMonitor(
747
758
  }
748
759
  }
749
760
 
750
- if (headState.epochCtx.proposersPrevEpoch !== null) {
761
+ if (headState.previousProposers !== null) {
751
762
  // proposersPrevEpoch is null on the first epoch of `headState` being generated
752
- for (const [slotIndex, validatorIndex] of headState.epochCtx.proposersPrevEpoch.entries()) {
763
+ for (const [slotIndex, validatorIndex] of headState.previousProposers.entries()) {
753
764
  const validator = validators.get(validatorIndex);
754
765
  if (validator) {
755
766
  // If expected proposer is a tracked validator
@@ -889,7 +900,7 @@ function renderAttestationSummary(
889
900
  summary: AttestationSummary | undefined,
890
901
  flags: ParticipationFlags
891
902
  ): string {
892
- // Reference https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
903
+ // Reference https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
893
904
  //
894
905
  // is_matching_source = data.source == justified_checkpoint
895
906
  // is_matching_target = is_matching_source and data.target.root == get_block_root(state, data.target.epoch)
@@ -1129,12 +1140,12 @@ function renderBlockProposalSummary(
1129
1140
  export class RootHexCache {
1130
1141
  private readonly blockRootSlotCache = new Map<Slot, RootHex>();
1131
1142
 
1132
- constructor(private readonly state: CachedBeaconStateAllForks) {}
1143
+ constructor(private readonly state: IBeaconStateView) {}
1133
1144
 
1134
1145
  getBlockRootAtSlot(slot: Slot): RootHex {
1135
1146
  let root = this.blockRootSlotCache.get(slot);
1136
1147
  if (!root) {
1137
- root = toRootHex(getBlockRootAtSlot(this.state, slot));
1148
+ root = toRootHex(this.state.getBlockRootAtSlot(slot));
1138
1149
  this.blockRootSlotCache.set(slot, root);
1139
1150
  }
1140
1151
  return root;
@@ -128,7 +128,7 @@ export interface IExecutionEngine {
128
128
  * corresponding state, up to and including finalized_block_hash.
129
129
  *
130
130
  * The call of the notify_forkchoice_updated function maps on the POS_FORKCHOICE_UPDATED event defined in the EIP-3675.
131
- * https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/fork-choice.md#notify_forkchoice_updated
131
+ * https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/fork-choice.md#notify_forkchoice_updated
132
132
  *
133
133
  * Should be called in response to fork-choice head and finalized events
134
134
  */
@@ -145,7 +145,7 @@ export interface IExecutionEngine {
145
145
  * since the corresponding call to prepare_payload method.
146
146
  *
147
147
  * Required for block producing
148
- * https://github.com/ethereum/consensus-specs/blob/dev/specs/merge/validator.md#get_payload
148
+ * https://github.com/ethereum/consensus-specs/blob/v1.1.7/specs/merge/validator.md#get_payload
149
149
  */
150
150
  getPayload(
151
151
  fork: ForkName,
@@ -3,6 +3,7 @@ import {NotReorgedReason} from "@lodestar/fork-choice";
3
3
  import {ArchiveStoreTask} from "../../chain/archiveStore/archiveStore.js";
4
4
  import {FrequencyStateArchiveStep} from "../../chain/archiveStore/strategies/frequencyStateArchiveStrategy.js";
5
5
  import {BlockInputSource} from "../../chain/blocks/blockInput/index.js";
6
+ import {PayloadEnvelopeInputSource} from "../../chain/blocks/payloadEnvelopeInput/index.js";
6
7
  import {JobQueueItemType} from "../../chain/bls/index.js";
7
8
  import {AttestationErrorCode, BlockErrorCode} from "../../chain/errors/index.js";
8
9
  import {
@@ -237,6 +238,56 @@ export function createLodestarMetrics(
237
238
  }),
238
239
  },
239
240
 
241
+ payloadEnvelopeProcessorQueue: {
242
+ length: register.gauge({
243
+ name: "lodestar_payload_envelope_processor_queue_length",
244
+ help: "Count of total payload envelope processor queue length",
245
+ }),
246
+ droppedJobs: register.gauge({
247
+ name: "lodestar_payload_envelope_processor_queue_dropped_jobs_total",
248
+ help: "Count of total payload envelope processor queue dropped jobs",
249
+ }),
250
+ jobTime: register.histogram({
251
+ name: "lodestar_payload_envelope_processor_queue_job_time_seconds",
252
+ help: "Time to process payload envelope processor queue job in seconds",
253
+ buckets: [0.01, 0.1, 1, 4, 12],
254
+ }),
255
+ jobWaitTime: register.histogram({
256
+ name: "lodestar_payload_envelope_processor_queue_job_wait_time_seconds",
257
+ help: "Time from job added to the payload envelope processor queue to starting in seconds",
258
+ buckets: [0.01, 0.1, 1, 4, 12],
259
+ }),
260
+ concurrency: register.gauge({
261
+ name: "lodestar_payload_envelope_processor_queue_concurrency",
262
+ help: "Current concurrency of payload envelope processor queue",
263
+ }),
264
+ },
265
+
266
+ unfinalizedPayloadEnvelopeWritesQueue: {
267
+ length: register.gauge({
268
+ name: "lodestar_unfinalized_payload_envelope_writes_queue_length",
269
+ help: "Count of total unfinalized payload envelope writes queue length",
270
+ }),
271
+ droppedJobs: register.gauge({
272
+ name: "lodestar_unfinalized_payload_envelope_writes_queue_dropped_jobs_total",
273
+ help: "Count of total unfinalized payload envelope writes queue dropped jobs",
274
+ }),
275
+ jobTime: register.histogram({
276
+ name: "lodestar_unfinalized_payload_envelope_writes_queue_job_time_seconds",
277
+ help: "Time to process unfinalized payload envelope writes queue job in seconds",
278
+ buckets: [0.01, 0.1, 1, 4, 12],
279
+ }),
280
+ jobWaitTime: register.histogram({
281
+ name: "lodestar_unfinalized_payload_envelope_writes_queue_job_wait_time_seconds",
282
+ help: "Time from job added to the unfinalized payload envelope writes queue to starting in seconds",
283
+ buckets: [0.01, 0.1, 1, 4, 12],
284
+ }),
285
+ concurrency: register.gauge({
286
+ name: "lodestar_unfinalized_payload_envelope_writes_queue_concurrency",
287
+ help: "Current concurrency of unfinalized payload envelope writes queue",
288
+ }),
289
+ },
290
+
240
291
  engineHttpProcessorQueue: {
241
292
  length: register.gauge({
242
293
  name: "lodestar_engine_http_processor_queue_length",
@@ -925,6 +976,18 @@ export function createLodestarMetrics(
925
976
  labelNames: ["reason"],
926
977
  }),
927
978
  },
979
+ importPayload: {
980
+ bySource: register.gauge<{source: PayloadEnvelopeInputSource}>({
981
+ name: "lodestar_import_payload_by_source_total",
982
+ help: "Total number of imported execution payload envelopes by source",
983
+ labelNames: ["source"],
984
+ }),
985
+ columnsBySource: register.gauge<{source: PayloadEnvelopeInputSource}>({
986
+ name: "lodestar_import_payload_columns_by_source_total",
987
+ help: "Total number of payload-attached columns (sampled columns for Gloas) by source",
988
+ labelNames: ["source"],
989
+ }),
990
+ },
928
991
  engineNotifyNewPayloadResult: register.gauge<{result: ExecutionPayloadStatus}>({
929
992
  name: "lodestar_execution_engine_notify_new_payload_result_total",
930
993
  help: "The total result of calling notifyNewPayload execution engine api",
@@ -1495,6 +1558,20 @@ export function createLodestarMetrics(
1495
1558
  help: "Number of BlockInputs created via a data column being seen first",
1496
1559
  }),
1497
1560
  },
1561
+ payloadEnvelopeInput: {
1562
+ count: register.gauge({
1563
+ name: "lodestar_seen_payload_envelope_input_cache_size",
1564
+ help: "Number of cached PayloadEnvelopeInputs",
1565
+ }),
1566
+ serializedObjectRefs: register.gauge({
1567
+ name: "lodestar_seen_payload_envelope_input_cache_serialized_object_refs",
1568
+ help: "Number of serialized-cache object refs retained by cached PayloadEnvelopeInputs",
1569
+ }),
1570
+ created: register.counter({
1571
+ name: "lodestar_seen_payload_envelope_input_cache_items_created_total",
1572
+ help: "Number of PayloadEnvelopeInputs created",
1573
+ }),
1574
+ },
1498
1575
  },
1499
1576
 
1500
1577
  processFinalizedCheckpoint: {
@@ -1635,33 +1712,37 @@ export function createLodestarMetrics(
1635
1712
  }),
1636
1713
  },
1637
1714
 
1638
- // reprocess gossip attestations
1639
- reprocessGossipAttestations: {
1640
- total: register.gauge({
1641
- name: "lodestar_reprocess_gossip_attestations_total",
1642
- help: "Total number of gossip attestations waiting to reprocess",
1715
+ // some gossip messages need to wait for block to be processed before they can be processed
1716
+ awaitingBlockGossipMessages: {
1717
+ queue: register.gauge<{topic: GossipType}>({
1718
+ name: "lodestar_awaiting_block_gossip_messages_total",
1719
+ help: "Total number of gossip messages waiting for block to be processed",
1720
+ labelNames: ["topic"],
1643
1721
  }),
1644
1722
  countPerSlot: register.gauge({
1645
- name: "lodestar_reprocess_gossip_attestations_per_slot_total",
1646
- help: "Total number of gossip attestations waiting to reprocess pet slot",
1723
+ name: "lodestar_awaiting_block_gossip_messages_per_slot_total",
1724
+ help: "Total number of gossip messages waiting for block to be processed per slot",
1647
1725
  }),
1648
- resolve: register.gauge({
1649
- name: "lodestar_reprocess_gossip_attestations_resolve_total",
1650
- help: "Total number of gossip attestations are reprocessed",
1726
+ resolve: register.gauge<{topic: GossipType}>({
1727
+ name: "lodestar_awaiting_block_gossip_messages_resolve_total",
1728
+ help: "Total number of gossip messages are reprocessed",
1729
+ labelNames: ["topic"],
1651
1730
  }),
1652
- waitSecBeforeResolve: register.gauge({
1653
- name: "lodestar_reprocess_gossip_attestations_wait_time_resolve_seconds",
1731
+ waitSecBeforeResolve: register.gauge<{topic: GossipType}>({
1732
+ name: "lodestar_awaiting_block_gossip_messages_wait_time_resolve_seconds",
1654
1733
  help: "Time to wait for unknown block in seconds",
1734
+ labelNames: ["topic"],
1655
1735
  }),
1656
- reject: register.gauge<{reason: ReprocessRejectReason}>({
1657
- name: "lodestar_reprocess_gossip_attestations_reject_total",
1658
- help: "Total number of attestations are rejected to reprocess",
1659
- labelNames: ["reason"],
1736
+ // having 2 labels here is not great for performance, however it's rarely happening and having the reason label is important for debugging
1737
+ reject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
1738
+ name: "lodestar_awaiting_block_gossip_messages_reject_total",
1739
+ help: "Total number of gossip messages are rejected to reprocess",
1740
+ labelNames: ["reason", "topic"],
1660
1741
  }),
1661
- waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason}>({
1662
- name: "lodestar_reprocess_gossip_attestations_wait_time_reject_seconds",
1742
+ waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
1743
+ name: "lodestar_awaiting_block_gossip_messages_wait_time_reject_seconds",
1663
1744
  help: "Time to wait for unknown block before being rejected",
1664
- labelNames: ["reason"],
1745
+ labelNames: ["reason", "topic"],
1665
1746
  }),
1666
1747
  },
1667
1748
 
@@ -24,12 +24,28 @@ const decoder = new snappyWasm.Decoder();
24
24
  // Shared buffer to convert msgId to string
25
25
  const sharedMsgIdBuf = Buffer.alloc(20);
26
26
 
27
+ // Cache topic -> seed to avoid per-message allocations on the hot path.
28
+ // Topics are a fixed set per fork (changes only at fork boundaries).
29
+ const topicSeedCache = new Map<string, bigint>();
30
+
27
31
  /**
28
32
  * The function used to generate a gossipsub message id
29
33
  * We use the first 8 bytes of SHA256(data) for content addressing
30
34
  */
31
35
  export function fastMsgIdFn(rpcMsg: RPC.Message): string {
32
36
  if (rpcMsg.data) {
37
+ if (rpcMsg.topic) {
38
+ // Use topic-derived seed to prevent cross-topic deduplication of identical messages.
39
+ // SyncCommitteeMessages are published to multiple sync_committee_{subnet} topics with
40
+ // identical data, so hashing only the data incorrectly deduplicates across subnets.
41
+ // See https://github.com/ChainSafe/lodestar/issues/8294
42
+ let topicSeed = topicSeedCache.get(rpcMsg.topic);
43
+ if (topicSeed === undefined) {
44
+ topicSeed = xxhash.h64Raw(Buffer.from(rpcMsg.topic), h64Seed);
45
+ topicSeedCache.set(rpcMsg.topic, topicSeed);
46
+ }
47
+ return xxhash.h64Raw(rpcMsg.data, topicSeed).toString(16);
48
+ }
33
49
  return xxhash.h64Raw(rpcMsg.data, h64Seed).toString(16);
34
50
  }
35
51
  return "0000000000000000";
@@ -38,7 +38,12 @@ import {
38
38
  import {BlockInputSource} from "../chain/blocks/blockInput/types.js";
39
39
  import {CustodyConfig} from "../util/dataColumns.js";
40
40
  import {PeerIdStr} from "../util/peerId.js";
41
- import {BeaconBlocksByRootRequest, BlobSidecarsByRootRequest, DataColumnSidecarsByRootRequest} from "../util/types.js";
41
+ import {
42
+ BeaconBlocksByRootRequest,
43
+ BlobSidecarsByRootRequest,
44
+ DataColumnSidecarsByRootRequest,
45
+ ExecutionPayloadEnvelopesByRootRequest,
46
+ } from "../util/types.js";
42
47
  import {INetworkCorePublic} from "./core/types.js";
43
48
  import {INetworkEventBus} from "./events.js";
44
49
  import {GossipType} from "./gossip/interface.js";
@@ -68,7 +73,7 @@ export interface INetwork extends INetworkCorePublic {
68
73
  reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): void;
69
74
  shouldAggregate(subnet: SubnetID, slot: Slot): boolean;
70
75
  reStatusPeers(peers: PeerIdStr[]): Promise<void>;
71
- searchUnknownSlotRoot(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void;
76
+ searchUnknownBlock(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void;
72
77
  // ReqResp
73
78
  sendBeaconBlocksByRange(peerId: PeerIdStr, request: phase0.BeaconBlocksByRangeRequest): Promise<SignedBeaconBlock[]>;
74
79
  sendBeaconBlocksByRoot(peerId: PeerIdStr, request: BeaconBlocksByRootRequest): Promise<SignedBeaconBlock[]>;
@@ -82,6 +87,14 @@ export interface INetwork extends INetworkCorePublic {
82
87
  peerId: PeerIdStr,
83
88
  request: DataColumnSidecarsByRootRequest
84
89
  ): Promise<fulu.DataColumnSidecar[]>;
90
+ sendExecutionPayloadEnvelopesByRange(
91
+ peerId: PeerIdStr,
92
+ request: gloas.ExecutionPayloadEnvelopesByRangeRequest
93
+ ): Promise<gloas.SignedExecutionPayloadEnvelope[]>;
94
+ sendExecutionPayloadEnvelopesByRoot(
95
+ peerId: PeerIdStr,
96
+ request: ExecutionPayloadEnvelopesByRootRequest
97
+ ): Promise<gloas.SignedExecutionPayloadEnvelope[]>;
85
98
 
86
99
  // Gossip
87
100
  publishBeaconBlock(signedBlock: SignedBeaconBlock): Promise<number>;
@@ -88,6 +88,9 @@ export async function createNodeJsLibp2p(
88
88
  );
89
89
  }
90
90
  if (networkOpts.quic) {
91
+ const quicMultiaddrs = localMultiaddrs.filter((ma) => ma.includes("/quic-v1"));
92
+ const hasIpv4Quic = quicMultiaddrs.some((ma) => ma.includes("/ip4/"));
93
+ const hasIpv6Quic = quicMultiaddrs.some((ma) => ma.includes("/ip6/"));
91
94
  transports.unshift(
92
95
  quic({
93
96
  handshakeTimeout: 5_000,
@@ -96,6 +99,8 @@ export async function createNodeJsLibp2p(
96
99
  maxConcurrentStreamLimit: 256,
97
100
  maxStreamData: 10_000_000,
98
101
  maxConnectionData: 15_000_000,
102
+ ipv4: hasIpv4Quic,
103
+ ipv6: hasIpv6Quic,
99
104
  })
100
105
  );
101
106
  }
@@ -40,7 +40,12 @@ import {IClock} from "../util/clock.js";
40
40
  import {CustodyConfig} from "../util/dataColumns.js";
41
41
  import {PeerIdStr, peerIdToString} from "../util/peerId.js";
42
42
  import {promiseAllMaybeAsync} from "../util/promises.js";
43
- import {BeaconBlocksByRootRequest, BlobSidecarsByRootRequest, DataColumnSidecarsByRootRequest} from "../util/types.js";
43
+ import {
44
+ BeaconBlocksByRootRequest,
45
+ BlobSidecarsByRootRequest,
46
+ DataColumnSidecarsByRootRequest,
47
+ ExecutionPayloadEnvelopesByRootRequest,
48
+ } from "../util/types.js";
44
49
  import {INetworkCore, NetworkCore, WorkerNetworkCore} from "./core/index.js";
45
50
  import {INetworkEventBus, NetworkEvent, NetworkEventBus, NetworkEventData} from "./events.js";
46
51
  import {getActiveForkBoundaries} from "./forks.js";
@@ -161,7 +166,7 @@ export class Network implements INetwork {
161
166
  const events = new NetworkEventBus();
162
167
  const aggregatorTracker = new AggregatorTracker();
163
168
 
164
- const activeValidatorCount = chain.getHeadState().epochCtx.currentShuffling.activeIndices.length;
169
+ const activeValidatorCount = chain.getHeadState().activeValidatorCount;
165
170
  const initialStatus = chain.getStatus();
166
171
  const initialCustodyGroupCount = chain.custodyConfig.targetCustodyGroupCount;
167
172
 
@@ -277,8 +282,8 @@ export class Network implements INetwork {
277
282
  return this.core.reStatusPeers(peers);
278
283
  }
279
284
 
280
- searchUnknownSlotRoot(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
281
- this.networkProcessor.searchUnknownSlotRoot(slotRoot, source, peer);
285
+ searchUnknownBlock(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
286
+ this.networkProcessor.searchUnknownBlock(slotRoot, source, peer);
282
287
  }
283
288
 
284
289
  async reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): Promise<void> {
@@ -636,6 +641,29 @@ export class Network implements INetwork {
636
641
  );
637
642
  }
638
643
 
644
+ async sendExecutionPayloadEnvelopesByRange(
645
+ peerId: PeerIdStr,
646
+ request: gloas.ExecutionPayloadEnvelopesByRangeRequest
647
+ ): Promise<gloas.SignedExecutionPayloadEnvelope[]> {
648
+ return collectMaxResponseTyped(
649
+ this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRange, [Version.V1], request),
650
+ request.count,
651
+ responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRange]
652
+ );
653
+ }
654
+
655
+ async sendExecutionPayloadEnvelopesByRoot(
656
+ peerId: PeerIdStr,
657
+ request: ExecutionPayloadEnvelopesByRootRequest
658
+ ): Promise<gloas.SignedExecutionPayloadEnvelope[]> {
659
+ return collectMaxResponseTyped(
660
+ this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRoot, [Version.V1], request),
661
+ request.length,
662
+ responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRoot],
663
+ this.chain.serializedCache
664
+ );
665
+ }
666
+
639
667
  private sendReqRespRequest<Req>(
640
668
  peerId: PeerIdStr,
641
669
  method: ReqRespMethod,
@@ -721,7 +749,7 @@ export class Network implements INetwork {
721
749
 
722
750
  try {
723
751
  // messages SHOULD be broadcast after SYNC_MESSAGE_DUE_BPS of slot has transpired
724
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/p2p-interface.md#sync-committee
752
+ // https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/altair/light-client/p2p-interface.md#sync-committee
725
753
  await this.waitForSyncMessageCutoff(finalityUpdate.signatureSlot);
726
754
  await this.publishLightClientFinalityUpdate(finalityUpdate);
727
755
  } catch (e) {
@@ -738,7 +766,7 @@ export class Network implements INetwork {
738
766
 
739
767
  try {
740
768
  // messages SHOULD be broadcast after SYNC_MESSAGE_DUE_BPS of slot has transpired
741
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/altair/light-client/p2p-interface.md#sync-committee
769
+ // https://github.com/ethereum/consensus-specs/blob/v1.6.1/specs/altair/light-client/p2p-interface.md#sync-committee
742
770
  await this.waitForSyncMessageCutoff(optimisticUpdate.signatureSlot);
743
771
  await this.publishLightClientOptimisticUpdate(optimisticUpdate);
744
772
  } catch (e) {