@lodestar/beacon-node 1.50.0 → 1.51.0-dev.15ecdb3b27

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 (311) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +7 -2
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/state/index.js +8 -2
  6. package/lib/api/impl/beacon/state/index.js.map +1 -1
  7. package/lib/api/impl/beacon/state/utils.d.ts +2 -1
  8. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  9. package/lib/api/impl/beacon/state/utils.js +17 -9
  10. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  11. package/lib/api/impl/debug/index.d.ts.map +1 -1
  12. package/lib/api/impl/debug/index.js +3 -0
  13. package/lib/api/impl/debug/index.js.map +1 -1
  14. package/lib/api/impl/validator/index.d.ts.map +1 -1
  15. package/lib/api/impl/validator/index.js +133 -27
  16. package/lib/api/impl/validator/index.js.map +1 -1
  17. package/lib/chain/ColumnReconstructionTracker.d.ts +11 -13
  18. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  19. package/lib/chain/ColumnReconstructionTracker.js +49 -44
  20. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  21. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  22. package/lib/chain/archiveStore/utils/archiveBlocks.js +4 -5
  23. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  24. package/lib/chain/blocks/blockInput/blockInput.d.ts +1 -1
  25. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  26. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  27. package/lib/chain/blocks/blockInput/utils.js +2 -2
  28. package/lib/chain/blocks/blockInput/utils.js.map +1 -1
  29. package/lib/chain/blocks/importBlock.js +10 -6
  30. package/lib/chain/blocks/importBlock.js.map +1 -1
  31. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  32. package/lib/chain/blocks/importExecutionPayload.js +49 -2
  33. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  34. package/lib/chain/blocks/types.d.ts +4 -0
  35. package/lib/chain/blocks/types.d.ts.map +1 -1
  36. package/lib/chain/blocks/types.js +5 -0
  37. package/lib/chain/blocks/types.js.map +1 -1
  38. package/lib/chain/chain.d.ts +2 -1
  39. package/lib/chain/chain.d.ts.map +1 -1
  40. package/lib/chain/chain.js +8 -3
  41. package/lib/chain/chain.js.map +1 -1
  42. package/lib/chain/errors/executionPayloadBid.d.ts +11 -1
  43. package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
  44. package/lib/chain/errors/executionPayloadBid.js +2 -0
  45. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  46. package/lib/chain/errors/inclusionList.d.ts +60 -0
  47. package/lib/chain/errors/inclusionList.d.ts.map +1 -0
  48. package/lib/chain/errors/inclusionList.js +19 -0
  49. package/lib/chain/errors/inclusionList.js.map +1 -0
  50. package/lib/chain/errors/index.d.ts +1 -0
  51. package/lib/chain/errors/index.d.ts.map +1 -1
  52. package/lib/chain/errors/index.js +1 -0
  53. package/lib/chain/errors/index.js.map +1 -1
  54. package/lib/chain/interface.d.ts +3 -2
  55. package/lib/chain/interface.d.ts.map +1 -1
  56. package/lib/chain/interface.js.map +1 -1
  57. package/lib/chain/opPools/inclusionListStore.d.ts +63 -0
  58. package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -0
  59. package/lib/chain/opPools/inclusionListStore.js +171 -0
  60. package/lib/chain/opPools/inclusionListStore.js.map +1 -0
  61. package/lib/chain/opPools/index.d.ts +1 -0
  62. package/lib/chain/opPools/index.d.ts.map +1 -1
  63. package/lib/chain/opPools/index.js +1 -0
  64. package/lib/chain/opPools/index.js.map +1 -1
  65. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  66. package/lib/chain/prepareNextSlot.js +4 -3
  67. package/lib/chain/prepareNextSlot.js.map +1 -1
  68. package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
  69. package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
  70. package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -1
  71. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  72. package/lib/chain/produceBlock/produceBlockBody.js +37 -14
  73. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  74. package/lib/chain/regen/interface.d.ts +1 -0
  75. package/lib/chain/regen/interface.d.ts.map +1 -1
  76. package/lib/chain/regen/interface.js +1 -0
  77. package/lib/chain/regen/interface.js.map +1 -1
  78. package/lib/chain/reprocess.d.ts +2 -1
  79. package/lib/chain/reprocess.d.ts.map +1 -1
  80. package/lib/chain/reprocess.js +2 -1
  81. package/lib/chain/reprocess.js.map +1 -1
  82. package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
  83. package/lib/chain/seenCache/seenGossipBlockInput.js +1 -1
  84. package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
  85. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  86. package/lib/chain/stateCache/persistentCheckpointsCache.js +1 -1
  87. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  88. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  89. package/lib/chain/validation/executionPayloadBid.js +33 -1
  90. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  91. package/lib/chain/validation/inclusionList.d.ts +14 -0
  92. package/lib/chain/validation/inclusionList.d.ts.map +1 -0
  93. package/lib/chain/validation/inclusionList.js +141 -0
  94. package/lib/chain/validation/inclusionList.js.map +1 -0
  95. package/lib/chain/validation/index.d.ts +1 -0
  96. package/lib/chain/validation/index.d.ts.map +1 -1
  97. package/lib/chain/validation/index.js +1 -0
  98. package/lib/chain/validation/index.js.map +1 -1
  99. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  100. package/lib/chain/validatorMonitor.js +6 -4
  101. package/lib/chain/validatorMonitor.js.map +1 -1
  102. package/lib/constants/constants.d.ts +1 -0
  103. package/lib/constants/constants.d.ts.map +1 -1
  104. package/lib/constants/constants.js +1 -0
  105. package/lib/constants/constants.js.map +1 -1
  106. package/lib/db/repositories/blockArchive.js +2 -2
  107. package/lib/db/repositories/blockArchive.js.map +1 -1
  108. package/lib/db/repositories/blockArchiveIndex.d.ts +1 -1
  109. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  110. package/lib/db/repositories/blockArchiveIndex.js +1 -2
  111. package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
  112. package/lib/execution/builder/validateBid.d.ts.map +1 -1
  113. package/lib/execution/builder/validateBid.js +14 -1
  114. package/lib/execution/builder/validateBid.js.map +1 -1
  115. package/lib/execution/engine/disabled.d.ts +1 -0
  116. package/lib/execution/engine/disabled.d.ts.map +1 -1
  117. package/lib/execution/engine/disabled.js +3 -0
  118. package/lib/execution/engine/disabled.js.map +1 -1
  119. package/lib/execution/engine/http.d.ts +8 -2
  120. package/lib/execution/engine/http.d.ts.map +1 -1
  121. package/lib/execution/engine/http.js +28 -4
  122. package/lib/execution/engine/http.js.map +1 -1
  123. package/lib/execution/engine/index.d.ts.map +1 -1
  124. package/lib/execution/engine/index.js +1 -1
  125. package/lib/execution/engine/index.js.map +1 -1
  126. package/lib/execution/engine/interface.d.ts +11 -2
  127. package/lib/execution/engine/interface.d.ts.map +1 -1
  128. package/lib/execution/engine/interface.js.map +1 -1
  129. package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
  130. package/lib/execution/engine/jsonRpcHttpClient.js +14 -4
  131. package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
  132. package/lib/execution/engine/jsonRpcTransport.d.ts +3 -2
  133. package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
  134. package/lib/execution/engine/jsonRpcTransport.js +33 -9
  135. package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
  136. package/lib/execution/engine/mock.d.ts +1 -0
  137. package/lib/execution/engine/mock.d.ts.map +1 -1
  138. package/lib/execution/engine/mock.js +25 -3
  139. package/lib/execution/engine/mock.js.map +1 -1
  140. package/lib/execution/engine/payloadIdCache.d.ts +4 -1
  141. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  142. package/lib/execution/engine/payloadIdCache.js +13 -2
  143. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  144. package/lib/execution/engine/restTransport.d.ts +5 -2
  145. package/lib/execution/engine/restTransport.d.ts.map +1 -1
  146. package/lib/execution/engine/restTransport.js +36 -21
  147. package/lib/execution/engine/restTransport.js.map +1 -1
  148. package/lib/execution/engine/transport.d.ts +5 -2
  149. package/lib/execution/engine/transport.d.ts.map +1 -1
  150. package/lib/execution/engine/transportMetrics.d.ts +5 -1
  151. package/lib/execution/engine/transportMetrics.d.ts.map +1 -1
  152. package/lib/execution/engine/types.d.ts +24 -0
  153. package/lib/execution/engine/types.d.ts.map +1 -1
  154. package/lib/execution/engine/types.js +24 -11
  155. package/lib/execution/engine/types.js.map +1 -1
  156. package/lib/metrics/metrics/beacon.d.ts +16 -0
  157. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  158. package/lib/metrics/metrics/beacon.js +35 -0
  159. package/lib/metrics/metrics/beacon.js.map +1 -1
  160. package/lib/metrics/metrics/lodestar.d.ts +20 -0
  161. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  162. package/lib/metrics/metrics/lodestar.js +51 -1
  163. package/lib/metrics/metrics/lodestar.js.map +1 -1
  164. package/lib/network/gossip/gossipsub.d.ts.map +1 -1
  165. package/lib/network/gossip/gossipsub.js +3 -1
  166. package/lib/network/gossip/gossipsub.js.map +1 -1
  167. package/lib/network/gossip/interface.d.ts +8 -2
  168. package/lib/network/gossip/interface.d.ts.map +1 -1
  169. package/lib/network/gossip/interface.js +1 -0
  170. package/lib/network/gossip/interface.js.map +1 -1
  171. package/lib/network/gossip/topic.d.ts +8 -14
  172. package/lib/network/gossip/topic.d.ts.map +1 -1
  173. package/lib/network/gossip/topic.js +13 -1
  174. package/lib/network/gossip/topic.js.map +1 -1
  175. package/lib/network/interface.d.ts +2 -1
  176. package/lib/network/interface.d.ts.map +1 -1
  177. package/lib/network/network.d.ts +2 -1
  178. package/lib/network/network.d.ts.map +1 -1
  179. package/lib/network/network.js +5 -0
  180. package/lib/network/network.js.map +1 -1
  181. package/lib/network/peers/utils/enrSubnetsDeserialize.d.ts.map +1 -1
  182. package/lib/network/peers/utils/enrSubnetsDeserialize.js +5 -2
  183. package/lib/network/peers/utils/enrSubnetsDeserialize.js.map +1 -1
  184. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  185. package/lib/network/processor/gossipHandlers.js +40 -1
  186. package/lib/network/processor/gossipHandlers.js.map +1 -1
  187. package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
  188. package/lib/network/processor/gossipQueues/index.js +6 -0
  189. package/lib/network/processor/gossipQueues/index.js.map +1 -1
  190. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  191. package/lib/network/processor/gossipValidatorFn.js +5 -1
  192. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  193. package/lib/network/processor/index.d.ts +5 -0
  194. package/lib/network/processor/index.d.ts.map +1 -1
  195. package/lib/network/processor/index.js +40 -29
  196. package/lib/network/processor/index.js.map +1 -1
  197. package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
  198. package/lib/network/reqresp/ReqRespBeaconNode.js +6 -0
  199. package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
  200. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  201. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +4 -4
  202. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  203. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +3 -3
  204. package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
  205. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts +10 -0
  206. package/lib/network/reqresp/handlers/inclusionListsByIndices.d.ts.map +1 -0
  207. package/lib/network/reqresp/handlers/inclusionListsByIndices.js +30 -0
  208. package/lib/network/reqresp/handlers/inclusionListsByIndices.js.map +1 -0
  209. package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
  210. package/lib/network/reqresp/handlers/index.js +5 -0
  211. package/lib/network/reqresp/handlers/index.js.map +1 -1
  212. package/lib/network/reqresp/protocols.d.ts +1 -0
  213. package/lib/network/reqresp/protocols.d.ts.map +1 -1
  214. package/lib/network/reqresp/protocols.js +5 -0
  215. package/lib/network/reqresp/protocols.js.map +1 -1
  216. package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
  217. package/lib/network/reqresp/rateLimit.js +6 -2
  218. package/lib/network/reqresp/rateLimit.js.map +1 -1
  219. package/lib/network/reqresp/types.d.ts +5 -2
  220. package/lib/network/reqresp/types.d.ts.map +1 -1
  221. package/lib/network/reqresp/types.js +3 -0
  222. package/lib/network/reqresp/types.js.map +1 -1
  223. package/lib/network/subnets/attnetsService.d.ts.map +1 -1
  224. package/lib/network/subnets/attnetsService.js +3 -1
  225. package/lib/network/subnets/attnetsService.js.map +1 -1
  226. package/lib/node/notifier.d.ts.map +1 -1
  227. package/lib/node/notifier.js +12 -13
  228. package/lib/node/notifier.js.map +1 -1
  229. package/lib/sync/unknownBlock.d.ts.map +1 -1
  230. package/lib/sync/unknownBlock.js +3 -2
  231. package/lib/sync/unknownBlock.js.map +1 -1
  232. package/lib/util/clock.d.ts.map +1 -1
  233. package/lib/util/clock.js +3 -4
  234. package/lib/util/clock.js.map +1 -1
  235. package/lib/util/sszBytes.d.ts +2 -2
  236. package/lib/util/sszBytes.d.ts.map +1 -1
  237. package/lib/util/sszBytes.js +22 -14
  238. package/lib/util/sszBytes.js.map +1 -1
  239. package/package.json +15 -15
  240. package/src/api/impl/beacon/blocks/index.ts +10 -3
  241. package/src/api/impl/beacon/state/index.ts +10 -1
  242. package/src/api/impl/beacon/state/utils.ts +19 -9
  243. package/src/api/impl/debug/index.ts +4 -0
  244. package/src/api/impl/validator/index.ts +173 -29
  245. package/src/chain/ColumnReconstructionTracker.ts +63 -46
  246. package/src/chain/archiveStore/utils/archiveBlocks.ts +6 -7
  247. package/src/chain/blocks/blockInput/blockInput.ts +1 -1
  248. package/src/chain/blocks/blockInput/utils.ts +2 -2
  249. package/src/chain/blocks/importBlock.ts +11 -11
  250. package/src/chain/blocks/importExecutionPayload.ts +67 -2
  251. package/src/chain/blocks/types.ts +5 -0
  252. package/src/chain/chain.ts +8 -2
  253. package/src/chain/errors/executionPayloadBid.ts +12 -0
  254. package/src/chain/errors/inclusionList.ts +38 -0
  255. package/src/chain/errors/index.ts +1 -0
  256. package/src/chain/interface.ts +4 -1
  257. package/src/chain/opPools/inclusionListStore.ts +208 -0
  258. package/src/chain/opPools/index.ts +1 -0
  259. package/src/chain/prepareNextSlot.ts +7 -3
  260. package/src/chain/produceBlock/computeNewStateRoot.ts +9 -2
  261. package/src/chain/produceBlock/produceBlockBody.ts +70 -23
  262. package/src/chain/regen/interface.ts +1 -0
  263. package/src/chain/reprocess.ts +2 -1
  264. package/src/chain/seenCache/seenGossipBlockInput.ts +2 -1
  265. package/src/chain/stateCache/persistentCheckpointsCache.ts +4 -1
  266. package/src/chain/validation/executionPayloadBid.ts +52 -2
  267. package/src/chain/validation/inclusionList.ts +183 -0
  268. package/src/chain/validation/index.ts +1 -0
  269. package/src/chain/validatorMonitor.ts +7 -4
  270. package/src/constants/constants.ts +1 -0
  271. package/src/db/repositories/blockArchive.ts +2 -2
  272. package/src/db/repositories/blockArchiveIndex.ts +2 -3
  273. package/src/execution/builder/validateBid.ts +23 -2
  274. package/src/execution/engine/disabled.ts +4 -0
  275. package/src/execution/engine/http.ts +41 -5
  276. package/src/execution/engine/index.ts +2 -1
  277. package/src/execution/engine/interface.ts +27 -3
  278. package/src/execution/engine/jsonRpcHttpClient.ts +12 -5
  279. package/src/execution/engine/jsonRpcTransport.ts +46 -9
  280. package/src/execution/engine/mock.ts +26 -3
  281. package/src/execution/engine/payloadIdCache.ts +23 -4
  282. package/src/execution/engine/restTransport.ts +68 -23
  283. package/src/execution/engine/transport.ts +7 -2
  284. package/src/execution/engine/transportMetrics.ts +2 -1
  285. package/src/execution/engine/types.ts +48 -11
  286. package/src/metrics/metrics/beacon.ts +37 -0
  287. package/src/metrics/metrics/lodestar.ts +53 -1
  288. package/src/network/gossip/gossipsub.ts +3 -1
  289. package/src/network/gossip/interface.ts +5 -0
  290. package/src/network/gossip/topic.ts +14 -0
  291. package/src/network/interface.ts +2 -0
  292. package/src/network/network.ts +11 -0
  293. package/src/network/peers/utils/enrSubnetsDeserialize.ts +5 -2
  294. package/src/network/processor/gossipHandlers.ts +52 -1
  295. package/src/network/processor/gossipQueues/index.ts +6 -0
  296. package/src/network/processor/gossipValidatorFn.ts +5 -0
  297. package/src/network/processor/index.ts +36 -27
  298. package/src/network/processor/types.ts +1 -1
  299. package/src/network/reqresp/ReqRespBeaconNode.ts +7 -0
  300. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -10
  301. package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +3 -3
  302. package/src/network/reqresp/handlers/inclusionListsByIndices.ts +44 -0
  303. package/src/network/reqresp/handlers/index.ts +5 -0
  304. package/src/network/reqresp/protocols.ts +6 -0
  305. package/src/network/reqresp/rateLimit.ts +6 -2
  306. package/src/network/reqresp/types.ts +6 -0
  307. package/src/network/subnets/attnetsService.ts +8 -3
  308. package/src/node/notifier.ts +14 -13
  309. package/src/sync/unknownBlock.ts +3 -2
  310. package/src/util/clock.ts +3 -4
  311. package/src/util/sszBytes.ts +25 -12
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "bugs": {
12
12
  "url": "https://github.com/ChainSafe/lodestar/issues"
13
13
  },
14
- "version": "1.50.0",
14
+ "version": "1.51.0-dev.15ecdb3b27",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -127,17 +127,17 @@
127
127
  "@libp2p/prometheus-metrics": "^5.0.28",
128
128
  "@libp2p/tcp": "^11.0.27",
129
129
  "@libp2p/utils": "^7.4.0",
130
- "@lodestar/api": "^1.50.0",
131
- "@lodestar/config": "^1.50.0",
132
- "@lodestar/db": "^1.50.0",
133
- "@lodestar/fork-choice": "^1.50.0",
134
- "@lodestar/logger": "^1.50.0",
135
- "@lodestar/params": "^1.50.0",
136
- "@lodestar/reqresp": "^1.50.0",
137
- "@lodestar/state-transition": "^1.50.0",
138
- "@lodestar/types": "^1.50.0",
139
- "@lodestar/utils": "^1.50.0",
140
- "@lodestar/validator": "^1.50.0",
130
+ "@lodestar/api": "^1.51.0-dev.15ecdb3b27",
131
+ "@lodestar/config": "^1.51.0-dev.15ecdb3b27",
132
+ "@lodestar/db": "^1.51.0-dev.15ecdb3b27",
133
+ "@lodestar/fork-choice": "^1.51.0-dev.15ecdb3b27",
134
+ "@lodestar/logger": "^1.51.0-dev.15ecdb3b27",
135
+ "@lodestar/params": "^1.51.0-dev.15ecdb3b27",
136
+ "@lodestar/reqresp": "^1.51.0-dev.15ecdb3b27",
137
+ "@lodestar/state-transition": "^1.51.0-dev.15ecdb3b27",
138
+ "@lodestar/types": "^1.51.0-dev.15ecdb3b27",
139
+ "@lodestar/utils": "^1.51.0-dev.15ecdb3b27",
140
+ "@lodestar/validator": "^1.51.0-dev.15ecdb3b27",
141
141
  "@multiformats/multiaddr": "^13.0.1",
142
142
  "datastore-core": "^12.0.1",
143
143
  "datastore-level": "^13.0.1",
@@ -159,8 +159,8 @@
159
159
  "@ethereumjs/rlp": "^4.0.1",
160
160
  "@libp2p/interface-internal": "^3.1.12",
161
161
  "@libp2p/logger": "^6.2.13",
162
- "@lodestar/spec-test-util": "^1.50.0",
163
- "@lodestar/test-utils": "^1.50.0",
162
+ "@lodestar/spec-test-util": "^1.51.0-dev.15ecdb3b27",
163
+ "@lodestar/test-utils": "^1.51.0-dev.15ecdb3b27",
164
164
  "@types/js-yaml": "^4.0.5",
165
165
  "@types/qs": "^6.9.7",
166
166
  "@types/tmp": "^0.2.3",
@@ -175,5 +175,5 @@
175
175
  "beacon",
176
176
  "blockchain"
177
177
  ],
178
- "gitHead": "003bd66543fa65b5c1e954eec9e8077054c226dc"
178
+ "gitHead": "64c24b46bbca210a0a80db782ebe3c5924b3cae5"
179
179
  }
@@ -6,6 +6,7 @@ import {
6
6
  ForkPostBellatrix,
7
7
  ForkPostFulu,
8
8
  ForkPostGloas,
9
+ ForkPreBellatrix,
9
10
  ForkPreGloas,
10
11
  NUMBER_OF_COLUMNS,
11
12
  SLOTS_PER_HISTORICAL_ROOT,
@@ -674,7 +675,7 @@ export function getBeaconBlockApi({
674
675
  return {
675
676
  data: isForkPostBellatrix(fork)
676
677
  ? signedBeaconBlockToBlinded(config, block as SignedBeaconBlock<ForkPostBellatrix & ForkPreGloas>)
677
- : block,
678
+ : (block as SignedBeaconBlock<ForkPreBellatrix>),
678
679
  meta: {
679
680
  executionOptimistic,
680
681
  finalized,
@@ -692,8 +693,14 @@ export function getBeaconBlockApi({
692
693
  },
693
694
 
694
695
  async getBlockRoot({blockId}) {
695
- // Fast path: From head state already available in memory get historical blockRoot
696
- const slot = typeof blockId === "string" ? parseInt(blockId) : blockId;
696
+ // Fast path: From head state already available in memory get historical blockRoot.
697
+ // A 0x id is a root. parseInt() accepts that prefix as hex and can return a slot.
698
+ const slot =
699
+ typeof blockId === "number"
700
+ ? blockId
701
+ : blockId.toLowerCase().startsWith("0x")
702
+ ? Number.NaN
703
+ : parseInt(blockId, 10);
697
704
  if (!Number.isNaN(slot)) {
698
705
  const head = chain.forkChoice.getHead();
699
706
 
@@ -17,6 +17,7 @@ import {
17
17
  isStatePostGloas,
18
18
  } from "@lodestar/state-transition";
19
19
  import {
20
+ BuilderIndex,
20
21
  ValidatorIndex,
21
22
  getBuilderStatus,
22
23
  getValidatorStatus,
@@ -29,6 +30,7 @@ import {ApiModules} from "../../types.js";
29
30
  import {assertUniqueItems} from "../../utils.js";
30
31
  import {
31
32
  filterStateValidatorsByStatus,
33
+ getBuilderIndexByPubkey,
32
34
  getStateBuilderIndex,
33
35
  getStateResponseWithRegen,
34
36
  getStateValidatorIndex,
@@ -170,8 +172,15 @@ export function getBeaconStateApi({
170
172
  if (builderIds.length) {
171
173
  assertUniqueItems(builderIds, "Duplicate builder IDs provided");
172
174
 
175
+ // There is no builder pubkey cache, scan the registry at most once per request
176
+ let builderIndexByPubkey: Map<string, BuilderIndex> | null = null;
177
+ const getBuilderIndexByPubkeyMap = () => {
178
+ builderIndexByPubkey ??= getBuilderIndexByPubkey(state);
179
+ return builderIndexByPubkey;
180
+ };
181
+
173
182
  for (const id of builderIds) {
174
- const resp = getStateBuilderIndex(id, state);
183
+ const resp = getStateBuilderIndex(id, state, getBuilderIndexByPubkeyMap);
175
184
  if (resp.valid) {
176
185
  const builderIndex = resp.builderIndex;
177
186
  const builder = state.getBuilder(builderIndex);
@@ -13,7 +13,7 @@ import {
13
13
  getValidatorStatus,
14
14
  phase0,
15
15
  } from "@lodestar/types";
16
- import {byteArrayEquals, fromHex} from "@lodestar/utils";
16
+ import {fromHex, toHex} from "@lodestar/utils";
17
17
  import {IBeaconChain} from "../../../../chain/index.js";
18
18
  import {GENESIS_EPOCH} from "../../../../constants/index.js";
19
19
  import {IBeaconSync} from "../../../../sync/index.js";
@@ -118,9 +118,22 @@ type StateBuilderIndexResponse =
118
118
  | {valid: true; builderIndex: BuilderIndex}
119
119
  | {valid: false; code: number; reason: string};
120
120
 
121
+ export function getBuilderIndexByPubkey(state: IBeaconStateViewGloas): Map<string, BuilderIndex> {
122
+ const builderIndexByPubkey = new Map<string, BuilderIndex>();
123
+ const buildersLength = state.getBuildersLength();
124
+ for (let builderIndex = 0; builderIndex < buildersLength; builderIndex++) {
125
+ const pubkeyHex = toHex(state.getBuilder(builderIndex).pubkey);
126
+ if (!builderIndexByPubkey.has(pubkeyHex)) {
127
+ builderIndexByPubkey.set(pubkeyHex, builderIndex);
128
+ }
129
+ }
130
+ return builderIndexByPubkey;
131
+ }
132
+
121
133
  export function getStateBuilderIndex(
122
134
  id: routes.beacon.BuilderId | BLSPubkey,
123
- state: IBeaconStateViewGloas
135
+ state: IBeaconStateViewGloas,
136
+ getBuilderIndexByPubkeyMap: () => Map<string, BuilderIndex>
124
137
  ): StateBuilderIndexResponse {
125
138
  if (typeof id === "string") {
126
139
  // mutate `id` and fallthrough to below
@@ -148,14 +161,11 @@ export function getStateBuilderIndex(
148
161
  }
149
162
 
150
163
  // typeof id === Uint8Array
151
- // There is no builder pubkey cache, linear scan over the registry
152
- const buildersLength = state.getBuildersLength();
153
- for (let builderIndex = 0; builderIndex < buildersLength; builderIndex++) {
154
- if (byteArrayEquals(state.getBuilder(builderIndex).pubkey, id)) {
155
- return {valid: true, builderIndex};
156
- }
164
+ const builderIndex = getBuilderIndexByPubkeyMap().get(toHex(id));
165
+ if (builderIndex === undefined) {
166
+ return {valid: false, code: 404, reason: "Builder pubkey not found in state"};
157
167
  }
158
- return {valid: false, code: 404, reason: "Builder pubkey not found in state"};
168
+ return {valid: true, builderIndex};
159
169
  }
160
170
 
161
171
  export function filterStateValidatorsByStatus(
@@ -114,6 +114,10 @@ export function getDebugApi({
114
114
  unrealizedJustifiedRoot: node.unrealizedJustifiedRoot,
115
115
  unrealizedFinalizedEpoch: node.unrealizedFinalizedEpoch,
116
116
  unrealizedFinalizedRoot: node.unrealizedFinalizedRoot,
117
+ inclusionListSatisfied:
118
+ node.payloadStatus === PayloadStatus.FULL
119
+ ? forkChoice.getPayloadInclusionListSatisfaction(node.blockRoot)
120
+ : null,
117
121
  },
118
122
  };
119
123
  }),
@@ -5,6 +5,8 @@ import {
5
5
  BUILDER_INDEX_SELF_BUILD,
6
6
  ForkName,
7
7
  ForkPostBellatrix,
8
+ ForkPostDeneb,
9
+ ForkPreDeneb,
8
10
  ForkPreGloas,
9
11
  ForkSeq,
10
12
  GENESIS_SLOT,
@@ -16,6 +18,7 @@ import {
16
18
  isForkPostElectra,
17
19
  isForkPostFulu,
18
20
  isForkPostGloas,
21
+ isForkPostHeze,
19
22
  } from "@lodestar/params";
20
23
  import {
21
24
  DataAvailabilityStatus,
@@ -26,6 +29,7 @@ import {
26
29
  computeStartSlotAtEpoch,
27
30
  computeTimeAtSlot,
28
31
  getCurrentSlot,
32
+ getInclusionListCommittee,
29
33
  isStatePostAltair,
30
34
  isStatePostGloas,
31
35
  proposerShufflingDecisionRoot,
@@ -66,6 +70,7 @@ import {
66
70
  } from "@lodestar/utils";
67
71
  import {MAX_BUILDER_BOOST_FACTOR} from "@lodestar/validator";
68
72
  import {BlockInputSource} from "../../../chain/blocks/blockInput/types.js";
73
+ import {InclusionListSource} from "../../../chain/blocks/types.js";
69
74
  import {
70
75
  AttestationError,
71
76
  AttestationErrorCode,
@@ -81,7 +86,11 @@ import {PREPARE_NEXT_SLOT_BPS} from "../../../chain/prepareNextSlot.js";
81
86
  import {BlockType, ProduceFullDeneb, ProduceFullGloas} from "../../../chain/produceBlock/index.js";
82
87
  import {RegenCaller} from "../../../chain/regen/index.js";
83
88
  import {CheckpointHex} from "../../../chain/stateCache/types.js";
84
- import {validateApiAggregateAndProof} from "../../../chain/validation/index.js";
89
+ import {
90
+ InclusionListValidationResult,
91
+ validateApiAggregateAndProof,
92
+ validateGossipInclusionList,
93
+ } from "../../../chain/validation/index.js";
85
94
  import {validateGossipProposerPreferences} from "../../../chain/validation/proposerPreferences.js";
86
95
  import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
87
96
  import {ZERO_HASH} from "../../../constants/index.js";
@@ -111,14 +120,13 @@ import {
111
120
  * Post this time, race execution and builder to pick whatever resolves first.
112
121
  *
113
122
  * Empirically the builder block resolves in ~1 second, and execution block resolves in <500 ms.
114
- * A cutoff of 2 seconds gives enough time and if there are unexpected delays it ensures we publish
115
- * in time as proposals post 4 seconds into the slot will likely be orphaned due to proposer boost reorg.
123
+ * A cutoff of 1667 BPS (2 seconds for 12s slots) gives enough time and if there are unexpected delays
124
+ * it ensures we publish in time as proposals after the attestation deadline will likely be orphaned
125
+ * due to proposer boost reorg.
116
126
  *
117
127
  * TODO GLOAS: re-evaluate cutoff timing due to attestation deadline changes in gloas
118
128
  */
119
- const BLOCK_PRODUCTION_RACE_CUTOFF_MS = 2_000;
120
- /** Overall timeout for execution and block production apis */
121
- const BLOCK_PRODUCTION_RACE_TIMEOUT_MS = 12_000;
129
+ const BLOCK_PRODUCTION_RACE_CUTOFF_BPS = 1667;
122
130
  /** Rejection message of the bid block branch when there is no viable bid to commit to */
123
131
  const NO_BID_AVAILABLE = "No builder bid available";
124
132
 
@@ -167,8 +175,8 @@ function compareBidCandidates(a: BidCandidate, b: BidCandidate): number {
167
175
  }
168
176
 
169
177
  type ProduceBlockContentsRes = {executionPayloadValue: Wei; consensusBlockValue: Wei} & {
170
- data: BlockContents;
171
- version: ForkName;
178
+ data: BlockContents<ForkPreGloas>;
179
+ version: ForkPreGloas;
172
180
  };
173
181
  type ProduceBlindedBlockRes = {executionPayloadValue: Wei; consensusBlockValue: Wei} & {
174
182
  data: BlindedBeaconBlock;
@@ -246,13 +254,13 @@ export function getValidatorApi(
246
254
  genesisBlockRoot = state.computeAnchorCheckpoint().checkpoint.root;
247
255
  } else if (state.slot < SLOTS_PER_HISTORICAL_ROOT) {
248
256
  genesisBlockRoot = state.getBlockRootAtSlot(GENESIS_SLOT);
249
- }
250
-
251
- const blockRes = await chain.getCanonicalBlockAtSlot(GENESIS_SLOT);
252
- if (blockRes) {
253
- genesisBlockRoot = config
254
- .getForkTypes(blockRes.block.message.slot)
255
- .SignedBeaconBlock.hashTreeRoot(blockRes.block);
257
+ } else {
258
+ const blockRes = await chain.getCanonicalBlockAtSlot(GENESIS_SLOT);
259
+ if (blockRes) {
260
+ genesisBlockRoot = config
261
+ .getForkTypes(blockRes.block.message.slot)
262
+ .BeaconBlock.hashTreeRoot(blockRes.block.message);
263
+ }
256
264
  }
257
265
  }
258
266
 
@@ -301,8 +309,8 @@ export function getValidatorApi(
301
309
  */
302
310
  function msToNextEpoch(): number {
303
311
  const nextEpoch = chain.clock.currentEpoch + 1;
304
- const secPerEpoch = (SLOTS_PER_EPOCH * config.SLOT_DURATION_MS) / 1000;
305
- const nextEpochStartSec = chain.genesisTime + nextEpoch * secPerEpoch;
312
+ const nextEpochSlot = computeStartSlotAtEpoch(nextEpoch);
313
+ const nextEpochStartSec = computeTimeAtSlot(config, nextEpochSlot, chain.genesisTime);
306
314
  return nextEpochStartSec * 1000 - Date.now();
307
315
  }
308
316
 
@@ -511,6 +519,10 @@ export function getValidatorApi(
511
519
  parentBlock: ProtoBlock;
512
520
  }
513
521
  ): Promise<ProduceBlockContentsRes & {shouldOverrideBuilder?: boolean}> {
522
+ const version = config.getForkName(slot);
523
+ if (isForkPostGloas(version)) {
524
+ throw Error(`produceEngineBlockContents called for post-gloas fork=${version}`);
525
+ }
514
526
  const source = ProducedBlockSource.engine;
515
527
  metrics?.blockProductionRequests.inc({source});
516
528
 
@@ -525,7 +537,6 @@ export function getValidatorApi(
525
537
  feeRecipient,
526
538
  commonBlockBodyPromise,
527
539
  });
528
- const version = config.getForkName(block.slot);
529
540
  if (strictFeeRecipientCheck && feeRecipient && isForkPostBellatrix(version)) {
530
541
  const blockFeeRecipient = toHex((block as bellatrix.BeaconBlock).body.executionPayload.feeRecipient);
531
542
  if (blockFeeRecipient !== feeRecipient) {
@@ -563,7 +574,7 @@ export function getValidatorApi(
563
574
 
564
575
  return {
565
576
  data: {
566
- block,
577
+ block: block as BeaconBlock<ForkPostDeneb & ForkPreGloas>,
567
578
  blobs: blobsBundle.blobs,
568
579
  kzgProofs: blobsBundle.proofs,
569
580
  },
@@ -574,7 +585,13 @@ export function getValidatorApi(
574
585
  };
575
586
  }
576
587
 
577
- return {data: {block}, version, executionPayloadValue, consensusBlockValue, shouldOverrideBuilder};
588
+ return {
589
+ data: {block: block as BeaconBlock<ForkPreDeneb>},
590
+ version,
591
+ executionPayloadValue,
592
+ consensusBlockValue,
593
+ shouldOverrideBuilder,
594
+ };
578
595
  } finally {
579
596
  if (timer) timer({source});
580
597
  }
@@ -680,17 +697,21 @@ export function getValidatorApi(
680
697
  });
681
698
 
682
699
  // Calculate cutoff time based on start of the slot
683
- const cutoffMs = Math.max(0, BLOCK_PRODUCTION_RACE_CUTOFF_MS - chain.clock.msFromSlot(slot));
700
+ const cutoffMs = Math.max(
701
+ 0,
702
+ config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_BPS) - chain.clock.msFromSlot(slot)
703
+ );
704
+ const blockProductionTimeoutMs = config.getSlotDurationMs(fork);
684
705
 
685
706
  logger.verbose("Block production race (builder vs execution) starting", {
686
707
  ...loggerContext,
687
708
  cutoffMs,
688
- timeoutMs: BLOCK_PRODUCTION_RACE_TIMEOUT_MS,
709
+ timeoutMs: blockProductionTimeoutMs,
689
710
  });
690
711
 
691
712
  const blockProductionRacePromise = resolveOrRacePromises([builderPromise, enginePromise], {
692
713
  resolveTimeoutMs: cutoffMs,
693
- raceTimeoutMs: BLOCK_PRODUCTION_RACE_TIMEOUT_MS,
714
+ raceTimeoutMs: blockProductionTimeoutMs,
694
715
  signal: controller.signal,
695
716
  });
696
717
 
@@ -878,6 +899,10 @@ export function getValidatorApi(
878
899
 
879
900
  return {
880
901
  async produceBlockV3({slot, randaoReveal, graffiti, skipRandaoVerification, builderBoostFactor, ...opts}) {
902
+ const forkName = config.getForkName(slot);
903
+ if (isForkPostGloas(forkName)) {
904
+ throw new ApiError(400, `produceBlockV3 not supported for post-gloas fork=${forkName}, use produceBlockV4`);
905
+ }
881
906
  const {data, ...meta} = await produceEngineOrBuilderBlock(
882
907
  slot,
883
908
  randaoReveal,
@@ -1095,7 +1120,10 @@ export function getValidatorApi(
1095
1120
 
1096
1121
  // Calculate cutoff time based on start of the slot, ensures a slow local payload build does
1097
1122
  // not delay the proposal when a builder bid block is available (and vice versa)
1098
- const cutoffMs = Math.max(0, BLOCK_PRODUCTION_RACE_CUTOFF_MS - chain.clock.msFromSlot(slot));
1123
+ const cutoffMs = Math.max(
1124
+ 0,
1125
+ config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_BPS) - chain.clock.msFromSlot(slot)
1126
+ );
1099
1127
 
1100
1128
  // use abort controller to stop waiting for the bid block if the engine block will be selected
1101
1129
  const controller = new AbortController();
@@ -1123,7 +1151,7 @@ export function getValidatorApi(
1123
1151
 
1124
1152
  const [engineResult, bidBlockResult] = await resolveOrRacePromises([enginePromise, bidBlockPromise], {
1125
1153
  resolveTimeoutMs: cutoffMs,
1126
- raceTimeoutMs: BLOCK_PRODUCTION_RACE_TIMEOUT_MS,
1154
+ raceTimeoutMs: config.getSlotDurationMs(fork),
1127
1155
  signal: controller.signal,
1128
1156
  });
1129
1157
 
@@ -1417,7 +1445,7 @@ export function getValidatorApi(
1417
1445
  // Spec: set payload_present only if the envelope was seen before get_payload_due_ms()
1418
1446
  // into the slot. Use the envelope's own arrival time (getPayloadEnvelopeSource), not
1419
1447
  // the input's creation time.
1420
- const payloadDueSec = config.getPayloadDueMs() / 1000;
1448
+ const payloadDueSec = config.getPayloadDueMs(fork) / 1000;
1421
1449
  const payloadSeenSec =
1422
1450
  payloadInput?.hasPayloadEnvelope() === true
1423
1451
  ? chain.clock.secFromSlot(slot, payloadInput.getPayloadEnvelopeSource().seenTimestampSec)
@@ -1494,8 +1522,9 @@ export function getValidatorApi(
1494
1522
  const currentEpoch = currentEpochWithDisparity();
1495
1523
  const nextEpoch = currentEpoch + 1;
1496
1524
  const startSlot = computeStartSlotAtEpoch(epoch);
1525
+ const prepareFork = config.getForkName(computeStartSlotAtEpoch(nextEpoch) - 1);
1497
1526
  const prepareNextSlotLookAheadMs =
1498
- config.SLOT_DURATION_MS - config.getSlotComponentDurationMs(PREPARE_NEXT_SLOT_BPS);
1527
+ config.getSlotDurationMs(prepareFork) - config.getSlotComponentDurationMs(prepareFork, PREPARE_NEXT_SLOT_BPS);
1499
1528
  const toNextEpochMs = msToNextEpoch();
1500
1529
  const nearNextEpoch = toNextEpochMs < prepareNextSlotLookAheadMs;
1501
1530
  // Post-Fulu the proposer lookahead is deterministic and known a full epoch ahead, so
@@ -1678,7 +1707,7 @@ export function getValidatorApi(
1678
1707
  }
1679
1708
  }
1680
1709
 
1681
- const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch)) || (await getGenesisBlockRoot(state));
1710
+ const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch));
1682
1711
 
1683
1712
  return {
1684
1713
  data: duties,
@@ -1727,7 +1756,7 @@ export function getValidatorApi(
1727
1756
  }
1728
1757
  }
1729
1758
 
1730
- const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch)) || (await getGenesisBlockRoot(state));
1759
+ const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch));
1731
1760
 
1732
1761
  return {
1733
1762
  data: duties,
@@ -2176,6 +2205,121 @@ export function getValidatorApi(
2176
2205
  }
2177
2206
  },
2178
2207
 
2208
+ async produceInclusionList({slot}) {
2209
+ notWhileSyncing(chain, sync.state);
2210
+
2211
+ if (!isForkPostHeze(chain.config.getForkName(slot))) {
2212
+ throw new ApiError(400, `Producing inclusion list for pre-heze slot: ${slot}`);
2213
+ }
2214
+
2215
+ await waitForSlot(slot); // Must never request for a future slot > currentSlot
2216
+
2217
+ const timer = metrics?.getInclusionListV1RequestsDuration.startTimer();
2218
+ const transactions = await chain.executionEngine.getInclusionList();
2219
+ timer?.();
2220
+ metrics?.getInclusionListV1Requests.inc();
2221
+
2222
+ return {data: transactions, meta: {version: chain.config.getForkName(slot)}};
2223
+ },
2224
+
2225
+ async getInclusionListCommitteeDuties({epoch, indices}) {
2226
+ notWhileSyncing(chain, sync.state);
2227
+
2228
+ if (indices.length === 0) {
2229
+ throw new ApiError(400, "No validator to get inclusion list committee duties");
2230
+ }
2231
+
2232
+ if (!isForkPostHeze(chain.config.getForkName(computeStartSlotAtEpoch(epoch)))) {
2233
+ throw new ApiError(400, `Requesting pre-heze inclusion list committee duties epoch: ${epoch}`);
2234
+ }
2235
+
2236
+ // May request for an epoch that's in the future
2237
+ await waitForNextClosestEpoch();
2238
+
2239
+ if (epoch > chain.clock.currentEpoch + 1) {
2240
+ throw new ApiError(400, "Cannot get duties for epoch more than one ahead");
2241
+ }
2242
+
2243
+ const head = chain.forkChoice.getHead();
2244
+ const state = await chain.getHeadStateAtCurrentEpoch(RegenCaller.getDuties);
2245
+
2246
+ const pubkeys = getPubkeysForIndices(state, indices);
2247
+ const requestedIndices = new Set(indices);
2248
+ const epochStartSlot = computeStartSlotAtEpoch(epoch);
2249
+ const shuffling = state.getShufflingAtEpoch(epoch);
2250
+
2251
+ // Validators set this as `dependent_root` on their inclusion lists
2252
+ const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch));
2253
+
2254
+ // A validator can be on several slots' committees in an epoch; report the earliest, as for attester duties
2255
+ const dutySlotByValidator = new Map<ValidatorIndex, Slot>();
2256
+ for (let i = 0; i < SLOTS_PER_EPOCH; i++) {
2257
+ const slot = epochStartSlot + i;
2258
+ for (const validatorIndex of getInclusionListCommittee(shuffling, slot).validatorIndices) {
2259
+ if (requestedIndices.has(validatorIndex) && !dutySlotByValidator.has(validatorIndex)) {
2260
+ dutySlotByValidator.set(validatorIndex, slot);
2261
+ }
2262
+ }
2263
+ }
2264
+
2265
+ const duties: routes.validator.InclusionListDuty[] = [];
2266
+ for (let i = 0; i < indices.length; i++) {
2267
+ const validatorIndex = indices[i];
2268
+ const slot = dutySlotByValidator.get(validatorIndex);
2269
+ if (slot !== undefined) {
2270
+ duties.push({pubkey: pubkeys[i], validatorIndex, slot, dependentRoot});
2271
+ }
2272
+ }
2273
+
2274
+ return {
2275
+ data: duties,
2276
+ meta: {
2277
+ dependentRoot: toRootHex(dependentRoot),
2278
+ executionOptimistic: isOptimisticBlock(head),
2279
+ },
2280
+ };
2281
+ },
2282
+
2283
+ async publishInclusionList({signedInclusionList}) {
2284
+ notWhileSyncing(chain, sync.state);
2285
+
2286
+ const {slot} = signedInclusionList.message;
2287
+ if (!isForkPostHeze(chain.config.getForkName(slot))) {
2288
+ throw new ApiError(400, `Publishing pre-heze inclusion list slot: ${slot}`);
2289
+ }
2290
+
2291
+ // Timeliness is judged on receipt, as for gossip, so a list submitted in time stays timely if validation is slow
2292
+ const secFromSlot = chain.clock.secFromSlot(slot, Date.now() / 1000);
2293
+ metrics?.inclusionListsReceived.inc({source: InclusionListSource.api});
2294
+ metrics?.inclusionListTransactionsReceived.inc(
2295
+ {source: InclusionListSource.api},
2296
+ signedInclusionList.message.transactions.length
2297
+ );
2298
+
2299
+ const timer = metrics?.inclusionListsValidationTime.startTimer();
2300
+ let validationResult: InclusionListValidationResult;
2301
+ try {
2302
+ validationResult = await validateGossipInclusionList(chain, signedInclusionList);
2303
+ } finally {
2304
+ timer?.({source: InclusionListSource.api});
2305
+ }
2306
+ const {committeeIndices, totalBytes} = validationResult;
2307
+ metrics?.inclusionListsValid.inc({source: InclusionListSource.api});
2308
+ metrics?.inclusionListsValidSize.inc(totalBytes);
2309
+
2310
+ const isTimely =
2311
+ secFromSlot >= 0 && secFromSlot * 1000 < chain.config.getInclusionListDueMs(chain.config.getForkName(slot));
2312
+ chain.inclusionListStore.process(signedInclusionList, committeeIndices, isTimely);
2313
+
2314
+ chain.emitter.emit(routes.events.EventType.inclusionList, {
2315
+ version: chain.config.getForkName(slot),
2316
+ data: signedInclusionList,
2317
+ });
2318
+
2319
+ await network.publishInclusionList(signedInclusionList);
2320
+ metrics?.inclusionListsPublished.inc();
2321
+ },
2322
+
2179
2323
  async getExecutionPayloadEnvelope({slot, beaconBlockRoot}) {
2180
2324
  const fork = config.getForkName(slot);
2181
2325