@aztec/p2p 0.0.1-commit.9ef841308 → 0.0.1-commit.a5db02d

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 (344) hide show
  1. package/README.md +7 -6
  2. package/dest/bootstrap/bootstrap.d.ts +1 -1
  3. package/dest/bootstrap/bootstrap.d.ts.map +1 -1
  4. package/dest/bootstrap/bootstrap.js +22 -6
  5. package/dest/client/factory.d.ts +4 -3
  6. package/dest/client/factory.d.ts.map +1 -1
  7. package/dest/client/factory.js +33 -24
  8. package/dest/client/interface.d.ts +48 -11
  9. package/dest/client/interface.d.ts.map +1 -1
  10. package/dest/client/p2p_client.d.ts +34 -19
  11. package/dest/client/p2p_client.d.ts.map +1 -1
  12. package/dest/client/p2p_client.js +105 -46
  13. package/dest/config.d.ts +143 -107
  14. package/dest/config.d.ts.map +1 -1
  15. package/dest/config.js +72 -26
  16. package/dest/errors/p2p-service.error.d.ts +9 -0
  17. package/dest/errors/p2p-service.error.d.ts.map +1 -0
  18. package/dest/errors/p2p-service.error.js +10 -0
  19. package/dest/errors/reqresp.error.d.ts +9 -16
  20. package/dest/errors/reqresp.error.d.ts.map +1 -1
  21. package/dest/errors/reqresp.error.js +10 -17
  22. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +98 -56
  23. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
  24. package/dest/mem_pools/attestation_pool/attestation_pool.js +269 -196
  25. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +1 -1
  26. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
  27. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +218 -59
  28. package/dest/mem_pools/attestation_pool/mocks.d.ts +1 -1
  29. package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
  30. package/dest/mem_pools/attestation_pool/mocks.js +6 -4
  31. package/dest/mem_pools/instrumentation.d.ts +9 -4
  32. package/dest/mem_pools/instrumentation.d.ts.map +1 -1
  33. package/dest/mem_pools/instrumentation.js +28 -9
  34. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +1 -5
  35. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -1
  36. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +1 -7
  37. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +3 -3
  38. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -1
  39. package/dest/mem_pools/tx_pool_v2/deleted_pool.js +6 -6
  40. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +1 -1
  41. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +2 -1
  42. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -1
  43. package/dest/mem_pools/tx_pool_v2/eviction/index.js +1 -0
  44. package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.d.ts +16 -0
  45. package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.d.ts.map +1 -0
  46. package/dest/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.js +62 -0
  47. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
  48. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +33 -5
  49. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
  50. package/dest/mem_pools/tx_pool_v2/interfaces.js +2 -1
  51. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +5 -2
  52. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
  53. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +8 -5
  54. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +15 -1
  55. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
  56. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +31 -0
  57. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +9 -3
  58. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
  59. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +19 -8
  60. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +17 -4
  61. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
  62. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +208 -118
  63. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +10 -3
  64. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
  65. package/dest/msg_validators/attestation_validator/attestation_validator.js +38 -16
  66. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +7 -3
  67. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
  68. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.js +4 -5
  69. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +8 -3
  70. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
  71. package/dest/msg_validators/proposal_validator/block_proposal_validator.js +2 -2
  72. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +8 -3
  73. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
  74. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +8 -2
  75. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +25 -3
  76. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
  77. package/dest/msg_validators/proposal_validator/proposal_validator.js +85 -15
  78. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +1 -1
  79. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  80. package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +8 -15
  81. package/dest/msg_validators/tx_validator/allowed_public_setup.js +3 -3
  82. package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
  83. package/dest/msg_validators/tx_validator/cached_tx_validator.d.ts +15 -0
  84. package/dest/msg_validators/tx_validator/cached_tx_validator.d.ts.map +1 -0
  85. package/dest/msg_validators/tx_validator/cached_tx_validator.js +19 -0
  86. package/dest/msg_validators/tx_validator/data_validator.d.ts +2 -1
  87. package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
  88. package/dest/msg_validators/tx_validator/data_validator.js +1 -0
  89. package/dest/msg_validators/tx_validator/factory.d.ts +14 -15
  90. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  91. package/dest/msg_validators/tx_validator/factory.js +29 -16
  92. package/dest/msg_validators/tx_validator/gas_validator.d.ts +47 -10
  93. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  94. package/dest/msg_validators/tx_validator/gas_validator.js +65 -48
  95. package/dest/msg_validators/tx_validator/index.d.ts +3 -1
  96. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  97. package/dest/msg_validators/tx_validator/index.js +2 -0
  98. package/dest/msg_validators/tx_validator/phases_validator.js +2 -2
  99. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts +2 -1
  100. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +1 -1
  101. package/dest/msg_validators/tx_validator/tx_proof_validator.js +2 -0
  102. package/dest/msg_validators/tx_validator/tx_validation_cache.d.ts +48 -0
  103. package/dest/msg_validators/tx_validator/tx_validation_cache.d.ts.map +1 -0
  104. package/dest/msg_validators/tx_validator/tx_validation_cache.js +68 -0
  105. package/dest/services/data_store.d.ts +1 -1
  106. package/dest/services/data_store.d.ts.map +1 -1
  107. package/dest/services/data_store.js +5 -5
  108. package/dest/services/discv5/discV5_service.d.ts +13 -2
  109. package/dest/services/discv5/discV5_service.d.ts.map +1 -1
  110. package/dest/services/discv5/discV5_service.js +119 -25
  111. package/dest/services/discv5/persisted_enr_store.d.ts +38 -0
  112. package/dest/services/discv5/persisted_enr_store.d.ts.map +1 -0
  113. package/dest/services/discv5/persisted_enr_store.js +145 -0
  114. package/dest/services/dummy_service.d.ts +15 -15
  115. package/dest/services/dummy_service.d.ts.map +1 -1
  116. package/dest/services/dummy_service.js +15 -16
  117. package/dest/services/encoding.d.ts +19 -6
  118. package/dest/services/encoding.d.ts.map +1 -1
  119. package/dest/services/encoding.js +25 -15
  120. package/dest/services/gossipsub/topic_score_params.d.ts +6 -12
  121. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
  122. package/dest/services/gossipsub/topic_score_params.js +4 -14
  123. package/dest/services/libp2p/instrumentation.d.ts +3 -1
  124. package/dest/services/libp2p/instrumentation.d.ts.map +1 -1
  125. package/dest/services/libp2p/instrumentation.js +14 -0
  126. package/dest/services/libp2p/libp2p_service.d.ts +40 -40
  127. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  128. package/dest/services/libp2p/libp2p_service.js +292 -264
  129. package/dest/services/peer-manager/peer_manager.d.ts +15 -2
  130. package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
  131. package/dest/services/peer-manager/peer_manager.js +59 -17
  132. package/dest/services/peer-manager/peer_scoring.d.ts +30 -1
  133. package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
  134. package/dest/services/peer-manager/peer_scoring.js +74 -3
  135. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +1 -8
  136. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
  137. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +35 -44
  138. package/dest/services/reqresp/batch-tx-requester/interface.d.ts +8 -5
  139. package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
  140. package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts +5 -14
  141. package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts.map +1 -1
  142. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +6 -20
  143. package/dest/services/reqresp/config.d.ts +15 -3
  144. package/dest/services/reqresp/config.d.ts.map +1 -1
  145. package/dest/services/reqresp/config.js +11 -0
  146. package/dest/services/reqresp/interface.d.ts +16 -18
  147. package/dest/services/reqresp/interface.d.ts.map +1 -1
  148. package/dest/services/reqresp/interface.js +10 -20
  149. package/dest/services/reqresp/metrics.d.ts +1 -1
  150. package/dest/services/reqresp/metrics.d.ts.map +1 -1
  151. package/dest/services/reqresp/metrics.js +0 -1
  152. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +4 -3
  153. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -1
  154. package/dest/services/reqresp/protocols/block_txs/bitvector.js +3 -2
  155. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +1 -1
  156. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
  157. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +31 -28
  158. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +12 -7
  159. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
  160. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +42 -24
  161. package/dest/services/reqresp/protocols/index.d.ts +1 -2
  162. package/dest/services/reqresp/protocols/index.d.ts.map +1 -1
  163. package/dest/services/reqresp/protocols/index.js +0 -1
  164. package/dest/services/reqresp/protocols/tx.d.ts +1 -1
  165. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  166. package/dest/services/reqresp/protocols/tx.js +1 -3
  167. package/dest/services/reqresp/rate-limiter/rate_limits.d.ts +1 -1
  168. package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +1 -1
  169. package/dest/services/reqresp/rate-limiter/rate_limits.js +3 -13
  170. package/dest/services/reqresp/reqresp.d.ts +7 -29
  171. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  172. package/dest/services/reqresp/reqresp.js +59 -209
  173. package/dest/services/service.d.ts +23 -16
  174. package/dest/services/service.d.ts.map +1 -1
  175. package/dest/services/tx_collection/config.d.ts +2 -23
  176. package/dest/services/tx_collection/config.d.ts.map +1 -1
  177. package/dest/services/tx_collection/config.js +2 -55
  178. package/dest/services/tx_collection/file_store_tx_collection.d.ts +12 -28
  179. package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
  180. package/dest/services/tx_collection/file_store_tx_collection.js +43 -83
  181. package/dest/services/tx_collection/index.d.ts +2 -3
  182. package/dest/services/tx_collection/index.d.ts.map +1 -1
  183. package/dest/services/tx_collection/index.js +0 -1
  184. package/dest/services/tx_collection/instrumentation.d.ts +1 -1
  185. package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
  186. package/dest/services/tx_collection/instrumentation.js +0 -2
  187. package/dest/services/tx_collection/tx_collection.d.ts +35 -51
  188. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  189. package/dest/services/tx_collection/tx_collection.js +275 -119
  190. package/dest/services/tx_collection/tx_collection_sink.d.ts +1 -1
  191. package/dest/services/tx_collection/tx_collection_sink.js +2 -2
  192. package/dest/services/tx_collection/tx_source.d.ts +1 -1
  193. package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
  194. package/dest/services/tx_collection/tx_source.js +4 -1
  195. package/dest/services/tx_file_store/tx_file_store.d.ts +1 -3
  196. package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
  197. package/dest/services/tx_file_store/tx_file_store.js +4 -14
  198. package/dest/services/tx_provider.d.ts +3 -1
  199. package/dest/services/tx_provider.d.ts.map +1 -1
  200. package/dest/services/tx_provider.js +3 -0
  201. package/dest/test-helpers/make-test-p2p-clients.d.ts +1 -1
  202. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  203. package/dest/test-helpers/make-test-p2p-clients.js +5 -2
  204. package/dest/test-helpers/mock-pubsub.d.ts +21 -12
  205. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  206. package/dest/test-helpers/mock-pubsub.js +39 -47
  207. package/dest/test-helpers/reqresp-nodes.d.ts +4 -5
  208. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  209. package/dest/test-helpers/reqresp-nodes.js +16 -18
  210. package/dest/test-helpers/test_tx_provider.d.ts +3 -1
  211. package/dest/test-helpers/test_tx_provider.d.ts.map +1 -1
  212. package/dest/test-helpers/test_tx_provider.js +3 -0
  213. package/dest/test-helpers/testbench-utils.d.ts +15 -14
  214. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  215. package/dest/test-helpers/testbench-utils.js +28 -13
  216. package/dest/testbench/p2p_client_testbench_worker.d.ts +3 -5
  217. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
  218. package/dest/testbench/p2p_client_testbench_worker.js +60 -27
  219. package/dest/testbench/worker_client_manager.d.ts +10 -6
  220. package/dest/testbench/worker_client_manager.d.ts.map +1 -1
  221. package/dest/testbench/worker_client_manager.js +51 -8
  222. package/dest/util.d.ts +8 -8
  223. package/dest/util.d.ts.map +1 -1
  224. package/dest/util.js +38 -10
  225. package/dest/versioning.d.ts +3 -6
  226. package/dest/versioning.d.ts.map +1 -1
  227. package/dest/versioning.js +3 -24
  228. package/package.json +16 -16
  229. package/src/bootstrap/bootstrap.ts +17 -3
  230. package/src/client/factory.ts +49 -25
  231. package/src/client/interface.ts +44 -17
  232. package/src/client/p2p_client.ts +125 -79
  233. package/src/client/test/{tx_proposal_collector/README.md → p2p_client.batch_tx_requester.bench.README.md} +23 -53
  234. package/src/config.ts +146 -34
  235. package/src/errors/p2p-service.error.ts +11 -0
  236. package/src/errors/reqresp.error.ts +13 -19
  237. package/src/mem_pools/attestation_pool/attestation_pool.ts +324 -239
  238. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +238 -63
  239. package/src/mem_pools/attestation_pool/mocks.ts +13 -8
  240. package/src/mem_pools/instrumentation.ts +18 -12
  241. package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +1 -9
  242. package/src/mem_pools/tx_pool_v2/deleted_pool.ts +7 -7
  243. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +1 -1
  244. package/src/mem_pools/tx_pool_v2/eviction/index.ts +1 -0
  245. package/src/mem_pools/tx_pool_v2/eviction/insufficient_fee_per_gas_eviction_rule.ts +65 -0
  246. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +3 -3
  247. package/src/mem_pools/tx_pool_v2/interfaces.ts +31 -4
  248. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +13 -7
  249. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +35 -0
  250. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +22 -8
  251. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +233 -123
  252. package/src/msg_validators/attestation_validator/attestation_validator.ts +46 -15
  253. package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +15 -7
  254. package/src/msg_validators/proposal_validator/block_proposal_validator.ts +15 -3
  255. package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +26 -3
  256. package/src/msg_validators/proposal_validator/proposal_validator.ts +94 -12
  257. package/src/msg_validators/tx_validator/README.md +13 -3
  258. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -12
  259. package/src/msg_validators/tx_validator/allowed_public_setup.ts +3 -3
  260. package/src/msg_validators/tx_validator/archive_cache.ts +1 -1
  261. package/src/msg_validators/tx_validator/cached_tx_validator.ts +31 -0
  262. package/src/msg_validators/tx_validator/data_validator.ts +2 -0
  263. package/src/msg_validators/tx_validator/factory.ts +37 -20
  264. package/src/msg_validators/tx_validator/gas_validator.ts +99 -54
  265. package/src/msg_validators/tx_validator/index.ts +2 -0
  266. package/src/msg_validators/tx_validator/phases_validator.ts +2 -2
  267. package/src/msg_validators/tx_validator/tx_proof_validator.ts +2 -0
  268. package/src/msg_validators/tx_validator/tx_validation_cache.ts +101 -0
  269. package/src/services/data_store.ts +5 -13
  270. package/src/services/discv5/discV5_service.ts +126 -16
  271. package/src/services/discv5/persisted_enr_store.ts +158 -0
  272. package/src/services/dummy_service.ts +20 -39
  273. package/src/services/encoding.ts +28 -20
  274. package/src/services/gossipsub/README.md +33 -11
  275. package/src/services/gossipsub/topic_score_params.ts +9 -18
  276. package/src/services/libp2p/instrumentation.ts +14 -0
  277. package/src/services/libp2p/libp2p_service.ts +342 -290
  278. package/src/services/peer-manager/peer_manager.ts +63 -16
  279. package/src/services/peer-manager/peer_scoring.ts +81 -3
  280. package/src/services/reqresp/README.md +2 -37
  281. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +39 -52
  282. package/src/services/reqresp/batch-tx-requester/interface.ts +11 -4
  283. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +12 -25
  284. package/src/services/reqresp/config.ts +19 -2
  285. package/src/services/reqresp/interface.ts +21 -47
  286. package/src/services/reqresp/metrics.ts +0 -1
  287. package/src/services/reqresp/protocols/block_txs/bitvector.ts +3 -2
  288. package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +34 -30
  289. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +47 -20
  290. package/src/services/reqresp/protocols/index.ts +0 -1
  291. package/src/services/reqresp/protocols/tx.ts +1 -3
  292. package/src/services/reqresp/rate-limiter/rate_limits.ts +3 -13
  293. package/src/services/reqresp/reqresp.ts +69 -252
  294. package/src/services/service.ts +28 -32
  295. package/src/services/tx_collection/config.ts +3 -80
  296. package/src/services/tx_collection/file_store_tx_collection.ts +54 -103
  297. package/src/services/tx_collection/index.ts +1 -6
  298. package/src/services/tx_collection/instrumentation.ts +1 -7
  299. package/src/services/tx_collection/tx_collection.ts +330 -173
  300. package/src/services/tx_collection/tx_collection_sink.ts +2 -2
  301. package/src/services/tx_collection/tx_source.ts +2 -1
  302. package/src/services/tx_file_store/tx_file_store.ts +5 -17
  303. package/src/services/tx_provider.ts +5 -0
  304. package/src/test-helpers/make-test-p2p-clients.ts +3 -0
  305. package/src/test-helpers/mock-pubsub.ts +41 -64
  306. package/src/test-helpers/reqresp-nodes.ts +12 -22
  307. package/src/test-helpers/test_tx_provider.ts +5 -0
  308. package/src/test-helpers/testbench-utils.ts +35 -26
  309. package/src/testbench/p2p_client_testbench_worker.ts +68 -44
  310. package/src/testbench/worker_client_manager.ts +59 -19
  311. package/src/util.ts +33 -14
  312. package/src/versioning.ts +3 -33
  313. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts +0 -2
  314. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts.map +0 -1
  315. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +0 -315
  316. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts +0 -73
  317. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts.map +0 -1
  318. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.js +0 -8
  319. package/dest/msg_validators/clock_tolerance.d.ts +0 -21
  320. package/dest/msg_validators/clock_tolerance.d.ts.map +0 -1
  321. package/dest/msg_validators/clock_tolerance.js +0 -38
  322. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +0 -64
  323. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +0 -1
  324. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +0 -151
  325. package/dest/services/reqresp/protocols/block.d.ts +0 -9
  326. package/dest/services/reqresp/protocols/block.d.ts.map +0 -1
  327. package/dest/services/reqresp/protocols/block.js +0 -32
  328. package/dest/services/tx_collection/fast_tx_collection.d.ts +0 -51
  329. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +0 -1
  330. package/dest/services/tx_collection/fast_tx_collection.js +0 -311
  331. package/dest/services/tx_collection/proposal_tx_collector.d.ts +0 -48
  332. package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +0 -1
  333. package/dest/services/tx_collection/proposal_tx_collector.js +0 -50
  334. package/dest/services/tx_collection/slow_tx_collection.d.ts +0 -57
  335. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +0 -1
  336. package/dest/services/tx_collection/slow_tx_collection.js +0 -211
  337. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +0 -355
  338. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.ts +0 -43
  339. package/src/msg_validators/clock_tolerance.ts +0 -52
  340. package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +0 -161
  341. package/src/services/reqresp/protocols/block.ts +0 -37
  342. package/src/services/tx_collection/fast_tx_collection.ts +0 -361
  343. package/src/services/tx_collection/proposal_tx_collector.ts +0 -108
  344. package/src/services/tx_collection/slow_tx_collection.ts +0 -266
@@ -1,151 +0,0 @@
1
- import { createLogger } from '@aztec/foundation/log';
2
- /**
3
- * Manages batches of peers for parallel request processing.
4
- * Tracks active peers and provides deterministic peer assignment for requests.
5
- *
6
- * Example with 3 peers and 10 requests:
7
- *
8
- * Peers: [P1] [P2] [P3]
9
- * ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
10
- * Requests: 0,1,2,9 | 3,4,5 | 6,7,8
11
- *
12
- * Each peer handles a bucket of consecutive requests.
13
- * If a peer fails, it is replaced while maintaining the same bucket.
14
- */ export class BatchConnectionSampler {
15
- connectionSampler;
16
- logger;
17
- batch;
18
- requestsPerPeer;
19
- /** Tracks peer-index combinations that returned empty/invalid responses */ failedPeerIndices;
20
- constructor(connectionSampler, batchSize, maxPeers, exclude, logger = createLogger('p2p:reqresp:batch-connection-sampler')){
21
- this.connectionSampler = connectionSampler;
22
- this.logger = logger;
23
- this.batch = [];
24
- this.failedPeerIndices = new Map();
25
- if (maxPeers <= 0) {
26
- throw new Error('Max peers cannot be 0');
27
- }
28
- if (batchSize <= 0) {
29
- throw new Error('Batch size cannot be 0');
30
- }
31
- // Calculate how many requests each peer should handle, cannot be 0
32
- this.requestsPerPeer = Math.max(1, Math.floor(batchSize / maxPeers));
33
- // Sample initial peers
34
- const excluding = exclude && new Map(exclude.map((peerId)=>[
35
- peerId.toString(),
36
- true
37
- ]));
38
- this.batch = this.connectionSampler.samplePeersBatch(maxPeers, excluding);
39
- }
40
- /**
41
- * Gets the peer responsible for handling a specific request index.
42
- * If the primary peer has previously failed for this index, tries other peers.
43
- * If all batch peers have failed, attempts to sample a new peer.
44
- *
45
- * @param index - The request index
46
- * @returns The peer assigned to handle this request, or undefined if no peer available
47
- */ getPeerForRequest(index) {
48
- if (this.batch.length === 0) {
49
- return undefined;
50
- }
51
- // Calculate which peer bucket this index belongs to
52
- const primaryPeerIndex = Math.floor(index / this.requestsPerPeer) % this.batch.length;
53
- // Try peers starting from primary, wrapping around
54
- for(let offset = 0; offset < this.batch.length; offset++){
55
- const peerIndex = (primaryPeerIndex + offset) % this.batch.length;
56
- const peer = this.batch[peerIndex];
57
- const peerKey = peer.toString();
58
- const failedIndices = this.failedPeerIndices.get(peerKey);
59
- if (!failedIndices || !failedIndices.has(index)) {
60
- return peer;
61
- }
62
- }
63
- // All batch peers have failed for this index - try to sample a new peer
64
- const newPeer = this.sampleNewPeer();
65
- if (newPeer) {
66
- return newPeer;
67
- }
68
- return undefined;
69
- }
70
- /**
71
- * Attempts to sample a new peer that isn't already in the batch.
72
- * If successful, adds the peer to the batch.
73
- *
74
- * @returns The new peer if one was sampled, undefined otherwise
75
- */ sampleNewPeer() {
76
- // Exclude all current batch peers
77
- const excluding = new Map(this.batch.map((p)=>[
78
- p.toString(),
79
- true
80
- ]));
81
- const newPeer = this.connectionSampler.getPeer(excluding);
82
- if (newPeer) {
83
- this.batch.push(newPeer);
84
- this.logger.trace('Sampled new peer for exhausted index', {
85
- newPeer: newPeer.toString()
86
- });
87
- return newPeer;
88
- }
89
- return undefined;
90
- }
91
- /**
92
- * Marks that a peer returned an empty/invalid response for a specific request index.
93
- * The peer will not be assigned this index again.
94
- *
95
- * @param peerId - The peer that failed
96
- * @param index - The request index that failed
97
- */ markPeerFailedForIndex(peerId, index) {
98
- const peerKey = peerId.toString();
99
- let failedIndices = this.failedPeerIndices.get(peerKey);
100
- if (!failedIndices) {
101
- failedIndices = new Set();
102
- this.failedPeerIndices.set(peerKey, failedIndices);
103
- }
104
- failedIndices.add(index);
105
- this.logger.trace('Marked peer failed for index', {
106
- peerId: peerKey,
107
- index
108
- });
109
- }
110
- /**
111
- * Removes a peer and replaces it with a new one, maintaining the same position
112
- * in the batch array to keep request distribution consistent
113
- *
114
- * @param peerId - The peer to remove and replace
115
- */ removePeerAndReplace(peerId) {
116
- const index = this.batch.findIndex((p)=>p === peerId);
117
- if (index === -1) {
118
- return;
119
- }
120
- const excluding = new Map([
121
- [
122
- peerId.toString(),
123
- true
124
- ]
125
- ]);
126
- const newPeer = this.connectionSampler.getPeer(excluding); // Q: Shouldn't we accumulate all excluded peers? Otherwise the sampler could return us a previously excluded peer?
127
- if (newPeer) {
128
- this.batch[index] = newPeer;
129
- this.logger.trace('Replaced peer', {
130
- peerId,
131
- newPeer
132
- });
133
- } else {
134
- // If we couldn't get a replacement, remove the peer and compact the array
135
- this.batch.splice(index, 1);
136
- this.logger.trace('Removed peer', {
137
- peerId
138
- });
139
- }
140
- }
141
- /**
142
- * Gets the number of active peers
143
- */ get activePeerCount() {
144
- return this.batch.length;
145
- }
146
- /**
147
- * Gets the number of requests each peer is assigned to handle
148
- */ get requestsPerBucket() {
149
- return this.requestsPerPeer;
150
- }
151
- }
@@ -1,9 +0,0 @@
1
- import type { L2BlockSource } from '@aztec/stdlib/block';
2
- import type { ReqRespSubProtocolHandler } from '../interface.js';
3
- /**
4
- * Handler for L2 Block requests
5
- * @param l2BlockSource - source for L2 blocks
6
- * @returns the Block request handler
7
- * */
8
- export declare function reqRespBlockHandler(l2BlockSource: L2BlockSource): ReqRespSubProtocolHandler;
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2suZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9zZXJ2aWNlcy9yZXFyZXNwL3Byb3RvY29scy9ibG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxhQUFhLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUl6RCxPQUFPLEtBQUssRUFBRSx5QkFBeUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBR2pFOzs7O0tBSUs7QUFDTCx3QkFBZ0IsbUJBQW1CLENBQUMsYUFBYSxFQUFFLGFBQWEsR0FBRyx5QkFBeUIsQ0FzQjNGIn0=
@@ -1 +0,0 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../src/services/reqresp/protocols/block.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAGjE;;;;KAIK;AACL,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,aAAa,GAAG,yBAAyB,CAsB3F"}
@@ -1,32 +0,0 @@
1
- import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { Fr } from '@aztec/foundation/curves/bn254';
3
- import { ReqRespStatus, ReqRespStatusError } from '../status.js';
4
- /**
5
- * Handler for L2 Block requests
6
- * @param l2BlockSource - source for L2 blocks
7
- * @returns the Block request handler
8
- * */ export function reqRespBlockHandler(l2BlockSource) {
9
- /**
10
- * @param peerId - the peer ID of the requester
11
- * @param msg - the block request message, which is expected to contain valid block number as a Buffer
12
- * @returns a Buffer containing the requested block data, or an empty Buffer if the block is not found
13
- * @throws ReqRespStatusError if the input msg is not a valid block number
14
- * */ return async (_peerId, msg)=>{
15
- let blockNumber;
16
- try {
17
- blockNumber = Fr.fromBuffer(msg);
18
- } catch (err) {
19
- throw new ReqRespStatusError(ReqRespStatus.BADLY_FORMED_REQUEST, {
20
- cause: err
21
- });
22
- }
23
- try {
24
- const foundBlock = await l2BlockSource.getBlock(BlockNumber(Number(blockNumber)));
25
- return foundBlock ? foundBlock.toBuffer() : Buffer.alloc(0);
26
- } catch (err) {
27
- throw new ReqRespStatusError(ReqRespStatus.INTERNAL_ERROR, {
28
- cause: err
29
- });
30
- }
31
- };
32
- }
@@ -1,51 +0,0 @@
1
- import { BlockNumber } from '@aztec/foundation/branded-types';
2
- import { type Logger } from '@aztec/foundation/log';
3
- import { DateProvider } from '@aztec/foundation/timer';
4
- import { type Tx, TxHash } from '@aztec/stdlib/tx';
5
- import type { PeerId } from '@libp2p/interface';
6
- import type { BatchTxRequesterLibP2PService } from '../reqresp/batch-tx-requester/interface.js';
7
- import type { TxCollectionConfig } from './config.js';
8
- import { type MissingTxsCollector } from './proposal_tx_collector.js';
9
- import type { FastCollectionRequest, FastCollectionRequestInput } from './tx_collection.js';
10
- import type { TxCollectionSink } from './tx_collection_sink.js';
11
- import type { TxSource } from './tx_source.js';
12
- export declare class FastTxCollection {
13
- private nodes;
14
- private txCollectionSink;
15
- private config;
16
- private dateProvider;
17
- private log;
18
- protected requests: Set<FastCollectionRequest>;
19
- private missingTxsCollector;
20
- constructor(p2pService: BatchTxRequesterLibP2PService, nodes: TxSource[], txCollectionSink: TxCollectionSink, config: TxCollectionConfig, dateProvider?: DateProvider, log?: Logger, missingTxsCollector?: MissingTxsCollector);
21
- stop(): Promise<void>;
22
- getFastCollectionRequests(): Set<FastCollectionRequest>;
23
- collectFastFor(input: FastCollectionRequestInput, txHashes: TxHash[] | string[], opts: {
24
- deadline: Date;
25
- pinnedPeer?: PeerId;
26
- }): Promise<Tx[]>;
27
- protected collectFast(request: FastCollectionRequest, opts: {
28
- pinnedPeer?: PeerId;
29
- }): Promise<void>;
30
- private collectFastFromNodes;
31
- private collectFastFromNode;
32
- private collectFastViaReqResp;
33
- /** Returns the TxAddContext for the given request, used by the sink to add txs to the pool correctly. */
34
- private getAddContext;
35
- /**
36
- * Handle txs by marking them as found for the requests that are waiting for them, and resolves the request if all its txs have been found.
37
- * Called internally and from the main tx collection manager whenever the tx pool emits a tx-added event.
38
- */
39
- foundTxs(txs: Tx[]): void;
40
- /**
41
- * Stop collecting all txs for blocks less than or requal to the block number specified.
42
- * To be called when we no longer care about gathering txs up to a certain block, eg when they become proven or finalized.
43
- */
44
- stopCollectingForBlocksUpTo(blockNumber: BlockNumber): void;
45
- /**
46
- * Stop collecting all txs for blocks greater than the block number specified.
47
- * To be called when there is a chain prune and previously mined txs are no longer relevant.
48
- */
49
- stopCollectingForBlocksAfter(blockNumber: BlockNumber): void;
50
- }
51
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFzdF90eF9jb2xsZWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2VydmljZXMvdHhfY29sbGVjdGlvbi9mYXN0X3R4X2NvbGxlY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTlELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUVsRSxPQUFPLEVBQUUsWUFBWSxFQUFXLE1BQU0seUJBQXlCLENBQUM7QUFFaEUsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFFLE1BQU0sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRW5ELE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBR2hELE9BQU8sS0FBSyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sNENBQTRDLENBQUM7QUFDaEcsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDdEQsT0FBTyxFQUVMLEtBQUssbUJBQW1CLEVBRXpCLE1BQU0sNEJBQTRCLENBQUM7QUFFcEMsT0FBTyx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ec/foundation/sleep';
4
- import { DateProvider, elapsed } from '@aztec/foundation/timer';
5
- import { TxHash } from '@aztec/stdlib/tx';
6
- import { BatchTxRequesterCollector, SendBatchRequestCollector } from './proposal_tx_collector.js';
7
- import { RequestTracker } from './request_tracker.js';
8
- export class FastTxCollection {
9
- nodes;
10
- txCollectionSink;
11
- config;
12
- dateProvider;
13
- log;
14
- // eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
15
- requests;
16
- missingTxsCollector;
17
- constructor(p2pService, nodes, txCollectionSink, config, dateProvider = new DateProvider(), log = createLogger('p2p:tx_collection_service'), missingTxsCollector){
18
- this.nodes = nodes;
19
- this.txCollectionSink = txCollectionSink;
20
- this.config = config;
21
- this.dateProvider = dateProvider;
22
- this.log = log;
23
- this.requests = new Set();
24
- const batchTxRequesterConfig = this.config;
25
- const missingTxsCollectorType = this.config.txCollectionMissingTxsCollectorType;
26
- this.missingTxsCollector = missingTxsCollector ?? (missingTxsCollectorType === 'old' ? new SendBatchRequestCollector(p2pService) : new BatchTxRequesterCollector(p2pService, log, dateProvider, undefined, batchTxRequesterConfig));
27
- }
28
- async stop() {
29
- this.requests.forEach((request)=>{
30
- request.requestTracker.cancel();
31
- });
32
- await Promise.resolve();
33
- }
34
- getFastCollectionRequests() {
35
- return this.requests;
36
- }
37
- async collectFastFor(input, txHashes, opts) {
38
- const timeout = opts.deadline.getTime() - this.dateProvider.now();
39
- if (timeout <= 0) {
40
- this.log.warn(`Deadline for fast tx collection is in the past (${timeout}ms)`, {
41
- deadline: opts.deadline.getTime(),
42
- now: this.dateProvider.now()
43
- });
44
- return [];
45
- }
46
- const blockInfo = input.type === 'proposal' ? {
47
- ...input.blockProposal.toBlockInfo(),
48
- blockNumber: input.blockNumber
49
- } : {
50
- ...input.block.toBlockInfo()
51
- };
52
- const request = {
53
- ...input,
54
- blockInfo,
55
- requestTracker: RequestTracker.create(txHashes, opts.deadline, this.dateProvider)
56
- };
57
- const [duration] = await elapsed(()=>this.collectFast(request, {
58
- ...opts
59
- }));
60
- this.log.verbose(`Collected ${request.requestTracker.collectedTxs.length} txs out of ${txHashes.length} for ${input.type} at slot ${blockInfo.slotNumber}`, {
61
- ...blockInfo,
62
- duration,
63
- requestType: input.type,
64
- missingTxs: [
65
- ...request.requestTracker.missingTxHashes
66
- ]
67
- });
68
- return request.requestTracker.collectedTxs;
69
- }
70
- async collectFast(request, opts) {
71
- this.requests.add(request);
72
- const { blockInfo } = request;
73
- this.log.debug(`Starting fast collection of ${request.requestTracker.numberOfMissingTxs} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
74
- ...blockInfo,
75
- requestType: request.type,
76
- deadline: request.requestTracker.deadline
77
- });
78
- try {
79
- // Start blasting all nodes for the txs. We give them a little time to respond before we start reqresp.
80
- // We race against the cancellation token to exit as soon as all txs are collected, the deadline expires,
81
- // or the request is externally cancelled.
82
- const nodeCollectionPromise = this.collectFastFromNodes(request);
83
- const waitBeforeReqResp = sleep(this.config.txCollectionFastNodesTimeoutBeforeReqRespMs);
84
- await Promise.race([
85
- request.requestTracker.cancellationToken,
86
- waitBeforeReqResp
87
- ]);
88
- // If we have collected all txs or the request was cancelled, we can stop here.
89
- // Wait for node collection to settle so inner tasks finish before we return.
90
- if (request.requestTracker.checkCancelled()) {
91
- if (request.requestTracker.allFetched()) {
92
- this.log.debug(`All txs collected for slot ${blockInfo.slotNumber} without reqresp`, blockInfo);
93
- }
94
- await nodeCollectionPromise;
95
- return;
96
- }
97
- // Start blasting reqresp for the remaining txs. Note that node collection keeps running in parallel.
98
- // We stop when we have collected all txs, timed out, or both node collection and reqresp have given up.
99
- // Inner tasks observe requestTracker.checkCancelled() and stop themselves, so this settles shortly after cancellation.
100
- await Promise.allSettled([
101
- this.collectFastViaReqResp(request, opts),
102
- nodeCollectionPromise
103
- ]);
104
- } catch (err) {
105
- this.log.error(`Error collecting txs for ${request.type} for slot ${blockInfo.slotNumber}`, err, {
106
- ...blockInfo,
107
- missingTxs: request.requestTracker.missingTxHashes.values().map((txHash)=>txHash.toString())
108
- });
109
- } finally{
110
- // Ensure no unresolved promises and remove the request from the set
111
- request.requestTracker.cancel();
112
- this.requests.delete(request);
113
- }
114
- }
115
- /**
116
- * Starts collecting txs from all configured nodes. We send `txCollectionFastMaxParallelRequestsPerNode` requests
117
- * in parallel to each node. We keep track of the number of attempts made to collect each tx, so we can prioritize
118
- * the txs that have been requested less often whenever we need to send a new batch of requests. We ensure that no
119
- * tx is requested more than once at the same time to the same node.
120
- */ async collectFastFromNodes(request) {
121
- if (this.nodes.length === 0) {
122
- return;
123
- }
124
- // Keep a shared priority queue of all txs pending to be requested, sorted by the number of attempts made to collect them.
125
- const attemptsPerTx = [
126
- ...request.requestTracker.missingTxHashes
127
- ].map((txHash)=>({
128
- txHash,
129
- attempts: 0,
130
- found: false
131
- }));
132
- // Returns once we have finished all node loops. Each loop finishes when the deadline is hit, or all txs have been collected.
133
- await Promise.allSettled(this.nodes.map((node)=>this.collectFastFromNode(request, node, attemptsPerTx)));
134
- }
135
- async collectFastFromNode(request, node, attemptsPerTx) {
136
- const notFinished = ()=>!request.requestTracker.checkCancelled();
137
- const maxParallelRequests = this.config.txCollectionFastMaxParallelRequestsPerNode;
138
- const maxBatchSize = this.config.txCollectionNodeRpcMaxBatchSize;
139
- const activeRequestsToThisNode = new Set(); // Track the txs being actively requested to this node
140
- const processBatch = async ()=>{
141
- while(notFinished()){
142
- // Pull tx hashes from the attemptsPerTx array, which is sorted by attempts,
143
- // so we prioritize txs that have been requested less often.
144
- const batch = [];
145
- let index = 0;
146
- while(batch.length < maxBatchSize){
147
- const txToRequest = attemptsPerTx[index++];
148
- if (!txToRequest) {
149
- break;
150
- } else if (!request.requestTracker.isMissing(txToRequest.txHash)) {
151
- // Mark as found if it was found somewhere else, we'll then remove it from the array.
152
- // We don't delete it now since 'array.splice' is pretty expensive, so we do it after sorting.
153
- txToRequest.found = true;
154
- } else if (!activeRequestsToThisNode.has(txToRequest.txHash)) {
155
- // If the tx is not alredy being requested to this node, add it to the current batch and increase attempts.
156
- // Note that we increase the attempts *before* making the request, so the next `collectFastFromNode` that
157
- // needs to grab txs to send, will pick txs that have been requested less often, instead of all requesting
158
- // the same txs at the same time.
159
- batch.push(txToRequest);
160
- activeRequestsToThisNode.add(txToRequest.txHash);
161
- txToRequest.attempts++;
162
- }
163
- }
164
- // After modifying the array by removing txs or updating attempts, re-sort it and trim the found txs from the end.
165
- attemptsPerTx.sort((a, b)=>a.found === b.found ? a.attempts - b.attempts : Number(a.found) - Number(b.found));
166
- const firstFoundTxIndex = attemptsPerTx.findIndex((tx)=>tx.found);
167
- if (firstFoundTxIndex !== -1) {
168
- attemptsPerTx.length = firstFoundTxIndex;
169
- }
170
- // If we see no more txs to request, we can stop this "process" loop
171
- if (batch.length === 0) {
172
- return;
173
- }
174
- const txHashes = batch.map(({ txHash })=>txHash);
175
- // Collect this batch from the node
176
- await this.txCollectionSink.collect(async ()=>{
177
- const result = await node.getTxsByHash(txHashes.map(TxHash.fromString));
178
- for (const tx of result.validTxs){
179
- request.requestTracker.markFetched(tx);
180
- }
181
- return result;
182
- }, txHashes, {
183
- description: `fast ${node.getInfo()}`,
184
- node: node.getInfo(),
185
- method: 'fast-node-rpc',
186
- ...request.blockInfo
187
- }, this.getAddContext(request));
188
- // Clear from the active requests the txs we just requested
189
- for (const requestedTx of batch){
190
- activeRequestsToThisNode.delete(requestedTx.txHash);
191
- }
192
- // Sleep a bit until hitting the node again, but wake up immediately on cancellation
193
- if (notFinished()) {
194
- await Promise.race([
195
- sleep(this.config.txCollectionFastNodeIntervalMs),
196
- request.requestTracker.cancellationToken
197
- ]);
198
- }
199
- }
200
- };
201
- // Kick off N parallel requests to the node, up to the maxParallelRequests limit
202
- await Promise.all(times(maxParallelRequests, processBatch));
203
- }
204
- async collectFastViaReqResp(request, opts) {
205
- const pinnedPeer = opts.pinnedPeer;
206
- const blockInfo = request.blockInfo;
207
- const slotNumber = blockInfo.slotNumber;
208
- if (request.requestTracker.timeoutMs < 100) {
209
- this.log.warn(`Not initiating fast reqresp for txs for ${request.type} at slot ${blockInfo.slotNumber} due to timeout`, {
210
- timeoutMs: request.requestTracker.timeoutMs,
211
- ...blockInfo
212
- });
213
- return;
214
- }
215
- this.log.debug(`Starting fast reqresp for ${request.requestTracker.numberOfMissingTxs} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
216
- ...blockInfo,
217
- timeoutMs: request.requestTracker.timeoutMs,
218
- pinnedPeer
219
- });
220
- try {
221
- await this.txCollectionSink.collect(async ()=>{
222
- let result;
223
- if (request.type === 'proposal') {
224
- result = await this.missingTxsCollector.collectTxs(request.requestTracker, request.blockProposal, pinnedPeer);
225
- } else if (request.type === 'block') {
226
- const blockTxsSource = {
227
- txHashes: request.block.body.txEffects.map((e)=>e.txHash),
228
- archive: request.block.archive.root
229
- };
230
- result = await this.missingTxsCollector.collectTxs(request.requestTracker, blockTxsSource, pinnedPeer);
231
- } else {
232
- throw new Error(`Unknown request type: ${request.type}`);
233
- }
234
- return {
235
- validTxs: result,
236
- invalidTxHashes: []
237
- };
238
- }, Array.from(request.requestTracker.missingTxHashes), {
239
- description: `reqresp for slot ${slotNumber}`,
240
- method: 'fast-req-resp',
241
- ...opts,
242
- ...request.blockInfo
243
- }, this.getAddContext(request));
244
- } catch (err) {
245
- this.log.error(`Error sending fast reqresp request for txs`, err, {
246
- txs: [
247
- ...request.requestTracker.missingTxHashes
248
- ],
249
- ...blockInfo
250
- });
251
- }
252
- }
253
- /** Returns the TxAddContext for the given request, used by the sink to add txs to the pool correctly. */ getAddContext(request) {
254
- if (request.type === 'proposal') {
255
- return {
256
- type: 'proposal',
257
- blockHeader: request.blockProposal.blockHeader
258
- };
259
- } else {
260
- return {
261
- type: 'mined',
262
- block: request.block
263
- };
264
- }
265
- }
266
- /**
267
- * Handle txs by marking them as found for the requests that are waiting for them, and resolves the request if all its txs have been found.
268
- * Called internally and from the main tx collection manager whenever the tx pool emits a tx-added event.
269
- */ foundTxs(txs) {
270
- for (const request of this.requests){
271
- for (const tx of txs){
272
- const txHash = tx.txHash.toString();
273
- // Remove the tx hash from the missing set, and add it to the found set.
274
- if (request.requestTracker.markFetched(tx)) {
275
- this.log.trace(`Found tx ${txHash} for fast collection request`, {
276
- ...request.blockInfo,
277
- txHash: tx.txHash.toString(),
278
- type: request.type
279
- });
280
- if (request.requestTracker.allFetched()) {
281
- this.log.trace(`All txs found for fast collection request`, {
282
- ...request.blockInfo,
283
- type: request.type
284
- });
285
- break;
286
- }
287
- }
288
- }
289
- }
290
- }
291
- /**
292
- * Stop collecting all txs for blocks less than or requal to the block number specified.
293
- * To be called when we no longer care about gathering txs up to a certain block, eg when they become proven or finalized.
294
- */ stopCollectingForBlocksUpTo(blockNumber) {
295
- for (const request of this.requests){
296
- if (request.blockInfo.blockNumber <= blockNumber) {
297
- request.requestTracker.cancel();
298
- }
299
- }
300
- }
301
- /**
302
- * Stop collecting all txs for blocks greater than the block number specified.
303
- * To be called when there is a chain prune and previously mined txs are no longer relevant.
304
- */ stopCollectingForBlocksAfter(blockNumber) {
305
- for (const request of this.requests){
306
- if (request.blockInfo.blockNumber > blockNumber) {
307
- request.requestTracker.cancel();
308
- }
309
- }
310
- }
311
- }
@@ -1,48 +0,0 @@
1
- import type { Logger } from '@aztec/foundation/log';
2
- import type { DateProvider } from '@aztec/foundation/timer';
3
- import { type Tx } from '@aztec/stdlib/tx';
4
- import type { PeerId } from '@libp2p/interface';
5
- import type { BatchTxRequesterConfig } from '../reqresp/batch-tx-requester/config.js';
6
- import type { BatchTxRequesterLibP2PService } from '../reqresp/batch-tx-requester/interface.js';
7
- import type { IBatchRequestTxValidator } from '../reqresp/batch-tx-requester/tx_validator.js';
8
- import { type BlockTxsSource } from '../reqresp/index.js';
9
- import type { IRequestTracker } from './request_tracker.js';
10
- /**
11
- * Strategy interface for collecting missing transactions for a block or proposal.
12
- * Allows swapping between different tx collection implementations for benchmarking.
13
- */
14
- export interface MissingTxsCollector {
15
- /**
16
- * Collect missing transactions for a block or proposal.
17
- * @param requestTracker - The missing transactions tracker
18
- * @param blockTxsSource - The block or proposal containing the transactions
19
- * @param pinnedPeer - Optional peer expected to have the transactions
20
- * @returns The collected transactions
21
- */
22
- collectTxs(requestTracker: IRequestTracker, blockTxsSource: BlockTxsSource, pinnedPeer: PeerId | undefined): Promise<Tx[]>;
23
- }
24
- /**
25
- * Collects transactions using the BatchTxRequester implementation.
26
- * This uses a smart/dumb peer strategy with parallel workers.
27
- */
28
- export declare class BatchTxRequesterCollector implements MissingTxsCollector {
29
- private p2pService;
30
- private log;
31
- private dateProvider;
32
- private txValidator?;
33
- private batchTxRequesterConfig?;
34
- constructor(p2pService: BatchTxRequesterLibP2PService, log: Logger, dateProvider: DateProvider, txValidator?: IBatchRequestTxValidator | undefined, batchTxRequesterConfig?: Partial<BatchTxRequesterConfig> | undefined);
35
- collectTxs(requestTracker: IRequestTracker, blockTxsSource: BlockTxsSource, pinnedPeer: PeerId | undefined): Promise<Tx[]>;
36
- }
37
- /**
38
- * Collects transactions using the sendBatchRequest implementation from ReqResp.
39
- * This is the original implementation that balances requests across peers.
40
- */
41
- export declare class SendBatchRequestCollector implements MissingTxsCollector {
42
- private p2pService;
43
- private maxPeers;
44
- private maxRetryAttempts;
45
- constructor(p2pService: BatchTxRequesterLibP2PService, maxPeers?: number, maxRetryAttempts?: number);
46
- collectTxs(requestTracker: IRequestTracker, _blockTxsSource: BlockTxsSource, pinnedPeer: PeerId | undefined): Promise<Tx[]>;
47
- }
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvcG9zYWxfdHhfY29sbGVjdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2VydmljZXMvdHhfY29sbGVjdGlvbi9wcm9wb3NhbF90eF9jb2xsZWN0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1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