@aztec/p2p 0.0.0-test.1 → 0.0.1-commit.b655e406

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 (339) hide show
  1. package/dest/bootstrap/bootstrap.d.ts.map +1 -1
  2. package/dest/bootstrap/bootstrap.js +22 -9
  3. package/dest/client/factory.d.ts +13 -3
  4. package/dest/client/factory.d.ts.map +1 -1
  5. package/dest/client/factory.js +60 -24
  6. package/dest/client/index.d.ts +1 -0
  7. package/dest/client/index.d.ts.map +1 -1
  8. package/dest/client/index.js +1 -0
  9. package/dest/client/interface.d.ts +155 -0
  10. package/dest/client/interface.d.ts.map +1 -0
  11. package/dest/client/interface.js +9 -0
  12. package/dest/client/p2p_client.d.ts +72 -169
  13. package/dest/client/p2p_client.d.ts.map +1 -1
  14. package/dest/client/p2p_client.js +365 -174
  15. package/dest/config.d.ts +123 -103
  16. package/dest/config.d.ts.map +1 -1
  17. package/dest/config.js +173 -34
  18. package/dest/enr/generate-enr.d.ts +10 -2
  19. package/dest/enr/generate-enr.d.ts.map +1 -1
  20. package/dest/enr/generate-enr.js +27 -5
  21. package/dest/index.d.ts +3 -0
  22. package/dest/index.d.ts.map +1 -1
  23. package/dest/index.js +2 -0
  24. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +42 -4
  25. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
  26. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
  27. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +204 -54
  28. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +10 -2
  29. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +1 -1
  30. package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +93 -15
  31. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +10 -2
  32. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +1 -1
  33. package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +86 -18
  34. package/dest/mem_pools/attestation_pool/mocks.d.ts +1 -2
  35. package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
  36. package/dest/mem_pools/attestation_pool/mocks.js +9 -15
  37. package/dest/mem_pools/instrumentation.d.ts +7 -11
  38. package/dest/mem_pools/instrumentation.d.ts.map +1 -1
  39. package/dest/mem_pools/instrumentation.js +25 -37
  40. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +93 -9
  41. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +1 -1
  42. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.js +469 -97
  43. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts +33 -9
  44. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts.map +1 -1
  45. package/dest/mem_pools/tx_pool/memory_tx_pool.js +133 -36
  46. package/dest/mem_pools/tx_pool/priority.js +1 -1
  47. package/dest/mem_pools/tx_pool/tx_pool.d.ts +64 -8
  48. package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +1 -1
  49. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +1 -1
  50. package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +264 -39
  51. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +1 -0
  52. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
  53. package/dest/msg_validators/attestation_validator/attestation_validator.js +45 -9
  54. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts +5 -1
  55. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.d.ts.map +1 -1
  56. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.js +61 -12
  57. package/dest/msg_validators/msg_seen_validator/msg_seen_validator.d.ts +10 -0
  58. package/dest/msg_validators/msg_seen_validator/msg_seen_validator.d.ts.map +1 -0
  59. package/dest/msg_validators/msg_seen_validator/msg_seen_validator.js +36 -0
  60. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +3 -0
  61. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -0
  62. package/dest/msg_validators/tx_validator/allowed_public_setup.js +27 -0
  63. package/dest/msg_validators/tx_validator/archive_cache.d.ts +14 -0
  64. package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -0
  65. package/dest/msg_validators/tx_validator/archive_cache.js +22 -0
  66. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
  67. package/dest/msg_validators/tx_validator/block_header_validator.js +4 -4
  68. package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
  69. package/dest/msg_validators/tx_validator/data_validator.js +56 -86
  70. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +0 -2
  71. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
  72. package/dest/msg_validators/tx_validator/double_spend_validator.js +21 -27
  73. package/dest/msg_validators/tx_validator/factory.d.ts +15 -0
  74. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -0
  75. package/dest/msg_validators/tx_validator/factory.js +74 -0
  76. package/dest/msg_validators/tx_validator/gas_validator.d.ts +11 -0
  77. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -0
  78. package/dest/msg_validators/tx_validator/gas_validator.js +115 -0
  79. package/dest/msg_validators/tx_validator/index.d.ts +7 -0
  80. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  81. package/dest/msg_validators/tx_validator/index.js +7 -0
  82. package/dest/msg_validators/tx_validator/metadata_validator.d.ts +7 -3
  83. package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
  84. package/dest/msg_validators/tx_validator/metadata_validator.js +39 -20
  85. package/dest/msg_validators/tx_validator/phases_validator.d.ts +14 -0
  86. package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -0
  87. package/dest/msg_validators/tx_validator/phases_validator.js +91 -0
  88. package/dest/msg_validators/tx_validator/test_utils.d.ts +17 -0
  89. package/dest/msg_validators/tx_validator/test_utils.d.ts.map +1 -0
  90. package/dest/msg_validators/tx_validator/test_utils.js +22 -0
  91. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +12 -0
  92. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -0
  93. package/dest/msg_validators/tx_validator/timestamp_validator.js +32 -0
  94. package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts +8 -0
  95. package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts.map +1 -0
  96. package/dest/msg_validators/tx_validator/tx_permitted_validator.js +24 -0
  97. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +1 -1
  98. package/dest/msg_validators/tx_validator/tx_proof_validator.js +6 -5
  99. package/dest/services/discv5/discV5_service.d.ts +9 -8
  100. package/dest/services/discv5/discV5_service.d.ts.map +1 -1
  101. package/dest/services/discv5/discV5_service.js +63 -36
  102. package/dest/services/dummy_service.d.ts +49 -10
  103. package/dest/services/dummy_service.d.ts.map +1 -1
  104. package/dest/services/dummy_service.js +88 -5
  105. package/dest/services/encoding.d.ts +25 -6
  106. package/dest/services/encoding.d.ts.map +1 -1
  107. package/dest/services/encoding.js +73 -5
  108. package/dest/services/index.d.ts +4 -0
  109. package/dest/services/index.d.ts.map +1 -1
  110. package/dest/services/index.js +4 -0
  111. package/dest/services/libp2p/instrumentation.d.ts +18 -0
  112. package/dest/services/libp2p/instrumentation.d.ts.map +1 -0
  113. package/dest/services/libp2p/instrumentation.js +157 -0
  114. package/dest/services/libp2p/libp2p_service.d.ts +87 -42
  115. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  116. package/dest/services/libp2p/libp2p_service.js +500 -218
  117. package/dest/services/peer-manager/interface.d.ts +23 -0
  118. package/dest/services/peer-manager/interface.d.ts.map +1 -0
  119. package/dest/services/peer-manager/interface.js +1 -0
  120. package/dest/services/peer-manager/metrics.d.ts +3 -1
  121. package/dest/services/peer-manager/metrics.d.ts.map +1 -1
  122. package/dest/services/peer-manager/metrics.js +11 -2
  123. package/dest/services/peer-manager/peer_manager.d.ts +126 -15
  124. package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
  125. package/dest/services/peer-manager/peer_manager.js +547 -72
  126. package/dest/services/reqresp/config.d.ts +10 -8
  127. package/dest/services/reqresp/config.d.ts.map +1 -1
  128. package/dest/services/reqresp/config.js +18 -4
  129. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +1 -1
  130. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +1 -1
  131. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +10 -6
  132. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts +30 -13
  133. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts.map +1 -1
  134. package/dest/services/reqresp/connection-sampler/connection_sampler.js +142 -84
  135. package/dest/services/reqresp/index.d.ts +2 -1
  136. package/dest/services/reqresp/index.d.ts.map +1 -1
  137. package/dest/services/reqresp/index.js +2 -1
  138. package/dest/services/reqresp/interface.d.ts +72 -23
  139. package/dest/services/reqresp/interface.d.ts.map +1 -1
  140. package/dest/services/reqresp/interface.js +45 -26
  141. package/dest/services/reqresp/metrics.d.ts.map +1 -1
  142. package/dest/services/reqresp/protocols/auth.d.ts +43 -0
  143. package/dest/services/reqresp/protocols/auth.d.ts.map +1 -0
  144. package/dest/services/reqresp/protocols/auth.js +71 -0
  145. package/dest/services/reqresp/protocols/block.d.ts +5 -0
  146. package/dest/services/reqresp/protocols/block.d.ts.map +1 -1
  147. package/dest/services/reqresp/protocols/block.js +28 -5
  148. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +30 -0
  149. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -0
  150. package/dest/services/reqresp/protocols/block_txs/bitvector.js +75 -0
  151. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +11 -0
  152. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -0
  153. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +39 -0
  154. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +49 -0
  155. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -0
  156. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +75 -0
  157. package/dest/services/reqresp/protocols/block_txs/index.d.ts +4 -0
  158. package/dest/services/reqresp/protocols/block_txs/index.d.ts.map +1 -0
  159. package/dest/services/reqresp/protocols/block_txs/index.js +3 -0
  160. package/dest/services/reqresp/protocols/goodbye.d.ts +2 -4
  161. package/dest/services/reqresp/protocols/goodbye.d.ts.map +1 -1
  162. package/dest/services/reqresp/protocols/goodbye.js +7 -7
  163. package/dest/services/reqresp/protocols/index.d.ts +2 -0
  164. package/dest/services/reqresp/protocols/index.d.ts.map +1 -1
  165. package/dest/services/reqresp/protocols/index.js +2 -0
  166. package/dest/services/reqresp/protocols/ping.d.ts +0 -2
  167. package/dest/services/reqresp/protocols/ping.d.ts.map +1 -1
  168. package/dest/services/reqresp/protocols/status.d.ts +38 -6
  169. package/dest/services/reqresp/protocols/status.d.ts.map +1 -1
  170. package/dest/services/reqresp/protocols/status.js +72 -5
  171. package/dest/services/reqresp/protocols/tx.d.ts +12 -1
  172. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  173. package/dest/services/reqresp/protocols/tx.js +34 -6
  174. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts +4 -2
  175. package/dest/services/reqresp/rate-limiter/rate_limiter.d.ts.map +1 -1
  176. package/dest/services/reqresp/rate-limiter/rate_limiter.js +10 -2
  177. package/dest/services/reqresp/rate-limiter/rate_limits.d.ts.map +1 -1
  178. package/dest/services/reqresp/rate-limiter/rate_limits.js +21 -1
  179. package/dest/services/reqresp/reqresp.d.ts +45 -47
  180. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  181. package/dest/services/reqresp/reqresp.js +298 -207
  182. package/dest/services/reqresp/status.d.ts +9 -3
  183. package/dest/services/reqresp/status.d.ts.map +1 -1
  184. package/dest/services/reqresp/status.js +9 -2
  185. package/dest/services/service.d.ts +22 -18
  186. package/dest/services/service.d.ts.map +1 -1
  187. package/dest/services/tx_collection/config.d.ts +25 -0
  188. package/dest/services/tx_collection/config.d.ts.map +1 -0
  189. package/dest/services/tx_collection/config.js +58 -0
  190. package/dest/services/tx_collection/fast_tx_collection.d.ts +56 -0
  191. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -0
  192. package/dest/services/tx_collection/fast_tx_collection.js +300 -0
  193. package/dest/services/tx_collection/index.d.ts +3 -0
  194. package/dest/services/tx_collection/index.d.ts.map +1 -0
  195. package/dest/services/tx_collection/index.js +2 -0
  196. package/dest/services/tx_collection/instrumentation.d.ts +10 -0
  197. package/dest/services/tx_collection/instrumentation.d.ts.map +1 -0
  198. package/dest/services/tx_collection/instrumentation.js +34 -0
  199. package/dest/services/tx_collection/slow_tx_collection.d.ts +54 -0
  200. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -0
  201. package/dest/services/tx_collection/slow_tx_collection.js +176 -0
  202. package/dest/services/tx_collection/tx_collection.d.ts +110 -0
  203. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -0
  204. package/dest/services/tx_collection/tx_collection.js +128 -0
  205. package/dest/services/tx_collection/tx_collection_sink.d.ts +30 -0
  206. package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -0
  207. package/dest/services/tx_collection/tx_collection_sink.js +111 -0
  208. package/dest/services/tx_collection/tx_source.d.ts +18 -0
  209. package/dest/services/tx_collection/tx_source.d.ts.map +1 -0
  210. package/dest/services/tx_collection/tx_source.js +31 -0
  211. package/dest/services/tx_provider.d.ts +49 -0
  212. package/dest/services/tx_provider.d.ts.map +1 -0
  213. package/dest/services/tx_provider.js +210 -0
  214. package/dest/services/tx_provider_instrumentation.d.ts +13 -0
  215. package/dest/services/tx_provider_instrumentation.d.ts.map +1 -0
  216. package/dest/services/tx_provider_instrumentation.js +34 -0
  217. package/dest/test-helpers/get-ports.d.ts.map +1 -1
  218. package/dest/test-helpers/index.d.ts +1 -0
  219. package/dest/test-helpers/index.d.ts.map +1 -1
  220. package/dest/test-helpers/index.js +1 -0
  221. package/dest/test-helpers/make-enrs.d.ts.map +1 -1
  222. package/dest/test-helpers/make-enrs.js +4 -5
  223. package/dest/test-helpers/make-test-p2p-clients.d.ts +32 -4
  224. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  225. package/dest/test-helpers/make-test-p2p-clients.js +86 -16
  226. package/dest/test-helpers/mock-pubsub.d.ts +59 -0
  227. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -0
  228. package/dest/test-helpers/mock-pubsub.js +130 -0
  229. package/dest/test-helpers/mock-tx-helpers.d.ts +12 -0
  230. package/dest/test-helpers/mock-tx-helpers.d.ts.map +1 -0
  231. package/dest/test-helpers/mock-tx-helpers.js +19 -0
  232. package/dest/test-helpers/reqresp-nodes.d.ts +14 -10
  233. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  234. package/dest/test-helpers/reqresp-nodes.js +62 -28
  235. package/dest/testbench/p2p_client_testbench_worker.js +96 -25
  236. package/dest/testbench/parse_log_file.js +4 -4
  237. package/dest/testbench/testbench.js +4 -4
  238. package/dest/testbench/worker_client_manager.d.ts +0 -5
  239. package/dest/testbench/worker_client_manager.d.ts.map +1 -1
  240. package/dest/testbench/worker_client_manager.js +11 -19
  241. package/dest/types/index.d.ts +3 -1
  242. package/dest/types/index.d.ts.map +1 -1
  243. package/dest/types/index.js +2 -0
  244. package/dest/util.d.ts +22 -15
  245. package/dest/util.d.ts.map +1 -1
  246. package/dest/util.js +64 -67
  247. package/dest/versioning.d.ts +3 -3
  248. package/dest/versioning.d.ts.map +1 -1
  249. package/dest/versioning.js +8 -3
  250. package/package.json +28 -24
  251. package/src/bootstrap/bootstrap.ts +27 -11
  252. package/src/client/factory.ts +136 -45
  253. package/src/client/index.ts +1 -0
  254. package/src/client/interface.ts +195 -0
  255. package/src/client/p2p_client.ts +460 -327
  256. package/src/config.ts +288 -134
  257. package/src/enr/generate-enr.ts +39 -6
  258. package/src/index.ts +4 -0
  259. package/src/mem_pools/attestation_pool/attestation_pool.ts +48 -4
  260. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +241 -55
  261. package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +117 -20
  262. package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +114 -22
  263. package/src/mem_pools/attestation_pool/mocks.ts +11 -10
  264. package/src/mem_pools/instrumentation.ts +32 -46
  265. package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +549 -108
  266. package/src/mem_pools/tx_pool/memory_tx_pool.ts +153 -44
  267. package/src/mem_pools/tx_pool/priority.ts +1 -1
  268. package/src/mem_pools/tx_pool/tx_pool.ts +67 -8
  269. package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +217 -34
  270. package/src/msg_validators/attestation_validator/attestation_validator.ts +55 -10
  271. package/src/msg_validators/block_proposal_validator/block_proposal_validator.ts +66 -14
  272. package/src/msg_validators/msg_seen_validator/msg_seen_validator.ts +36 -0
  273. package/src/msg_validators/tx_validator/allowed_public_setup.ts +35 -0
  274. package/src/msg_validators/tx_validator/archive_cache.ts +28 -0
  275. package/src/msg_validators/tx_validator/block_header_validator.ts +4 -4
  276. package/src/msg_validators/tx_validator/data_validator.ts +81 -69
  277. package/src/msg_validators/tx_validator/double_spend_validator.ts +19 -17
  278. package/src/msg_validators/tx_validator/factory.ts +109 -0
  279. package/src/msg_validators/tx_validator/gas_validator.ts +134 -0
  280. package/src/msg_validators/tx_validator/index.ts +7 -0
  281. package/src/msg_validators/tx_validator/metadata_validator.ts +58 -21
  282. package/src/msg_validators/tx_validator/phases_validator.ts +114 -0
  283. package/src/msg_validators/tx_validator/test_utils.ts +43 -0
  284. package/src/msg_validators/tx_validator/timestamp_validator.ts +46 -0
  285. package/src/msg_validators/tx_validator/tx_permitted_validator.ts +17 -0
  286. package/src/msg_validators/tx_validator/tx_proof_validator.ts +6 -5
  287. package/src/services/discv5/discV5_service.ts +84 -38
  288. package/src/services/dummy_service.ts +147 -9
  289. package/src/services/encoding.ts +80 -5
  290. package/src/services/index.ts +4 -0
  291. package/src/services/libp2p/instrumentation.ts +158 -0
  292. package/src/services/libp2p/libp2p_service.ts +646 -263
  293. package/src/services/peer-manager/interface.ts +29 -0
  294. package/src/services/peer-manager/metrics.ts +16 -1
  295. package/src/services/peer-manager/peer_manager.ts +652 -78
  296. package/src/services/reqresp/config.ts +26 -9
  297. package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +12 -6
  298. package/src/services/reqresp/connection-sampler/connection_sampler.ts +148 -95
  299. package/src/services/reqresp/index.ts +2 -0
  300. package/src/services/reqresp/interface.ts +91 -36
  301. package/src/services/reqresp/metrics.ts +4 -1
  302. package/src/services/reqresp/protocols/auth.ts +83 -0
  303. package/src/services/reqresp/protocols/block.ts +24 -3
  304. package/src/services/reqresp/protocols/block_txs/bitvector.ts +90 -0
  305. package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +53 -0
  306. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +79 -0
  307. package/src/services/reqresp/protocols/block_txs/index.ts +3 -0
  308. package/src/services/reqresp/protocols/goodbye.ts +9 -7
  309. package/src/services/reqresp/protocols/index.ts +2 -0
  310. package/src/services/reqresp/protocols/status.ts +117 -5
  311. package/src/services/reqresp/protocols/tx.ts +35 -6
  312. package/src/services/reqresp/rate-limiter/rate_limiter.ts +12 -3
  313. package/src/services/reqresp/rate-limiter/rate_limits.ts +21 -1
  314. package/src/services/reqresp/reqresp.ts +387 -256
  315. package/src/services/reqresp/status.ts +12 -3
  316. package/src/services/service.ts +45 -21
  317. package/src/services/tx_collection/config.ts +84 -0
  318. package/src/services/tx_collection/fast_tx_collection.ts +340 -0
  319. package/src/services/tx_collection/index.ts +2 -0
  320. package/src/services/tx_collection/instrumentation.ts +43 -0
  321. package/src/services/tx_collection/slow_tx_collection.ts +232 -0
  322. package/src/services/tx_collection/tx_collection.ts +215 -0
  323. package/src/services/tx_collection/tx_collection_sink.ts +129 -0
  324. package/src/services/tx_collection/tx_source.ts +37 -0
  325. package/src/services/tx_provider.ts +216 -0
  326. package/src/services/tx_provider_instrumentation.ts +44 -0
  327. package/src/test-helpers/index.ts +1 -0
  328. package/src/test-helpers/make-enrs.ts +4 -5
  329. package/src/test-helpers/make-test-p2p-clients.ts +111 -21
  330. package/src/test-helpers/mock-pubsub.ts +188 -0
  331. package/src/test-helpers/mock-tx-helpers.ts +24 -0
  332. package/src/test-helpers/reqresp-nodes.ts +86 -35
  333. package/src/testbench/p2p_client_testbench_worker.ts +145 -22
  334. package/src/testbench/parse_log_file.ts +4 -4
  335. package/src/testbench/testbench.ts +4 -4
  336. package/src/testbench/worker_client_manager.ts +17 -23
  337. package/src/types/index.ts +2 -0
  338. package/src/util.ts +93 -89
  339. package/src/versioning.ts +11 -4
@@ -1,135 +1,32 @@
1
+ import { DateProvider } from '@aztec/foundation/timer';
1
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { L2BlockId, L2BlockSource, L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
3
- import type { P2PApi, PeerInfo, ProverCoordination } from '@aztec/stdlib/interfaces/server';
4
- import type { BlockAttestation, BlockProposal, P2PClientType } from '@aztec/stdlib/p2p';
3
+ import type { EthAddress, L2BlockSource, L2BlockStreamEvent, L2Tips } from '@aztec/stdlib/block';
4
+ import type { ContractDataSource } from '@aztec/stdlib/contract';
5
+ import { type PeerInfo } from '@aztec/stdlib/interfaces/server';
6
+ import { BlockAttestation, type BlockProposal, type P2PClientType } from '@aztec/stdlib/p2p';
5
7
  import type { Tx, TxHash } from '@aztec/stdlib/tx';
6
8
  import { type TelemetryClient, WithTracer } from '@aztec/telemetry-client';
7
- import type { ENR } from '@chainsafe/enr';
9
+ import type { PeerId } from '@libp2p/interface';
10
+ import type { ENR } from '@nethermindeth/enr';
8
11
  import { type P2PConfig } from '../config.js';
9
12
  import type { MemPools } from '../mem_pools/interface.js';
10
- import type { P2PService } from '../services/service.js';
11
- /**
12
- * Enum defining the possible states of the p2p client.
13
- */
14
- export declare enum P2PClientState {
15
- IDLE = 0,
16
- SYNCHING = 1,
17
- RUNNING = 2,
18
- STOPPED = 3
19
- }
20
- /**
21
- * The synchronization status of the P2P client.
22
- */
23
- export interface P2PSyncState {
24
- /**
25
- * The current state of the p2p client.
26
- */
27
- state: P2PClientState;
28
- /**
29
- * The block number that the p2p client is synced to.
30
- */
31
- syncedToL2Block: L2BlockId;
32
- }
33
- /**
34
- * Interface of a P2P client.
35
- **/
36
- export type P2P<T extends P2PClientType = P2PClientType.Full> = ProverCoordination & P2PApi<T> & {
37
- /**
38
- * Broadcasts a block proposal to other peers.
39
- *
40
- * @param proposal - the block proposal
41
- */
42
- broadcastProposal(proposal: BlockProposal): void;
43
- /**
44
- * Registers a callback from the validator client that determines how to behave when
45
- * foreign block proposals are received
46
- *
47
- * @param handler - A function taking a received block proposal and producing an attestation
48
- */
49
- registerBlockProposalHandler(handler: (block: BlockProposal) => Promise<BlockAttestation | undefined>): void;
50
- /**
51
- * Request a list of transactions from another peer by their tx hashes.
52
- * @param txHashes - Hashes of the txs to query.
53
- * @returns A list of transactions or undefined if the transactions are not found.
54
- */
55
- requestTxs(txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
56
- /**
57
- * Request a transaction from another peer by its tx hash.
58
- * @param txHash - Hash of the tx to query.
59
- */
60
- requestTxByHash(txHash: TxHash): Promise<Tx | undefined>;
61
- /**
62
- * Verifies the 'tx' and, if valid, adds it to local tx pool and forwards it to other peers.
63
- * @param tx - The transaction.
64
- **/
65
- sendTx(tx: Tx): Promise<void>;
66
- /**
67
- * Deletes 'txs' from the pool, given hashes.
68
- * NOT used if we use sendTx as reconcileTxPool will handle this.
69
- * @param txHashes - Hashes to check.
70
- **/
71
- deleteTxs(txHashes: TxHash[]): Promise<void>;
72
- /**
73
- * Returns a transaction in the transaction pool by its hash.
74
- * @param txHash - Hash of tx to return.
75
- * @returns A single tx or undefined.
76
- */
77
- getTxByHashFromPool(txHash: TxHash): Promise<Tx | undefined>;
78
- /**
79
- * Returns a transaction in the transaction pool by its hash, requesting it from the network if it is not found.
80
- * @param txHash - Hash of tx to return.
81
- * @returns A single tx or undefined.
82
- */
83
- getTxByHash(txHash: TxHash): Promise<Tx | undefined>;
84
- /**
85
- * Returns an archived transaction from the transaction pool by its hash.
86
- * @param txHash - Hash of tx to return.
87
- * @returns A single tx or undefined.
88
- */
89
- getArchivedTxByHash(txHash: TxHash): Promise<Tx | undefined>;
90
- /**
91
- * Returns whether the given tx hash is flagged as pending or mined.
92
- * @param txHash - Hash of the tx to query.
93
- * @returns Pending or mined depending on its status, or undefined if not found.
94
- */
95
- getTxStatus(txHash: TxHash): Promise<'pending' | 'mined' | undefined>;
96
- /** Returns an iterator over pending txs on the mempool. */
97
- iteratePendingTxs(): AsyncIterableIterator<Tx>;
98
- /** Returns the number of pending txs in the mempool. */
99
- getPendingTxCount(): Promise<number>;
100
- /**
101
- * Starts the p2p client.
102
- * @returns A promise signalling the completion of the block sync.
103
- */
104
- start(): Promise<void>;
105
- /**
106
- * Stops the p2p client.
107
- * @returns A promise signalling the completion of the stop process.
108
- */
109
- stop(): Promise<void>;
110
- /**
111
- * Indicates if the p2p client is ready for transaction submission.
112
- * @returns A boolean flag indicating readiness.
113
- */
114
- isReady(): boolean;
115
- /**
116
- * Returns the current status of the p2p client.
117
- */
118
- getStatus(): Promise<P2PSyncState>;
119
- /**
120
- * Returns the ENR of this node, if any.
121
- */
122
- getEnr(): ENR | undefined;
123
- /** Identifies a p2p client. */
124
- isP2PClient(): true;
125
- };
13
+ import type { AuthRequest, StatusMessage } from '../services/index.js';
14
+ import { ReqRespSubProtocol, type ReqRespSubProtocolHandler, type ReqRespSubProtocolValidators } from '../services/reqresp/interface.js';
15
+ import type { P2PBlockReceivedCallback, P2PService } from '../services/service.js';
16
+ import { TxCollection } from '../services/tx_collection/tx_collection.js';
17
+ import { TxProvider } from '../services/tx_provider.js';
18
+ import { type P2P, type P2PSyncState } from './interface.js';
126
19
  /**
127
20
  * The P2P client implementation.
128
21
  */
129
22
  export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> extends WithTracer implements P2P, P2P<P2PClientType.Prover> {
130
23
  #private;
24
+ private store;
131
25
  private l2BlockSource;
132
26
  private p2pService;
27
+ private txCollection;
28
+ private _dateProvider;
29
+ private telemetry;
133
30
  private log;
134
31
  /** The JS promise that will be running to keep the client's data in sync. Can be interrupted if the client is stopped. */
135
32
  private runningPromise;
@@ -138,76 +35,71 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
138
35
  private syncResolve?;
139
36
  private latestBlockNumberAtStart;
140
37
  private provenBlockNumberAtStart;
38
+ private finalizedBlockNumberAtStart;
141
39
  private synchedBlockHashes;
142
40
  private synchedLatestBlockNumber;
143
41
  private synchedProvenBlockNumber;
42
+ private synchedFinalizedBlockNumber;
43
+ private synchedLatestSlot;
144
44
  private txPool;
145
45
  private attestationPool;
146
- /** How many slots to keep attestations for. */
147
- private keepAttestationsInPoolFor;
148
- /** How many slots to keep proven txs for. */
149
- private keepProvenTxsFor;
46
+ private config;
150
47
  private blockStream;
48
+ private txProvider;
49
+ private validatorAddresses;
151
50
  /**
152
51
  * In-memory P2P client constructor.
153
52
  * @param store - The client's instance of the KV store.
154
53
  * @param l2BlockSource - P2P client's source for fetching existing blocks.
155
54
  * @param txPool - The client's instance of a transaction pool. Defaults to in-memory implementation.
156
55
  * @param p2pService - The concrete instance of p2p networking to use.
157
- * @param keepProvenTxsFor - How many blocks have to pass after a block is proven before its txs are deleted (zero to delete immediately once proven).
158
56
  * @param log - A logger.
159
57
  */
160
- constructor(_clientType: T, store: AztecAsyncKVStore, l2BlockSource: L2BlockSource, mempools: MemPools<T>, p2pService: P2PService, config?: Partial<P2PConfig>, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
58
+ constructor(_clientType: T, store: AztecAsyncKVStore, l2BlockSource: L2BlockSource & ContractDataSource, mempools: MemPools<T>, p2pService: P2PService, txCollection: TxCollection, config?: Partial<P2PConfig>, _dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
59
+ registerThisValidatorAddresses(addresses: EthAddress[]): void;
60
+ clear(): Promise<void>;
161
61
  isP2PClient(): true;
62
+ getTxProvider(): TxProvider;
162
63
  getPeers(includePending?: boolean): Promise<PeerInfo[]>;
163
64
  getL2BlockHash(number: number): Promise<string | undefined>;
65
+ updateP2PConfig(config: Partial<P2PConfig>): Promise<void>;
164
66
  getL2Tips(): Promise<L2Tips>;
165
67
  handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void>;
68
+ private setBlockHash;
166
69
  /**
167
70
  * Starts the P2P client.
168
71
  * @returns An empty promise signalling the synching process.
169
72
  */
170
73
  start(): Promise<void>;
74
+ addReqRespSubProtocol(subProtocol: ReqRespSubProtocol, handler: ReqRespSubProtocolHandler, validator: ReqRespSubProtocolValidators[ReqRespSubProtocol]): Promise<void>;
75
+ private initBlockStream;
171
76
  /**
172
77
  * Allows consumers to stop the instance of the P2P client.
173
78
  * 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted.
174
79
  */
175
80
  stop(): Promise<void>;
176
- broadcastProposal(proposal: BlockProposal): void;
177
- getAttestationsForSlot(slot: bigint, proposalId: string): Promise<BlockAttestation[]>;
178
- registerBlockProposalHandler(handler: (block: BlockProposal) => Promise<BlockAttestation | undefined>): void;
179
- /**
180
- * Requests the transactions with the given hashes from the network.
181
- *
182
- * If a transaction can be retrieved, it will be returned, if not an undefined
183
- * will be returned. In place.
184
- *
185
- * @param txHashes - The hashes of the transactions to request.
186
- * @returns A promise that resolves to an array of transactions or undefined.
187
- */
188
- requestTxs(txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
189
- /**
190
- * Uses the Request Response protocol to request a transaction from the network.
191
- *
192
- * If the underlying request response protocol fails, then we return undefined.
193
- * If it succeeds then we add the transaction to our transaction pool and return.
194
- *
195
- * @param txHash - The hash of the transaction to request.
196
- * @returns A promise that resolves to a transaction or undefined.
197
- */
198
- requestTxByHash(txHash: TxHash): Promise<Tx | undefined>;
81
+ /** Triggers a sync to the archiver. Used for testing. */
82
+ sync(): Promise<void>;
83
+ broadcastProposal(proposal: BlockProposal): Promise<void>;
84
+ getAttestationsForSlot(slot: bigint, proposalId?: string): Promise<BlockAttestation[]>;
85
+ addAttestations(attestations: BlockAttestation[]): Promise<void>;
86
+ deleteAttestation(attestation: BlockAttestation): Promise<void>;
87
+ registerBlockProposalHandler(handler: P2PBlockReceivedCallback): void;
199
88
  /**
200
89
  * Uses the batched Request Response protocol to request a set of transactions from the network.
201
90
  */
202
- requestTxsByHash(txHashes: TxHash[]): Promise<Tx[]>;
203
- getPendingTxs(): Promise<Tx[]>;
91
+ requestTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<Tx[]>;
92
+ getPendingTxs(limit?: number, after?: TxHash): Promise<Tx[]>;
204
93
  getPendingTxCount(): Promise<number>;
205
94
  iteratePendingTxs(): AsyncIterableIterator<Tx>;
206
95
  /**
207
96
  * Returns all transactions in the transaction pool.
97
+ * @param filter - The type of txs to return
98
+ * @param limit - How many txs to return
99
+ * @param after - If paginating, the last known tx hash. Will return txs after this hash
208
100
  * @returns An array of Txs.
209
101
  */
210
- getTxs(filter: 'all' | 'pending' | 'mined'): Promise<Tx[]>;
102
+ getTxs(filter: 'all' | 'pending' | 'mined', limit?: number, after?: TxHash): Promise<Tx[]>;
211
103
  /**
212
104
  * Returns a transaction in the transaction pool by its hash.
213
105
  * @param txHash - Hash of the transaction to look for in the pool.
@@ -215,19 +107,19 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
215
107
  */
216
108
  getTxByHashFromPool(txHash: TxHash): Promise<Tx | undefined>;
217
109
  /**
218
- * Returns a transaction in the transaction pool by its hash.
219
- * If the transaction is not in the pool, it will be requested from the network.
220
- * @param txHash - Hash of the transaction to look for in the pool.
221
- * @returns A single tx or undefined.
110
+ * Returns transactions in the transaction pool by hash.
111
+ * @param txHashes - Hashes of the transactions to look for.
112
+ * @returns The txs found, in the same order as the requested hashes. If a tx is not found, it will be undefined.
222
113
  */
223
- getTxByHash(txHash: TxHash): Promise<Tx | undefined>;
114
+ getTxsByHashFromPool(txHashes: TxHash[]): Promise<(Tx | undefined)[]>;
115
+ hasTxsInPool(txHashes: TxHash[]): Promise<boolean[]>;
224
116
  /**
225
117
  * Returns transactions in the transaction pool by hash.
226
118
  * If a transaction is not in the pool, it will be requested from the network.
227
119
  * @param txHashes - Hashes of the transactions to look for.
228
- * @returns The txs found, not necessarily on the same order as the hashes.
120
+ * @returns The txs found, or undefined if not found in the order requested.
229
121
  */
230
- getTxsByHash(txHashes: TxHash[]): Promise<Tx[]>;
122
+ getTxsByHash(txHashes: TxHash[], pinnedPeerId: PeerId | undefined): Promise<(Tx | undefined)[]>;
231
123
  /**
232
124
  * Returns an archived transaction in the transaction pool by its hash.
233
125
  * @param txHash - Hash of the archived transaction to look for.
@@ -240,12 +132,17 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
240
132
  * @returns Empty promise.
241
133
  **/
242
134
  sendTx(tx: Tx): Promise<void>;
135
+ /**
136
+ * Adds transactions to the pool. Does not send to peers or validate the txs.
137
+ * @param txs - The transactions.
138
+ **/
139
+ addTxsToPool(txs: Tx[]): Promise<number>;
243
140
  /**
244
141
  * Returns whether the given tx hash is flagged as pending or mined.
245
142
  * @param txHash - Hash of the tx to query.
246
143
  * @returns Pending or mined depending on its status, or undefined if not found.
247
144
  */
248
- getTxStatus(txHash: TxHash): Promise<'pending' | 'mined' | undefined>;
145
+ getTxStatus(txHash: TxHash): Promise<'pending' | 'mined' | 'deleted' | undefined>;
249
146
  getEnr(): ENR | undefined;
250
147
  getEncodedEnr(): Promise<string | undefined>;
251
148
  /**
@@ -270,6 +167,9 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
270
167
  * @returns Block number of latest proven L2 Block we've synced with.
271
168
  */
272
169
  getSyncedProvenBlockNum(): Promise<number>;
170
+ getSyncedFinalizedBlockNum(): Promise<number>;
171
+ /** Returns latest L2 slot for which we have seen an L2 block. */
172
+ getSyncedLatestSlot(): Promise<bigint>;
273
173
  /**
274
174
  * Method to check the status the p2p client.
275
175
  * @returns Information about p2p client status: state & syncedToBlockNum.
@@ -281,24 +181,20 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
281
181
  * @returns Empty promise.
282
182
  */
283
183
  private markTxsAsMinedFromBlocks;
284
- /**
285
- * Deletes txs from these blocks.
286
- * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
287
- * @returns Empty promise.
288
- */
289
- private deleteTxsFromBlocks;
290
184
  /**
291
185
  * Handles new mined blocks by marking the txs in them as mined.
292
186
  * @param blocks - A list of existing blocks with txs that the P2P client needs to ensure the tx pool is reconciled with.
293
187
  * @returns Empty promise.
294
188
  */
295
189
  private handleLatestL2Blocks;
190
+ /** Request txs for unproven blocks so the prover node has more chances to get them. */
191
+ private startCollectingMissingTxs;
296
192
  /**
297
- * Handles new proven blocks by deleting the txs in them, or by deleting the txs in blocks `keepProvenTxsFor` ago.
298
- * @param blocks - A list of proven L2 blocks.
193
+ * Handles new finalized blocks by deleting the txs and attestations in them.
194
+ * @param blocks - A list of finalized L2 blocks.
299
195
  * @returns Empty promise.
300
196
  */
301
- private handleProvenL2Blocks;
197
+ private handleFinalizedL2Blocks;
302
198
  /**
303
199
  * Updates the tx pool after a chain prune.
304
200
  * @param latestBlock - The block number the chain was pruned to.
@@ -310,5 +206,12 @@ export declare class P2PClient<T extends P2PClientType = P2PClientType.Full> ext
310
206
  * @param newState - New state value.
311
207
  */
312
208
  private setCurrentState;
209
+ validate(txs: Tx[]): Promise<void>;
210
+ /**
211
+ * Marks transactions as non-evictable in the pool.
212
+ * @param txHashes - Hashes of the transactions to mark as non-evictable.
213
+ */
214
+ markTxsAsNonEvictable(txHashes: TxHash[]): Promise<void>;
215
+ handleAuthRequestFromPeer(authRequest: AuthRequest, peerId: PeerId): Promise<StatusMessage>;
313
216
  }
314
217
  //# sourceMappingURL=p2p_client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"p2p_client.d.ts","sourceRoot":"","sources":["../../src/client/p2p_client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAsC,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAW,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAEL,KAAK,eAAe,EAEpB,UAAU,EAGX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,oBAAY,cAAc;IACxB,IAAI,IAAA;IACJ,QAAQ,IAAA;IACR,OAAO,IAAA;IACP,OAAO,IAAA;CACR;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,eAAe,EAAE,SAAS,CAAC;CAC5B;AAED;;IAEI;AACJ,MAAM,MAAM,GAA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