@lodestar/beacon-node 1.51.0-dev.b3beff2246 → 1.51.0-dev.bb16085c5e

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 (250) hide show
  1. package/lib/api/impl/api.js +1 -1
  2. package/lib/api/impl/api.js.map +1 -1
  3. package/lib/api/impl/beacon/blocks/index.d.ts +2 -1
  4. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/blocks/index.js +29 -34
  6. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  7. package/lib/api/impl/beacon/index.d.ts +2 -1
  8. package/lib/api/impl/beacon/index.d.ts.map +1 -1
  9. package/lib/api/impl/beacon/index.js +2 -2
  10. package/lib/api/impl/beacon/index.js.map +1 -1
  11. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  12. package/lib/api/impl/beacon/pool/index.js +5 -2
  13. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  14. package/lib/api/impl/beacon/state/utils.d.ts +1 -1
  15. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  16. package/lib/api/impl/validator/index.d.ts.map +1 -1
  17. package/lib/api/impl/validator/index.js +4 -1
  18. package/lib/api/impl/validator/index.js.map +1 -1
  19. package/lib/api/options.d.ts +2 -0
  20. package/lib/api/options.d.ts.map +1 -1
  21. package/lib/api/options.js +1 -0
  22. package/lib/api/options.js.map +1 -1
  23. package/lib/chain/GetBlobsTracker.d.ts +11 -0
  24. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  25. package/lib/chain/GetBlobsTracker.js +85 -27
  26. package/lib/chain/GetBlobsTracker.js.map +1 -1
  27. package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
  28. package/lib/chain/archiveStore/archiveStore.js +1 -0
  29. package/lib/chain/archiveStore/archiveStore.js.map +1 -1
  30. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +4 -0
  31. package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
  32. package/lib/chain/archiveStore/utils/archiveBlocks.js +61 -97
  33. package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
  34. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  35. package/lib/chain/blocks/importBlock.js +6 -5
  36. package/lib/chain/blocks/importBlock.js.map +1 -1
  37. package/lib/chain/blocks/importExecutionPayload.d.ts +4 -1
  38. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  39. package/lib/chain/blocks/importExecutionPayload.js +9 -3
  40. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  41. package/lib/chain/blocks/index.js +2 -2
  42. package/lib/chain/blocks/index.js.map +1 -1
  43. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -5
  44. package/lib/chain/blocks/payloadEnvelopeProcessor.js +7 -7
  45. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  46. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  47. package/lib/chain/blocks/verifyBlock.js +1 -1
  48. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  49. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
  50. package/lib/chain/blocks/verifyBlocksDataAvailability.js +8 -1
  51. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  52. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
  53. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
  54. package/lib/chain/blocks/verifyPayloadsDataAvailability.js +13 -6
  55. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  56. package/lib/chain/bls/multithread/index.js +5 -5
  57. package/lib/chain/bls/multithread/index.js.map +1 -1
  58. package/lib/chain/bls/multithread/types.d.ts +1 -1
  59. package/lib/chain/bls/multithread/types.d.ts.map +1 -1
  60. package/lib/chain/bls/multithread/worker.js +1 -1
  61. package/lib/chain/bls/multithread/worker.js.map +1 -1
  62. package/lib/chain/bls/singleThread.js +1 -1
  63. package/lib/chain/bls/singleThread.js.map +1 -1
  64. package/lib/chain/bls/utils.js +1 -1
  65. package/lib/chain/bls/utils.js.map +1 -1
  66. package/lib/chain/chain.d.ts +1 -1
  67. package/lib/chain/chain.d.ts.map +1 -1
  68. package/lib/chain/chain.js +4 -4
  69. package/lib/chain/chain.js.map +1 -1
  70. package/lib/chain/errors/blockError.d.ts +1 -1
  71. package/lib/chain/errors/blockError.d.ts.map +1 -1
  72. package/lib/chain/errors/blockError.js +1 -1
  73. package/lib/chain/errors/blockError.js.map +1 -1
  74. package/lib/chain/interface.d.ts +2 -3
  75. package/lib/chain/interface.d.ts.map +1 -1
  76. package/lib/chain/interface.js.map +1 -1
  77. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  78. package/lib/chain/opPools/aggregatedAttestationPool.js +1 -1
  79. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  80. package/lib/chain/opPools/attestationPool.d.ts +1 -1
  81. package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
  82. package/lib/chain/opPools/attestationPool.js +1 -1
  83. package/lib/chain/opPools/attestationPool.js.map +1 -1
  84. package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
  85. package/lib/chain/opPools/inclusionListStore.js +2 -2
  86. package/lib/chain/opPools/inclusionListStore.js.map +1 -1
  87. package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
  88. package/lib/chain/opPools/payloadAttestationPool.js +1 -1
  89. package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
  90. package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
  91. package/lib/chain/opPools/syncCommitteeMessagePool.js +1 -1
  92. package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
  93. package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
  94. package/lib/chain/opPools/syncContributionAndProofPool.js +1 -1
  95. package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
  96. package/lib/chain/opPools/utils.d.ts +1 -1
  97. package/lib/chain/opPools/utils.d.ts.map +1 -1
  98. package/lib/chain/opPools/utils.js +1 -1
  99. package/lib/chain/opPools/utils.js.map +1 -1
  100. package/lib/chain/options.d.ts +0 -1
  101. package/lib/chain/options.d.ts.map +1 -1
  102. package/lib/chain/options.js +0 -1
  103. package/lib/chain/options.js.map +1 -1
  104. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  105. package/lib/chain/produceBlock/produceBlockBody.js +0 -1
  106. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  107. package/lib/chain/regen/interface.d.ts +0 -1
  108. package/lib/chain/regen/interface.d.ts.map +1 -1
  109. package/lib/chain/regen/interface.js +0 -1
  110. package/lib/chain/regen/interface.js.map +1 -1
  111. package/lib/chain/validation/executionPayloadBid.d.ts +0 -15
  112. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  113. package/lib/chain/validation/executionPayloadBid.js +0 -153
  114. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  115. package/lib/chain/validation/inclusionList.d.ts.map +1 -1
  116. package/lib/chain/validation/inclusionList.js +11 -2
  117. package/lib/chain/validation/inclusionList.js.map +1 -1
  118. package/lib/db/beacon.d.ts +7 -0
  119. package/lib/db/beacon.d.ts.map +1 -1
  120. package/lib/db/beacon.js +34 -0
  121. package/lib/db/beacon.js.map +1 -1
  122. package/lib/db/dataColumnStore.d.ts +1 -1
  123. package/lib/db/dataColumnStore.d.ts.map +1 -1
  124. package/lib/db/dataColumnStore.js +1 -4
  125. package/lib/db/dataColumnStore.js.map +1 -1
  126. package/lib/db/interface.d.ts +1 -0
  127. package/lib/db/interface.d.ts.map +1 -1
  128. package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
  129. package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
  130. package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
  131. package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
  132. package/lib/execution/engine/blobVersionedHashes.d.ts +1 -1
  133. package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
  134. package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
  135. package/lib/execution/engine/http.d.ts.map +1 -1
  136. package/lib/execution/engine/http.js +0 -1
  137. package/lib/execution/engine/http.js.map +1 -1
  138. package/lib/execution/engine/index.d.ts +1 -1
  139. package/lib/execution/engine/index.d.ts.map +1 -1
  140. package/lib/execution/engine/index.js +1 -1
  141. package/lib/execution/engine/index.js.map +1 -1
  142. package/lib/execution/engine/interface.d.ts +1 -1
  143. package/lib/execution/engine/interface.d.ts.map +1 -1
  144. package/lib/execution/engine/interface.js.map +1 -1
  145. package/lib/execution/engine/mock.d.ts.map +1 -1
  146. package/lib/execution/engine/mock.js +6 -4
  147. package/lib/execution/engine/mock.js.map +1 -1
  148. package/lib/execution/engine/payloadIdCache.d.ts +1 -2
  149. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  150. package/lib/execution/engine/payloadIdCache.js +3 -3
  151. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  152. package/lib/execution/engine/sszTypes.d.ts +38 -38
  153. package/lib/execution/engine/types.d.ts +1 -1
  154. package/lib/execution/engine/types.d.ts.map +1 -1
  155. package/lib/execution/engine/types.js +9 -8
  156. package/lib/execution/engine/types.js.map +1 -1
  157. package/lib/index.d.ts +1 -0
  158. package/lib/index.d.ts.map +1 -1
  159. package/lib/index.js +2 -0
  160. package/lib/index.js.map +1 -1
  161. package/lib/metrics/metrics/lodestar.d.ts +3 -0
  162. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  163. package/lib/metrics/metrics/lodestar.js +5 -0
  164. package/lib/metrics/metrics/lodestar.js.map +1 -1
  165. package/lib/monitoring/service.js +1 -1
  166. package/lib/monitoring/service.js.map +1 -1
  167. package/lib/network/gossip/topic.d.ts +6 -6
  168. package/lib/network/network.d.ts.map +1 -1
  169. package/lib/network/network.js +3 -1
  170. package/lib/network/network.js.map +1 -1
  171. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  172. package/lib/network/processor/gossipHandlers.js +33 -23
  173. package/lib/network/processor/gossipHandlers.js.map +1 -1
  174. package/lib/node/nodejs.d.ts +1 -1
  175. package/lib/node/nodejs.d.ts.map +1 -1
  176. package/lib/node/nodejs.js +10 -2
  177. package/lib/node/nodejs.js.map +1 -1
  178. package/lib/node/options.d.ts +1 -1
  179. package/lib/node/options.d.ts.map +1 -1
  180. package/lib/node/options.js +1 -1
  181. package/lib/node/options.js.map +1 -1
  182. package/lib/sync/interface.d.ts.map +1 -1
  183. package/lib/sync/interface.js.map +1 -1
  184. package/lib/sync/unknownBlock.d.ts.map +1 -1
  185. package/lib/sync/unknownBlock.js +42 -18
  186. package/lib/sync/unknownBlock.js.map +1 -1
  187. package/lib/util/queue/itemQueue.js +1 -1
  188. package/lib/util/queue/itemQueue.js.map +1 -1
  189. package/lib/util/sszBytes.js +2 -2
  190. package/lib/util/sszBytes.js.map +1 -1
  191. package/package.json +17 -17
  192. package/src/api/impl/api.ts +1 -1
  193. package/src/api/impl/beacon/blocks/index.ts +57 -62
  194. package/src/api/impl/beacon/index.ts +3 -1
  195. package/src/api/impl/beacon/pool/index.ts +5 -1
  196. package/src/api/impl/beacon/state/utils.ts +1 -1
  197. package/src/api/impl/validator/index.ts +4 -1
  198. package/src/api/options.ts +3 -0
  199. package/src/chain/GetBlobsTracker.ts +97 -38
  200. package/src/chain/archiveStore/archiveStore.ts +1 -0
  201. package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
  202. package/src/chain/blocks/importBlock.ts +8 -7
  203. package/src/chain/blocks/importExecutionPayload.ts +14 -3
  204. package/src/chain/blocks/index.ts +6 -2
  205. package/src/chain/blocks/payloadEnvelopeProcessor.ts +7 -7
  206. package/src/chain/blocks/verifyBlock.ts +1 -0
  207. package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -1
  208. package/src/chain/blocks/verifyPayloadsDataAvailability.ts +16 -6
  209. package/src/chain/bls/multithread/index.ts +5 -5
  210. package/src/chain/bls/multithread/types.ts +1 -1
  211. package/src/chain/bls/multithread/worker.ts +1 -5
  212. package/src/chain/bls/singleThread.ts +1 -1
  213. package/src/chain/bls/utils.ts +1 -1
  214. package/src/chain/chain.ts +5 -5
  215. package/src/chain/errors/blockError.ts +1 -1
  216. package/src/chain/interface.ts +2 -3
  217. package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
  218. package/src/chain/opPools/attestationPool.ts +1 -1
  219. package/src/chain/opPools/inclusionListStore.ts +3 -3
  220. package/src/chain/opPools/payloadAttestationPool.ts +1 -1
  221. package/src/chain/opPools/syncCommitteeMessagePool.ts +1 -1
  222. package/src/chain/opPools/syncContributionAndProofPool.ts +1 -1
  223. package/src/chain/opPools/utils.ts +1 -1
  224. package/src/chain/options.ts +0 -2
  225. package/src/chain/produceBlock/produceBlockBody.ts +0 -1
  226. package/src/chain/regen/interface.ts +0 -1
  227. package/src/chain/validation/executionPayloadBid.ts +0 -180
  228. package/src/chain/validation/inclusionList.ts +11 -2
  229. package/src/db/beacon.ts +44 -0
  230. package/src/db/dataColumnStore.ts +2 -4
  231. package/src/db/interface.ts +2 -0
  232. package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
  233. package/src/execution/engine/blobVersionedHashes.ts +1 -1
  234. package/src/execution/engine/http.ts +0 -1
  235. package/src/execution/engine/index.ts +1 -1
  236. package/src/execution/engine/interface.ts +1 -1
  237. package/src/execution/engine/mock.ts +6 -4
  238. package/src/execution/engine/payloadIdCache.ts +6 -7
  239. package/src/execution/engine/types.ts +11 -9
  240. package/src/index.ts +2 -0
  241. package/src/metrics/metrics/lodestar.ts +5 -0
  242. package/src/monitoring/service.ts +1 -1
  243. package/src/network/network.ts +3 -1
  244. package/src/network/processor/gossipHandlers.ts +41 -25
  245. package/src/node/nodejs.ts +24 -7
  246. package/src/node/options.ts +4 -5
  247. package/src/sync/interface.ts +1 -0
  248. package/src/sync/unknownBlock.ts +47 -28
  249. package/src/util/queue/itemQueue.ts +1 -1
  250. package/src/util/sszBytes.ts +2 -2
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.51.0-dev.b3beff2246",
14
+ "version": "1.51.0-dev.bb16085c5e",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -105,11 +105,10 @@
105
105
  "@chainsafe/enr": "^6.0.2",
106
106
  "@chainsafe/libp2p-noise": "^17.0.0",
107
107
  "@chainsafe/libp2p-quic": "^2.1.5",
108
- "@chainsafe/lodestar-z": "catalog:",
109
108
  "@chainsafe/persistent-merkle-tree": "^1.3.1",
110
109
  "@chainsafe/prometheus-gc-stats": "^1.0.0",
111
110
  "@chainsafe/snappy-wasm": "^0.5.2",
112
- "@chainsafe/ssz": "^1.8.1",
111
+ "@chainsafe/ssz": "^1.9.0",
113
112
  "@chainsafe/threads": "^1.11.3",
114
113
  "@crate-crypto/node-eth-kzg": "0.9.1",
115
114
  "@fastify/bearer-auth": "^10.0.1",
@@ -127,17 +126,18 @@
127
126
  "@libp2p/prometheus-metrics": "^5.0.31",
128
127
  "@libp2p/tcp": "^11.0.30",
129
128
  "@libp2p/utils": "^7.4.3",
130
- "@lodestar/api": "^1.51.0-dev.b3beff2246",
131
- "@lodestar/config": "^1.51.0-dev.b3beff2246",
132
- "@lodestar/db": "^1.51.0-dev.b3beff2246",
133
- "@lodestar/fork-choice": "^1.51.0-dev.b3beff2246",
134
- "@lodestar/logger": "^1.51.0-dev.b3beff2246",
135
- "@lodestar/params": "^1.51.0-dev.b3beff2246",
136
- "@lodestar/reqresp": "^1.51.0-dev.b3beff2246",
137
- "@lodestar/state-transition": "^1.51.0-dev.b3beff2246",
138
- "@lodestar/types": "^1.51.0-dev.b3beff2246",
139
- "@lodestar/utils": "^1.51.0-dev.b3beff2246",
140
- "@lodestar/validator": "^1.51.0-dev.b3beff2246",
129
+ "@lodestar/api": "^1.51.0-dev.bb16085c5e",
130
+ "@lodestar/config": "^1.51.0-dev.bb16085c5e",
131
+ "@lodestar/db": "^1.51.0-dev.bb16085c5e",
132
+ "@lodestar/fork-choice": "^1.51.0-dev.bb16085c5e",
133
+ "@lodestar/logger": "^1.51.0-dev.bb16085c5e",
134
+ "@lodestar/native": "^1.51.0-dev.bb16085c5e",
135
+ "@lodestar/params": "^1.51.0-dev.bb16085c5e",
136
+ "@lodestar/reqresp": "^1.51.0-dev.bb16085c5e",
137
+ "@lodestar/state-transition": "^1.51.0-dev.bb16085c5e",
138
+ "@lodestar/types": "^1.51.0-dev.bb16085c5e",
139
+ "@lodestar/utils": "^1.51.0-dev.bb16085c5e",
140
+ "@lodestar/validator": "^1.51.0-dev.bb16085c5e",
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.2.0",
161
161
  "@libp2p/logger": "^6.2.15",
162
- "@lodestar/spec-test-util": "^1.51.0-dev.b3beff2246",
163
- "@lodestar/test-utils": "^1.51.0-dev.b3beff2246",
162
+ "@lodestar/spec-test-util": "^1.51.0-dev.bb16085c5e",
163
+ "@lodestar/test-utils": "^1.51.0-dev.bb16085c5e",
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": "7b70bcaf48e0f212ad066039e2e4674f9643e284"
178
+ "gitHead": "13c2d148ae5042e2dac08751a63a2adf3c7e2dd2"
179
179
  }
@@ -13,7 +13,7 @@ import {getValidatorApi} from "./validator/index.js";
13
13
 
14
14
  export function getApi(opts: ApiOptions, modules: ApiModules): BeaconApiMethods {
15
15
  return {
16
- beacon: getBeaconApi(modules),
16
+ beacon: getBeaconApi(opts, modules),
17
17
  config: getConfigApi(modules),
18
18
  debug: getDebugApi(modules),
19
19
  events: getEventsApi(modules),
@@ -62,7 +62,7 @@ import {
62
62
  } from "../../../../chain/produceBlock/index.js";
63
63
  import {RegenCaller} from "../../../../chain/regen/index.js";
64
64
  import {validateGossipBlock, verifyBlockProposerSignature} from "../../../../chain/validation/block.js";
65
- import {validateApiExecutionPayloadBid} from "../../../../chain/validation/executionPayloadBid.js";
65
+ import {validateGossipExecutionPayloadBid} from "../../../../chain/validation/executionPayloadBid.js";
66
66
  import {validateApiExecutionPayloadEnvelope} from "../../../../chain/validation/executionPayloadEnvelope.js";
67
67
  import {OpSource} from "../../../../chain/validatorMonitor.js";
68
68
  import {
@@ -79,6 +79,7 @@ import {
79
79
  import {isOptimisticBlock} from "../../../../util/forkChoice.js";
80
80
  import {kzg} from "../../../../util/kzg.js";
81
81
  import {promiseAllMaybeAsync} from "../../../../util/promises.js";
82
+ import {ApiOptions} from "../../../options.js";
82
83
  import {ApiModules} from "../../types.js";
83
84
  import {assertUniqueItems} from "../../utils.js";
84
85
  import {getBlockResponse, toBeaconHeaderResponse} from "./utils.js";
@@ -96,16 +97,10 @@ const MAX_API_CLOCK_DISPARITY_MS = 1000;
96
97
  */
97
98
  const IDENTITY_PEER_ID = ""; // TODO: Compute identity keypair
98
99
 
99
- export function getBeaconBlockApi({
100
- chain,
101
- config,
102
- metrics,
103
- network,
104
- db,
105
- }: Pick<
106
- ApiModules,
107
- "chain" | "config" | "metrics" | "network" | "db"
108
- >): ApplicationMethods<routes.beacon.block.Endpoints> {
100
+ export function getBeaconBlockApi(
101
+ opts: ApiOptions,
102
+ {chain, config, metrics, network, db}: Pick<ApiModules, "chain" | "config" | "metrics" | "network" | "db">
103
+ ): ApplicationMethods<routes.beacon.block.Endpoints> {
109
104
  const publishBlockV2: ApplicationMethods<routes.beacon.block.Endpoints>["publishBlockV2"] = async (
110
105
  {signedBlockContents, broadcastValidation, builderUrl},
111
106
  context,
@@ -321,18 +316,8 @@ export function getBeaconBlockApi({
321
316
  break;
322
317
  }
323
318
 
324
- case routes.beacon.BroadcastValidation.none: {
325
- chain.logger.debug("Skipping broadcast validation", valLogMeta);
326
- break;
327
- }
328
-
329
319
  default: {
330
- // error or log warning we do not support this validation
331
- const message = `Broadcast validation of ${broadcastValidation} type not implemented yet`;
332
- if (chain.opts.broadcastValidationStrictness === "error") {
333
- throw Error(message);
334
- }
335
- chain.logger.warn(message, valLogMeta);
320
+ throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
336
321
  }
337
322
  }
338
323
 
@@ -402,26 +387,24 @@ export function getBeaconBlockApi({
402
387
  ...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
403
388
  () =>
404
389
  // there is no rush to persist block since we published it to gossip anyway
405
- chain
406
- .processBlock(blockForImport, opts)
407
- .catch((e) => {
408
- if (e instanceof BlockError) {
409
- switch (e.type.code) {
410
- case BlockErrorCode.ALREADY_KNOWN:
411
- // Block was imported while publishing, e.g. received via gossip
412
- chain.logger.debug("Ignoring already-known block during publishing", valLogMeta);
413
- return;
414
- case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
415
- case BlockErrorCode.PARENT_PAYLOAD_UNKNOWN:
416
- chain.emitter.emit(ChainEvent.blockUnknownParent, {
417
- blockInput: blockForImport,
418
- peer: IDENTITY_PEER_ID,
419
- source: BlockInputSource.api,
420
- });
421
- }
390
+ chain.processBlock(blockForImport, opts).catch((e) => {
391
+ if (e instanceof BlockError) {
392
+ switch (e.type.code) {
393
+ case BlockErrorCode.ALREADY_KNOWN:
394
+ // Block was imported while publishing, e.g. received via gossip
395
+ chain.logger.debug("Ignoring already-known block during publishing", valLogMeta);
396
+ return;
397
+ case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
398
+ case BlockErrorCode.PARENT_PAYLOAD_UNKNOWN:
399
+ chain.emitter.emit(ChainEvent.blockUnknownParent, {
400
+ blockInput: blockForImport,
401
+ peer: IDENTITY_PEER_ID,
402
+ source: BlockInputSource.api,
403
+ });
422
404
  }
423
- throw e;
424
- }),
405
+ }
406
+ throw e;
407
+ }),
425
408
  ];
426
409
  const sentPeersArr = await promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
427
410
  publishPromises
@@ -809,11 +792,6 @@ export function getBeaconBlockApi({
809
792
  };
810
793
  try {
811
794
  switch (broadcastValidation) {
812
- case routes.beacon.BroadcastValidation.none: {
813
- chain.logger.debug("Skipping broadcast validation of execution payload envelope", valLogMeta);
814
- break;
815
- }
816
-
817
795
  case routes.beacon.BroadcastValidation.gossip: {
818
796
  await validateApiExecutionPayloadEnvelope(chain, signedExecutionPayloadEnvelope);
819
797
  break;
@@ -852,11 +830,7 @@ export function getBeaconBlockApi({
852
830
  }
853
831
 
854
832
  default: {
855
- const message = `Broadcast validation of ${broadcastValidation} type not implemented yet`;
856
- if (chain.opts.broadcastValidationStrictness === "error") {
857
- throw Error(message);
858
- }
859
- chain.logger.warn(message, valLogMeta);
833
+ throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
860
834
  }
861
835
  }
862
836
  } catch (error) {
@@ -1008,9 +982,13 @@ export function getBeaconBlockApi({
1008
982
  () => network.publishSignedExecutionPayloadEnvelope(signedExecutionPayloadEnvelope),
1009
983
  // Publish all data column sidecars
1010
984
  ...dataColumnSidecars.map((dataColumnSidecar) => () => network.publishDataColumnSidecar(dataColumnSidecar)),
1011
- // Import execution payload. Signature is verified during broadcast validation, an already
1012
- // known envelope was verified by its original source and `none` deliberately skips validation
1013
- () => chain.processExecutionPayload(payloadInput, {validSignature: true}),
985
+ // Import execution payload
986
+ () =>
987
+ chain.processExecutionPayload(payloadInput, {
988
+ // Signature is verified during broadcast validation only for the submitted envelope,
989
+ // an envelope cached by another source is verified at import
990
+ validSignature: payloadInput.getPayloadEnvelope() === signedExecutionPayloadEnvelope,
991
+ }),
1014
992
  ];
1015
993
 
1016
994
  const publishPromise = promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
@@ -1077,15 +1055,25 @@ export function getBeaconBlockApi({
1077
1055
  throw new ApiError(400, `publishExecutionPayloadBid not supported for pre-gloas fork=${fork}`);
1078
1056
  }
1079
1057
 
1080
- const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
1081
- // TODO: once the builder is tested and can be trusted, skip this local validation
1082
- // to publish faster, accepting peer-score risk if it ever emits an invalid bid.
1083
- await validateApiExecutionPayloadBid(chain, signedExecutionPayloadBid);
1084
- validationTimer?.();
1085
-
1086
1058
  const elapsedSec = chain.clock.secFromSlot(slot, seenTimestampSec);
1087
1059
  metrics?.gossipExecutionPayloadBid.elapsedTimeTillReceived.observe({source: OpSource.api}, elapsedSec);
1088
1060
 
1061
+ if (!opts.disableBidValidation) {
1062
+ const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
1063
+ const {proposerIndex} = await validateGossipExecutionPayloadBid(chain, signedExecutionPayloadBid);
1064
+ validationTimer?.();
1065
+
1066
+ // Gossip does not deliver our own messages back to us, so a validated bid is added to the
1067
+ // pool here to allow a proposer on this node to select it
1068
+ const insertOutcome = chain.executionPayloadBidPool.add(
1069
+ signedExecutionPayloadBid,
1070
+ Math.floor(elapsedSec * 1000)
1071
+ );
1072
+ metrics?.opPool.executionPayloadBidPool.apiInsertOutcome.inc({insertOutcome});
1073
+
1074
+ chain.validatorMonitor?.registerExecutionPayloadBid(OpSource.api, proposerIndex, bid);
1075
+ }
1076
+
1089
1077
  const sentPeers = await network.publishSignedExecutionPayloadBid(signedExecutionPayloadBid);
1090
1078
 
1091
1079
  chain.emitter.emit(routes.events.EventType.executionPayloadBid, {
@@ -1104,7 +1092,7 @@ export function getBeaconBlockApi({
1104
1092
  },
1105
1093
 
1106
1094
  async getSignedExecutionPayloadEnvelope({blockId}, context) {
1107
- const {block, executionOptimistic, finalized} = await getBlockResponse(chain, blockId);
1095
+ const {block, finalized} = await getBlockResponse(chain, blockId);
1108
1096
  const slot = block.message.slot;
1109
1097
  const fork = config.getForkName(slot);
1110
1098
 
@@ -1118,6 +1106,13 @@ export function getBeaconBlockApi({
1118
1106
  const blockRoot = config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block.message);
1119
1107
  const blockRootHex = toRootHex(blockRoot);
1120
1108
 
1109
+ // The block's own flag is the status of the payload it builds on, the envelope's is that of its
1110
+ // FULL variant. An unfinalized block without one has not imported its envelope yet.
1111
+ const payload = finalized ? null : chain.forkChoice.getBlockHex(blockRootHex, PayloadStatus.FULL);
1112
+ if (!finalized && payload === null) {
1113
+ throw new ApiError(404, `Execution payload envelope not found for slot=${slot}, blockRoot=${blockRootHex}`);
1114
+ }
1115
+
1121
1116
  let data: Uint8Array | gloas.SignedExecutionPayloadEnvelope | null;
1122
1117
  try {
1123
1118
  data = context?.returnBytes
@@ -1142,7 +1137,7 @@ export function getBeaconBlockApi({
1142
1137
 
1143
1138
  return {
1144
1139
  data,
1145
- meta: {executionOptimistic, finalized, version: fork},
1140
+ meta: {executionOptimistic: payload !== null && isOptimisticBlock(payload), finalized, version: fork},
1146
1141
  };
1147
1142
  },
1148
1143
 
@@ -3,6 +3,7 @@ import {ApplicationMethods} from "@lodestar/api/server";
3
3
  import {isForkPostGloas} from "@lodestar/params";
4
4
  import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
5
5
  import {toRootHex} from "@lodestar/utils";
6
+ import {ApiOptions} from "../../options.js";
6
7
  import {ApiError} from "../errors.js";
7
8
  import {ApiModules} from "../types.js";
8
9
  import {getBeaconBlockApi} from "./blocks/index.js";
@@ -11,9 +12,10 @@ import {getBeaconRewardsApi} from "./rewards/index.js";
11
12
  import {getBeaconStateApi} from "./state/index.js";
12
13
 
13
14
  export function getBeaconApi(
15
+ opts: ApiOptions,
14
16
  modules: Pick<ApiModules, "chain" | "config" | "logger" | "metrics" | "network" | "db" | "sync">
15
17
  ): ApplicationMethods<routes.beacon.Endpoints> {
16
- const block = getBeaconBlockApi(modules);
18
+ const block = getBeaconBlockApi(opts, modules);
17
19
  const pool = getBeaconPoolApi(modules);
18
20
  const state = getBeaconStateApi(modules);
19
21
  const rewards = getBeaconRewardsApi(modules);
@@ -17,6 +17,7 @@ import {
17
17
  PayloadAttestationError,
18
18
  PayloadAttestationErrorCode,
19
19
  SyncCommitteeError,
20
+ SyncCommitteeErrorCode,
20
21
  } from "../../../../chain/errors/index.js";
21
22
  import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
22
23
  import {validateApiBlsToExecutionChange} from "../../../../chain/validation/blsToExecutionChange.js";
@@ -340,7 +341,10 @@ export function getBeaconPoolApi({
340
341
  const synCommittee = state.getIndexedSyncCommittee(signature.slot);
341
342
  const indexesInCommittee = synCommittee.validatorIndexMap.get(signature.validatorIndex);
342
343
  if (indexesInCommittee === undefined || indexesInCommittee.length === 0) {
343
- return; // Not a sync committee member
344
+ throw new SyncCommitteeError(GossipAction.REJECT, {
345
+ code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
346
+ validatorIndex: signature.validatorIndex,
347
+ });
344
348
  }
345
349
 
346
350
  // Verify signature only, all other data is very likely to be correct, since the `signature` object is created by this node.
@@ -1,6 +1,6 @@
1
- import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
2
1
  import {routes} from "@lodestar/api";
3
2
  import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
3
+ import {type PubkeyCache} from "@lodestar/native/pubkeys";
4
4
  import {GENESIS_SLOT} from "@lodestar/params";
5
5
  import {IBeaconStateView, IBeaconStateViewGloas} from "@lodestar/state-transition";
6
6
  import {
@@ -1756,7 +1756,10 @@ export function getValidatorApi(
1756
1756
  }
1757
1757
  }
1758
1758
 
1759
- const dependentRoot = fromHex(state.getShufflingDecisionRoot(epoch));
1759
+ // The fork epoch PTC is computed at the fork from effective balances updated at the end of the
1760
+ // last pre-fork epoch, so its dependent root is one epoch later than for other epochs
1761
+ const dependentRootEpoch = epoch === config.GLOAS_FORK_EPOCH ? epoch + 1 : epoch;
1762
+ const dependentRoot = fromHex(state.getShufflingDecisionRoot(dependentRootEpoch));
1760
1763
 
1761
1764
  return {
1762
1765
  data: duties,
@@ -2,6 +2,8 @@ import {BeaconRestApiServerOpts, beaconRestApiServerOpts} from "./rest/index.js"
2
2
 
3
3
  export type ApiOptions = {
4
4
  maxGindicesInProof?: number;
5
+ /** Broadcast execution payload bids submitted via the API without running gossip validation */
6
+ disableBidValidation?: boolean;
5
7
  rest: BeaconRestApiServerOpts;
6
8
  commit?: string;
7
9
  version?: string;
@@ -10,6 +12,7 @@ export type ApiOptions = {
10
12
 
11
13
  export const defaultApiOptions: ApiOptions = {
12
14
  maxGindicesInProof: 512,
15
+ disableBidValidation: false,
13
16
  rest: beaconRestApiServerOpts,
14
17
  version: "dev",
15
18
  private: false,
@@ -1,10 +1,9 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
2
  import {computeEpochAtSlot} from "@lodestar/state-transition";
3
- import {Logger} from "@lodestar/utils";
3
+ import {Logger, pruneSetToMax} from "@lodestar/utils";
4
4
  import {BLOB_AND_PROOF_V2_RPC_BYTES} from "../execution/engine/types.js";
5
5
  import {IExecutionEngine} from "../execution/index.js";
6
6
  import {Metrics} from "../metrics/metrics.js";
7
- import {callInNextEventLoop} from "../util/eventLoop.js";
8
7
  import {
9
8
  DataColumnEngineResult,
10
9
  getBlobSidecarsFromExecution,
@@ -14,6 +13,11 @@ import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
14
13
  import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
15
14
  import {ChainEventEmitter} from "./emitter.js";
16
15
 
16
+ /** A `null` answer only changes if the EL receives the transactions later, so retries are few and spaced out */
17
+ export const MAX_GET_BLOBS_ATTEMPTS = 3;
18
+ export const GET_BLOBS_RETRY_INTERVAL_MS = 1000;
19
+ const MAX_TRACKED_BLOCK_ROOTS = 64;
20
+
17
21
  export type GetBlobsTrackerInit = {
18
22
  logger: Logger;
19
23
  executionEngine: IExecutionEngine;
@@ -32,6 +36,8 @@ export class GetBlobsTracker {
32
36
  metrics: Metrics | null;
33
37
  config: ChainForkConfig;
34
38
  activeReconstructions = new Set<string>();
39
+ failedAttempts = new Map<string, {count: number; lastAttemptMs: number; retryTimer?: NodeJS.Timeout}>();
40
+ pendingTriggers = new Set<string>();
35
41
  // Preallocate buffers for getBlobsV2 RPC calls
36
42
  // See https://github.com/ChainSafe/lodestar/pull/8282 for context
37
43
  blobsAndProofsBuffers: {buffers: Uint8Array[]; inUse: boolean}[] = [];
@@ -46,23 +52,55 @@ export class GetBlobsTracker {
46
52
 
47
53
  triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput): void {
48
54
  if (this.activeReconstructions.has(input.blockRootHex)) {
55
+ this.pendingTriggers.add(input.blockRootHex);
49
56
  return;
50
57
  }
51
58
 
59
+ const failed = this.failedAttempts.get(input.blockRootHex);
60
+ if (failed) {
61
+ if (failed.count >= MAX_GET_BLOBS_ATTEMPTS) {
62
+ return;
63
+ }
64
+ const waitMs = GET_BLOBS_RETRY_INTERVAL_MS - (Date.now() - failed.lastAttemptMs);
65
+ if (waitMs > 0) {
66
+ // Columns tend to arrive in one burst, so keep a single trailing retry instead of relying on a later trigger
67
+ failed.retryTimer ??= setTimeout(() => {
68
+ failed.retryTimer = undefined;
69
+ if (this.failedAttempts.get(input.blockRootHex) === failed && !input.hasAllData()) {
70
+ this.triggerGetBlobs(input);
71
+ }
72
+ }, waitMs).unref();
73
+ return;
74
+ }
75
+ }
76
+
77
+ // The request is sent right away, before block processing issues newPayload: ELs that drop a
78
+ // transaction's blobs once the payload is validated can only answer a request that gets there first
52
79
  if (!(input instanceof PayloadEnvelopeInput) && isBlockInputBlobs(input)) {
53
80
  // there is not preallocation for blob sidecars like there is for columns sidecars so no need to
54
81
  // store the index for the preallocated buffers
55
82
  this.activeReconstructions.add(input.blockRootHex);
56
- callInNextEventLoop(() => {
57
- const logCtx = {slot: input.slot, root: input.blockRootHex};
58
- this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
59
- getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input).finally(
60
- () => {
61
- this.logger.verbose("Completed getBlobsV1 for block", logCtx);
62
- this.activeReconstructions.delete(input.blockRootHex);
83
+ const logCtx = {slot: input.slot, root: input.blockRootHex};
84
+ this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
85
+ let requestFailed = false;
86
+ getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input)
87
+ .then(() => {
88
+ // EL errors and misses are handled inside the helper, blobs still missing means the attempt failed
89
+ if (!input.hasAllData()) {
90
+ requestFailed = true;
91
+ this.recordFailedAttempt(input.blockRootHex);
63
92
  }
64
- );
65
- });
93
+ })
94
+ .catch((error) => {
95
+ this.logger.debug("Error during getBlobsV1 for block", logCtx, error as Error);
96
+ requestFailed = true;
97
+ this.recordFailedAttempt(input.blockRootHex);
98
+ })
99
+ .finally(() => {
100
+ this.logger.verbose("Completed getBlobsV1 for block", logCtx);
101
+ this.activeReconstructions.delete(input.blockRootHex);
102
+ this.retryPendingTrigger(input, requestFailed);
103
+ });
66
104
 
67
105
  return;
68
106
  }
@@ -83,34 +121,55 @@ export class GetBlobsTracker {
83
121
  }
84
122
  timer?.();
85
123
 
86
- // We don't care about the outcome of this call,
87
- // just that it has been triggered for this block root.
88
124
  this.activeReconstructions.add(input.blockRootHex);
89
125
  this.blobsAndProofsBuffers[freeIndex].inUse = true;
90
- callInNextEventLoop(() => {
91
- const logCtx = {slot: input.slot, root: input.blockRootHex};
92
- this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
93
- getDataColumnSidecarsFromExecution(
94
- this.config,
95
- this.executionEngine,
96
- this.emitter,
97
- input,
98
- this.metrics,
99
- this.blobsAndProofsBuffers[freeIndex].buffers
100
- )
101
- .then((result) => {
102
- this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
103
- this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
104
- })
105
- .catch((error) => {
106
- this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
107
- this.metrics?.dataColumns.dataColumnEngineResult.inc({result: DataColumnEngineResult.Failed});
108
- })
109
- .finally(() => {
110
- this.logger.verbose("Completed getBlobsV2 for block", logCtx);
111
- this.activeReconstructions.delete(input.blockRootHex);
112
- this.blobsAndProofsBuffers[freeIndex].inUse = false;
113
- });
114
- });
126
+ const logCtx = {slot: input.slot, root: input.blockRootHex};
127
+ this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
128
+ let requestFailed = false;
129
+ getDataColumnSidecarsFromExecution(
130
+ this.config,
131
+ this.executionEngine,
132
+ this.emitter,
133
+ input,
134
+ this.metrics,
135
+ this.blobsAndProofsBuffers[freeIndex].buffers
136
+ )
137
+ .then((result) => {
138
+ this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
139
+ this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
140
+ if (result === DataColumnEngineResult.NullResponse) {
141
+ requestFailed = true;
142
+ this.recordFailedAttempt(input.blockRootHex);
143
+ }
144
+ })
145
+ .catch((error) => {
146
+ this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
147
+ this.metrics?.dataColumns.dataColumnEngineResult.inc({result: DataColumnEngineResult.Failed});
148
+ requestFailed = true;
149
+ this.recordFailedAttempt(input.blockRootHex);
150
+ })
151
+ .finally(() => {
152
+ this.logger.verbose("Completed getBlobsV2 for block", logCtx);
153
+ this.activeReconstructions.delete(input.blockRootHex);
154
+ this.blobsAndProofsBuffers[freeIndex].inUse = false;
155
+ this.retryPendingTrigger(input, requestFailed);
156
+ });
157
+ }
158
+
159
+ private retryPendingTrigger(input: IBlockInput | PayloadEnvelopeInput, requestFailed: boolean): void {
160
+ // Triggers dropped while the request was in flight re-enter once it failed, the attempt that was just
161
+ // recorded makes this arm the trailing retry instead of sending another request right away.
162
+ // Post-gloas only the bid triggers a request, so every failed attempt re-enters to arm its own retry
163
+ const hadPendingTrigger = this.pendingTriggers.delete(input.blockRootHex);
164
+ if (requestFailed && (hadPendingTrigger || input instanceof PayloadEnvelopeInput)) {
165
+ this.triggerGetBlobs(input);
166
+ }
167
+ }
168
+
169
+ private recordFailedAttempt(blockRootHex: string): void {
170
+ const failed = this.failedAttempts.get(blockRootHex);
171
+ clearTimeout(failed?.retryTimer);
172
+ this.failedAttempts.set(blockRootHex, {count: (failed?.count ?? 0) + 1, lastAttemptMs: Date.now()});
173
+ pruneSetToMax(this.failedAttempts, MAX_TRACKED_BLOCK_ROOTS);
115
174
  }
116
175
  }
@@ -197,6 +197,7 @@ export class ArchiveStore {
197
197
  //
198
198
  // `jobQueue.push()` can throw synchronously (queue aborted / full) or reject asynchronously;
199
199
  // awaiting it inside the deferred callback funnels both failure modes into the one catch.
200
+ // biome-ignore lint/nursery/noMisusedPromises: the callback catches all errors itself
200
201
  callInNextEventLoop(async () => {
201
202
  try {
202
203
  await this.jobQueue.push(finalized);