@aztec/p2p 0.0.1-commit.f295ac2 → 0.0.1-commit.f8ca9b2f3

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 (443) hide show
  1. package/dest/bootstrap/bootstrap.d.ts +4 -3
  2. package/dest/bootstrap/bootstrap.d.ts.map +1 -1
  3. package/dest/bootstrap/bootstrap.js +4 -4
  4. package/dest/client/factory.d.ts +5 -5
  5. package/dest/client/factory.d.ts.map +1 -1
  6. package/dest/client/factory.js +47 -13
  7. package/dest/client/interface.d.ts +33 -15
  8. package/dest/client/interface.d.ts.map +1 -1
  9. package/dest/client/p2p_client.d.ts +35 -36
  10. package/dest/client/p2p_client.d.ts.map +1 -1
  11. package/dest/client/p2p_client.js +115 -139
  12. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts +2 -0
  13. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.d.ts.map +1 -0
  14. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +305 -0
  15. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts +73 -0
  16. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.d.ts.map +1 -0
  17. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.js +8 -0
  18. package/dest/config.d.ts +24 -3
  19. package/dest/config.d.ts.map +1 -1
  20. package/dest/config.js +16 -2
  21. package/dest/index.d.ts +2 -1
  22. package/dest/index.d.ts.map +1 -1
  23. package/dest/index.js +1 -0
  24. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +102 -88
  25. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
  26. package/dest/mem_pools/attestation_pool/attestation_pool.js +436 -3
  27. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts +2 -2
  28. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.d.ts.map +1 -1
  29. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +353 -87
  30. package/dest/mem_pools/attestation_pool/index.d.ts +2 -3
  31. package/dest/mem_pools/attestation_pool/index.d.ts.map +1 -1
  32. package/dest/mem_pools/attestation_pool/index.js +1 -2
  33. package/dest/mem_pools/index.d.ts +3 -2
  34. package/dest/mem_pools/index.d.ts.map +1 -1
  35. package/dest/mem_pools/index.js +1 -1
  36. package/dest/mem_pools/instrumentation.d.ts +1 -1
  37. package/dest/mem_pools/instrumentation.d.ts.map +1 -1
  38. package/dest/mem_pools/instrumentation.js +2 -2
  39. package/dest/mem_pools/interface.d.ts +5 -5
  40. package/dest/mem_pools/interface.d.ts.map +1 -1
  41. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +3 -3
  42. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +1 -1
  43. package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts +3 -2
  44. package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts.map +1 -1
  45. package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts +3 -2
  46. package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts.map +1 -1
  47. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts +3 -3
  48. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -1
  49. package/dest/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.js +8 -1
  50. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts +3 -3
  51. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -1
  52. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.js +2 -0
  53. package/dest/mem_pools/tx_pool_v2/archive/index.d.ts +2 -0
  54. package/dest/mem_pools/tx_pool_v2/archive/index.d.ts.map +1 -0
  55. package/dest/mem_pools/tx_pool_v2/archive/index.js +1 -0
  56. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts +43 -0
  57. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.d.ts.map +1 -0
  58. package/dest/mem_pools/tx_pool_v2/archive/tx_archive.js +103 -0
  59. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts +87 -0
  60. package/dest/mem_pools/tx_pool_v2/deleted_pool.d.ts.map +1 -0
  61. package/dest/mem_pools/tx_pool_v2/deleted_pool.js +180 -0
  62. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts +47 -0
  63. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.d.ts.map +1 -0
  64. package/dest/mem_pools/tx_pool_v2/eviction/eviction_manager.js +119 -0
  65. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts +17 -0
  66. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.d.ts.map +1 -0
  67. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +90 -0
  68. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +19 -0
  69. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -0
  70. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +89 -0
  71. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts +10 -0
  72. package/dest/mem_pools/tx_pool_v2/eviction/index.d.ts.map +1 -0
  73. package/dest/mem_pools/tx_pool_v2/eviction/index.js +11 -0
  74. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +131 -0
  75. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -0
  76. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.js +17 -0
  77. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts +15 -0
  78. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.d.ts.map +1 -0
  79. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.js +63 -0
  80. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts +17 -0
  81. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -0
  82. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +91 -0
  83. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +16 -0
  84. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -0
  85. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +70 -0
  86. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +20 -0
  87. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -0
  88. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +63 -0
  89. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +15 -0
  90. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -0
  91. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +19 -0
  92. package/dest/mem_pools/tx_pool_v2/index.d.ts +6 -0
  93. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -0
  94. package/dest/mem_pools/tx_pool_v2/index.js +5 -0
  95. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +197 -0
  96. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -0
  97. package/dest/mem_pools/tx_pool_v2/interfaces.js +6 -0
  98. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +93 -0
  99. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -0
  100. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +127 -0
  101. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts +26 -0
  102. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.d.ts.map +1 -0
  103. package/dest/mem_pools/tx_pool_v2/tx_pool_bench_metrics.js +70 -0
  104. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +99 -0
  105. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -0
  106. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +332 -0
  107. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +55 -0
  108. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -0
  109. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +156 -0
  110. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +69 -0
  111. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -0
  112. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +751 -0
  113. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts +3 -3
  114. package/dest/msg_validators/attestation_validator/attestation_validator.d.ts.map +1 -1
  115. package/dest/msg_validators/attestation_validator/attestation_validator.js +41 -10
  116. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts +5 -5
  117. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.d.ts.map +1 -1
  118. package/dest/msg_validators/attestation_validator/fisherman_attestation_validator.js +18 -6
  119. package/dest/msg_validators/clock_tolerance.d.ts +21 -0
  120. package/dest/msg_validators/clock_tolerance.d.ts.map +1 -0
  121. package/dest/msg_validators/clock_tolerance.js +37 -0
  122. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +3 -3
  123. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
  124. package/dest/msg_validators/proposal_validator/proposal_validator.js +55 -31
  125. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +3 -3
  126. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +1 -1
  127. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +93 -64
  128. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +3 -3
  129. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  130. package/dest/msg_validators/tx_validator/archive_cache.d.ts +3 -3
  131. package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -1
  132. package/dest/msg_validators/tx_validator/archive_cache.js +1 -1
  133. package/dest/msg_validators/tx_validator/block_header_validator.d.ts +20 -6
  134. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
  135. package/dest/msg_validators/tx_validator/block_header_validator.js +4 -3
  136. package/dest/msg_validators/tx_validator/data_validator.d.ts +3 -1
  137. package/dest/msg_validators/tx_validator/data_validator.d.ts.map +1 -1
  138. package/dest/msg_validators/tx_validator/data_validator.js +4 -1
  139. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts +15 -4
  140. package/dest/msg_validators/tx_validator/double_spend_validator.d.ts.map +1 -1
  141. package/dest/msg_validators/tx_validator/double_spend_validator.js +7 -6
  142. package/dest/msg_validators/tx_validator/factory.d.ts +8 -3
  143. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  144. package/dest/msg_validators/tx_validator/factory.js +21 -11
  145. package/dest/msg_validators/tx_validator/gas_validator.d.ts +3 -2
  146. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  147. package/dest/msg_validators/tx_validator/gas_validator.js +3 -2
  148. package/dest/msg_validators/tx_validator/index.d.ts +2 -1
  149. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  150. package/dest/msg_validators/tx_validator/index.js +1 -0
  151. package/dest/msg_validators/tx_validator/metadata_validator.d.ts +3 -2
  152. package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
  153. package/dest/msg_validators/tx_validator/metadata_validator.js +2 -2
  154. package/dest/msg_validators/tx_validator/phases_validator.d.ts +3 -2
  155. package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
  156. package/dest/msg_validators/tx_validator/phases_validator.js +3 -3
  157. package/dest/msg_validators/tx_validator/size_validator.d.ts +8 -0
  158. package/dest/msg_validators/tx_validator/size_validator.d.ts.map +1 -0
  159. package/dest/msg_validators/tx_validator/size_validator.js +23 -0
  160. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts +22 -5
  161. package/dest/msg_validators/tx_validator/timestamp_validator.d.ts.map +1 -1
  162. package/dest/msg_validators/tx_validator/timestamp_validator.js +4 -4
  163. package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts +3 -2
  164. package/dest/msg_validators/tx_validator/tx_permitted_validator.d.ts.map +1 -1
  165. package/dest/msg_validators/tx_validator/tx_permitted_validator.js +2 -2
  166. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts +3 -2
  167. package/dest/msg_validators/tx_validator/tx_proof_validator.d.ts.map +1 -1
  168. package/dest/msg_validators/tx_validator/tx_proof_validator.js +2 -2
  169. package/dest/services/data_store.d.ts +1 -1
  170. package/dest/services/data_store.d.ts.map +1 -1
  171. package/dest/services/data_store.js +10 -6
  172. package/dest/services/discv5/discV5_service.js +1 -1
  173. package/dest/services/dummy_service.d.ts +22 -2
  174. package/dest/services/dummy_service.d.ts.map +1 -1
  175. package/dest/services/dummy_service.js +45 -0
  176. package/dest/services/encoding.d.ts +2 -2
  177. package/dest/services/encoding.d.ts.map +1 -1
  178. package/dest/services/encoding.js +4 -5
  179. package/dest/services/gossipsub/index.d.ts +3 -0
  180. package/dest/services/gossipsub/index.d.ts.map +1 -0
  181. package/dest/services/gossipsub/index.js +2 -0
  182. package/dest/services/gossipsub/scoring.d.ts +21 -3
  183. package/dest/services/gossipsub/scoring.d.ts.map +1 -1
  184. package/dest/services/gossipsub/scoring.js +24 -7
  185. package/dest/services/gossipsub/topic_score_params.d.ts +161 -0
  186. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -0
  187. package/dest/services/gossipsub/topic_score_params.js +324 -0
  188. package/dest/services/index.d.ts +2 -1
  189. package/dest/services/index.d.ts.map +1 -1
  190. package/dest/services/index.js +1 -0
  191. package/dest/services/libp2p/instrumentation.d.ts +1 -1
  192. package/dest/services/libp2p/instrumentation.d.ts.map +1 -1
  193. package/dest/services/libp2p/instrumentation.js +14 -3
  194. package/dest/services/libp2p/libp2p_service.d.ts +91 -36
  195. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  196. package/dest/services/libp2p/libp2p_service.js +407 -303
  197. package/dest/services/peer-manager/metrics.d.ts +2 -2
  198. package/dest/services/peer-manager/metrics.d.ts.map +1 -1
  199. package/dest/services/peer-manager/metrics.js +20 -5
  200. package/dest/services/peer-manager/peer_scoring.d.ts +1 -1
  201. package/dest/services/peer-manager/peer_scoring.d.ts.map +1 -1
  202. package/dest/services/peer-manager/peer_scoring.js +33 -4
  203. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +47 -0
  204. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -0
  205. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +566 -0
  206. package/dest/services/reqresp/batch-tx-requester/config.d.ts +17 -0
  207. package/dest/services/reqresp/batch-tx-requester/config.d.ts.map +1 -0
  208. package/dest/services/reqresp/batch-tx-requester/config.js +27 -0
  209. package/dest/services/reqresp/batch-tx-requester/interface.d.ts +50 -0
  210. package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -0
  211. package/dest/services/reqresp/batch-tx-requester/interface.js +1 -0
  212. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +37 -0
  213. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -0
  214. package/dest/services/reqresp/batch-tx-requester/missing_txs.js +151 -0
  215. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +54 -0
  216. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -0
  217. package/dest/services/reqresp/batch-tx-requester/peer_collection.js +139 -0
  218. package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts +20 -0
  219. package/dest/services/reqresp/batch-tx-requester/tx_validator.d.ts.map +1 -0
  220. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +21 -0
  221. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts +22 -3
  222. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.d.ts.map +1 -1
  223. package/dest/services/reqresp/connection-sampler/batch_connection_sampler.js +63 -4
  224. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts +2 -1
  225. package/dest/services/reqresp/connection-sampler/connection_sampler.d.ts.map +1 -1
  226. package/dest/services/reqresp/connection-sampler/connection_sampler.js +12 -0
  227. package/dest/services/reqresp/interface.d.ts +14 -3
  228. package/dest/services/reqresp/interface.d.ts.map +1 -1
  229. package/dest/services/reqresp/interface.js +17 -3
  230. package/dest/services/reqresp/metrics.d.ts +6 -5
  231. package/dest/services/reqresp/metrics.d.ts.map +1 -1
  232. package/dest/services/reqresp/metrics.js +17 -5
  233. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts +5 -1
  234. package/dest/services/reqresp/protocols/block_txs/bitvector.d.ts.map +1 -1
  235. package/dest/services/reqresp/protocols/block_txs/bitvector.js +5 -0
  236. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts +7 -5
  237. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.d.ts.map +1 -1
  238. package/dest/services/reqresp/protocols/block_txs/block_txs_handler.js +27 -9
  239. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +29 -6
  240. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
  241. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +59 -13
  242. package/dest/services/reqresp/protocols/tx.d.ts +7 -1
  243. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  244. package/dest/services/reqresp/protocols/tx.js +20 -0
  245. package/dest/services/reqresp/reqresp.d.ts +6 -1
  246. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  247. package/dest/services/reqresp/reqresp.js +69 -26
  248. package/dest/services/service.d.ts +38 -1
  249. package/dest/services/service.d.ts.map +1 -1
  250. package/dest/services/tx_collection/config.d.ts +10 -1
  251. package/dest/services/tx_collection/config.d.ts.map +1 -1
  252. package/dest/services/tx_collection/config.js +25 -1
  253. package/dest/services/tx_collection/fast_tx_collection.d.ts +7 -4
  254. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
  255. package/dest/services/tx_collection/fast_tx_collection.js +34 -13
  256. package/dest/services/tx_collection/file_store_tx_collection.d.ts +44 -0
  257. package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -0
  258. package/dest/services/tx_collection/file_store_tx_collection.js +118 -0
  259. package/dest/services/tx_collection/file_store_tx_source.d.ts +27 -0
  260. package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -0
  261. package/dest/services/tx_collection/file_store_tx_source.js +57 -0
  262. package/dest/services/tx_collection/index.d.ts +3 -1
  263. package/dest/services/tx_collection/index.d.ts.map +1 -1
  264. package/dest/services/tx_collection/index.js +2 -0
  265. package/dest/services/tx_collection/instrumentation.d.ts +1 -1
  266. package/dest/services/tx_collection/instrumentation.d.ts.map +1 -1
  267. package/dest/services/tx_collection/instrumentation.js +9 -2
  268. package/dest/services/tx_collection/proposal_tx_collector.d.ts +48 -0
  269. package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -0
  270. package/dest/services/tx_collection/proposal_tx_collector.js +49 -0
  271. package/dest/services/tx_collection/slow_tx_collection.d.ts +5 -3
  272. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
  273. package/dest/services/tx_collection/slow_tx_collection.js +48 -19
  274. package/dest/services/tx_collection/tx_collection.d.ts +23 -13
  275. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  276. package/dest/services/tx_collection/tx_collection.js +62 -6
  277. package/dest/services/tx_collection/tx_collection_sink.d.ts +15 -6
  278. package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
  279. package/dest/services/tx_collection/tx_collection_sink.js +13 -7
  280. package/dest/services/tx_file_store/config.d.ts +16 -0
  281. package/dest/services/tx_file_store/config.d.ts.map +1 -0
  282. package/dest/services/tx_file_store/config.js +22 -0
  283. package/dest/services/tx_file_store/index.d.ts +4 -0
  284. package/dest/services/tx_file_store/index.d.ts.map +1 -0
  285. package/dest/services/tx_file_store/index.js +3 -0
  286. package/dest/services/tx_file_store/instrumentation.d.ts +15 -0
  287. package/dest/services/tx_file_store/instrumentation.d.ts.map +1 -0
  288. package/dest/services/tx_file_store/instrumentation.js +29 -0
  289. package/dest/services/tx_file_store/tx_file_store.d.ts +47 -0
  290. package/dest/services/tx_file_store/tx_file_store.d.ts.map +1 -0
  291. package/dest/services/tx_file_store/tx_file_store.js +149 -0
  292. package/dest/services/tx_provider.d.ts +5 -5
  293. package/dest/services/tx_provider.d.ts.map +1 -1
  294. package/dest/services/tx_provider.js +5 -4
  295. package/dest/services/tx_provider_instrumentation.d.ts +1 -1
  296. package/dest/services/tx_provider_instrumentation.d.ts.map +1 -1
  297. package/dest/services/tx_provider_instrumentation.js +5 -5
  298. package/dest/test-helpers/index.d.ts +3 -1
  299. package/dest/test-helpers/index.d.ts.map +1 -1
  300. package/dest/test-helpers/index.js +2 -0
  301. package/dest/test-helpers/make-test-p2p-clients.d.ts +3 -3
  302. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  303. package/dest/test-helpers/mock-pubsub.d.ts +27 -1
  304. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  305. package/dest/test-helpers/mock-pubsub.js +97 -2
  306. package/dest/test-helpers/reqresp-nodes.d.ts +1 -1
  307. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  308. package/dest/test-helpers/reqresp-nodes.js +2 -1
  309. package/dest/test-helpers/test_tx_provider.d.ts +40 -0
  310. package/dest/test-helpers/test_tx_provider.d.ts.map +1 -0
  311. package/dest/test-helpers/test_tx_provider.js +41 -0
  312. package/dest/test-helpers/testbench-utils.d.ts +158 -0
  313. package/dest/test-helpers/testbench-utils.d.ts.map +1 -0
  314. package/dest/test-helpers/testbench-utils.js +360 -0
  315. package/dest/testbench/p2p_client_testbench_worker.d.ts +28 -2
  316. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
  317. package/dest/testbench/p2p_client_testbench_worker.js +213 -134
  318. package/dest/testbench/worker_client_manager.d.ts +51 -6
  319. package/dest/testbench/worker_client_manager.d.ts.map +1 -1
  320. package/dest/testbench/worker_client_manager.js +226 -44
  321. package/package.json +14 -14
  322. package/src/bootstrap/bootstrap.ts +7 -4
  323. package/src/client/factory.ts +78 -22
  324. package/src/client/interface.ts +39 -14
  325. package/src/client/p2p_client.ts +155 -166
  326. package/src/client/test/tx_proposal_collector/README.md +227 -0
  327. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +336 -0
  328. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker_protocol.ts +43 -0
  329. package/src/config.ts +38 -2
  330. package/src/index.ts +1 -0
  331. package/src/mem_pools/attestation_pool/attestation_pool.ts +488 -91
  332. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +442 -102
  333. package/src/mem_pools/attestation_pool/index.ts +9 -2
  334. package/src/mem_pools/index.ts +4 -1
  335. package/src/mem_pools/instrumentation.ts +2 -1
  336. package/src/mem_pools/interface.ts +4 -4
  337. package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +2 -2
  338. package/src/mem_pools/tx_pool/eviction/eviction_manager.ts +2 -1
  339. package/src/mem_pools/tx_pool/eviction/eviction_strategy.ts +2 -1
  340. package/src/mem_pools/tx_pool/eviction/fee_payer_balance_eviction_rule.ts +10 -7
  341. package/src/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.ts +4 -2
  342. package/src/mem_pools/tx_pool_v2/README.md +259 -0
  343. package/src/mem_pools/tx_pool_v2/archive/index.ts +1 -0
  344. package/src/mem_pools/tx_pool_v2/archive/tx_archive.ts +120 -0
  345. package/src/mem_pools/tx_pool_v2/deleted_pool.ts +234 -0
  346. package/src/mem_pools/tx_pool_v2/eviction/eviction_manager.ts +147 -0
  347. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +118 -0
  348. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +111 -0
  349. package/src/mem_pools/tx_pool_v2/eviction/index.ts +23 -0
  350. package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +164 -0
  351. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_mining_rule.ts +74 -0
  352. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +101 -0
  353. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +86 -0
  354. package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +72 -0
  355. package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +31 -0
  356. package/src/mem_pools/tx_pool_v2/index.ts +12 -0
  357. package/src/mem_pools/tx_pool_v2/interfaces.ts +227 -0
  358. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +207 -0
  359. package/src/mem_pools/tx_pool_v2/tx_pool_bench_metrics.ts +77 -0
  360. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +417 -0
  361. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +212 -0
  362. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +895 -0
  363. package/src/msg_validators/attestation_validator/attestation_validator.ts +26 -14
  364. package/src/msg_validators/attestation_validator/fisherman_attestation_validator.ts +16 -10
  365. package/src/msg_validators/clock_tolerance.ts +51 -0
  366. package/src/msg_validators/proposal_validator/proposal_validator.ts +31 -31
  367. package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +91 -67
  368. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +2 -2
  369. package/src/msg_validators/tx_validator/archive_cache.ts +3 -3
  370. package/src/msg_validators/tx_validator/block_header_validator.ts +21 -8
  371. package/src/msg_validators/tx_validator/data_validator.ts +6 -2
  372. package/src/msg_validators/tx_validator/double_spend_validator.ts +15 -9
  373. package/src/msg_validators/tx_validator/factory.ts +64 -23
  374. package/src/msg_validators/tx_validator/gas_validator.ts +9 -3
  375. package/src/msg_validators/tx_validator/index.ts +1 -0
  376. package/src/msg_validators/tx_validator/metadata_validator.ts +6 -3
  377. package/src/msg_validators/tx_validator/phases_validator.ts +5 -3
  378. package/src/msg_validators/tx_validator/size_validator.ts +22 -0
  379. package/src/msg_validators/tx_validator/timestamp_validator.ts +25 -17
  380. package/src/msg_validators/tx_validator/tx_permitted_validator.ts +8 -3
  381. package/src/msg_validators/tx_validator/tx_proof_validator.ts +8 -3
  382. package/src/services/data_store.ts +10 -7
  383. package/src/services/discv5/discV5_service.ts +1 -1
  384. package/src/services/dummy_service.ts +57 -0
  385. package/src/services/encoding.ts +4 -5
  386. package/src/services/gossipsub/README.md +626 -0
  387. package/src/services/gossipsub/index.ts +2 -0
  388. package/src/services/gossipsub/scoring.ts +29 -5
  389. package/src/services/gossipsub/topic_score_params.ts +451 -0
  390. package/src/services/index.ts +1 -0
  391. package/src/services/libp2p/instrumentation.ts +15 -2
  392. package/src/services/libp2p/libp2p_service.ts +437 -316
  393. package/src/services/peer-manager/metrics.ts +21 -4
  394. package/src/services/peer-manager/peer_scoring.ts +29 -1
  395. package/src/services/reqresp/batch-tx-requester/README.md +305 -0
  396. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +706 -0
  397. package/src/services/reqresp/batch-tx-requester/config.ts +40 -0
  398. package/src/services/reqresp/batch-tx-requester/interface.ts +57 -0
  399. package/src/services/reqresp/batch-tx-requester/missing_txs.ts +209 -0
  400. package/src/services/reqresp/batch-tx-requester/peer_collection.ts +205 -0
  401. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +37 -0
  402. package/src/services/reqresp/connection-sampler/batch_connection_sampler.ts +65 -4
  403. package/src/services/reqresp/connection-sampler/connection_sampler.ts +16 -0
  404. package/src/services/reqresp/interface.ts +31 -3
  405. package/src/services/reqresp/metrics.ts +34 -9
  406. package/src/services/reqresp/protocols/block_txs/bitvector.ts +7 -0
  407. package/src/services/reqresp/protocols/block_txs/block_txs_handler.ts +35 -12
  408. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +74 -9
  409. package/src/services/reqresp/protocols/tx.ts +22 -0
  410. package/src/services/reqresp/reqresp.ts +79 -22
  411. package/src/services/service.ts +44 -0
  412. package/src/services/tx_collection/config.ts +41 -1
  413. package/src/services/tx_collection/fast_tx_collection.ts +44 -19
  414. package/src/services/tx_collection/file_store_tx_collection.ts +152 -0
  415. package/src/services/tx_collection/file_store_tx_source.ts +70 -0
  416. package/src/services/tx_collection/index.ts +6 -0
  417. package/src/services/tx_collection/instrumentation.ts +11 -2
  418. package/src/services/tx_collection/proposal_tx_collector.ts +112 -0
  419. package/src/services/tx_collection/slow_tx_collection.ts +57 -28
  420. package/src/services/tx_collection/tx_collection.ts +86 -20
  421. package/src/services/tx_collection/tx_collection_sink.ts +17 -7
  422. package/src/services/tx_file_store/config.ts +37 -0
  423. package/src/services/tx_file_store/index.ts +3 -0
  424. package/src/services/tx_file_store/instrumentation.ts +36 -0
  425. package/src/services/tx_file_store/tx_file_store.ts +173 -0
  426. package/src/services/tx_provider.ts +10 -9
  427. package/src/services/tx_provider_instrumentation.ts +11 -5
  428. package/src/test-helpers/index.ts +2 -0
  429. package/src/test-helpers/make-test-p2p-clients.ts +3 -3
  430. package/src/test-helpers/mock-pubsub.ts +133 -3
  431. package/src/test-helpers/reqresp-nodes.ts +2 -1
  432. package/src/test-helpers/test_tx_provider.ts +64 -0
  433. package/src/test-helpers/testbench-utils.ts +422 -0
  434. package/src/testbench/p2p_client_testbench_worker.ts +322 -127
  435. package/src/testbench/worker_client_manager.ts +304 -47
  436. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts +0 -40
  437. package/dest/mem_pools/attestation_pool/kv_attestation_pool.d.ts.map +0 -1
  438. package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +0 -218
  439. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts +0 -31
  440. package/dest/mem_pools/attestation_pool/memory_attestation_pool.d.ts.map +0 -1
  441. package/dest/mem_pools/attestation_pool/memory_attestation_pool.js +0 -180
  442. package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +0 -320
  443. package/src/mem_pools/attestation_pool/memory_attestation_pool.ts +0 -264
@@ -1,7 +1,7 @@
1
1
  // Taken from lodestar: https://github.com/ChainSafe/lodestar
2
2
  import { sha256 } from '@aztec/foundation/crypto/sha256';
3
3
  import { createLogger } from '@aztec/foundation/log';
4
- import { TopicType, getTopicFromString } from '@aztec/stdlib/p2p';
4
+ import { MAX_TX_SIZE_KB, TopicType, getTopicFromString } from '@aztec/stdlib/p2p';
5
5
  import { compressSync, uncompressSync } from 'snappy';
6
6
  import xxhashFactory from 'xxhash-wasm';
7
7
  // Load WASM
@@ -41,8 +41,7 @@ export function msgIdToStrFn(msgId) {
41
41
  return sha256(Buffer.concat(vec)).subarray(0, 20);
42
42
  }
43
43
  const DefaultMaxSizesKb = {
44
- // Tx effects should not exceed 128kb, so 512kb for the full tx obj should be sufficient
45
- [TopicType.tx]: 512,
44
+ [TopicType.tx]: MAX_TX_SIZE_KB,
46
45
  // An attestation has roughly 30 fields, which is 1kb, so 5x is plenty
47
46
  [TopicType.checkpoint_attestation]: 5,
48
47
  // Proposals may carry some tx objects, so we allow a larger size capped at 10mb
@@ -67,11 +66,11 @@ const DefaultMaxSizesKb = {
67
66
  const topic = getTopicFromString(topicStr);
68
67
  return this.inboundTransformData(Buffer.from(data), topic);
69
68
  }
70
- inboundTransformData(data, topic) {
69
+ inboundTransformData(data, topic, maxSizeKbOverride) {
71
70
  if (data.length === 0) {
72
71
  return data;
73
72
  }
74
- const maxSizeKb = this.maxSizesKb[topic] ?? this.defaultMaxSizeKb;
73
+ const maxSizeKb = maxSizeKbOverride ?? this.maxSizesKb[topic] ?? this.defaultMaxSizeKb;
75
74
  const { decompressedSize } = readSnappyPreamble(data);
76
75
  if (decompressedSize > maxSizeKb * 1024) {
77
76
  this.logger.warn(`Decompressed size ${decompressedSize} exceeds maximum allowed size of ${maxSizeKb}kb`);
@@ -0,0 +1,3 @@
1
+ export * from './scoring.js';
2
+ export * from './topic_score_params.js';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZXJ2aWNlcy9nb3NzaXBzdWIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyx5QkFBeUIsQ0FBQyJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/gossipsub/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './scoring.js';
2
+ export * from './topic_score_params.js';
@@ -1,7 +1,25 @@
1
1
  import type { PeerScoreThresholds } from '@chainsafe/libp2p-gossipsub/score';
2
2
  /**
3
- * The following params is implemented by Lighthouse at
4
- * https://github.com/sigp/lighthouse/blob/b0ac3464ca5fb1e9d75060b56c83bfaf990a3d25/beacon_node/eth2_libp2p/src/behaviour/gossipsub_scoring_parameters.rs#L83
3
+ * Weight applied to application-level peer scores before contributing to gossipsub score.
4
+ *
5
+ * Note: positive topic scores can partially offset app penalties, so alignment with
6
+ * app-level thresholds is best-effort rather than strict.
7
+ */
8
+ export declare const APP_SPECIFIC_WEIGHT = 10;
9
+ /**
10
+ * Gossipsub peer score thresholds aligned with application-level scoring.
11
+ *
12
+ * These thresholds work with appSpecificWeight=10 to align gossipsub behavior
13
+ * with application-level peer states (Healthy → Disconnect → Banned).
14
+ *
15
+ * Alignment:
16
+ * - gossipThreshold (-500): Matches Disconnect state (app score -50 × weight 10)
17
+ * - publishThreshold (-1000): Matches Ban state (app score -100 × weight 10)
18
+ * - graylistThreshold (-2000): For severe attacks (ban + topic penalties)
19
+ *
20
+ * The 1:2:4 ratio follows Lodestar's approach and gossipsub spec recommendations.
21
+ *
22
+ * @see https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#peer-scoring
5
23
  */
6
24
  export declare const gossipScoreThresholds: PeerScoreThresholds;
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NvcmluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NlcnZpY2VzL2dvc3NpcHN1Yi9zY29yaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFFN0U7OztHQUdHO0FBQ0gsZUFBTyxNQUFNLHFCQUFxQixFQUFFLG1CQU1uQyxDQUFDIn0=
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NvcmluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NlcnZpY2VzL2dvc3NpcHN1Yi9zY29yaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFFN0U7Ozs7O0dBS0c7QUFDSCxlQUFPLE1BQU0sbUJBQW1CLEtBQUssQ0FBQztBQUV0Qzs7Ozs7Ozs7Ozs7Ozs7R0FjRztBQUNILGVBQU8sTUFBTSxxQkFBcUIsRUFBRSxtQkFXbkMsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../src/services/gossipsub/scoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAMnC,CAAC"}
1
+ {"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../src/services/gossipsub/scoring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAWnC,CAAC"}
@@ -1,10 +1,27 @@
1
1
  /**
2
- * The following params is implemented by Lighthouse at
3
- * https://github.com/sigp/lighthouse/blob/b0ac3464ca5fb1e9d75060b56c83bfaf990a3d25/beacon_node/eth2_libp2p/src/behaviour/gossipsub_scoring_parameters.rs#L83
2
+ * Weight applied to application-level peer scores before contributing to gossipsub score.
3
+ *
4
+ * Note: positive topic scores can partially offset app penalties, so alignment with
5
+ * app-level thresholds is best-effort rather than strict.
6
+ */ export const APP_SPECIFIC_WEIGHT = 10;
7
+ /**
8
+ * Gossipsub peer score thresholds aligned with application-level scoring.
9
+ *
10
+ * These thresholds work with appSpecificWeight=10 to align gossipsub behavior
11
+ * with application-level peer states (Healthy → Disconnect → Banned).
12
+ *
13
+ * Alignment:
14
+ * - gossipThreshold (-500): Matches Disconnect state (app score -50 × weight 10)
15
+ * - publishThreshold (-1000): Matches Ban state (app score -100 × weight 10)
16
+ * - graylistThreshold (-2000): For severe attacks (ban + topic penalties)
17
+ *
18
+ * The 1:2:4 ratio follows Lodestar's approach and gossipsub spec recommendations.
19
+ *
20
+ * @see https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#peer-scoring
4
21
  */ export const gossipScoreThresholds = {
5
- gossipThreshold: -4000,
6
- publishThreshold: -8000,
7
- graylistThreshold: -16000,
8
- acceptPXThreshold: 100,
9
- opportunisticGraftThreshold: 5
22
+ /** Below this, peer is not gossiped to (matches Disconnect state) */ gossipThreshold: -500,
23
+ /** Below this, self-published messages are not propagated to peer (matches Ban state) */ publishThreshold: -1000,
24
+ /** Below this, all RPCs from peer are ignored (severe attack scenario) */ graylistThreshold: -2000,
25
+ /** Above this, peer can offer peer exchange (PX) */ acceptPXThreshold: 100,
26
+ /** Above this, peer can be grafted to mesh opportunistically */ opportunisticGraftThreshold: 5
10
27
  };
@@ -0,0 +1,161 @@
1
+ import { TopicType } from '@aztec/stdlib/p2p';
2
+ import { createTopicScoreParams } from '@chainsafe/libp2p-gossipsub/score';
3
+ /**
4
+ * Network parameters needed to compute topic-specific gossipsub scoring parameters.
5
+ */
6
+ export type TopicScoringNetworkParams = {
7
+ /** L2 slot duration in milliseconds */
8
+ slotDurationMs: number;
9
+ /** Gossipsub heartbeat interval in milliseconds */
10
+ heartbeatIntervalMs: number;
11
+ /** Target committee size (number of validators expected to attest per slot) */
12
+ targetCommitteeSize: number;
13
+ /** Duration per block in milliseconds when building multiple blocks per slot. If undefined, single block mode. */
14
+ blockDurationMs?: number;
15
+ };
16
+ /**
17
+ * Calculates the number of blocks per slot based on timing parameters.
18
+ * Uses the shared calculation from @aztec/stdlib/timetable.
19
+ *
20
+ * @param slotDurationMs - L2 slot duration in milliseconds
21
+ * @param blockDurationMs - Duration per block in milliseconds (undefined = single block mode)
22
+ * @returns Number of blocks per slot
23
+ */
24
+ export declare function calculateBlocksPerSlot(slotDurationMs: number, blockDurationMs: number | undefined): number;
25
+ /**
26
+ * Determines the decay window in slots based on expected message frequency.
27
+ * Low-frequency topics need longer decay windows to accumulate meaningful counter values.
28
+ *
29
+ * @param expectedMessagesPerSlot - Expected messages per slot for this topic
30
+ * @returns Number of slots over which the counter should decay to ~1%
31
+ */
32
+ export declare function getDecayWindowSlots(expectedMessagesPerSlot: number): number;
33
+ /**
34
+ * Computes the decay factor for exponential decay over a given window.
35
+ * After `heartbeatsInWindow` heartbeats, the counter decays to ~1% of its original value.
36
+ *
37
+ * @param heartbeatIntervalMs - Gossipsub heartbeat interval in milliseconds
38
+ * @param slotDurationMs - L2 slot duration in milliseconds
39
+ * @param decayWindowSlots - Number of slots over which to decay
40
+ * @returns Decay factor (0 < decay < 1), applied each heartbeat
41
+ */
42
+ export declare function computeDecay(heartbeatIntervalMs: number, slotDurationMs: number, decayWindowSlots: number): number;
43
+ /**
44
+ * Computes the steady-state convergence value for a decaying counter.
45
+ * If messages arrive at a constant rate and decay is applied each heartbeat,
46
+ * the counter converges to: rate / (1 - decay)
47
+ *
48
+ * @param messagesPerHeartbeat - Expected messages per heartbeat
49
+ * @param decay - Decay factor applied each heartbeat
50
+ * @returns Convergence value (steady-state counter value)
51
+ */
52
+ export declare function computeConvergence(messagesPerHeartbeat: number, decay: number): number;
53
+ /**
54
+ * Computes a conservative threshold for mesh message deliveries.
55
+ * The threshold should be low enough to avoid penalizing honest peers with normal variance.
56
+ *
57
+ * @param convergence - Steady-state counter value
58
+ * @param conservativeFactor - Fraction of convergence to use as threshold (e.g., 0.3)
59
+ * @returns Threshold value
60
+ */
61
+ export declare function computeThreshold(convergence: number, conservativeFactor: number): number;
62
+ /**
63
+ * Gets the expected messages per slot for a given topic type.
64
+ *
65
+ * @param topicType - The topic type
66
+ * @param targetCommitteeSize - Target committee size
67
+ * @param blocksPerSlot - Number of blocks per slot
68
+ * @returns Expected messages per slot, or undefined if unpredictable
69
+ */
70
+ export declare function getExpectedMessagesPerSlot(topicType: TopicType, targetCommitteeSize: number, blocksPerSlot: number): number | undefined;
71
+ /** Maximum P1 score contribution per topic */
72
+ export declare const MAX_P1_SCORE = 8;
73
+ /** Maximum P2 score contribution per topic */
74
+ export declare const MAX_P2_SCORE = 25;
75
+ /** Maximum P3 penalty per topic (must exceed P1 + P2 to cause pruning) */
76
+ export declare const MAX_P3_PENALTY_PER_TOPIC: number;
77
+ /** Number of topics with P3 enabled in MBPS mode (block_proposal + checkpoint_proposal + checkpoint_attestation) */
78
+ export declare const NUM_P3_ENABLED_TOPICS = 3;
79
+ /** Total maximum P3b penalty across all topics after pruning in MBPS mode */
80
+ export declare const TOTAL_MAX_P3B_PENALTY: number;
81
+ /**
82
+ * Factory class for creating gossipsub topic scoring parameters.
83
+ * Computes shared values once and reuses them across all topics.
84
+ */
85
+ export declare class TopicScoreParamsFactory {
86
+ private readonly params;
87
+ /** Number of blocks per slot based on timetable configuration */
88
+ readonly blocksPerSlot: number;
89
+ /** Decay factor for invalid message penalties (P4) */
90
+ readonly invalidDecay: number;
91
+ /** Number of heartbeats per slot */
92
+ readonly heartbeatsPerSlot: number;
93
+ /** P1: Time in mesh quantum (slot duration in ms - score increases by ~1 per slot) */
94
+ readonly timeInMeshQuantum: number;
95
+ /** P1: Time in mesh cap (number of slots to reach max score) */
96
+ readonly timeInMeshCap: number;
97
+ /** P1: Time in mesh weight (normalized so max P1 = MAX_P1_SCORE) */
98
+ readonly timeInMeshWeight: number;
99
+ /** P2: First message deliveries decay factor */
100
+ readonly firstMessageDeliveriesDecay: number;
101
+ /** P2: First message deliveries cap (convergence-based) */
102
+ readonly firstMessageDeliveriesCap: number;
103
+ /** P2: First message deliveries weight (normalized so max P2 = MAX_P2_SCORE) */
104
+ readonly firstMessageDeliveriesWeight: number;
105
+ /** Base parameters common to all topics */
106
+ private readonly baseParams;
107
+ constructor(params: TopicScoringNetworkParams);
108
+ /**
109
+ * Creates scoring parameters for topics with unpredictable or zero message rates.
110
+ * Disables P1, P2, P3, and P3b to avoid unbalanced positive score accumulation.
111
+ *
112
+ * Rationale: If P1/P2 were enabled without P3, the topic would contribute free
113
+ * positive scores that could offset penalties from other topics, preventing
114
+ * proper mesh pruning of non-contributing peers.
115
+ */
116
+ private createDisabledP3Params;
117
+ /**
118
+ * Creates scoring parameters for topics with predictable message rates.
119
+ * Enables P1, P2, P3, and P3b for balanced scoring.
120
+ *
121
+ * The scoring is designed so that:
122
+ * - P1 + P2 max = 8 + 25 = 33 (positive rewards for good behavior)
123
+ * - P3 max = -34 (penalty exceeds P1+P2 to ensure pruning of non-contributors)
124
+ * - After pruning: P1 resets, P2 decays, P3b persists with slow decay
125
+ *
126
+ * @param expectedPerSlot - Expected messages per slot
127
+ */
128
+ private createEnabledP3Params;
129
+ /**
130
+ * Creates topic score parameters for a specific topic type.
131
+ *
132
+ * @param topicType - The topic type
133
+ * @returns TopicScoreParams for the topic
134
+ */
135
+ createForTopic(topicType: TopicType): ReturnType<typeof createTopicScoreParams>;
136
+ /**
137
+ * Creates all topic score parameters for gossipsub configuration.
138
+ *
139
+ * @param protocolVersion - Protocol version string for topic naming
140
+ * @returns Record mapping topic strings to their score parameters
141
+ */
142
+ createAll(protocolVersion: string): Record<string, ReturnType<typeof createTopicScoreParams>>;
143
+ }
144
+ /**
145
+ * Creates topic score parameters for a specific topic type.
146
+ * Convenience function that creates a factory internally.
147
+ *
148
+ * @param topicType - The topic type
149
+ * @param params - Network parameters for scoring calculation
150
+ * @returns TopicScoreParams for the topic
151
+ */
152
+ export declare function createTopicScoreParamsForTopic(topicType: TopicType, params: TopicScoringNetworkParams): ReturnType<typeof createTopicScoreParams>;
153
+ /**
154
+ * Creates all topic score parameters for gossipsub configuration.
155
+ *
156
+ * @param protocolVersion - Protocol version string for topic naming
157
+ * @param params - Network parameters for scoring calculation
158
+ * @returns Record mapping topic strings to their score parameters
159
+ */
160
+ export declare function createAllTopicScoreParams(protocolVersion: string, params: TopicScoringNetworkParams): Record<string, ReturnType<typeof createTopicScoreParams>>;
161
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWNfc2NvcmVfcGFyYW1zLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2VydmljZXMvZ29zc2lwc3ViL3RvcG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B,GAChC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAG3C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,yBAAyB,GAChC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAG3D"}
@@ -0,0 +1,324 @@
1
+ import { TopicType, createTopicString } from '@aztec/stdlib/p2p';
2
+ import { calculateMaxBlocksPerSlot } from '@aztec/stdlib/timetable';
3
+ import { createTopicScoreParams } from '@chainsafe/libp2p-gossipsub/score';
4
+ /**
5
+ * Calculates the number of blocks per slot based on timing parameters.
6
+ * Uses the shared calculation from @aztec/stdlib/timetable.
7
+ *
8
+ * @param slotDurationMs - L2 slot duration in milliseconds
9
+ * @param blockDurationMs - Duration per block in milliseconds (undefined = single block mode)
10
+ * @returns Number of blocks per slot
11
+ */ export function calculateBlocksPerSlot(slotDurationMs, blockDurationMs) {
12
+ return calculateMaxBlocksPerSlot(slotDurationMs / 1000, blockDurationMs ? blockDurationMs / 1000 : undefined);
13
+ }
14
+ /**
15
+ * Determines the decay window in slots based on expected message frequency.
16
+ * Low-frequency topics need longer decay windows to accumulate meaningful counter values.
17
+ *
18
+ * @param expectedMessagesPerSlot - Expected messages per slot for this topic
19
+ * @returns Number of slots over which the counter should decay to ~1%
20
+ */ export function getDecayWindowSlots(expectedMessagesPerSlot) {
21
+ if (expectedMessagesPerSlot <= 1) {
22
+ return 5; // Low frequency: decay over 5 slots
23
+ } else if (expectedMessagesPerSlot <= 10) {
24
+ return 3; // Medium frequency: decay over 3 slots
25
+ } else {
26
+ return 2; // High frequency: decay over 2 slots
27
+ }
28
+ }
29
+ /**
30
+ * Computes the decay factor for exponential decay over a given window.
31
+ * After `heartbeatsInWindow` heartbeats, the counter decays to ~1% of its original value.
32
+ *
33
+ * @param heartbeatIntervalMs - Gossipsub heartbeat interval in milliseconds
34
+ * @param slotDurationMs - L2 slot duration in milliseconds
35
+ * @param decayWindowSlots - Number of slots over which to decay
36
+ * @returns Decay factor (0 < decay < 1), applied each heartbeat
37
+ */ export function computeDecay(heartbeatIntervalMs, slotDurationMs, decayWindowSlots) {
38
+ const heartbeatsPerSlot = slotDurationMs / heartbeatIntervalMs;
39
+ const heartbeatsInWindow = heartbeatsPerSlot * decayWindowSlots;
40
+ // Decay to 1% over the window: decay^heartbeatsInWindow = 0.01
41
+ // decay = 0.01^(1/heartbeatsInWindow)
42
+ return Math.pow(0.01, 1 / heartbeatsInWindow);
43
+ }
44
+ /**
45
+ * Computes the steady-state convergence value for a decaying counter.
46
+ * If messages arrive at a constant rate and decay is applied each heartbeat,
47
+ * the counter converges to: rate / (1 - decay)
48
+ *
49
+ * @param messagesPerHeartbeat - Expected messages per heartbeat
50
+ * @param decay - Decay factor applied each heartbeat
51
+ * @returns Convergence value (steady-state counter value)
52
+ */ export function computeConvergence(messagesPerHeartbeat, decay) {
53
+ return messagesPerHeartbeat / (1 - decay);
54
+ }
55
+ /**
56
+ * Computes a conservative threshold for mesh message deliveries.
57
+ * The threshold should be low enough to avoid penalizing honest peers with normal variance.
58
+ *
59
+ * @param convergence - Steady-state counter value
60
+ * @param conservativeFactor - Fraction of convergence to use as threshold (e.g., 0.3)
61
+ * @returns Threshold value
62
+ */ export function computeThreshold(convergence, conservativeFactor) {
63
+ return convergence * conservativeFactor;
64
+ }
65
+ /**
66
+ * Gets the expected messages per slot for a given topic type.
67
+ *
68
+ * @param topicType - The topic type
69
+ * @param targetCommitteeSize - Target committee size
70
+ * @param blocksPerSlot - Number of blocks per slot
71
+ * @returns Expected messages per slot, or undefined if unpredictable
72
+ */ export function getExpectedMessagesPerSlot(topicType, targetCommitteeSize, blocksPerSlot) {
73
+ switch(topicType){
74
+ case TopicType.tx:
75
+ // Transactions are unpredictable - disable mesh message delivery scoring
76
+ return undefined;
77
+ case TopicType.block_proposal:
78
+ // In MBPS mode, N-1 block proposals per slot (last one bundled with checkpoint)
79
+ // In single block mode (blocksPerSlot=1), this is 0
80
+ return Math.max(0, blocksPerSlot - 1);
81
+ case TopicType.checkpoint_proposal:
82
+ // Exactly 1 checkpoint proposal per slot
83
+ return 1;
84
+ case TopicType.checkpoint_attestation:
85
+ // Each committee member sends one attestation per slot
86
+ return targetCommitteeSize;
87
+ default:
88
+ return undefined;
89
+ }
90
+ }
91
+ /** Conservative factor for threshold calculation (30% of convergence) */ const CONSERVATIVE_FACTOR = 0.3;
92
+ /** Number of slots over which invalid message penalty decays */ const INVALID_DECAY_WINDOW_SLOTS = 4;
93
+ /** Weight for invalid message deliveries penalty */ const INVALID_MESSAGE_WEIGHT = -20;
94
+ /** Mesh message deliveries window in milliseconds (5 seconds - balanced for TypeScript runtime) */ const MESH_DELIVERIES_WINDOW_MS = 5000;
95
+ /**
96
+ * Multiplier for activation time to provide extra grace period during network bootstrap.
97
+ * The activation timer starts from mesh join time, not from first message received.
98
+ * During bootstrap, peers may join before messages start flowing, so we need extra time.
99
+ */ const ACTIVATION_MULTIPLIER = 5;
100
+ // ============================================================================
101
+ // P1 (timeInMesh) Configuration
102
+ // ============================================================================
103
+ // P1 rewards peers for time spent in the mesh. Following Lodestar's approach,
104
+ // we normalize the score so that max P1 = MAX_P1_SCORE after P1_CAP_TIME_SECONDS.
105
+ //
106
+ // Formula: P1 = min(timeInMesh / quantum, cap) * weight
107
+ // - quantum = slotDurationMs (one increment per slot worth of time)
108
+ // - cap = P1_CAP_TIME_SECONDS / slotSeconds (number of slots to reach cap)
109
+ // - weight = MAX_P1_SCORE / cap
110
+ //
111
+ // This ensures: max P1 = cap * weight = MAX_P1_SCORE
112
+ /** Maximum P1 score contribution per topic */ export const MAX_P1_SCORE = 8;
113
+ /** Time in seconds to reach P1 cap (1 hour) */ const P1_CAP_TIME_SECONDS = 3600;
114
+ // ============================================================================
115
+ // P2 (firstMessageDeliveries) Configuration
116
+ // ============================================================================
117
+ // P2 rewards peers who deliver messages first. We normalize so max P2 = MAX_P2_SCORE.
118
+ // P2 uses a decaying counter, so we set the cap based on convergence and scale the weight.
119
+ //
120
+ // Formula: P2 = min(firstMessageDeliveries, cap) * weight
121
+ // - cap = convergence value for first deliveries
122
+ // - weight = MAX_P2_SCORE / cap
123
+ /** Maximum P2 score contribution per topic */ export const MAX_P2_SCORE = 25;
124
+ /** Decay window for first message deliveries in slots (fast decay) */ const P2_DECAY_WINDOW_SLOTS = 2;
125
+ // ============================================================================
126
+ // P3 (meshMessageDeliveries) Configuration
127
+ // ============================================================================
128
+ // P3 penalizes peers who under-deliver messages. For a peer to be pruned from
129
+ // the mesh, their topic score must be negative: P1 + P2 + P3 < 0
130
+ //
131
+ // Therefore, P3 max penalty must exceed (P1 + P2) to cause pruning:
132
+ // |P3| > P1 + P2
133
+ // |P3| > 8 + 25 = 33
134
+ //
135
+ // We set P3 max = -34 per topic (slightly more than P1+P2) to ensure pruning.
136
+ // With 3 topics having P3 enabled, total P3b after pruning = -102.
137
+ //
138
+ // With appSpecificWeight=10, ~20 HighTolerance errors (-40 app score) plus max P3b (-102)
139
+ // would cross gossipThreshold (-500). This keeps non-contributors from being disconnected
140
+ // unless they also accrue app-level penalties.
141
+ //
142
+ // The weight formula ensures max penalty equals MAX_P3_PENALTY_PER_TOPIC:
143
+ // weight = MAX_P3_PENALTY_PER_TOPIC / threshold²
144
+ // When deficit = threshold: penalty = threshold² * weight = MAX_P3_PENALTY_PER_TOPIC
145
+ /** Maximum P3 penalty per topic (must exceed P1 + P2 to cause pruning) */ export const MAX_P3_PENALTY_PER_TOPIC = -(MAX_P1_SCORE + MAX_P2_SCORE + 1); // -34
146
+ /** Number of topics with P3 enabled in MBPS mode (block_proposal + checkpoint_proposal + checkpoint_attestation) */ export const NUM_P3_ENABLED_TOPICS = 3;
147
+ /** Total maximum P3b penalty across all topics after pruning in MBPS mode */ export const TOTAL_MAX_P3B_PENALTY = MAX_P3_PENALTY_PER_TOPIC * NUM_P3_ENABLED_TOPICS; // -102
148
+ /**
149
+ * Factory class for creating gossipsub topic scoring parameters.
150
+ * Computes shared values once and reuses them across all topics.
151
+ */ export class TopicScoreParamsFactory {
152
+ params;
153
+ /** Number of blocks per slot based on timetable configuration */ blocksPerSlot;
154
+ /** Decay factor for invalid message penalties (P4) */ invalidDecay;
155
+ /** Number of heartbeats per slot */ heartbeatsPerSlot;
156
+ /** P1: Time in mesh quantum (slot duration in ms - score increases by ~1 per slot) */ timeInMeshQuantum;
157
+ /** P1: Time in mesh cap (number of slots to reach max score) */ timeInMeshCap;
158
+ /** P1: Time in mesh weight (normalized so max P1 = MAX_P1_SCORE) */ timeInMeshWeight;
159
+ /** P2: First message deliveries decay factor */ firstMessageDeliveriesDecay;
160
+ /** P2: First message deliveries cap (convergence-based) */ firstMessageDeliveriesCap;
161
+ /** P2: First message deliveries weight (normalized so max P2 = MAX_P2_SCORE) */ firstMessageDeliveriesWeight;
162
+ /** Base parameters common to all topics */ baseParams;
163
+ constructor(params){
164
+ this.params = params;
165
+ const { slotDurationMs, heartbeatIntervalMs, blockDurationMs } = params;
166
+ // Compute values that are the same for all topics
167
+ this.blocksPerSlot = calculateBlocksPerSlot(slotDurationMs, blockDurationMs);
168
+ this.heartbeatsPerSlot = slotDurationMs / heartbeatIntervalMs;
169
+ this.invalidDecay = computeDecay(heartbeatIntervalMs, slotDurationMs, INVALID_DECAY_WINDOW_SLOTS);
170
+ // P1: timeInMesh - Lodestar style slot-based normalization
171
+ // quantum = slot duration, so score increases by ~1 per slot of mesh membership
172
+ // cap = number of slots in P1_CAP_TIME_SECONDS (1 hour)
173
+ // weight = MAX_P1_SCORE / cap, so max P1 = cap * weight = MAX_P1_SCORE
174
+ const slotDurationSeconds = slotDurationMs / 1000;
175
+ this.timeInMeshQuantum = slotDurationMs;
176
+ this.timeInMeshCap = P1_CAP_TIME_SECONDS / slotDurationSeconds;
177
+ this.timeInMeshWeight = MAX_P1_SCORE / this.timeInMeshCap;
178
+ // P2: firstMessageDeliveries - convergence-based cap with normalized weight
179
+ // Uses fast decay (2 slots) so it rewards recent first deliveries
180
+ // cap = convergence at 1 first delivery per heartbeat (theoretical max rate)
181
+ // weight = MAX_P2_SCORE / cap, so max P2 = cap * weight = MAX_P2_SCORE
182
+ this.firstMessageDeliveriesDecay = computeDecay(heartbeatIntervalMs, slotDurationMs, P2_DECAY_WINDOW_SLOTS);
183
+ // Convergence for 1 message per heartbeat (generous estimate for first deliveries)
184
+ this.firstMessageDeliveriesCap = computeConvergence(1, this.firstMessageDeliveriesDecay);
185
+ this.firstMessageDeliveriesWeight = MAX_P2_SCORE / this.firstMessageDeliveriesCap;
186
+ // Base params are identical for all topics
187
+ this.baseParams = {
188
+ topicWeight: 1,
189
+ invalidMessageDeliveriesWeight: INVALID_MESSAGE_WEIGHT,
190
+ invalidMessageDeliveriesDecay: this.invalidDecay,
191
+ // P1: timeInMesh (same for all topics)
192
+ timeInMeshQuantum: this.timeInMeshQuantum,
193
+ timeInMeshCap: this.timeInMeshCap,
194
+ timeInMeshWeight: this.timeInMeshWeight,
195
+ // P2: firstMessageDeliveries (same for all topics)
196
+ firstMessageDeliveriesDecay: this.firstMessageDeliveriesDecay,
197
+ firstMessageDeliveriesCap: this.firstMessageDeliveriesCap,
198
+ firstMessageDeliveriesWeight: this.firstMessageDeliveriesWeight
199
+ };
200
+ }
201
+ /**
202
+ * Creates scoring parameters for topics with unpredictable or zero message rates.
203
+ * Disables P1, P2, P3, and P3b to avoid unbalanced positive score accumulation.
204
+ *
205
+ * Rationale: If P1/P2 were enabled without P3, the topic would contribute free
206
+ * positive scores that could offset penalties from other topics, preventing
207
+ * proper mesh pruning of non-contributing peers.
208
+ */ createDisabledP3Params() {
209
+ return createTopicScoreParams({
210
+ topicWeight: 1,
211
+ // P1: timeInMesh - disabled (no free positive scores)
212
+ timeInMeshQuantum: 1,
213
+ timeInMeshCap: 0,
214
+ timeInMeshWeight: 0,
215
+ // P2: firstMessageDeliveries - disabled
216
+ firstMessageDeliveriesDecay: 0.5,
217
+ firstMessageDeliveriesCap: 0,
218
+ firstMessageDeliveriesWeight: 0,
219
+ // P3: meshMessageDeliveries - disabled
220
+ meshMessageDeliveriesWeight: 0,
221
+ meshMessageDeliveriesDecay: 0.5,
222
+ meshMessageDeliveriesThreshold: 0,
223
+ meshMessageDeliveriesWindow: 0,
224
+ meshMessageDeliveriesActivation: 0,
225
+ meshMessageDeliveriesCap: 0,
226
+ // P3b: meshFailurePenalty - disabled
227
+ meshFailurePenaltyWeight: 0,
228
+ meshFailurePenaltyDecay: 0.5,
229
+ // P4: invalidMessageDeliveries - still enabled for attack detection
230
+ invalidMessageDeliveriesWeight: INVALID_MESSAGE_WEIGHT,
231
+ invalidMessageDeliveriesDecay: this.invalidDecay
232
+ });
233
+ }
234
+ /**
235
+ * Creates scoring parameters for topics with predictable message rates.
236
+ * Enables P1, P2, P3, and P3b for balanced scoring.
237
+ *
238
+ * The scoring is designed so that:
239
+ * - P1 + P2 max = 8 + 25 = 33 (positive rewards for good behavior)
240
+ * - P3 max = -34 (penalty exceeds P1+P2 to ensure pruning of non-contributors)
241
+ * - After pruning: P1 resets, P2 decays, P3b persists with slow decay
242
+ *
243
+ * @param expectedPerSlot - Expected messages per slot
244
+ */ createEnabledP3Params(expectedPerSlot) {
245
+ const { slotDurationMs, heartbeatIntervalMs } = this.params;
246
+ // Calculate decay based on message frequency
247
+ const decayWindowSlots = getDecayWindowSlots(expectedPerSlot);
248
+ const decay = computeDecay(heartbeatIntervalMs, slotDurationMs, decayWindowSlots);
249
+ // Calculate convergence and threshold
250
+ const messagesPerHeartbeat = expectedPerSlot / this.heartbeatsPerSlot;
251
+ const convergence = computeConvergence(messagesPerHeartbeat, decay);
252
+ const threshold = computeThreshold(convergence, CONSERVATIVE_FACTOR);
253
+ // Cap factor: higher for high-volume topics
254
+ const capFactor = expectedPerSlot > 10 ? 8 : 4;
255
+ // P3 Weight: scaled so max penalty = MAX_P3_PENALTY_PER_TOPIC (-34)
256
+ // When deficit = threshold (peer delivers nothing):
257
+ // penalty = deficit² × weight = threshold² × (MAX_P3_PENALTY_PER_TOPIC / threshold²) = MAX_P3_PENALTY_PER_TOPIC
258
+ const meshDeliveriesWeight = threshold > 0 ? MAX_P3_PENALTY_PER_TOPIC / (threshold * threshold) : 0;
259
+ // Activation time: use the decay window multiplied by ACTIVATION_MULTIPLIER for extra grace
260
+ // during network bootstrap. The timer starts from mesh join time, not from first message,
261
+ // so peers joining before messages flow need extra time to accumulate counter values.
262
+ const activationMs = slotDurationMs * decayWindowSlots * ACTIVATION_MULTIPLIER;
263
+ return createTopicScoreParams({
264
+ ...this.baseParams,
265
+ // P3: meshMessageDeliveries
266
+ meshMessageDeliveriesWeight: meshDeliveriesWeight,
267
+ meshMessageDeliveriesDecay: decay,
268
+ meshMessageDeliveriesThreshold: threshold,
269
+ meshMessageDeliveriesWindow: MESH_DELIVERIES_WINDOW_MS,
270
+ meshMessageDeliveriesActivation: activationMs,
271
+ meshMessageDeliveriesCap: Math.max(threshold * capFactor, 2),
272
+ // P3b: meshFailurePenalty (same weight and decay as P3)
273
+ meshFailurePenaltyWeight: meshDeliveriesWeight,
274
+ meshFailurePenaltyDecay: decay
275
+ });
276
+ }
277
+ /**
278
+ * Creates topic score parameters for a specific topic type.
279
+ *
280
+ * @param topicType - The topic type
281
+ * @returns TopicScoreParams for the topic
282
+ */ createForTopic(topicType) {
283
+ const expectedPerSlot = getExpectedMessagesPerSlot(topicType, this.params.targetCommitteeSize, this.blocksPerSlot);
284
+ // For unpredictable topics (tx) or topics with 0 expected messages, disable P3/P3b
285
+ if (expectedPerSlot === undefined || expectedPerSlot === 0) {
286
+ return this.createDisabledP3Params();
287
+ }
288
+ return this.createEnabledP3Params(expectedPerSlot);
289
+ }
290
+ /**
291
+ * Creates all topic score parameters for gossipsub configuration.
292
+ *
293
+ * @param protocolVersion - Protocol version string for topic naming
294
+ * @returns Record mapping topic strings to their score parameters
295
+ */ createAll(protocolVersion) {
296
+ const topics = {};
297
+ for (const topicType of Object.values(TopicType)){
298
+ const topicString = createTopicString(topicType, protocolVersion);
299
+ topics[topicString] = this.createForTopic(topicType);
300
+ }
301
+ return topics;
302
+ }
303
+ }
304
+ /**
305
+ * Creates topic score parameters for a specific topic type.
306
+ * Convenience function that creates a factory internally.
307
+ *
308
+ * @param topicType - The topic type
309
+ * @param params - Network parameters for scoring calculation
310
+ * @returns TopicScoreParams for the topic
311
+ */ export function createTopicScoreParamsForTopic(topicType, params) {
312
+ const factory = new TopicScoreParamsFactory(params);
313
+ return factory.createForTopic(topicType);
314
+ }
315
+ /**
316
+ * Creates all topic score parameters for gossipsub configuration.
317
+ *
318
+ * @param protocolVersion - Protocol version string for topic naming
319
+ * @param params - Network parameters for scoring calculation
320
+ * @returns Record mapping topic strings to their score parameters
321
+ */ export function createAllTopicScoreParams(protocolVersion, params) {
322
+ const factory = new TopicScoreParamsFactory(params);
323
+ return factory.createAll(protocolVersion);
324
+ }
@@ -3,5 +3,6 @@ export * from './libp2p/libp2p_service.js';
3
3
  export * from './tx_provider.js';
4
4
  export * from './dummy_service.js';
5
5
  export * from './reqresp/index.js';
6
+ export * from './tx_file_store/index.js';
6
7
  export * from './tx_collection/index.js';
7
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMEJBQTBCLENBQUMifQ==
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywwQkFBMEIsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
@@ -3,4 +3,5 @@ export * from './libp2p/libp2p_service.js';
3
3
  export * from './tx_provider.js';
4
4
  export * from './dummy_service.js';
5
5
  export * from './reqresp/index.js';
6
+ export * from './tx_file_store/index.js';
6
7
  export * from './tx_collection/index.js';
@@ -17,4 +17,4 @@ export declare class P2PInstrumentation {
17
17
  recordMessageLatency(topicName: TopicType, timerOrMs: Timer | number): void;
18
18
  private aggregate;
19
19
  }
20
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zdHJ1bWVudGF0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi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