@aztec/p2p 0.0.1-commit.6d63667d → 0.0.1-commit.7b97ef96e

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 (291) hide show
  1. package/dest/client/factory.d.ts +7 -6
  2. package/dest/client/factory.d.ts.map +1 -1
  3. package/dest/client/factory.js +46 -11
  4. package/dest/client/interface.d.ts +43 -23
  5. package/dest/client/interface.d.ts.map +1 -1
  6. package/dest/client/p2p_client.d.ts +38 -42
  7. package/dest/client/p2p_client.d.ts.map +1 -1
  8. package/dest/client/p2p_client.js +145 -145
  9. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +6 -6
  10. package/dest/config.d.ts +23 -4
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +16 -1
  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/deleted_pool.d.ts +104 -0
  38. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -0
  39. package/dest/mem_pools/tx_pool_v2/deleted_pool.js +251 -0
  40. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +3 -3
  41. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -1
  42. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +18 -9
  43. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +1 -1
  44. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
  45. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +4 -1
  46. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +3 -3
  47. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
  48. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +10 -4
  49. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +2 -2
  50. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -1
  51. package/dest/mem_pools/tx_pool_v2/eviction/index.js +1 -1
  52. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +48 -5
  53. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
  54. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +8 -0
  55. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +7 -5
  56. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +5 -3
  57. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +1 -1
  58. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
  59. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +8 -4
  60. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +4 -4
  61. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
  62. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +14 -4
  63. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +3 -3
  64. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
  65. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
  66. package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -1
  67. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
  68. package/dest/mem_pools/tx_pool_v2/index.js +1 -0
  69. package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts +15 -0
  70. package/dest/mem_pools/tx_pool_v2/instrumentation.d.ts.map +1 -0
  71. package/dest/mem_pools/tx_pool_v2/instrumentation.js +43 -0
  72. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +16 -4
  73. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
  74. package/dest/mem_pools/tx_pool_v2/interfaces.js +3 -1
  75. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +31 -5
  76. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
  77. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +62 -5
  78. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +12 -3
  79. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
  80. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +27 -4
  81. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +8 -3
  82. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
  83. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +11 -6
  84. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +12 -4
  85. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
  86. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +239 -109
  87. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +3 -3
  88. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
  89. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +3 -3
  90. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  91. package/dest/msg_validators/tx_validator/block_header_validator.d.ts +16 -3
  92. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
  93. package/dest/msg_validators/tx_validator/block_header_validator.js +1 -1
  94. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +13 -3
  95. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
  96. package/dest/msg_validators/tx_validator/double_spend_validator.js +4 -4
  97. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +20 -4
  98. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
  99. package/dest/msg_validators/tx_validator/timestamp_validator.js +6 -6
  100. package/dest/services/dummy_service.d.ts +12 -3
  101. package/dest/services/dummy_service.d.ts.map +1 -1
  102. package/dest/services/dummy_service.js +9 -0
  103. package/dest/services/encoding.d.ts +2 -2
  104. package/dest/services/encoding.d.ts.map +1 -1
  105. package/dest/services/encoding.js +4 -3
  106. package/dest/services/gossipsub/index.d.ts +3 -0
  107. package/dest/services/gossipsub/index.d.ts.map +1 -0
  108. package/dest/services/gossipsub/index.js +2 -0
  109. package/dest/services/gossipsub/scoring.d.ts +21 -3
  110. package/dest/services/gossipsub/scoring.d.ts.map +1 -1
  111. package/dest/services/gossipsub/scoring.js +24 -7
  112. package/dest/services/gossipsub/topic_score_params.d.ts +173 -0
  113. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
  114. package/dest/services/gossipsub/topic_score_params.js +346 -0
  115. package/dest/services/libp2p/libp2p_service.d.ts +85 -35
  116. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  117. package/dest/services/libp2p/libp2p_service.js +370 -267
  118. package/dest/services/peer-manager/peer_scoring.d.ts +1 -1
  119. package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
  120. package/dest/services/peer-manager/peer_scoring.js +25 -2
  121. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +4 -3
  122. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
  123. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +5 -9
  124. package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
  125. package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
  126. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -13
  127. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
  128. package/dest/services/reqresp/batch-tx-requester/missing_txs.js +25 -46
  129. package/dest/services/reqresp/interface.d.ts +10 -1
  130. package/dest/services/reqresp/interface.d.ts.map +1 -1
  131. package/dest/services/reqresp/interface.js +15 -1
  132. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +4 -3
  133. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
  134. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +7 -1
  135. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
  136. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +15 -0
  137. package/dest/services/reqresp/protocols/tx.d.ts +7 -1
  138. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  139. package/dest/services/reqresp/protocols/tx.js +20 -0
  140. package/dest/services/reqresp/reqresp.d.ts +1 -1
  141. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  142. package/dest/services/reqresp/reqresp.js +11 -4
  143. package/dest/services/service.d.ts +38 -2
  144. package/dest/services/service.d.ts.map +1 -1
  145. package/dest/services/tx_collection/config.d.ts +19 -1
  146. package/dest/services/tx_collection/config.d.ts.map +1 -1
  147. package/dest/services/tx_collection/config.js +46 -0
  148. package/dest/services/tx_collection/fast_tx_collection.d.ts +3 -1
  149. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
  150. package/dest/services/tx_collection/fast_tx_collection.js +56 -36
  151. package/dest/services/tx_collection/file_store_tx_collection.d.ts +53 -0
  152. package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -0
  153. package/dest/services/tx_collection/file_store_tx_collection.js +167 -0
  154. package/dest/services/tx_collection/file_store_tx_source.d.ts +37 -0
  155. package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -0
  156. package/dest/services/tx_collection/file_store_tx_source.js +90 -0
  157. package/dest/services/tx_collection/index.d.ts +2 -1
  158. package/dest/services/tx_collection/index.d.ts.map +1 -1
  159. package/dest/services/tx_collection/index.js +1 -0
  160. package/dest/services/tx_collection/instrumentation.d.ts +1 -1
  161. package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
  162. package/dest/services/tx_collection/instrumentation.js +2 -1
  163. package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
  164. package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
  165. package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
  166. package/dest/services/tx_collection/proposal_tx_collector.d.ts +7 -6
  167. package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
  168. package/dest/services/tx_collection/proposal_tx_collector.js +5 -4
  169. package/dest/services/tx_collection/slow_tx_collection.d.ts +7 -3
  170. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
  171. package/dest/services/tx_collection/slow_tx_collection.js +60 -26
  172. package/dest/services/tx_collection/tx_collection.d.ts +23 -10
  173. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  174. package/dest/services/tx_collection/tx_collection.js +75 -3
  175. package/dest/services/tx_collection/tx_collection_sink.d.ts +18 -8
  176. package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
  177. package/dest/services/tx_collection/tx_collection_sink.js +26 -29
  178. package/dest/services/tx_collection/tx_source.d.ts +8 -3
  179. package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
  180. package/dest/services/tx_collection/tx_source.js +19 -2
  181. package/dest/services/tx_file_store/config.d.ts +1 -3
  182. package/dest/services/tx_file_store/config.d.ts.map +1 -1
  183. package/dest/services/tx_file_store/config.js +0 -4
  184. package/dest/services/tx_file_store/tx_file_store.d.ts +4 -3
  185. package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -1
  186. package/dest/services/tx_file_store/tx_file_store.js +9 -6
  187. package/dest/services/tx_provider.d.ts +3 -3
  188. package/dest/services/tx_provider.d.ts.map +1 -1
  189. package/dest/services/tx_provider.js +5 -4
  190. package/dest/test-helpers/make-test-p2p-clients.d.ts +3 -3
  191. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  192. package/dest/test-helpers/mock-pubsub.d.ts +29 -2
  193. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  194. package/dest/test-helpers/mock-pubsub.js +103 -2
  195. package/dest/test-helpers/reqresp-nodes.d.ts +1 -1
  196. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  197. package/dest/test-helpers/reqresp-nodes.js +2 -1
  198. package/dest/test-helpers/testbench-utils.d.ts +43 -38
  199. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  200. package/dest/test-helpers/testbench-utils.js +128 -59
  201. package/dest/testbench/p2p_client_testbench_worker.d.ts +2 -2
  202. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
  203. package/dest/testbench/p2p_client_testbench_worker.js +10 -10
  204. package/dest/util.d.ts +2 -2
  205. package/dest/util.d.ts.map +1 -1
  206. package/package.json +14 -14
  207. package/src/client/factory.ts +86 -15
  208. package/src/client/interface.ts +59 -23
  209. package/src/client/p2p_client.ts +184 -167
  210. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +19 -9
  211. package/src/config.ts +34 -2
  212. package/src/errors/tx-pool.error.ts +12 -0
  213. package/src/index.ts +1 -0
  214. package/src/mem_pools/attestation_pool/attestation_pool.ts +496 -91
  215. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +442 -102
  216. package/src/mem_pools/attestation_pool/index.ts +9 -2
  217. package/src/mem_pools/attestation_pool/mocks.ts +2 -1
  218. package/src/mem_pools/index.ts +4 -1
  219. package/src/mem_pools/interface.ts +4 -4
  220. package/src/mem_pools/tx_pool/README.md +1 -1
  221. package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +3 -3
  222. package/src/mem_pools/tx_pool_v2/README.md +76 -10
  223. package/src/mem_pools/tx_pool_v2/deleted_pool.ts +321 -0
  224. package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +21 -8
  225. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +4 -1
  226. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +15 -4
  227. package/src/mem_pools/tx_pool_v2/eviction/index.ts +4 -0
  228. package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +49 -4
  229. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +5 -5
  230. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +3 -3
  231. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +8 -7
  232. package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +24 -6
  233. package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +3 -3
  234. package/src/mem_pools/tx_pool_v2/index.ts +1 -0
  235. package/src/mem_pools/tx_pool_v2/instrumentation.ts +69 -0
  236. package/src/mem_pools/tx_pool_v2/interfaces.ts +16 -4
  237. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +90 -9
  238. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +32 -5
  239. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +17 -6
  240. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +274 -104
  241. package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +2 -2
  242. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +2 -2
  243. package/src/msg_validators/tx_validator/block_header_validator.ts +15 -3
  244. package/src/msg_validators/tx_validator/double_spend_validator.ts +11 -6
  245. package/src/msg_validators/tx_validator/timestamp_validator.ts +23 -18
  246. package/src/services/dummy_service.ts +17 -1
  247. package/src/services/encoding.ts +4 -3
  248. package/src/services/gossipsub/README.md +641 -0
  249. package/src/services/gossipsub/index.ts +2 -0
  250. package/src/services/gossipsub/scoring.ts +29 -5
  251. package/src/services/gossipsub/topic_score_params.ts +487 -0
  252. package/src/services/libp2p/libp2p_service.ts +367 -271
  253. package/src/services/peer-manager/peer_scoring.ts +25 -0
  254. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +6 -6
  255. package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
  256. package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
  257. package/src/services/reqresp/interface.ts +26 -1
  258. package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +4 -3
  259. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +17 -0
  260. package/src/services/reqresp/protocols/tx.ts +22 -0
  261. package/src/services/reqresp/reqresp.ts +13 -3
  262. package/src/services/service.ts +50 -1
  263. package/src/services/tx_collection/config.ts +68 -0
  264. package/src/services/tx_collection/fast_tx_collection.ts +65 -32
  265. package/src/services/tx_collection/file_store_tx_collection.ts +202 -0
  266. package/src/services/tx_collection/file_store_tx_source.ts +117 -0
  267. package/src/services/tx_collection/index.ts +1 -0
  268. package/src/services/tx_collection/instrumentation.ts +7 -1
  269. package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
  270. package/src/services/tx_collection/proposal_tx_collector.ts +8 -7
  271. package/src/services/tx_collection/slow_tx_collection.ts +66 -33
  272. package/src/services/tx_collection/tx_collection.ts +113 -16
  273. package/src/services/tx_collection/tx_collection_sink.ts +30 -34
  274. package/src/services/tx_collection/tx_source.ts +22 -3
  275. package/src/services/tx_file_store/config.ts +0 -6
  276. package/src/services/tx_file_store/tx_file_store.ts +10 -8
  277. package/src/services/tx_provider.ts +8 -7
  278. package/src/test-helpers/make-test-p2p-clients.ts +3 -3
  279. package/src/test-helpers/mock-pubsub.ts +143 -3
  280. package/src/test-helpers/reqresp-nodes.ts +2 -1
  281. package/src/test-helpers/testbench-utils.ts +127 -71
  282. package/src/testbench/p2p_client_testbench_worker.ts +22 -15
  283. package/src/util.ts +7 -1
  284. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -40
  285. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
  286. package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +0 -218
  287. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -31
  288. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
  289. package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +0 -180
  290. package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +0 -320
  291. package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +0 -264
@@ -372,8 +372,9 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
372
372
  }
373
373
  var _dec, _dec1, _initProto;
374
374
  import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
375
- import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
375
+ import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
376
376
  import { createLogger } from '@aztec/foundation/log';
377
+ import { RunningPromise } from '@aztec/foundation/promise';
377
378
  import { DateProvider } from '@aztec/foundation/timer';
378
379
  import { L2TipsKVStore } from '@aztec/kv-store/stores';
379
380
  import { L2BlockStream } from '@aztec/stdlib/block';
@@ -381,6 +382,7 @@ import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
381
382
  import { tryStop } from '@aztec/stdlib/interfaces/server';
382
383
  import { Attributes, WithTracer, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
383
384
  import { getP2PDefaultConfig } from '../config.js';
385
+ import { TxPoolError } from '../errors/tx-pool.error.js';
384
386
  import { ReqRespSubProtocol } from '../services/reqresp/interface.js';
385
387
  import { chunkTxHashesRequest } from '../services/reqresp/protocols/tx.js';
386
388
  import { TxProvider } from '../services/tx_provider.js';
@@ -402,6 +404,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
402
404
  p2pService;
403
405
  txCollection;
404
406
  txFileStore;
407
+ epochCache;
405
408
  _dateProvider;
406
409
  telemetry;
407
410
  log;
@@ -434,15 +437,10 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
434
437
  blockStream;
435
438
  txProvider;
436
439
  validatorAddresses;
437
- /**
438
- * In-memory P2P client constructor.
439
- * @param store - The client's instance of the KV store.
440
- * @param l2BlockSource - P2P client's source for fetching existing blocks.
441
- * @param txPool - The client's instance of a transaction pool. Defaults to in-memory implementation.
442
- * @param p2pService - The concrete instance of p2p networking to use.
443
- * @param log - A logger.
444
- */ constructor(_clientType, store, l2BlockSource, mempools, p2pService, txCollection, txFileStore, config = {}, _dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('p2p')){
445
- super(telemetry, 'P2PClient'), this.store = store, this.l2BlockSource = l2BlockSource, this.p2pService = p2pService, this.txCollection = txCollection, this.txFileStore = txFileStore, this._dateProvider = _dateProvider, this.telemetry = telemetry, this.log = log, this.currentState = (_initProto(this), P2PClientState.IDLE), this.syncPromise = Promise.resolve(), this.syncResolve = undefined, this.latestBlockNumberAtStart = -1, this.provenBlockNumberAtStart = -1, this.finalizedBlockNumberAtStart = -1, this.validatorAddresses = [];
440
+ /** Tracks the last slot for which we called prepareForSlot */ lastSlotProcessed;
441
+ /** Polls for slot changes and calls prepareForSlot on the tx pool */ slotMonitor;
442
+ constructor(_clientType, store, l2BlockSource, mempools, p2pService, txCollection, txFileStore, epochCache, config = {}, _dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('p2p')){
443
+ super(telemetry, 'P2PClient'), this.store = store, this.l2BlockSource = l2BlockSource, this.p2pService = p2pService, this.txCollection = txCollection, this.txFileStore = txFileStore, this.epochCache = epochCache, this._dateProvider = _dateProvider, this.telemetry = telemetry, this.log = log, this.currentState = (_initProto(this), P2PClientState.IDLE), this.syncPromise = Promise.resolve(), this.syncResolve = undefined, this.latestBlockNumberAtStart = -1, this.provenBlockNumberAtStart = -1, this.finalizedBlockNumberAtStart = -1, this.validatorAddresses = [], this.lastSlotProcessed = SlotNumber.ZERO;
446
444
  this.config = {
447
445
  ...getP2PDefaultConfig(),
448
446
  ...config
@@ -494,13 +492,15 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
494
492
  getPeers(includePending) {
495
493
  return Promise.resolve(this.p2pService.getPeers(includePending));
496
494
  }
495
+ getGossipMeshPeerCount(topicType) {
496
+ return Promise.resolve(this.p2pService.getGossipMeshPeerCount(topicType));
497
+ }
497
498
  getL2BlockHash(number) {
498
499
  return this.l2Tips.getL2BlockHash(number);
499
500
  }
500
- updateP2PConfig(config) {
501
- this.txPool.updateConfig(config);
501
+ async updateP2PConfig(config) {
502
+ await this.txPool.updateConfig(config);
502
503
  this.p2pService.updateConfig(config);
503
- return Promise.resolve();
504
504
  }
505
505
  getL2Tips() {
506
506
  return this.l2Tips.getL2Tips();
@@ -527,7 +527,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
527
527
  break;
528
528
  case 'chain-pruned':
529
529
  this.txCollection.stopCollectingForBlocksAfter(event.block.number);
530
- await this.handlePruneL2Blocks(event.block.number);
530
+ await this.handlePruneL2Blocks(event.block, event.checkpoint);
531
531
  break;
532
532
  case 'chain-checkpointed':
533
533
  break;
@@ -542,7 +542,6 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
542
542
  await this.startServiceIfSynched();
543
543
  }
544
544
  #assertIsReady() {
545
- // this.log.info('Checking if p2p client is ready, current state: ', this.currentState);
546
545
  if (!this.isReady()) {
547
546
  throw new Error('P2P client not ready');
548
547
  }
@@ -557,6 +556,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
557
556
  if (this.currentState !== P2PClientState.IDLE) {
558
557
  return this.syncPromise;
559
558
  }
559
+ // Start the tx pool first, as it needs to hydrate state from persistence
560
+ await this.txPool.start();
560
561
  // get the current latest block numbers
561
562
  const latestBlockNumbers = await this.l2BlockSource.getL2Tips();
562
563
  this.latestBlockNumberAtStart = latestBlockNumbers.proposed.number;
@@ -600,6 +601,9 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
600
601
  this.blockStream.start();
601
602
  await this.txCollection.start();
602
603
  this.txFileStore?.start();
604
+ // Start slot monitor to call prepareForSlot when the slot changes
605
+ this.slotMonitor = new RunningPromise(()=>this.maybeCallPrepareForSlot(), this.log, this.config.slotCheckIntervalMS);
606
+ this.slotMonitor.start();
603
607
  return this.syncPromise;
604
608
  }
605
609
  addReqRespSubProtocol(subProtocol, handler, validator) {
@@ -620,6 +624,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
620
624
  * 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
621
625
  */ async stop() {
622
626
  this.log.debug('Stopping p2p client...');
627
+ await this.slotMonitor?.stop();
628
+ this.log.debug('Stopped slot monitor');
623
629
  await tryStop(this.txCollection);
624
630
  this.log.debug('Stopped tx collection service');
625
631
  await this.txFileStore?.stop();
@@ -628,6 +634,8 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
628
634
  this.log.debug('Stopped p2p service');
629
635
  await this.blockStream?.stop();
630
636
  this.log.debug('Stopped block downloader');
637
+ await this.txPool.stop();
638
+ this.log.debug('Stopped tx pool');
631
639
  await this.runningPromise;
632
640
  this.setCurrentState(P2PClientState.STOPPED);
633
641
  this.log.info('P2P client stopped');
@@ -639,7 +647,18 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
639
647
  async broadcastProposal(proposal) {
640
648
  this.log.verbose(`Broadcasting proposal for slot ${proposal.slotNumber} to peers`);
641
649
  // Store our own proposal so we can respond to req/resp requests for it
642
- await this.attestationPool.addBlockProposal(proposal);
650
+ const { count } = await this.attestationPool.tryAddBlockProposal(proposal);
651
+ if (count > 1) {
652
+ if (this.config.broadcastEquivocatedProposals) {
653
+ this.log.warn(`Broadcasting equivocated block proposal for slot ${proposal.slotNumber}`, {
654
+ slot: proposal.slotNumber,
655
+ archive: proposal.archive.toString(),
656
+ count
657
+ });
658
+ } else {
659
+ throw new Error(`Attempted to broadcast a duplicate block proposal for slot ${proposal.slotNumber}`);
660
+ }
661
+ }
643
662
  return this.p2pService.propagate(proposal);
644
663
  }
645
664
  async broadcastCheckpointProposal(proposal) {
@@ -647,7 +666,7 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
647
666
  const blockProposal = proposal.getBlockProposal();
648
667
  if (blockProposal) {
649
668
  // Store our own last-block proposal so we can respond to req/resp requests for it.
650
- await this.attestationPool.addBlockProposal(blockProposal);
669
+ await this.attestationPool.tryAddBlockProposal(blockProposal);
651
670
  }
652
671
  return this.p2pService.propagate(proposal);
653
672
  }
@@ -658,8 +677,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
658
677
  async getCheckpointAttestationsForSlot(slot, proposalId) {
659
678
  return await (proposalId ? this.attestationPool.getCheckpointAttestationsForSlotAndProposal(slot, proposalId) : this.attestationPool.getCheckpointAttestationsForSlot(slot));
660
679
  }
661
- addCheckpointAttestations(attestations) {
662
- return this.attestationPool.addCheckpointAttestations(attestations);
680
+ addOwnCheckpointAttestations(attestations) {
681
+ return this.attestationPool.addOwnCheckpointAttestations(attestations);
682
+ }
683
+ hasBlockProposalsForSlot(slot) {
684
+ return this.attestationPool.hasBlockProposalsForSlot(slot);
663
685
  }
664
686
  // REVIEW: https://github.com/AztecProtocol/aztec-packages/issues/7963
665
687
  // ^ This pattern is not my favorite (md)
@@ -669,6 +691,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
669
691
  registerCheckpointProposalHandler(handler) {
670
692
  this.p2pService.registerCheckpointReceivedCallback(handler);
671
693
  }
694
+ registerDuplicateProposalCallback(callback) {
695
+ this.p2pService.registerDuplicateProposalCallback(callback);
696
+ }
697
+ registerDuplicateAttestationCallback(callback) {
698
+ this.p2pService.registerDuplicateAttestationCallback(callback);
699
+ }
672
700
  /**
673
701
  * Uses the batched Request Response protocol to request a set of transactions from the network.
674
702
  */ async requestTxsByHash(txHashes, pinnedPeerId) {
@@ -679,15 +707,30 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
679
707
  const txBatches = await this.p2pService.sendBatchRequest(ReqRespSubProtocol.TX, requests, pinnedPeerId, timeoutMs, maxPeers, maxRetryAttempts);
680
708
  const txs = txBatches.flat();
681
709
  if (txs.length > 0) {
682
- await this.txPool.addTxs(txs);
710
+ await this.txPool.addPendingTxs(txs);
683
711
  }
684
712
  const txHashesStr = txHashes.map((tx)=>tx.toString()).join(', ');
685
713
  this.log.debug(`Requested txs ${txHashesStr} (${txs.length} / ${txHashes.length}) from peers`);
686
714
  // We return all transactions, even the not found ones to the caller, such they can handle missing items themselves.
687
715
  return txs;
688
716
  }
689
- getPendingTxs(limit, after) {
690
- return this.getTxs('pending', limit, after);
717
+ async getPendingTxs(limit, after) {
718
+ if (limit !== undefined && limit <= 0) {
719
+ throw new TypeError('limit must be greater than 0');
720
+ }
721
+ let txHashes = await this.txPool.getPendingTxHashes();
722
+ let startIndex = 0;
723
+ if (after) {
724
+ startIndex = txHashes.findIndex((txHash)=>after.equals(txHash));
725
+ if (startIndex === -1) {
726
+ return [];
727
+ }
728
+ startIndex++;
729
+ }
730
+ const endIndex = limit !== undefined ? startIndex + limit : undefined;
731
+ txHashes = txHashes.slice(startIndex, endIndex);
732
+ const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
733
+ return maybeTxs.filter((tx)=>!!tx);
691
734
  }
692
735
  getPendingTxCount() {
693
736
  return this.txPool.getPendingTxCount();
@@ -700,52 +743,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
700
743
  }
701
744
  }
702
745
  }
703
- /**
704
- * Returns all transactions in the transaction pool.
705
- * @param filter - The type of txs to return
706
- * @param limit - How many txs to return
707
- * @param after - If paginating, the last known tx hash. Will return txs after this hash
708
- * @returns An array of Txs.
709
- */ async getTxs(filter, limit, after) {
710
- if (limit !== undefined && limit <= 0) {
711
- throw new TypeError('limit must be greater than 0');
712
- }
713
- let txs = undefined;
714
- let txHashes;
715
- if (filter === 'all') {
716
- txs = await this.txPool.getAllTxs();
717
- txHashes = await Promise.all(txs.map((tx)=>tx.getTxHash()));
718
- } else if (filter === 'mined') {
719
- const minedTxHashes = await this.txPool.getMinedTxHashes();
720
- txHashes = minedTxHashes.map(([txHash])=>txHash);
721
- } else if (filter === 'pending') {
722
- txHashes = await this.txPool.getPendingTxHashes();
723
- } else {
724
- const _ = filter;
725
- throw new Error(`Unknown filter ${filter}`);
726
- }
727
- let startIndex = 0;
728
- let endIndex = undefined;
729
- if (after) {
730
- startIndex = txHashes.findIndex((txHash)=>after.equals(txHash));
731
- // if we can't find the last tx in our set then return an empty array as pagination is no longer valid.
732
- if (startIndex === -1) {
733
- return [];
746
+ async *iterateEligiblePendingTxs() {
747
+ for (const txHash of (await this.txPool.getEligiblePendingTxHashes())){
748
+ const tx = await this.txPool.getTxByHash(txHash);
749
+ if (tx) {
750
+ yield tx;
734
751
  }
735
- // increment by one because we don't want to return the same tx again
736
- startIndex++;
737
- }
738
- if (limit !== undefined) {
739
- endIndex = startIndex + limit;
740
752
  }
741
- txHashes = txHashes.slice(startIndex, endIndex);
742
- if (txs) {
743
- txs = txs.slice(startIndex, endIndex);
744
- } else {
745
- const maybeTxs = await Promise.all(txHashes.map((txHash)=>this.txPool.getTxByHash(txHash)));
746
- txs = maybeTxs.filter((tx)=>!!tx);
747
- }
748
- return txs;
749
753
  }
750
754
  /**
751
755
  * Returns a transaction in the transaction pool by its hash.
@@ -808,31 +812,35 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
808
812
  return this.txPool.getArchivedTxByHash(txHash);
809
813
  }
810
814
  /**
811
- * Verifies the 'tx' and, if valid, adds it to local tx pool and forwards it to other peers.
812
- * @param tx - The tx to verify.
815
+ * Accepts a transaction, adds it to local tx pool and forwards it to other peers.
816
+ * @param tx - The tx to send.
813
817
  * @returns Empty promise.
814
818
  **/ async sendTx(tx) {
815
- const addedCount = await this.addTxsToPool([
819
+ this.#assertIsReady();
820
+ const result = await this.txPool.addPendingTxs([
816
821
  tx
817
- ]);
818
- const txAddedSuccessfully = addedCount === 1;
819
- if (txAddedSuccessfully) {
822
+ ], {
823
+ feeComparisonOnly: true
824
+ });
825
+ if (result.accepted.length === 1) {
820
826
  await this.p2pService.propagate(tx);
827
+ return;
821
828
  }
822
- }
823
- /**
824
- * Adds transactions to the pool. Does not send to peers or validate the txs.
825
- * @param txs - The transactions.
826
- **/ async addTxsToPool(txs) {
827
- this.#assertIsReady();
828
- return await this.txPool.addTxs(txs);
829
+ const txHashStr = tx.getTxHash().toString();
830
+ const reason = result.errors?.get(txHashStr);
831
+ if (reason) {
832
+ this.log.warn(`Tx ${txHashStr} not added to pool: ${reason.message}`);
833
+ throw new TxPoolError(reason);
834
+ }
835
+ this.log.warn(`Tx ${txHashStr} not propagated: accepted=${result.accepted.length} ignored=${result.ignored.length} rejected=${result.rejected.length}`);
829
836
  }
830
837
  /**
831
838
  * Returns whether the given tx hash is flagged as pending or mined.
832
839
  * @param txHash - Hash of the tx to query.
833
840
  * @returns Pending or mined depending on its status, or undefined if not found.
834
- */ getTxStatus(txHash) {
835
- return this.txPool.getTxStatus(txHash);
841
+ */ async getTxStatus(txHash) {
842
+ const status = await this.txPool.getTxStatus(txHash);
843
+ return status === 'protected' ? 'pending' : status;
836
844
  }
837
845
  getEnr() {
838
846
  return this.p2pService.getEnr();
@@ -841,13 +849,11 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
841
849
  return Promise.resolve(this.p2pService.getEnr()?.encodeTxt());
842
850
  }
843
851
  /**
844
- * Deletes the 'txs' from the pool.
845
- * NOT used if we use sendTx as reconcileTxPool will handle this.
846
- * @param txHashes - Hashes of the transactions to delete.
847
- * @returns Empty promise.
848
- **/ async deleteTxs(txHashes) {
852
+ * Handles failed transaction execution by removing txs from the pool.
853
+ * @param txHashes - Hashes of the transactions that failed execution.
854
+ **/ async handleFailedExecution(txHashes) {
849
855
  this.#assertIsReady();
850
- await this.txPool.deleteTxs(txHashes);
856
+ await this.txPool.handleFailedExecution(txHashes);
851
857
  }
852
858
  /**
853
859
  * Public function to check if the p2p client is fully synced and ready to receive txs.
@@ -891,13 +897,12 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
891
897
  };
892
898
  }
893
899
  /**
894
- * Mark all txs from these blocks as mined.
900
+ * Handles mined blocks by marking the txs in them as mined.
895
901
  * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
896
902
  * @returns Empty promise.
897
- */ async markTxsAsMinedFromBlocks(blocks) {
903
+ */ async handleMinedBlocks(blocks) {
898
904
  for (const block of blocks){
899
- const txHashes = block.body.txEffects.map((txEffect)=>txEffect.txHash);
900
- await this.txPool.markAsMined(txHashes, block.header);
905
+ await this.txPool.handleMinedBlock(block);
901
906
  }
902
907
  }
903
908
  /**
@@ -906,14 +911,13 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
906
911
  * @returns Empty promise.
907
912
  */ async handleLatestL2Blocks(blocks) {
908
913
  if (!blocks.length) {
909
- return Promise.resolve();
914
+ return;
910
915
  }
911
- await this.markTxsAsMinedFromBlocks(blocks);
912
- await this.txPool.clearNonEvictableTxs();
916
+ await this.handleMinedBlocks(blocks);
917
+ await this.maybeCallPrepareForSlot();
913
918
  await this.startCollectingMissingTxs(blocks);
914
919
  const lastBlock = blocks.at(-1);
915
920
  await this.synchedLatestSlot.set(BigInt(lastBlock.header.getSlot()));
916
- this.log.verbose(`Synched to latest block ${lastBlock.number}`);
917
921
  }
918
922
  /** Request txs for unproven blocks so the prover node has more chances to get them. */ async startCollectingMissingTxs(blocks) {
919
923
  try {
@@ -947,59 +951,45 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
947
951
  * @returns Empty promise.
948
952
  */ async handleFinalizedL2Blocks(blocks) {
949
953
  if (!blocks.length) {
950
- return Promise.resolve();
954
+ return;
951
955
  }
952
- this.log.debug(`Handling finalized blocks ${blocks.length} up to ${blocks.at(-1)?.number}`);
953
- const lastBlockNum = blocks[blocks.length - 1].number;
954
- const lastBlockSlot = blocks[blocks.length - 1].header.getSlot();
955
- const txHashes = blocks.flatMap((block)=>block.body.txEffects.map((txEffect)=>txEffect.txHash));
956
- this.log.debug(`Deleting ${txHashes.length} txs from pool from finalized blocks up to ${lastBlockNum}`);
957
- await this.txPool.deleteTxs(txHashes, {
958
- permanently: true
959
- });
960
- await this.txPool.cleanupDeletedMinedTxs(lastBlockNum);
961
- await this.attestationPool.deleteCheckpointAttestationsOlderThan(lastBlockSlot);
962
- this.log.debug(`Synched to finalized block ${lastBlockNum} at slot ${lastBlockSlot}`);
956
+ // Finalization is monotonic, so we only need to call with the last block
957
+ const lastBlock = blocks.at(-1);
958
+ await this.txPool.handleFinalizedBlock(lastBlock.header);
959
+ await this.attestationPool.deleteOlderThan(lastBlock.header.getSlot());
963
960
  }
964
961
  /**
965
962
  * Updates the tx pool after a chain prune.
966
- * @param latestBlock - The block number the chain was pruned to.
967
- */ async handlePruneL2Blocks(latestBlock) {
968
- const txsToDelete = new Map();
969
- const minedTxs = await this.txPool.getMinedTxHashes();
970
- // Find transactions that reference pruned blocks in their historical header
971
- for (const tx of (await this.txPool.getAllTxs())){
972
- // every tx that's been generated against a block that has now been pruned is no longer valid
973
- if (tx.data.constants.anchorBlockHeader.globalVariables.blockNumber > latestBlock) {
974
- const txHash = tx.getTxHash();
975
- txsToDelete.set(txHash.toString(), txHash);
976
- }
977
- }
978
- this.log.info(`Detected chain prune. Removing ${txsToDelete.size} txs built against pruned blocks.`, {
979
- newLatestBlock: latestBlock,
980
- previousLatestBlock: await this.getSyncedLatestBlockNum(),
981
- txsToDelete: Array.from(txsToDelete.keys())
963
+ * Detects epoch prunes (checkpoint number changed) and deletes all txs in that case.
964
+ * @param latestBlock - The block ID the chain was pruned to.
965
+ * @param newCheckpoint - The checkpoint ID after the prune.
966
+ */ async handlePruneL2Blocks(latestBlock, newCheckpoint) {
967
+ const deleteAllTxs = this.config.txPoolDeleteTxsAfterReorg && await this.isEpochPrune(newCheckpoint);
968
+ await this.txPool.handlePrunedBlocks(latestBlock, {
969
+ deleteAllTxs
982
970
  });
983
- // delete invalid txs (both pending and mined)
984
- await this.txPool.deleteTxs(Array.from(txsToDelete.values()));
985
- // everything left in the mined set was built against a block on the proven chain so its still valid
986
- // move back to pending the txs that were reorged out of the chain, unless txPoolDeleteTxsAfterReorg is set,
987
- // in which case we clean them up to avoid potential reorg loops
988
- // NOTE: we can't move _all_ txs back to pending because the tx pool could keep hold of mined txs for longer
989
- // (see this.keepProvenTxsFor)
990
- const minedTxsFromReorg = [];
991
- for (const [txHash, blockNumber] of minedTxs){
992
- // We keep the txsToDelete out of this list as they have already been deleted above
993
- if (blockNumber > latestBlock && !txsToDelete.has(txHash.toString())) {
994
- minedTxsFromReorg.push(txHash);
995
- }
971
+ }
972
+ /**
973
+ * Returns true if the prune crossed a checkpoint boundary.
974
+ * If the old and new checkpoint numbers are the same, the prune is within a single checkpoint.
975
+ * If they differ, the prune spans across checkpoints (epoch prune).
976
+ */ async isEpochPrune(newCheckpoint) {
977
+ const tips = await this.l2Tips.getL2Tips();
978
+ const oldCheckpointNumber = tips.checkpointed.checkpoint.number;
979
+ if (oldCheckpointNumber <= CheckpointNumber.ZERO) {
980
+ return false;
996
981
  }
997
- if (this.config.txPoolDeleteTxsAfterReorg) {
998
- this.log.info(`Deleting ${minedTxsFromReorg.length} mined txs from reorg`);
999
- await this.txPool.deleteTxs(minedTxsFromReorg);
1000
- } else {
1001
- await this.txPool.markMinedAsPending(minedTxsFromReorg, latestBlock);
982
+ const isEpochPrune = oldCheckpointNumber !== newCheckpoint.number;
983
+ this.log.info(`Detected epoch prune: ${isEpochPrune}. Old checkpoint: ${oldCheckpointNumber}, new checkpoint: ${newCheckpoint.number}`);
984
+ return isEpochPrune;
985
+ }
986
+ /** Checks if the slot has changed and calls prepareForSlot if so. */ async maybeCallPrepareForSlot() {
987
+ const { currentSlot } = this.epochCache.getCurrentAndNextSlot();
988
+ if (currentSlot <= this.lastSlotProcessed) {
989
+ return;
1002
990
  }
991
+ this.lastSlotProcessed = currentSlot;
992
+ await this.txPool.prepareForSlot(currentSlot);
1003
993
  }
1004
994
  async startServiceIfSynched() {
1005
995
  if (this.currentState !== P2PClientState.SYNCHING) {
@@ -1034,10 +1024,20 @@ _dec = trackSpan('p2pClient.broadcastProposal', async (proposal)=>({
1034
1024
  return this.p2pService.validate(txs);
1035
1025
  }
1036
1026
  /**
1037
- * Marks transactions as non-evictable in the pool.
1038
- * @param txHashes - Hashes of the transactions to mark as non-evictable.
1039
- */ markTxsAsNonEvictable(txHashes) {
1040
- return this.txPool.markTxsAsNonEvictable(txHashes);
1027
+ * Protects existing transactions by hash for a given slot.
1028
+ * Returns hashes of transactions that weren't found in the pool.
1029
+ * @param txHashes - Hashes of the transactions to protect.
1030
+ * @param blockHeader - The block header providing slot context.
1031
+ * @returns Hashes of transactions not found in the pool.
1032
+ */ protectTxs(txHashes, blockHeader) {
1033
+ return this.txPool.protectTxs(txHashes, blockHeader);
1034
+ }
1035
+ /**
1036
+ * Prepares the pool for a new slot.
1037
+ * Unprotects transactions from earlier slots and validates them.
1038
+ * @param slotNumber - The slot number to prepare for
1039
+ */ async prepareForSlot(slotNumber) {
1040
+ await this.txPool.prepareForSlot(slotNumber);
1041
1041
  }
1042
1042
  handleAuthRequestFromPeer(authRequest, peerId) {
1043
1043
  return this.p2pService.handleAuthRequestFromPeer(authRequest, peerId);
@@ -7,10 +7,10 @@ import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
7
7
  import { P2PClientType } from '@aztec/stdlib/p2p';
8
8
  import { getTelemetryClient } from '@aztec/telemetry-client';
9
9
  import { peerIdFromString } from '@libp2p/peer-id';
10
+ import { BatchTxRequesterCollector, SendBatchRequestCollector } from '../../../services/index.js';
10
11
  import { RateLimitStatus } from '../../../services/reqresp/rate-limiter/rate_limiter.js';
11
- import { BatchTxRequesterCollector, SendBatchRequestCollector } from '../../../services/tx_collection/proposal_tx_collector.js';
12
- import { AlwaysTrueCircuitVerifier } from '../../../test-helpers/reqresp-nodes.js';
13
- import { BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, calculateInternalTimeout, createMockEpochCache, createMockWorldStateSynchronizer } from '../../../test-helpers/testbench-utils.js';
12
+ import { MissingTxsTracker } from '../../../services/tx_collection/missing_txs_tracker.js';
13
+ import { AlwaysTrueCircuitVerifier, BENCHMARK_CONSTANTS, InMemoryAttestationPool, InMemoryTxPool, UNLIMITED_RATE_LIMIT_QUOTA, calculateInternalTimeout, createMockEpochCache, createMockWorldStateSynchronizer } from '../../../test-helpers/index.js';
14
14
  import { createP2PClient } from '../../index.js';
15
15
  import { deserializeBlockProposal, deserializeTx, deserializeTxHash } from './proposal_tx_collector_worker_protocol.js';
16
16
  let client;
@@ -162,11 +162,11 @@ async function runCollector(cmd) {
162
162
  try {
163
163
  if (collectorType === 'batch-requester') {
164
164
  const collector = new BatchTxRequesterCollector(p2pService, logger, new DateProvider(), noopTxValidator);
165
- const fetched = await executeTimeout((_signal)=>collector.collectTxs(parsedTxHashes, parsedProposal, pinnedPeer, internalTimeoutMs), timeoutMs, ()=>new Error(`Collector timed out after ${timeoutMs}ms`));
165
+ const fetched = await executeTimeout((_signal)=>collector.collectTxs(MissingTxsTracker.fromArray(parsedTxHashes), parsedProposal, pinnedPeer, internalTimeoutMs), timeoutMs, ()=>new Error(`Collector timed out after ${timeoutMs}ms`));
166
166
  fetchedCount = fetched.length;
167
167
  } else {
168
168
  const collector = new SendBatchRequestCollector(p2pService, BENCHMARK_CONSTANTS.FIXED_MAX_PEERS, BENCHMARK_CONSTANTS.FIXED_MAX_RETRY_ATTEMPTS);
169
- const fetched = await executeTimeout((_signal)=>collector.collectTxs(parsedTxHashes, parsedProposal, pinnedPeer, internalTimeoutMs), timeoutMs, ()=>new Error(`Collector timed out after ${timeoutMs}ms`));
169
+ const fetched = await executeTimeout((_signal)=>collector.collectTxs(MissingTxsTracker.fromArray(parsedTxHashes), parsedProposal, pinnedPeer, internalTimeoutMs), timeoutMs, ()=>new Error(`Collector timed out after ${timeoutMs}ms`));
170
170
  fetchedCount = fetched.length;
171
171
  }
172
172
  } catch (err) {
@@ -246,7 +246,7 @@ process.on('message', (msg)=>{
246
246
  throw new Error('Attestation pool not initialized');
247
247
  }
248
248
  const proposal = deserializeBlockProposal(msg.blockProposal);
249
- await attestationPool.addBlockProposal(proposal);
249
+ await attestationPool.tryAddBlockProposal(proposal);
250
250
  await sendMessage({
251
251
  type: 'BLOCK_PROPOSAL_SET',
252
252
  requestId,
package/dest/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
2
2
  import { type DataStoreConfig } from '@aztec/kv-store/config';
3
- import { type AllowedElement, type ChainConfig } from '@aztec/stdlib/config';
3
+ import { type AllowedElement, type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
4
4
  import { type BatchTxRequesterConfig } from './services/reqresp/batch-tx-requester/config.js';
5
5
  import { type P2PReqRespConfig } from './services/reqresp/config.js';
6
6
  import { type TxCollectionConfig } from './services/tx_collection/config.js';
@@ -8,11 +8,13 @@ import { type TxFileStoreConfig } from './services/tx_file_store/config.js';
8
8
  /**
9
9
  * P2P client configuration values.
10
10
  */
11
- export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig, TxFileStoreConfig {
11
+ export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, ChainConfig, TxCollectionConfig, TxFileStoreConfig, Pick<SequencerConfig, 'blockDurationMs' | 'expectedBlockProposalsPerSlot'> {
12
12
  /** A flag dictating whether the P2P subsystem should be enabled. */
13
13
  p2pEnabled: boolean;
14
14
  /** The frequency in which to check for new L2 blocks. */
15
15
  blockCheckIntervalMS: number;
16
+ /** The frequency in which to check for new L2 slots. */
17
+ slotCheckIntervalMS: number;
16
18
  /** The number of blocks to fetch in a single batch. */
17
19
  blockRequestBatchSize: number;
18
20
  /** DEBUG: Disable colocation penalty - for testing purposes only */
@@ -107,6 +109,10 @@ export interface P2PConfig extends P2PReqRespConfig, BatchTxRequesterConfig, Cha
107
109
  debugP2PInstrumentMessages: boolean;
108
110
  /** Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus */
109
111
  fishermanMode: boolean;
112
+ /** Broadcast block proposals even when a conflicting proposal for the same slot already exists in the pool (for testing purposes only). */
113
+ broadcastEquivocatedProposals?: boolean;
114
+ /** Minimum age (ms) a transaction must have been in the pool before it's eligible for block building. */
115
+ minTxPoolAgeMs: number;
110
116
  }
111
117
  export declare const DEFAULT_P2P_PORT = 40400;
112
118
  export declare const p2pConfigMappings: ConfigMappingsType<P2PConfig>;
@@ -127,10 +133,12 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
127
133
  batchTxRequesterSmartParallelWorkerCount: unknown;
128
134
  batchTxRequesterTxBatchSize: unknown;
129
135
  blockCheckIntervalMS: unknown;
136
+ blockDurationMs: unknown;
130
137
  blockRequestBatchSize: unknown;
131
138
  bootstrapNodeEnrVersionCheck: unknown;
132
139
  bootstrapNodes: unknown;
133
140
  bootstrapNodesAsFullPeers: unknown;
141
+ broadcastEquivocatedProposals: unknown;
134
142
  dataDirectory: unknown;
135
143
  dataStoreMapSizeKb: unknown;
136
144
  debugDisableColocationPenalty: unknown;
@@ -140,6 +148,7 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
140
148
  doubleSpendSeverePeerPenaltyWindow: unknown;
141
149
  dropTransactions: unknown;
142
150
  dropTransactionsProbability: unknown;
151
+ expectedBlockProposalsPerSlot: unknown;
143
152
  fishermanMode: unknown;
144
153
  gossipsubD: unknown;
145
154
  gossipsubDLazy: unknown;
@@ -160,6 +169,7 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
160
169
  listenAddress: unknown;
161
170
  maxPeerCount: unknown;
162
171
  maxPendingTxCount: unknown;
172
+ minTxPoolAgeMs: unknown;
163
173
  overallRequestTimeoutMs: unknown;
164
174
  p2pAllowOnlyValidators: unknown;
165
175
  p2pBroadcastPort: unknown;
@@ -180,11 +190,21 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
180
190
  queryForIp: unknown;
181
191
  rollupVersion: unknown;
182
192
  seenMessageCacheSize: unknown;
193
+ slotCheckIntervalMS: unknown;
183
194
  trustedPeers: unknown;
184
195
  txCollectionDisableSlowDuringFastRequests: unknown;
185
196
  txCollectionFastMaxParallelRequestsPerNode: unknown;
186
197
  txCollectionFastNodeIntervalMs: unknown;
187
198
  txCollectionFastNodesTimeoutBeforeReqRespMs: unknown;
199
+ txCollectionFileStoreFastBackoffBaseMs: unknown;
200
+ txCollectionFileStoreFastBackoffMaxMs: unknown;
201
+ txCollectionFileStoreFastDelayMs: unknown;
202
+ txCollectionFileStoreFastWorkerCount: unknown;
203
+ txCollectionFileStoreSlowBackoffBaseMs: unknown;
204
+ txCollectionFileStoreSlowBackoffMaxMs: unknown;
205
+ txCollectionFileStoreSlowDelayMs: unknown;
206
+ txCollectionFileStoreSlowWorkerCount: unknown;
207
+ txCollectionFileStoreUrls: unknown;
188
208
  txCollectionMissingTxsCollectorType: unknown;
189
209
  txCollectionNodeRpcMaxBatchSize: unknown;
190
210
  txCollectionNodeRpcUrls: unknown;
@@ -192,7 +212,6 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
192
212
  txCollectionSlowNodesIntervalMs: unknown;
193
213
  txCollectionSlowReqRespIntervalMs: unknown;
194
214
  txCollectionSlowReqRespTimeoutMs: unknown;
195
- txFileStoreDownloadUrl: unknown;
196
215
  txFileStoreEnabled: unknown;
197
216
  txFileStoreMaxQueueSize: unknown;
198
217
  txFileStoreUploadConcurrency: unknown;
@@ -212,4 +231,4 @@ export declare const bootnodeConfigMappings: ConfigMappingsType<Pick<{
212
231
  * @returns A list of allowed elements
213
232
  */
214
233
  export declare function parseAllowList(value: string): AllowedElement[];
215
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUN2QixXQUFXLEVBUVosTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQXNCLE1BQU0sd0JBQXdCLENBQUM7QUFHbEYsT0FBTyxFQUFFLEtBQUssY0FBYyxFQUF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