@aztec/p2p 0.0.1-commit.c80b6263 → 0.0.1-commit.c949de6bc

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 (355) hide show
  1. package/dest/client/factory.d.ts +10 -10
  2. package/dest/client/factory.d.ts.map +1 -1
  3. package/dest/client/factory.js +40 -14
  4. package/dest/client/interface.d.ts +46 -33
  5. package/dest/client/interface.d.ts.map +1 -1
  6. package/dest/client/p2p_client.d.ts +41 -51
  7. package/dest/client/p2p_client.d.ts.map +1 -1
  8. package/dest/client/p2p_client.js +156 -200
  9. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +8 -9
  10. package/dest/config.d.ts +30 -8
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +19 -7
  13. package/dest/errors/tx-pool.error.d.ts +8 -0
  14. package/dest/errors/tx-pool.error.d.ts.map +1 -0
  15. package/dest/errors/tx-pool.error.js +9 -0
  16. package/dest/index.d.ts +2 -1
  17. package/dest/index.d.ts.map +1 -1
  18. package/dest/index.js +1 -0
  19. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +104 -88
  20. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
  21. package/dest/mem_pools/attestation_pool/attestation_pool.js +441 -3
  22. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +2 -2
  23. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
  24. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +353 -87
  25. package/dest/mem_pools/attestation_pool/index.d.ts +2 -3
  26. package/dest/mem_pools/attestation_pool/index.d.ts.map +1 -1
  27. package/dest/mem_pools/attestation_pool/index.js +1 -2
  28. package/dest/mem_pools/attestation_pool/mocks.d.ts +2 -2
  29. package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
  30. package/dest/mem_pools/attestation_pool/mocks.js +2 -2
  31. package/dest/mem_pools/index.d.ts +3 -2
  32. package/dest/mem_pools/index.d.ts.map +1 -1
  33. package/dest/mem_pools/index.js +1 -1
  34. package/dest/mem_pools/interface.d.ts +5 -5
  35. package/dest/mem_pools/interface.d.ts.map +1 -1
  36. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +3 -3
  37. package/dest/mem_pools/tx_pool_v2/archive/index.d.ts +2 -0
  38. package/dest/mem_pools/tx_pool_v2/archive/index.d.ts.map +1 -0
  39. package/dest/mem_pools/tx_pool_v2/archive/index.js +1 -0
  40. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +43 -0
  41. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -0
  42. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +103 -0
  43. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +104 -0
  44. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -0
  45. package/dest/mem_pools/tx_pool_v2/deleted_pool.js +251 -0
  46. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +47 -0
  47. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -0
  48. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +128 -0
  49. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +17 -0
  50. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -0
  51. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +93 -0
  52. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +19 -0
  53. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -0
  54. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +97 -0
  55. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +10 -0
  56. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -0
  57. package/dest/mem_pools/tx_pool_v2/eviction/index.js +11 -0
  58. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +174 -0
  59. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -0
  60. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +25 -0
  61. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts +15 -0
  62. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts.map +1 -0
  63. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +65 -0
  64. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts +17 -0
  65. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -0
  66. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +93 -0
  67. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +16 -0
  68. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -0
  69. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +78 -0
  70. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +20 -0
  71. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -0
  72. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +73 -0
  73. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +15 -0
  74. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -0
  75. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +19 -0
  76. package/dest/mem_pools/tx_pool_v2/index.d.ts +6 -0
  77. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -0
  78. package/dest/mem_pools/tx_pool_v2/index.js +5 -0
  79. package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts +15 -0
  80. package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts.map +1 -0
  81. package/dest/mem_pools/tx_pool_v2/instrumentation.js +43 -0
  82. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +211 -0
  83. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
  84. package/dest/mem_pools/tx_pool_v2/interfaces.js +9 -0
  85. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +119 -0
  86. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -0
  87. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +193 -0
  88. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts +26 -0
  89. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts.map +1 -0
  90. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.js +70 -0
  91. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +108 -0
  92. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -0
  93. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +354 -0
  94. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +60 -0
  95. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -0
  96. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +161 -0
  97. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +77 -0
  98. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -0
  99. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +905 -0
  100. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +3 -3
  101. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
  102. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +4 -4
  103. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  104. package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
  105. package/dest/msg_validators/tx_validator/archive_cache.d.ts +3 -3
  106. package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -1
  107. package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
  108. package/dest/msg_validators/tx_validator/block_header_validator.d.ts +18 -5
  109. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
  110. package/dest/msg_validators/tx_validator/block_header_validator.js +2 -2
  111. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +13 -3
  112. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
  113. package/dest/msg_validators/tx_validator/double_spend_validator.js +4 -4
  114. package/dest/msg_validators/tx_validator/factory.d.ts +114 -6
  115. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  116. package/dest/msg_validators/tx_validator/factory.js +219 -58
  117. package/dest/msg_validators/tx_validator/gas_validator.d.ts +58 -3
  118. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  119. package/dest/msg_validators/tx_validator/gas_validator.js +73 -36
  120. package/dest/msg_validators/tx_validator/index.d.ts +2 -1
  121. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  122. package/dest/msg_validators/tx_validator/index.js +1 -0
  123. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
  124. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
  125. package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
  126. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +20 -4
  127. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
  128. package/dest/msg_validators/tx_validator/timestamp_validator.js +6 -6
  129. package/dest/services/data_store.d.ts +1 -1
  130. package/dest/services/data_store.d.ts.map +1 -1
  131. package/dest/services/data_store.js +10 -6
  132. package/dest/services/dummy_service.d.ts +13 -5
  133. package/dest/services/dummy_service.d.ts.map +1 -1
  134. package/dest/services/dummy_service.js +10 -4
  135. package/dest/services/encoding.d.ts +3 -3
  136. package/dest/services/encoding.d.ts.map +1 -1
  137. package/dest/services/encoding.js +11 -10
  138. package/dest/services/gossipsub/index.d.ts +3 -0
  139. package/dest/services/gossipsub/index.d.ts.map +1 -0
  140. package/dest/services/gossipsub/index.js +2 -0
  141. package/dest/services/gossipsub/scoring.d.ts +21 -3
  142. package/dest/services/gossipsub/scoring.d.ts.map +1 -1
  143. package/dest/services/gossipsub/scoring.js +24 -7
  144. package/dest/services/gossipsub/topic_score_params.d.ts +173 -0
  145. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
  146. package/dest/services/gossipsub/topic_score_params.js +346 -0
  147. package/dest/services/index.d.ts +2 -1
  148. package/dest/services/index.d.ts.map +1 -1
  149. package/dest/services/index.js +1 -0
  150. package/dest/services/libp2p/libp2p_service.d.ts +94 -42
  151. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  152. package/dest/services/libp2p/libp2p_service.js +425 -342
  153. package/dest/services/peer-manager/peer_scoring.d.ts +1 -1
  154. package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
  155. package/dest/services/peer-manager/peer_scoring.js +25 -2
  156. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +6 -5
  157. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
  158. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +27 -54
  159. package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
  160. package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
  161. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -13
  162. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
  163. package/dest/services/reqresp/batch-tx-requester/missing_txs.js +25 -46
  164. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +17 -11
  165. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
  166. package/dest/services/reqresp/batch-tx-requester/peer_collection.js +49 -15
  167. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
  168. package/dest/services/reqresp/interface.d.ts +10 -1
  169. package/dest/services/reqresp/interface.d.ts.map +1 -1
  170. package/dest/services/reqresp/interface.js +15 -1
  171. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +7 -5
  172. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
  173. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +17 -12
  174. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +25 -14
  175. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
  176. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +40 -24
  177. package/dest/services/reqresp/protocols/tx.d.ts +7 -1
  178. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  179. package/dest/services/reqresp/protocols/tx.js +20 -0
  180. package/dest/services/reqresp/reqresp.d.ts +1 -1
  181. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  182. package/dest/services/reqresp/reqresp.js +13 -5
  183. package/dest/services/service.d.ts +39 -3
  184. package/dest/services/service.d.ts.map +1 -1
  185. package/dest/services/tx_collection/config.d.ts +22 -4
  186. package/dest/services/tx_collection/config.d.ts.map +1 -1
  187. package/dest/services/tx_collection/config.js +49 -3
  188. package/dest/services/tx_collection/fast_tx_collection.d.ts +6 -5
  189. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
  190. package/dest/services/tx_collection/fast_tx_collection.js +64 -48
  191. package/dest/services/tx_collection/file_store_tx_collection.d.ts +53 -0
  192. package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -0
  193. package/dest/services/tx_collection/file_store_tx_collection.js +167 -0
  194. package/dest/services/tx_collection/file_store_tx_source.d.ts +37 -0
  195. package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -0
  196. package/dest/services/tx_collection/file_store_tx_source.js +90 -0
  197. package/dest/services/tx_collection/index.d.ts +3 -2
  198. package/dest/services/tx_collection/index.d.ts.map +1 -1
  199. package/dest/services/tx_collection/index.js +1 -0
  200. package/dest/services/tx_collection/instrumentation.d.ts +1 -1
  201. package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
  202. package/dest/services/tx_collection/instrumentation.js +2 -1
  203. package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
  204. package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
  205. package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
  206. package/dest/services/tx_collection/proposal_tx_collector.d.ts +15 -14
  207. package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
  208. package/dest/services/tx_collection/proposal_tx_collector.js +6 -6
  209. package/dest/services/tx_collection/slow_tx_collection.d.ts +7 -3
  210. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
  211. package/dest/services/tx_collection/slow_tx_collection.js +60 -26
  212. package/dest/services/tx_collection/tx_collection.d.ts +23 -10
  213. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  214. package/dest/services/tx_collection/tx_collection.js +75 -3
  215. package/dest/services/tx_collection/tx_collection_sink.d.ts +18 -8
  216. package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
  217. package/dest/services/tx_collection/tx_collection_sink.js +26 -29
  218. package/dest/services/tx_collection/tx_source.d.ts +8 -3
  219. package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
  220. package/dest/services/tx_collection/tx_source.js +19 -2
  221. package/dest/services/tx_file_store/config.d.ts +16 -0
  222. package/dest/services/tx_file_store/config.d.ts.map +1 -0
  223. package/dest/services/tx_file_store/config.js +22 -0
  224. package/dest/services/tx_file_store/index.d.ts +4 -0
  225. package/dest/services/tx_file_store/index.d.ts.map +1 -0
  226. package/dest/services/tx_file_store/index.js +3 -0
  227. package/dest/services/tx_file_store/instrumentation.d.ts +15 -0
  228. package/dest/services/tx_file_store/instrumentation.d.ts.map +1 -0
  229. package/dest/services/tx_file_store/instrumentation.js +29 -0
  230. package/dest/services/tx_file_store/tx_file_store.d.ts +48 -0
  231. package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -0
  232. package/dest/services/tx_file_store/tx_file_store.js +152 -0
  233. package/dest/services/tx_provider.d.ts +4 -4
  234. package/dest/services/tx_provider.d.ts.map +1 -1
  235. package/dest/services/tx_provider.js +9 -8
  236. package/dest/test-helpers/make-test-p2p-clients.d.ts +7 -8
  237. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  238. package/dest/test-helpers/make-test-p2p-clients.js +1 -2
  239. package/dest/test-helpers/mock-pubsub.d.ts +30 -4
  240. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  241. package/dest/test-helpers/mock-pubsub.js +105 -4
  242. package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
  243. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  244. package/dest/test-helpers/reqresp-nodes.js +4 -3
  245. package/dest/test-helpers/testbench-utils.d.ts +45 -38
  246. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  247. package/dest/test-helpers/testbench-utils.js +130 -60
  248. package/dest/testbench/p2p_client_testbench_worker.d.ts +2 -2
  249. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
  250. package/dest/testbench/p2p_client_testbench_worker.js +16 -16
  251. package/dest/util.d.ts +2 -2
  252. package/dest/util.d.ts.map +1 -1
  253. package/package.json +14 -14
  254. package/src/client/factory.ts +77 -26
  255. package/src/client/interface.ts +56 -34
  256. package/src/client/p2p_client.ts +192 -247
  257. package/src/client/test/tx_proposal_collector/README.md +4 -4
  258. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +21 -12
  259. package/src/config.ts +42 -11
  260. package/src/errors/tx-pool.error.ts +12 -0
  261. package/src/index.ts +1 -0
  262. package/src/mem_pools/attestation_pool/attestation_pool.ts +496 -91
  263. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +442 -102
  264. package/src/mem_pools/attestation_pool/index.ts +9 -2
  265. package/src/mem_pools/attestation_pool/mocks.ts +2 -1
  266. package/src/mem_pools/index.ts +4 -1
  267. package/src/mem_pools/interface.ts +4 -4
  268. package/src/mem_pools/tx_pool/README.md +1 -1
  269. package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +3 -3
  270. package/src/mem_pools/tx_pool_v2/README.md +275 -0
  271. package/src/mem_pools/tx_pool_v2/archive/index.ts +1 -0
  272. package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +120 -0
  273. package/src/mem_pools/tx_pool_v2/deleted_pool.ts +321 -0
  274. package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +160 -0
  275. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +121 -0
  276. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +125 -0
  277. package/src/mem_pools/tx_pool_v2/eviction/index.ts +27 -0
  278. package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +209 -0
  279. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +74 -0
  280. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +101 -0
  281. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +91 -0
  282. package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +90 -0
  283. package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +31 -0
  284. package/src/mem_pools/tx_pool_v2/index.ts +12 -0
  285. package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
  286. package/src/mem_pools/tx_pool_v2/interfaces.ts +242 -0
  287. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +297 -0
  288. package/src/mem_pools/tx_pool_v2/tx_pool_bench_metrics.ts +77 -0
  289. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +444 -0
  290. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +223 -0
  291. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +1083 -0
  292. package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +2 -2
  293. package/src/msg_validators/tx_validator/README.md +115 -0
  294. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +5 -5
  295. package/src/msg_validators/tx_validator/archive_cache.ts +3 -3
  296. package/src/msg_validators/tx_validator/block_header_validator.ts +18 -8
  297. package/src/msg_validators/tx_validator/double_spend_validator.ts +11 -6
  298. package/src/msg_validators/tx_validator/factory.ts +353 -77
  299. package/src/msg_validators/tx_validator/gas_validator.ts +90 -27
  300. package/src/msg_validators/tx_validator/index.ts +1 -0
  301. package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
  302. package/src/msg_validators/tx_validator/timestamp_validator.ts +23 -18
  303. package/src/services/data_store.ts +10 -7
  304. package/src/services/dummy_service.ts +18 -6
  305. package/src/services/encoding.ts +9 -9
  306. package/src/services/gossipsub/README.md +641 -0
  307. package/src/services/gossipsub/index.ts +2 -0
  308. package/src/services/gossipsub/scoring.ts +29 -5
  309. package/src/services/gossipsub/topic_score_params.ts +487 -0
  310. package/src/services/index.ts +1 -0
  311. package/src/services/libp2p/libp2p_service.ts +450 -365
  312. package/src/services/peer-manager/peer_scoring.ts +25 -0
  313. package/src/services/reqresp/batch-tx-requester/README.md +14 -14
  314. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +32 -60
  315. package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
  316. package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
  317. package/src/services/reqresp/batch-tx-requester/peer_collection.ts +63 -24
  318. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
  319. package/src/services/reqresp/interface.ts +26 -1
  320. package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +24 -15
  321. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +47 -24
  322. package/src/services/reqresp/protocols/tx.ts +22 -0
  323. package/src/services/reqresp/reqresp.ts +16 -4
  324. package/src/services/service.ts +51 -2
  325. package/src/services/tx_collection/config.ts +74 -6
  326. package/src/services/tx_collection/fast_tx_collection.ts +74 -51
  327. package/src/services/tx_collection/file_store_tx_collection.ts +202 -0
  328. package/src/services/tx_collection/file_store_tx_source.ts +117 -0
  329. package/src/services/tx_collection/index.ts +2 -1
  330. package/src/services/tx_collection/instrumentation.ts +7 -1
  331. package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
  332. package/src/services/tx_collection/proposal_tx_collector.ts +20 -21
  333. package/src/services/tx_collection/slow_tx_collection.ts +66 -33
  334. package/src/services/tx_collection/tx_collection.ts +113 -16
  335. package/src/services/tx_collection/tx_collection_sink.ts +30 -34
  336. package/src/services/tx_collection/tx_source.ts +22 -3
  337. package/src/services/tx_file_store/config.ts +37 -0
  338. package/src/services/tx_file_store/index.ts +3 -0
  339. package/src/services/tx_file_store/instrumentation.ts +36 -0
  340. package/src/services/tx_file_store/tx_file_store.ts +175 -0
  341. package/src/services/tx_provider.ts +10 -9
  342. package/src/test-helpers/make-test-p2p-clients.ts +3 -5
  343. package/src/test-helpers/mock-pubsub.ts +146 -9
  344. package/src/test-helpers/reqresp-nodes.ts +4 -6
  345. package/src/test-helpers/testbench-utils.ts +129 -71
  346. package/src/testbench/p2p_client_testbench_worker.ts +25 -22
  347. package/src/util.ts +7 -1
  348. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -40
  349. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
  350. package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +0 -218
  351. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -31
  352. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
  353. package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +0 -180
  354. package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +0 -320
  355. package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +0 -264
@@ -1,16 +1,13 @@
1
1
  import { times } from '@aztec/foundation/collection';
2
2
  import { AbortError, TimeoutError } from '@aztec/foundation/error';
3
3
  import { createLogger } from '@aztec/foundation/log';
4
- import { boundInclusive } from '@aztec/foundation/number';
5
4
  import { promiseWithResolvers } from '@aztec/foundation/promise';
6
5
  import { sleep } from '@aztec/foundation/sleep';
7
6
  import { DateProvider, elapsed } from '@aztec/foundation/timer';
8
7
  import { TxHash } from '@aztec/stdlib/tx';
9
- import { ReqRespSubProtocol } from '../reqresp/interface.js';
10
- import { chunkTxHashesRequest } from '../reqresp/protocols/tx.js';
8
+ import { MissingTxsTracker } from './missing_txs_tracker.js';
11
9
  import { BatchTxRequesterCollector, SendBatchRequestCollector } from './proposal_tx_collector.js';
12
10
  export class FastTxCollection {
13
- p2pService;
14
11
  nodes;
15
12
  txCollectionSink;
16
13
  config;
@@ -18,9 +15,8 @@ export class FastTxCollection {
18
15
  log;
19
16
  // eslint-disable-next-line aztec-custom/no-non-primitive-in-collections
20
17
  requests;
21
- proposalTxCollector;
22
- constructor(p2pService, nodes, txCollectionSink, config, dateProvider = new DateProvider(), log = createLogger('p2p:tx_collection_service'), proposalTxCollector){
23
- this.p2pService = p2pService;
18
+ missingTxsCollector;
19
+ constructor(p2pService, nodes, txCollectionSink, config, dateProvider = new DateProvider(), log = createLogger('p2p:tx_collection_service'), missingTxsCollector){
24
20
  this.nodes = nodes;
25
21
  this.txCollectionSink = txCollectionSink;
26
22
  this.config = config;
@@ -28,8 +24,8 @@ export class FastTxCollection {
28
24
  this.log = log;
29
25
  this.requests = new Set();
30
26
  const batchTxRequesterConfig = this.config;
31
- const proposalCollectorType = this.config.txCollectionProposalTxCollectorType;
32
- this.proposalTxCollector = proposalTxCollector ?? (proposalCollectorType === 'old' ? new SendBatchRequestCollector(p2pService) : new BatchTxRequesterCollector(p2pService, log, dateProvider, undefined, batchTxRequesterConfig));
27
+ const missingTxsCollectorType = this.config.txCollectionMissingTxsCollectorType;
28
+ this.missingTxsCollector = missingTxsCollector ?? (missingTxsCollectorType === 'old' ? new SendBatchRequestCollector(p2pService) : new BatchTxRequesterCollector(p2pService, log, dateProvider, undefined, batchTxRequesterConfig));
33
29
  }
34
30
  async stop() {
35
31
  this.requests.forEach((request)=>request.promise.reject(new AbortError(`Stopped collection service`)));
@@ -56,34 +52,32 @@ export class FastTxCollection {
56
52
  // This promise is used to await for the collection to finish during the main collectFast method.
57
53
  // It gets resolved in `foundTxs` when all txs have been collected, or rejected if the request is aborted or hits the deadline.
58
54
  const promise = promiseWithResolvers();
59
- setTimeout(()=>promise.reject(new TimeoutError(`Timed out while collecting txs`)), timeout);
55
+ const timeoutTimer = setTimeout(()=>promise.reject(new TimeoutError(`Timed out while collecting txs`)), timeout);
60
56
  const request = {
61
57
  ...input,
62
58
  blockInfo,
63
59
  promise,
64
- foundTxs: new Map(),
65
- missingTxHashes: new Set(txHashes.map((t)=>t.toString())),
60
+ missingTxTracker: MissingTxsTracker.fromArray(txHashes),
66
61
  deadline: opts.deadline
67
62
  };
68
63
  const [duration] = await elapsed(()=>this.collectFast(request, {
69
64
  ...opts
70
65
  }));
71
- this.log.verbose(`Collected ${request.foundTxs.size} txs out of ${txHashes.length} for ${input.type} at slot ${blockInfo.slotNumber}`, {
66
+ clearTimeout(timeoutTimer);
67
+ this.log.verbose(`Collected ${request.missingTxTracker.collectedTxs.length} txs out of ${txHashes.length} for ${input.type} at slot ${blockInfo.slotNumber}`, {
72
68
  ...blockInfo,
73
69
  duration,
74
70
  requestType: input.type,
75
71
  missingTxs: [
76
- ...request.missingTxHashes
72
+ ...request.missingTxTracker.missingTxHashes
77
73
  ]
78
74
  });
79
- return [
80
- ...request.foundTxs.values()
81
- ];
75
+ return request.missingTxTracker.collectedTxs;
82
76
  }
83
77
  async collectFast(request, opts) {
84
78
  this.requests.add(request);
85
79
  const { blockInfo } = request;
86
- this.log.debug(`Starting fast collection of ${request.missingTxHashes.size} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
80
+ this.log.debug(`Starting fast collection of ${request.missingTxTracker.numberOfMissingTxs} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
87
81
  ...blockInfo,
88
82
  requestType: request.type,
89
83
  deadline: opts.deadline
@@ -99,7 +93,7 @@ export class FastTxCollection {
99
93
  waitBeforeReqResp
100
94
  ]);
101
95
  // If we have collected all txs, we can stop here
102
- if (request.missingTxHashes.size === 0) {
96
+ if (request.missingTxTracker.allFetched()) {
103
97
  this.log.debug(`All txs collected for slot ${blockInfo.slotNumber} without reqresp`, blockInfo);
104
98
  return;
105
99
  }
@@ -118,9 +112,7 @@ export class FastTxCollection {
118
112
  const logCtx = {
119
113
  ...blockInfo,
120
114
  errorMessage: err instanceof Error ? err.message : undefined,
121
- missingTxs: [
122
- ...request.missingTxHashes
123
- ].map((txHash)=>txHash.toString())
115
+ missingTxs: request.missingTxTracker.missingTxHashes.values().map((txHash)=>txHash.toString())
124
116
  };
125
117
  if (err instanceof Error && err.name === 'TimeoutError') {
126
118
  this.log.warn(`Timed out collecting txs for ${request.type} at slot ${blockInfo.slotNumber}`, logCtx);
@@ -146,7 +138,7 @@ export class FastTxCollection {
146
138
  }
147
139
  // Keep a shared priority queue of all txs pending to be requested, sorted by the number of attempts made to collect them.
148
140
  const attemptsPerTx = [
149
- ...request.missingTxHashes
141
+ ...request.missingTxTracker.missingTxHashes
150
142
  ].map((txHash)=>({
151
143
  txHash,
152
144
  attempts: 0,
@@ -156,7 +148,7 @@ export class FastTxCollection {
156
148
  await Promise.allSettled(this.nodes.map((node)=>this.collectFastFromNode(request, node, attemptsPerTx, opts)));
157
149
  }
158
150
  async collectFastFromNode(request, node, attemptsPerTx, opts) {
159
- const notFinished = ()=>this.dateProvider.now() <= +opts.deadline && request.missingTxHashes.size > 0 && this.requests.has(request);
151
+ const notFinished = ()=>this.dateProvider.now() <= +opts.deadline && !request.missingTxTracker.allFetched() && this.requests.has(request);
160
152
  const maxParallelRequests = this.config.txCollectionFastMaxParallelRequestsPerNode;
161
153
  const maxBatchSize = this.config.txCollectionNodeRpcMaxBatchSize;
162
154
  const activeRequestsToThisNode = new Set(); // Track the txs being actively requested to this node
@@ -170,7 +162,7 @@ export class FastTxCollection {
170
162
  const txToRequest = attemptsPerTx[index++];
171
163
  if (!txToRequest) {
172
164
  break;
173
- } else if (!request.missingTxHashes.has(txToRequest.txHash)) {
165
+ } else if (!request.missingTxTracker.isMissing(txToRequest.txHash)) {
174
166
  // Mark as found if it was found somewhere else, we'll then remove it from the array.
175
167
  // We don't delete it now since 'array.splice' is pretty expensive, so we do it after sorting.
176
168
  txToRequest.found = true;
@@ -194,13 +186,20 @@ export class FastTxCollection {
194
186
  if (batch.length === 0) {
195
187
  return;
196
188
  }
189
+ const txHashes = batch.map(({ txHash })=>txHash);
197
190
  // Collect this batch from the node
198
- await this.txCollectionSink.collect((txHashes)=>node.getTxsByHash(txHashes), batch.map(({ txHash })=>TxHash.fromString(txHash)), {
191
+ await this.txCollectionSink.collect(async ()=>{
192
+ const result = await node.getTxsByHash(txHashes.map(TxHash.fromString));
193
+ for (const tx of result.validTxs){
194
+ request.missingTxTracker.markFetched(tx);
195
+ }
196
+ return result;
197
+ }, txHashes, {
199
198
  description: `fast ${node.getInfo()}`,
200
199
  node: node.getInfo(),
201
200
  method: 'fast-node-rpc',
202
201
  ...request.blockInfo
203
- });
202
+ }, this.getAddContext(request));
204
203
  // Clear from the active requests the txs we just requested
205
204
  for (const requestedTx of batch){
206
205
  activeRequestsToThisNode.delete(requestedTx.txHash);
@@ -217,8 +216,6 @@ export class FastTxCollection {
217
216
  async collectFastViaReqResp(request, opts) {
218
217
  const timeoutMs = +request.deadline - this.dateProvider.now();
219
218
  const pinnedPeer = opts.pinnedPeer;
220
- const maxPeers = boundInclusive(Math.ceil(request.missingTxHashes.size / 2), 8, 32);
221
- const maxRetryAttempts = 5;
222
219
  const blockInfo = request.blockInfo;
223
220
  const slotNumber = blockInfo.slotNumber;
224
221
  if (timeoutMs < 100) {
@@ -228,36 +225,57 @@ export class FastTxCollection {
228
225
  });
229
226
  return;
230
227
  }
231
- this.log.debug(`Starting fast reqresp for ${request.missingTxHashes.size} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
228
+ this.log.debug(`Starting fast reqresp for ${request.missingTxTracker.numberOfMissingTxs} txs for ${request.type} at slot ${blockInfo.slotNumber}`, {
232
229
  ...blockInfo,
233
230
  timeoutMs,
234
231
  pinnedPeer
235
232
  });
236
233
  try {
237
- await this.txCollectionSink.collect(async (txHashes)=>{
234
+ await this.txCollectionSink.collect(async ()=>{
235
+ let result;
238
236
  if (request.type === 'proposal') {
239
- return await this.proposalTxCollector.collectTxs(txHashes, request.blockProposal, pinnedPeer, timeoutMs);
237
+ result = await this.missingTxsCollector.collectTxs(request.missingTxTracker, request.blockProposal, pinnedPeer, timeoutMs);
240
238
  } else if (request.type === 'block') {
241
- const txs = await this.p2pService.reqResp.sendBatchRequest(ReqRespSubProtocol.TX, chunkTxHashesRequest(txHashes), pinnedPeer, timeoutMs, maxPeers, maxRetryAttempts);
242
- return txs.flat();
239
+ const blockTxsSource = {
240
+ txHashes: request.block.body.txEffects.map((e)=>e.txHash),
241
+ archive: request.block.archive.root
242
+ };
243
+ result = await this.missingTxsCollector.collectTxs(request.missingTxTracker, blockTxsSource, pinnedPeer, timeoutMs);
243
244
  } else {
244
245
  throw new Error(`Unknown request type: ${request.type}`);
245
246
  }
246
- }, Array.from(request.missingTxHashes).map((txHash)=>TxHash.fromString(txHash)), {
247
+ return {
248
+ validTxs: result,
249
+ invalidTxHashes: []
250
+ };
251
+ }, Array.from(request.missingTxTracker.missingTxHashes), {
247
252
  description: `reqresp for slot ${slotNumber}`,
248
253
  method: 'fast-req-resp',
249
254
  ...opts,
250
255
  ...request.blockInfo
251
- });
256
+ }, this.getAddContext(request));
252
257
  } catch (err) {
253
258
  this.log.error(`Error sending fast reqresp request for txs`, err, {
254
259
  txs: [
255
- ...request.missingTxHashes
260
+ ...request.missingTxTracker.missingTxHashes
256
261
  ],
257
262
  ...blockInfo
258
263
  });
259
264
  }
260
265
  }
266
+ /** Returns the TxAddContext for the given request, used by the sink to add txs to the pool correctly. */ getAddContext(request) {
267
+ if (request.type === 'proposal') {
268
+ return {
269
+ type: 'proposal',
270
+ blockHeader: request.blockProposal.blockHeader
271
+ };
272
+ } else {
273
+ return {
274
+ type: 'mined',
275
+ block: request.block
276
+ };
277
+ }
278
+ }
261
279
  /**
262
280
  * 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.
263
281
  * Called internally and from the main tx collection manager whenever the tx pool emits a tx-added event.
@@ -266,22 +284,20 @@ export class FastTxCollection {
266
284
  for (const tx of txs){
267
285
  const txHash = tx.txHash.toString();
268
286
  // Remove the tx hash from the missing set, and add it to the found set.
269
- if (request.missingTxHashes.has(txHash)) {
270
- request.missingTxHashes.delete(txHash);
271
- request.foundTxs.set(txHash, tx);
287
+ if (request.missingTxTracker.markFetched(tx)) {
272
288
  this.log.trace(`Found tx ${txHash} for fast collection request`, {
273
289
  ...request.blockInfo,
274
290
  txHash: tx.txHash.toString(),
275
291
  type: request.type
276
292
  });
277
- // If we found all txs for this request, we resolve the promise
278
- if (request.missingTxHashes.size === 0) {
279
- this.log.trace(`All txs found for fast collection request`, {
280
- ...request.blockInfo,
281
- type: request.type
282
- });
283
- request.promise.resolve();
284
- }
293
+ }
294
+ // If we found all txs for this request, we resolve the promise
295
+ if (request.missingTxTracker.allFetched()) {
296
+ this.log.trace(`All txs found for fast collection request`, {
297
+ ...request.blockInfo,
298
+ type: request.type
299
+ });
300
+ request.promise.resolve();
285
301
  }
286
302
  }
287
303
  }
@@ -0,0 +1,53 @@
1
+ import { type Logger } from '@aztec/foundation/log';
2
+ import { DateProvider } from '@aztec/foundation/timer';
3
+ import { Tx, TxHash } from '@aztec/stdlib/tx';
4
+ import type { FileStoreTxSource } from './file_store_tx_source.js';
5
+ import type { TxAddContext, TxCollectionSink } from './tx_collection_sink.js';
6
+ /** Configuration for a FileStoreTxCollection instance. */
7
+ export type FileStoreCollectionConfig = {
8
+ workerCount: number;
9
+ backoffBaseMs: number;
10
+ backoffMaxMs: number;
11
+ };
12
+ /**
13
+ * Collects txs from file stores as a fallback after P2P methods have been tried.
14
+ * Uses a shared worker pool that pulls entries with priority (fewest attempts first),
15
+ * retries with round-robin across sources, and applies exponential backoff between
16
+ * full cycles through all sources.
17
+ */
18
+ export declare class FileStoreTxCollection {
19
+ private readonly sources;
20
+ private readonly txCollectionSink;
21
+ private readonly config;
22
+ private readonly dateProvider;
23
+ private readonly log;
24
+ /** Map from tx hash string to entry for all pending downloads. */
25
+ private entries;
26
+ /** Worker promises for the shared worker pool. */
27
+ private workers;
28
+ /** Whether the worker pool is running. */
29
+ private running;
30
+ /** Signal used to wake sleeping workers when new entries arrive or stop is called. */
31
+ private wakeSignal;
32
+ constructor(sources: FileStoreTxSource[], txCollectionSink: TxCollectionSink, config: FileStoreCollectionConfig, dateProvider?: DateProvider, log?: Logger);
33
+ /** Starts the shared worker pool. */
34
+ start(): void;
35
+ /** Stops all workers and clears state. */
36
+ stop(): Promise<void>;
37
+ /** Adds entries to the shared map and wakes workers. */
38
+ startCollecting(txHashes: TxHash[], context: TxAddContext, deadline: Date): void;
39
+ /** Removes entries for txs that have been found elsewhere. */
40
+ foundTxs(txs: Tx[]): void;
41
+ /** Clears all pending entries. */
42
+ clearPending(): void;
43
+ private workerLoop;
44
+ /** Single-pass scan: removes expired entries, finds the best ready entry, or computes sleep time. */
45
+ private getNextAction;
46
+ /** Computes backoff for an entry. Backoff applies after a full cycle through all sources. */
47
+ private getBackoffMs;
48
+ /** Resolves the current wake signal and creates a new one. */
49
+ private wake;
50
+ private waitForWake;
51
+ private sleepOrWake;
52
+ }
53
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZV9zdG9yZV90eF9j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XVCO0lBRXRDLDBDQUEwQztJQUMxQyxPQUFPLENBQUMsT0FBTyxDQUFTO0lBRXhCLHNGQUFzRjtJQUN0RixPQUFPLENBQUMsVUFBVSxDQUE2QjtJQUUvQyxZQUNtQixPQUFPLEVBQUUsaUJBQWlCLEVBQUUsRUFDNUIsZ0JBQWdCLEVBQUUsZ0JBQWdCLEVBQ2xDLE1BQU0sRUFBRSx5QkFBeUIsRUFDakMsWUFBWSxHQUFFLFlBQWlDLEVBQy9DLEdBQUcsR0FBRSxNQUFxRCxFQUc1RTtJQUVELHFDQUFxQztJQUM5QixLQUFLLElBQUksSUFBSSxDQVNuQjtJQUVELDBDQUEwQztJQUM3QixJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1qQztJQUVELHdEQUF3RDtJQUNqRCxlQUFlLENBQUMsUUFBUSxFQUFFLE1BQU0sRUFBRSxFQUFFLE9BQU8sRUFBRSxZQUFZLEVBQUUsUUFBUSxFQUFFLElBQUksR0FBRyxJQUFJLENBc0J0RjtJQUVELDhEQUE4RDtJQUN2RCxRQUFRLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxHQUFHLElBQUksQ0FJL0I7SUFFRCxrQ0FBa0M7SUFDM0IsWUFBWSxJQUFJLElBQUksQ0FFMUI7WUFFYSxVQUFVO0lBa0N4QixxR0FBcUc7SUFDckcsT0FBTyxDQUFDLGFBQWE7SUE4QnJCLDZGQUE2RjtJQUM3RixPQUFPLENBQUMsWUFBWTtJQVFwQiw4REFBOEQ7SUFDOUQsT0FBTyxDQUFDLElBQUk7WUFNRSxXQUFXO1lBS1gsV0FBVztDQUcxQiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file_store_tx_collection.d.ts","sourceRoot":"","sources":["../../../src/services/tx_collection/file_store_tx_collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAE,YAAY,EAAE,MAAM,yBA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AI/B;IAED,kCAAkC;IAC3B,YAAY,IAAI,IAAI,CAE1B;YAEa,UAAU;IAkCxB,qGAAqG;IACrG,OAAO,CAAC,aAAa;IA8BrB,6FAA6F;IAC7F,OAAO,CAAC,YAAY;IAQpB,8DAA8D;IAC9D,OAAO,CAAC,IAAI;YAME,WAAW;YAKX,WAAW;CAG1B"}
@@ -0,0 +1,167 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { promiseWithResolvers } from '@aztec/foundation/promise';
3
+ import { sleep } from '@aztec/foundation/sleep';
4
+ import { DateProvider } from '@aztec/foundation/timer';
5
+ import { TxHash } from '@aztec/stdlib/tx';
6
+ /**
7
+ * Collects txs from file stores as a fallback after P2P methods have been tried.
8
+ * Uses a shared worker pool that pulls entries with priority (fewest attempts first),
9
+ * retries with round-robin across sources, and applies exponential backoff between
10
+ * full cycles through all sources.
11
+ */ export class FileStoreTxCollection {
12
+ sources;
13
+ txCollectionSink;
14
+ config;
15
+ dateProvider;
16
+ log;
17
+ /** Map from tx hash string to entry for all pending downloads. */ entries;
18
+ /** Worker promises for the shared worker pool. */ workers;
19
+ /** Whether the worker pool is running. */ running;
20
+ /** Signal used to wake sleeping workers when new entries arrive or stop is called. */ wakeSignal;
21
+ constructor(sources, txCollectionSink, config, dateProvider = new DateProvider(), log = createLogger('p2p:file_store_tx_collection')){
22
+ this.sources = sources;
23
+ this.txCollectionSink = txCollectionSink;
24
+ this.config = config;
25
+ this.dateProvider = dateProvider;
26
+ this.log = log;
27
+ this.entries = new Map();
28
+ this.workers = [];
29
+ this.running = false;
30
+ this.wakeSignal = promiseWithResolvers();
31
+ }
32
+ /** Starts the shared worker pool. */ start() {
33
+ if (this.sources.length === 0) {
34
+ this.log.debug('No file store sources configured');
35
+ return;
36
+ }
37
+ this.running = true;
38
+ for(let i = 0; i < this.config.workerCount; i++){
39
+ this.workers.push(this.workerLoop());
40
+ }
41
+ }
42
+ /** Stops all workers and clears state. */ async stop() {
43
+ this.running = false;
44
+ this.wake();
45
+ await Promise.all(this.workers);
46
+ this.workers = [];
47
+ this.entries.clear();
48
+ }
49
+ /** Adds entries to the shared map and wakes workers. */ startCollecting(txHashes, context, deadline) {
50
+ if (this.sources.length === 0 || txHashes.length === 0) {
51
+ return;
52
+ }
53
+ if (+deadline <= this.dateProvider.now()) {
54
+ return;
55
+ }
56
+ for (const txHash of txHashes){
57
+ const hashStr = txHash.toString();
58
+ if (!this.entries.has(hashStr)) {
59
+ this.entries.set(hashStr, {
60
+ txHash: hashStr,
61
+ context,
62
+ deadline,
63
+ attempts: 0,
64
+ lastAttemptTime: 0,
65
+ nextSourceIndex: Math.floor(Math.random() * this.sources.length)
66
+ });
67
+ }
68
+ }
69
+ this.wake();
70
+ }
71
+ /** Removes entries for txs that have been found elsewhere. */ foundTxs(txs) {
72
+ for (const tx of txs){
73
+ this.entries.delete(tx.getTxHash().toString());
74
+ }
75
+ }
76
+ /** Clears all pending entries. */ clearPending() {
77
+ this.entries.clear();
78
+ }
79
+ async workerLoop() {
80
+ while(this.running){
81
+ const action = this.getNextAction();
82
+ if (action.type === 'sleep') {
83
+ await action.promise;
84
+ continue;
85
+ }
86
+ const entry = action.entry;
87
+ const source = this.sources[entry.nextSourceIndex % this.sources.length];
88
+ entry.nextSourceIndex++;
89
+ entry.attempts++;
90
+ entry.lastAttemptTime = this.dateProvider.now();
91
+ try {
92
+ const result = await this.txCollectionSink.collect(()=>source.getTxsByHash([
93
+ TxHash.fromString(entry.txHash)
94
+ ]), [
95
+ entry.txHash
96
+ ], {
97
+ description: `file-store ${source.getInfo()}`,
98
+ method: 'file-store',
99
+ fileStore: source.getInfo()
100
+ }, entry.context);
101
+ if (result.txs.length > 0) {
102
+ this.entries.delete(entry.txHash);
103
+ }
104
+ } catch (err) {
105
+ this.log.trace(`Error downloading tx ${entry.txHash} from ${source.getInfo()}`, {
106
+ err
107
+ });
108
+ }
109
+ }
110
+ }
111
+ /** Single-pass scan: removes expired entries, finds the best ready entry, or computes sleep time. */ getNextAction() {
112
+ const now = this.dateProvider.now();
113
+ let best;
114
+ let earliestReadyAt = Infinity;
115
+ for (const [key, entry] of this.entries){
116
+ if (+entry.deadline <= now) {
117
+ this.entries.delete(key);
118
+ continue;
119
+ }
120
+ const backoffMs = this.getBackoffMs(entry);
121
+ const readyAt = entry.lastAttemptTime + backoffMs;
122
+ if (readyAt > now) {
123
+ earliestReadyAt = Math.min(earliestReadyAt, readyAt);
124
+ continue;
125
+ }
126
+ if (!best || entry.attempts < best.attempts) {
127
+ best = entry;
128
+ }
129
+ }
130
+ if (best) {
131
+ return {
132
+ type: 'process',
133
+ entry: best
134
+ };
135
+ }
136
+ if (earliestReadyAt < Infinity) {
137
+ return {
138
+ type: 'sleep',
139
+ promise: this.sleepOrWake(earliestReadyAt - now)
140
+ };
141
+ }
142
+ return {
143
+ type: 'sleep',
144
+ promise: this.waitForWake()
145
+ };
146
+ }
147
+ /** Computes backoff for an entry. Backoff applies after a full cycle through all sources. */ getBackoffMs(entry) {
148
+ const fullCycles = Math.floor(entry.attempts / this.sources.length);
149
+ if (fullCycles === 0) {
150
+ return 0;
151
+ }
152
+ return Math.min(this.config.backoffBaseMs * Math.pow(2, fullCycles - 1), this.config.backoffMaxMs);
153
+ }
154
+ /** Resolves the current wake signal and creates a new one. */ wake() {
155
+ this.wakeSignal.resolve();
156
+ this.wakeSignal = promiseWithResolvers();
157
+ }
158
+ /** Waits until the wake signal is resolved. */ async waitForWake() {
159
+ await this.wakeSignal.promise;
160
+ }
161
+ /** Sleeps for the given duration or until the wake signal is resolved. */ async sleepOrWake(ms) {
162
+ await Promise.race([
163
+ sleep(ms),
164
+ this.wakeSignal.promise
165
+ ]);
166
+ }
167
+ }
@@ -0,0 +1,37 @@
1
+ import { type Logger } from '@aztec/foundation/log';
2
+ import { type TxHash } from '@aztec/stdlib/tx';
3
+ import { type TelemetryClient } from '@aztec/telemetry-client';
4
+ import type { TxSource, TxSourceCollectionResult } from './tx_source.js';
5
+ /** TxSource implementation that downloads txs from a file store. */
6
+ export declare class FileStoreTxSource implements TxSource {
7
+ private readonly fileStore;
8
+ private readonly baseUrl;
9
+ private readonly basePath;
10
+ private readonly log;
11
+ private downloadsSuccess;
12
+ private downloadsFailed;
13
+ private downloadDuration;
14
+ private downloadSize;
15
+ private constructor();
16
+ /**
17
+ * Creates a FileStoreTxSource from a URL.
18
+ * @param url - The file store URL (s3://, gs://, file://, http://, https://).
19
+ * @param basePath - Base path for tx files within the store.
20
+ * @param log - Optional logger.
21
+ * @param telemetry - Optional telemetry client.
22
+ * @returns The FileStoreTxSource instance, or undefined if creation fails.
23
+ */
24
+ static create(url: string, basePath: string, log?: Logger, telemetry?: TelemetryClient): Promise<FileStoreTxSource | undefined>;
25
+ getInfo(): string;
26
+ getTxsByHash(txHashes: TxHash[]): Promise<TxSourceCollectionResult>;
27
+ }
28
+ /**
29
+ * Creates FileStoreTxSource instances from URLs.
30
+ * @param urls - Array of file store URLs.
31
+ * @param basePath - Base path for tx files within each store.
32
+ * @param log - Optional logger.
33
+ * @param telemetry - Optional telemetry client.
34
+ * @returns Array of successfully created FileStoreTxSource instances.
35
+ */
36
+ export declare function createFileStoreTxSources(urls: string[], basePath: string, log?: Logger, telemetry?: TelemetryClient): Promise<FileStoreTxSource[]>;
37
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZV9zdG9yZV90eF9zb3VyY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZXJ2aWNlcy90eF9jb2xsZWN0aW9uL2ZpbGVfc3RvcmVfdHhfc291cmNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUdsRSxPQUFPLEVBQU0sS0FBSyxNQUFNLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUNuRCxPQUFPL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AAsC,GAChD,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAG9B"}
@@ -0,0 +1,90 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { Timer } from '@aztec/foundation/timer';
3
+ import { createReadOnlyFileStore } from '@aztec/stdlib/file-store';
4
+ import { Tx } from '@aztec/stdlib/tx';
5
+ import { Metrics, getTelemetryClient } from '@aztec/telemetry-client';
6
+ /** TxSource implementation that downloads txs from a file store. */ export class FileStoreTxSource {
7
+ fileStore;
8
+ baseUrl;
9
+ basePath;
10
+ log;
11
+ downloadsSuccess;
12
+ downloadsFailed;
13
+ downloadDuration;
14
+ downloadSize;
15
+ constructor(fileStore, baseUrl, basePath, log, telemetry){
16
+ this.fileStore = fileStore;
17
+ this.baseUrl = baseUrl;
18
+ this.basePath = basePath;
19
+ this.log = log;
20
+ const meter = telemetry.getMeter('file-store-tx-source');
21
+ this.downloadsSuccess = meter.createUpDownCounter(Metrics.TX_FILE_STORE_DOWNLOADS_SUCCESS);
22
+ this.downloadsFailed = meter.createUpDownCounter(Metrics.TX_FILE_STORE_DOWNLOADS_FAILED);
23
+ this.downloadDuration = meter.createHistogram(Metrics.TX_FILE_STORE_DOWNLOAD_DURATION);
24
+ this.downloadSize = meter.createHistogram(Metrics.TX_FILE_STORE_DOWNLOAD_SIZE);
25
+ }
26
+ /**
27
+ * Creates a FileStoreTxSource from a URL.
28
+ * @param url - The file store URL (s3://, gs://, file://, http://, https://).
29
+ * @param basePath - Base path for tx files within the store.
30
+ * @param log - Optional logger.
31
+ * @param telemetry - Optional telemetry client.
32
+ * @returns The FileStoreTxSource instance, or undefined if creation fails.
33
+ */ static async create(url, basePath, log = createLogger('p2p:file_store_tx_source'), telemetry = getTelemetryClient()) {
34
+ try {
35
+ const fileStore = await createReadOnlyFileStore(url, log);
36
+ if (!fileStore) {
37
+ log.warn(`Failed to create file store for URL: ${url}`);
38
+ return undefined;
39
+ }
40
+ return new FileStoreTxSource(fileStore, url, basePath, log, telemetry);
41
+ } catch (err) {
42
+ log.warn(`Error creating file store for URL: ${url}`, {
43
+ error: err
44
+ });
45
+ return undefined;
46
+ }
47
+ }
48
+ getInfo() {
49
+ return `file-store:${this.baseUrl}`;
50
+ }
51
+ async getTxsByHash(txHashes) {
52
+ const invalidTxHashes = [];
53
+ return {
54
+ validTxs: (await Promise.all(txHashes.map(async (txHash)=>{
55
+ const path = `${this.basePath}/txs/${txHash.toString()}.bin`;
56
+ const timer = new Timer();
57
+ try {
58
+ const buffer = await this.fileStore.read(path);
59
+ const tx = Tx.fromBuffer(buffer);
60
+ if (await tx.validateTxHash() && txHash.equals(tx.txHash)) {
61
+ this.downloadsSuccess.add(1);
62
+ this.downloadDuration.record(Math.ceil(timer.ms()));
63
+ this.downloadSize.record(buffer.length);
64
+ return tx;
65
+ } else {
66
+ invalidTxHashes.push(tx.txHash.toString());
67
+ this.downloadsFailed.add(1);
68
+ return undefined;
69
+ }
70
+ } catch {
71
+ // Tx not found or error reading - return undefined
72
+ this.downloadsFailed.add(1);
73
+ return undefined;
74
+ }
75
+ }))).filter((tx)=>tx !== undefined),
76
+ invalidTxHashes: invalidTxHashes
77
+ };
78
+ }
79
+ }
80
+ /**
81
+ * Creates FileStoreTxSource instances from URLs.
82
+ * @param urls - Array of file store URLs.
83
+ * @param basePath - Base path for tx files within each store.
84
+ * @param log - Optional logger.
85
+ * @param telemetry - Optional telemetry client.
86
+ * @returns Array of successfully created FileStoreTxSource instances.
87
+ */ export async function createFileStoreTxSources(urls, basePath, log = createLogger('p2p:file_store_tx_source'), telemetry = getTelemetryClient()) {
88
+ const sources = await Promise.all(urls.map((url)=>FileStoreTxSource.create(url, basePath, log, telemetry)));
89
+ return sources.filter((s)=>s !== undefined);
90
+ }
@@ -1,4 +1,5 @@
1
1
  export { TxCollection, type FastCollectionRequestInput } from './tx_collection.js';
2
2
  export { type TxSource, createNodeRpcTxSources, NodeRpcTxSource } from './tx_source.js';
3
- export { type ProposalTxCollector, BatchTxRequesterCollector, SendBatchRequestCollector, } from './proposal_tx_collector.js';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZXJ2aWNlcy90eF9jb2xsZWN0aW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsS0FBSywwQkFBMEIsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ25GLE9BQU8sRUFBRSxLQUFLLFFBQVEsRUFBRSxzQkFBc0IsRUFBRSxlQUFlLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFDeEIseUJBQXlCLEVBQ3pCLHlCQUF5QixHQUMxQixNQUFNLDRCQUE0QixDQUFDIn0=
3
+ export { type MissingTxsCollector, BatchTxRequesterCollector, SendBatchRequestCollector, } from './proposal_tx_collector.js';
4
+ export { FileStoreTxSource, createFileStoreTxSources } from './file_store_tx_source.js';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZXJ2aWNlcy90eF9jb2xsZWN0aW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsS0FBSywwQkFBMEIsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ25GLE9BQU8sRUFBRSxLQUFLLFFBQVEsRUFBRSxzQkFBc0IsRUFBRSxlQUFlLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxtQkFBbUIsRUFDeEIseUJBQXlCLEVBQ3pCLHlCQUF5QixHQUMxQixNQUFNLDRCQUE0QixDQUFDO0FBQ3BDLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/tx_collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,KAAK,QAAQ,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/tx_collection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,KAAK,QAAQ,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { TxCollection } from './tx_collection.js';
2
2
  export { createNodeRpcTxSources, NodeRpcTxSource } from './tx_source.js';
3
3
  export { BatchTxRequesterCollector, SendBatchRequestCollector } from './proposal_tx_collector.js';
4
+ export { FileStoreTxSource, createFileStoreTxSources } from './file_store_tx_source.js';
@@ -7,4 +7,4 @@ export declare class TxCollectionInstrumentation {
7
7
  constructor(client: TelemetryClient, name: string);
8
8
  increaseTxsFor(what: CollectionMethod, count: number, duration: number): void;
9
9
  }
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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