@aztec/p2p 0.0.1-commit.cf93bcc56 → 0.0.1-commit.d1cd2107c

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 (246) hide show
  1. package/dest/client/factory.d.ts +5 -6
  2. package/dest/client/factory.d.ts.map +1 -1
  3. package/dest/client/factory.js +16 -26
  4. package/dest/client/interface.d.ts +8 -13
  5. package/dest/client/interface.d.ts.map +1 -1
  6. package/dest/client/p2p_client.d.ts +7 -13
  7. package/dest/client/p2p_client.d.ts.map +1 -1
  8. package/dest/client/p2p_client.js +29 -86
  9. package/dest/client/test/tx_proposal_collector/proposal_tx_collector_worker.js +6 -7
  10. package/dest/config.d.ts +22 -15
  11. package/dest/config.d.ts.map +1 -1
  12. package/dest/config.js +66 -37
  13. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts +1 -1
  14. package/dest/mem_pools/attestation_pool/attestation_pool.d.ts.map +1 -1
  15. package/dest/mem_pools/attestation_pool/attestation_pool.js +5 -1
  16. package/dest/mem_pools/instrumentation.d.ts +4 -2
  17. package/dest/mem_pools/instrumentation.d.ts.map +1 -1
  18. package/dest/mem_pools/instrumentation.js +16 -14
  19. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.js +1 -1
  20. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts +1 -1
  21. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.d.ts.map +1 -1
  22. package/dest/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.js +2 -0
  23. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts +7 -1
  24. package/dest/mem_pools/tx_pool_v2/eviction/interfaces.d.ts.map +1 -1
  25. package/dest/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.js +2 -2
  26. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts +2 -2
  27. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.d.ts.map +1 -1
  28. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.js +10 -6
  29. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts +1 -1
  30. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.d.ts.map +1 -1
  31. package/dest/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.js +8 -6
  32. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts +2 -2
  33. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.d.ts.map +1 -1
  34. package/dest/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.js +2 -2
  35. package/dest/mem_pools/tx_pool_v2/index.d.ts +2 -2
  36. package/dest/mem_pools/tx_pool_v2/index.d.ts.map +1 -1
  37. package/dest/mem_pools/tx_pool_v2/index.js +1 -1
  38. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts +12 -6
  39. package/dest/mem_pools/tx_pool_v2/interfaces.d.ts.map +1 -1
  40. package/dest/mem_pools/tx_pool_v2/interfaces.js +3 -1
  41. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts +40 -10
  42. package/dest/mem_pools/tx_pool_v2/tx_metadata.d.ts.map +1 -1
  43. package/dest/mem_pools/tx_pool_v2/tx_metadata.js +74 -16
  44. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts +1 -1
  45. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.d.ts.map +1 -1
  46. package/dest/mem_pools/tx_pool_v2/tx_pool_indices.js +26 -44
  47. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts +5 -3
  48. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.d.ts.map +1 -1
  49. package/dest/mem_pools/tx_pool_v2/tx_pool_v2.js +5 -2
  50. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts +6 -3
  51. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.d.ts.map +1 -1
  52. package/dest/mem_pools/tx_pool_v2/tx_pool_v2_impl.js +178 -140
  53. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts +6 -4
  54. package/dest/msg_validators/proposal_validator/block_proposal_validator.d.ts.map +1 -1
  55. package/dest/msg_validators/proposal_validator/block_proposal_validator.js +10 -2
  56. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts +6 -4
  57. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.d.ts.map +1 -1
  58. package/dest/msg_validators/proposal_validator/checkpoint_proposal_validator.js +16 -2
  59. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts +13 -8
  60. package/dest/msg_validators/proposal_validator/proposal_validator.d.ts.map +1 -1
  61. package/dest/msg_validators/proposal_validator/proposal_validator.js +48 -36
  62. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts +2 -2
  63. package/dest/msg_validators/tx_validator/aggregate_tx_validator.d.ts.map +1 -1
  64. package/dest/msg_validators/tx_validator/aggregate_tx_validator.js +3 -3
  65. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts +2 -1
  66. package/dest/msg_validators/tx_validator/allowed_public_setup.d.ts.map +1 -1
  67. package/dest/msg_validators/tx_validator/allowed_public_setup.js +24 -20
  68. package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts +17 -0
  69. package/dest/msg_validators/tx_validator/allowed_setup_helpers.d.ts.map +1 -0
  70. package/dest/msg_validators/tx_validator/allowed_setup_helpers.js +24 -0
  71. package/dest/msg_validators/tx_validator/factory.d.ts +114 -6
  72. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  73. package/dest/msg_validators/tx_validator/factory.js +219 -58
  74. package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts +1 -1
  75. package/dest/msg_validators/tx_validator/fee_payer_balance.d.ts.map +1 -1
  76. package/dest/msg_validators/tx_validator/fee_payer_balance.js +6 -2
  77. package/dest/msg_validators/tx_validator/gas_validator.d.ts +58 -3
  78. package/dest/msg_validators/tx_validator/gas_validator.d.ts.map +1 -1
  79. package/dest/msg_validators/tx_validator/gas_validator.js +73 -36
  80. package/dest/msg_validators/tx_validator/index.d.ts +3 -1
  81. package/dest/msg_validators/tx_validator/index.d.ts.map +1 -1
  82. package/dest/msg_validators/tx_validator/index.js +2 -0
  83. package/dest/msg_validators/tx_validator/metadata_validator.d.ts +1 -1
  84. package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
  85. package/dest/msg_validators/tx_validator/metadata_validator.js +4 -4
  86. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts +14 -0
  87. package/dest/msg_validators/tx_validator/nullifier_cache.d.ts.map +1 -0
  88. package/dest/msg_validators/tx_validator/nullifier_cache.js +24 -0
  89. package/dest/msg_validators/tx_validator/phases_validator.d.ts +2 -2
  90. package/dest/msg_validators/tx_validator/phases_validator.d.ts.map +1 -1
  91. package/dest/msg_validators/tx_validator/phases_validator.js +44 -23
  92. package/dest/services/dummy_service.d.ts +4 -4
  93. package/dest/services/dummy_service.d.ts.map +1 -1
  94. package/dest/services/dummy_service.js +4 -4
  95. package/dest/services/encoding.d.ts +2 -2
  96. package/dest/services/encoding.d.ts.map +1 -1
  97. package/dest/services/encoding.js +7 -7
  98. package/dest/services/gossipsub/topic_score_params.d.ts +18 -6
  99. package/dest/services/gossipsub/topic_score_params.d.ts.map +1 -1
  100. package/dest/services/gossipsub/topic_score_params.js +32 -10
  101. package/dest/services/libp2p/libp2p_service.d.ts +16 -13
  102. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  103. package/dest/services/libp2p/libp2p_service.js +84 -90
  104. package/dest/services/peer-manager/metrics.d.ts +3 -1
  105. package/dest/services/peer-manager/metrics.d.ts.map +1 -1
  106. package/dest/services/peer-manager/metrics.js +6 -0
  107. package/dest/services/peer-manager/peer_manager.d.ts +1 -1
  108. package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
  109. package/dest/services/peer-manager/peer_manager.js +2 -1
  110. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts +4 -3
  111. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.d.ts.map +1 -1
  112. package/dest/services/reqresp/batch-tx-requester/batch_tx_requester.js +19 -46
  113. package/dest/services/reqresp/batch-tx-requester/interface.d.ts +2 -6
  114. package/dest/services/reqresp/batch-tx-requester/interface.d.ts.map +1 -1
  115. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts +10 -13
  116. package/dest/services/reqresp/batch-tx-requester/missing_txs.d.ts.map +1 -1
  117. package/dest/services/reqresp/batch-tx-requester/missing_txs.js +25 -46
  118. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts +17 -11
  119. package/dest/services/reqresp/batch-tx-requester/peer_collection.d.ts.map +1 -1
  120. package/dest/services/reqresp/batch-tx-requester/peer_collection.js +49 -15
  121. package/dest/services/reqresp/batch-tx-requester/tx_validator.js +2 -2
  122. package/dest/services/reqresp/reqresp.d.ts +1 -1
  123. package/dest/services/reqresp/reqresp.d.ts.map +1 -1
  124. package/dest/services/reqresp/reqresp.js +2 -1
  125. package/dest/services/service.d.ts +5 -3
  126. package/dest/services/service.d.ts.map +1 -1
  127. package/dest/services/tx_collection/fast_tx_collection.d.ts +1 -1
  128. package/dest/services/tx_collection/fast_tx_collection.d.ts.map +1 -1
  129. package/dest/services/tx_collection/fast_tx_collection.js +39 -33
  130. package/dest/services/tx_collection/file_store_tx_collection.d.ts +1 -1
  131. package/dest/services/tx_collection/file_store_tx_collection.d.ts.map +1 -1
  132. package/dest/services/tx_collection/file_store_tx_collection.js +4 -2
  133. package/dest/services/tx_collection/file_store_tx_source.d.ts +4 -4
  134. package/dest/services/tx_collection/file_store_tx_source.d.ts.map +1 -1
  135. package/dest/services/tx_collection/file_store_tx_source.js +27 -16
  136. package/dest/services/tx_collection/missing_txs_tracker.d.ts +32 -0
  137. package/dest/services/tx_collection/missing_txs_tracker.d.ts.map +1 -0
  138. package/dest/services/tx_collection/missing_txs_tracker.js +27 -0
  139. package/dest/services/tx_collection/proposal_tx_collector.d.ts +7 -6
  140. package/dest/services/tx_collection/proposal_tx_collector.d.ts.map +1 -1
  141. package/dest/services/tx_collection/proposal_tx_collector.js +5 -4
  142. package/dest/services/tx_collection/slow_tx_collection.d.ts +2 -2
  143. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
  144. package/dest/services/tx_collection/slow_tx_collection.js +10 -8
  145. package/dest/services/tx_collection/tx_collection.d.ts +5 -4
  146. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  147. package/dest/services/tx_collection/tx_collection_sink.d.ts +6 -5
  148. package/dest/services/tx_collection/tx_collection_sink.d.ts.map +1 -1
  149. package/dest/services/tx_collection/tx_collection_sink.js +13 -22
  150. package/dest/services/tx_collection/tx_source.d.ts +8 -3
  151. package/dest/services/tx_collection/tx_source.d.ts.map +1 -1
  152. package/dest/services/tx_collection/tx_source.js +19 -2
  153. package/dest/services/tx_provider.d.ts +3 -3
  154. package/dest/services/tx_provider.d.ts.map +1 -1
  155. package/dest/services/tx_provider.js +4 -4
  156. package/dest/test-helpers/make-test-p2p-clients.d.ts +5 -6
  157. package/dest/test-helpers/make-test-p2p-clients.d.ts.map +1 -1
  158. package/dest/test-helpers/make-test-p2p-clients.js +1 -2
  159. package/dest/test-helpers/mock-pubsub.d.ts +4 -4
  160. package/dest/test-helpers/mock-pubsub.d.ts.map +1 -1
  161. package/dest/test-helpers/mock-pubsub.js +8 -2
  162. package/dest/test-helpers/reqresp-nodes.d.ts +2 -3
  163. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  164. package/dest/test-helpers/reqresp-nodes.js +2 -2
  165. package/dest/test-helpers/testbench-utils.d.ts +5 -3
  166. package/dest/test-helpers/testbench-utils.d.ts.map +1 -1
  167. package/dest/test-helpers/testbench-utils.js +1 -1
  168. package/dest/testbench/p2p_client_testbench_worker.d.ts +2 -2
  169. package/dest/testbench/p2p_client_testbench_worker.d.ts.map +1 -1
  170. package/dest/testbench/p2p_client_testbench_worker.js +13 -12
  171. package/dest/testbench/worker_client_manager.d.ts +3 -1
  172. package/dest/testbench/worker_client_manager.d.ts.map +1 -1
  173. package/dest/testbench/worker_client_manager.js +6 -2
  174. package/dest/util.d.ts +3 -3
  175. package/dest/util.d.ts.map +1 -1
  176. package/package.json +14 -14
  177. package/src/client/factory.ts +24 -47
  178. package/src/client/interface.ts +8 -13
  179. package/src/client/p2p_client.ts +34 -113
  180. package/src/client/test/tx_proposal_collector/proposal_tx_collector_worker.ts +20 -11
  181. package/src/config.ts +92 -43
  182. package/src/mem_pools/attestation_pool/attestation_pool.ts +5 -4
  183. package/src/mem_pools/instrumentation.ts +17 -13
  184. package/src/mem_pools/tx_pool_v2/README.md +9 -1
  185. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_eviction_rule.ts +1 -1
  186. package/src/mem_pools/tx_pool_v2/eviction/fee_payer_balance_pre_add_rule.ts +3 -0
  187. package/src/mem_pools/tx_pool_v2/eviction/interfaces.ts +11 -1
  188. package/src/mem_pools/tx_pool_v2/eviction/invalid_txs_after_reorg_rule.ts +2 -2
  189. package/src/mem_pools/tx_pool_v2/eviction/low_priority_eviction_rule.ts +10 -6
  190. package/src/mem_pools/tx_pool_v2/eviction/low_priority_pre_add_rule.ts +15 -6
  191. package/src/mem_pools/tx_pool_v2/eviction/nullifier_conflict_rule.ts +2 -1
  192. package/src/mem_pools/tx_pool_v2/index.ts +1 -1
  193. package/src/mem_pools/tx_pool_v2/interfaces.ts +11 -5
  194. package/src/mem_pools/tx_pool_v2/tx_metadata.ts +104 -19
  195. package/src/mem_pools/tx_pool_v2/tx_pool_indices.ts +29 -43
  196. package/src/mem_pools/tx_pool_v2/tx_pool_v2.ts +6 -3
  197. package/src/mem_pools/tx_pool_v2/tx_pool_v2_impl.ts +189 -141
  198. package/src/msg_validators/proposal_validator/block_proposal_validator.ts +14 -4
  199. package/src/msg_validators/proposal_validator/checkpoint_proposal_validator.ts +20 -7
  200. package/src/msg_validators/proposal_validator/proposal_validator.ts +63 -40
  201. package/src/msg_validators/tx_validator/README.md +115 -0
  202. package/src/msg_validators/tx_validator/aggregate_tx_validator.ts +3 -3
  203. package/src/msg_validators/tx_validator/allowed_public_setup.ts +22 -27
  204. package/src/msg_validators/tx_validator/allowed_setup_helpers.ts +31 -0
  205. package/src/msg_validators/tx_validator/factory.ts +353 -77
  206. package/src/msg_validators/tx_validator/fee_payer_balance.ts +6 -2
  207. package/src/msg_validators/tx_validator/gas_validator.ts +90 -27
  208. package/src/msg_validators/tx_validator/index.ts +2 -0
  209. package/src/msg_validators/tx_validator/metadata_validator.ts +12 -4
  210. package/src/msg_validators/tx_validator/nullifier_cache.ts +30 -0
  211. package/src/msg_validators/tx_validator/phases_validator.ts +51 -26
  212. package/src/services/dummy_service.ts +6 -6
  213. package/src/services/encoding.ts +5 -6
  214. package/src/services/gossipsub/README.md +29 -14
  215. package/src/services/gossipsub/topic_score_params.ts +49 -13
  216. package/src/services/libp2p/libp2p_service.ts +95 -96
  217. package/src/services/peer-manager/metrics.ts +7 -0
  218. package/src/services/peer-manager/peer_manager.ts +2 -1
  219. package/src/services/reqresp/batch-tx-requester/batch_tx_requester.ts +20 -48
  220. package/src/services/reqresp/batch-tx-requester/interface.ts +1 -5
  221. package/src/services/reqresp/batch-tx-requester/missing_txs.ts +23 -71
  222. package/src/services/reqresp/batch-tx-requester/peer_collection.ts +63 -24
  223. package/src/services/reqresp/batch-tx-requester/tx_validator.ts +2 -2
  224. package/src/services/reqresp/reqresp.ts +3 -1
  225. package/src/services/service.ts +11 -2
  226. package/src/services/tx_collection/fast_tx_collection.ts +51 -30
  227. package/src/services/tx_collection/file_store_tx_collection.ts +7 -3
  228. package/src/services/tx_collection/file_store_tx_source.ts +32 -19
  229. package/src/services/tx_collection/missing_txs_tracker.ts +52 -0
  230. package/src/services/tx_collection/proposal_tx_collector.ts +8 -7
  231. package/src/services/tx_collection/slow_tx_collection.ts +8 -9
  232. package/src/services/tx_collection/tx_collection.ts +4 -3
  233. package/src/services/tx_collection/tx_collection_sink.ts +15 -29
  234. package/src/services/tx_collection/tx_source.ts +22 -3
  235. package/src/services/tx_provider.ts +2 -2
  236. package/src/test-helpers/make-test-p2p-clients.ts +1 -3
  237. package/src/test-helpers/mock-pubsub.ts +13 -6
  238. package/src/test-helpers/reqresp-nodes.ts +3 -6
  239. package/src/test-helpers/testbench-utils.ts +2 -2
  240. package/src/testbench/p2p_client_testbench_worker.ts +22 -18
  241. package/src/testbench/worker_client_manager.ts +13 -5
  242. package/src/util.ts +8 -2
  243. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts +0 -23
  244. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.d.ts.map +0 -1
  245. package/dest/msg_validators/proposal_validator/proposal_validator_test_suite.js +0 -212
  246. package/src/msg_validators/proposal_validator/proposal_validator_test_suite.ts +0 -230
package/src/config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  type ConfigMappingsType,
3
3
  SecretValue,
4
+ bigintConfigHelper,
4
5
  booleanConfigHelper,
5
6
  getConfigFromMappings,
6
7
  getDefaultConfig,
@@ -10,7 +11,6 @@ import {
10
11
  secretStringConfigHelper,
11
12
  } from '@aztec/foundation/config';
12
13
  import { Fr } from '@aztec/foundation/curves/bn254';
13
- import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
14
14
  import { FunctionSelector } from '@aztec/stdlib/abi/function-selector';
15
15
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
16
16
  import {
@@ -20,6 +20,7 @@ import {
20
20
  chainConfigMappings,
21
21
  sharedSequencerConfigMappings,
22
22
  } from '@aztec/stdlib/config';
23
+ import { type DataStoreConfig, dataConfigMappings } from '@aztec/stdlib/kv-store';
23
24
 
24
25
  import {
25
26
  type BatchTxRequesterConfig,
@@ -38,7 +39,10 @@ export interface P2PConfig
38
39
  ChainConfig,
39
40
  TxCollectionConfig,
40
41
  TxFileStoreConfig,
41
- Pick<SequencerConfig, 'blockDurationMs'> {
42
+ Pick<SequencerConfig, 'blockDurationMs' | 'expectedBlockProposalsPerSlot' | 'maxTxsPerBlock'> {
43
+ /** Maximum transactions per block for validation. Overrides maxTxsPerBlock for gossip validation when set. */
44
+ validateMaxTxsPerBlock?: number;
45
+
42
46
  /** A flag dictating whether the P2P subsystem should be enabled. */
43
47
  p2pEnabled: boolean;
44
48
 
@@ -150,8 +154,8 @@ export interface P2PConfig
150
154
  /** The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb. */
151
155
  p2pStoreMapSizeKb?: number;
152
156
 
153
- /** Which calls are allowed in the public setup phase of a tx. */
154
- txPublicSetupAllowList: AllowedElement[];
157
+ /** Additional entries to extend the default setup allow list. */
158
+ txPublicSetupAllowListExtend: AllowedElement[];
155
159
 
156
160
  /** The maximum number of pending txs before evicting lower priority txs. */
157
161
  maxPendingTxCount: number;
@@ -173,10 +177,7 @@ export interface P2PConfig
173
177
  /** Whether transactions are disabled for this node. This means transactions will be rejected at the RPC and P2P layers. */
174
178
  disableTransactions: boolean;
175
179
 
176
- /** True to simulate discarding transactions. - For testing purposes only*/
177
- dropTransactions: boolean;
178
-
179
- /** The probability that a transaction is discarded. - For testing purposes only */
180
+ /** The probability that a transaction is discarded (0 = disabled). - For testing purposes only */
180
181
  dropTransactionsProbability: number;
181
182
 
182
183
  /** Whether to delete transactions from the pool after a reorg instead of moving them back to pending. */
@@ -193,11 +194,20 @@ export interface P2PConfig
193
194
 
194
195
  /** Minimum age (ms) a transaction must have been in the pool before it's eligible for block building. */
195
196
  minTxPoolAgeMs: number;
197
+
198
+ /** Minimum percentage fee increase required to replace an existing tx via RPC (0 = no bump). */
199
+ priceBumpPercentage: bigint;
196
200
  }
197
201
 
198
202
  export const DEFAULT_P2P_PORT = 40400;
199
203
 
200
204
  export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
205
+ validateMaxTxsPerBlock: {
206
+ env: 'VALIDATOR_MAX_TX_PER_BLOCK',
207
+ description:
208
+ 'Maximum transactions per block for validation. Overrides maxTxsPerBlock for gossip validation when set.',
209
+ parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
210
+ },
201
211
  p2pEnabled: {
202
212
  env: 'P2P_ENABLED',
203
213
  description: 'A flag dictating whether the P2P subsystem should be enabled.',
@@ -396,12 +406,13 @@ export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
396
406
  parseEnv: (val: string | undefined) => (val ? +val : undefined),
397
407
  description: 'The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKb.',
398
408
  },
399
- txPublicSetupAllowList: {
409
+ txPublicSetupAllowListExtend: {
400
410
  env: 'TX_PUBLIC_SETUP_ALLOWLIST',
401
411
  parseEnv: (val: string) => parseAllowList(val),
402
- description: 'The list of functions calls allowed to run in setup',
412
+ description:
413
+ 'Additional entries to extend the default setup allow list. Format: I:address:selector[:flags],C:classId:selector[:flags]. Flags: os (onlySelf), rn (rejectNullMsgSender), cl=N (calldataLength), joined with +.',
403
414
  printDefault: () =>
404
- 'AuthRegistry, FeeJuice.increase_public_balance, Token.increase_public_balance, FPC.prepare_fee',
415
+ 'Default: AuthRegistry._set_authorized, AuthRegistry.set_authorized, FeeJuice._increase_public_balance',
405
416
  },
406
417
  maxPendingTxCount: {
407
418
  env: 'P2P_MAX_PENDING_TX_COUNT',
@@ -430,11 +441,6 @@ export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
430
441
  description: 'Number of auth attempts to allow before peer is banned. Number is inclusive',
431
442
  ...numberConfigHelper(3),
432
443
  },
433
- dropTransactions: {
434
- env: 'P2P_DROP_TX',
435
- description: 'True to simulate discarding transactions. - For testing purposes only',
436
- ...booleanConfigHelper(false),
437
- },
438
444
  dropTransactionsProbability: {
439
445
  env: 'P2P_DROP_TX_CHANCE',
440
446
  description: 'The probability that a transaction is discarded (0 - 1). - For testing purposes only',
@@ -472,6 +478,12 @@ export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
472
478
  description: 'Minimum age (ms) a transaction must have been in the pool before it is eligible for block building.',
473
479
  ...numberConfigHelper(2_000),
474
480
  },
481
+ priceBumpPercentage: {
482
+ env: 'P2P_RPC_PRICE_BUMP_PERCENTAGE',
483
+ description:
484
+ 'Minimum percentage fee increase required to replace an existing tx via RPC. Even at 0%, replacement still requires paying at least 1 unit more.',
485
+ ...bigintConfigHelper(10n),
486
+ },
475
487
  ...sharedSequencerConfigMappings,
476
488
  ...p2pReqRespConfigMappings,
477
489
  ...batchTxRequesterConfigMappings,
@@ -529,13 +541,44 @@ export const bootnodeConfigMappings = pickConfigMappings(
529
541
  bootnodeConfigKeys,
530
542
  );
531
543
 
544
+ /**
545
+ * Parses a `+`-separated flags string into validation properties for an allow list entry.
546
+ * Supported flags: `os` (onlySelf), `rn` (rejectNullMsgSender), `cl=N` (calldataLength).
547
+ */
548
+ function parseFlags(
549
+ flags: string,
550
+ entry: string,
551
+ ): { onlySelf?: boolean; rejectNullMsgSender?: boolean; calldataLength?: number } {
552
+ const result: { onlySelf?: boolean; rejectNullMsgSender?: boolean; calldataLength?: number } = {};
553
+ for (const flag of flags.split('+')) {
554
+ if (flag === 'os') {
555
+ result.onlySelf = true;
556
+ } else if (flag === 'rn') {
557
+ result.rejectNullMsgSender = true;
558
+ } else if (flag.startsWith('cl=')) {
559
+ const n = parseInt(flag.slice(3), 10);
560
+ if (isNaN(n) || n < 0) {
561
+ throw new Error(
562
+ `Invalid allow list entry "${entry}": invalid calldataLength in flag "${flag}". Expected a non-negative integer.`,
563
+ );
564
+ }
565
+ result.calldataLength = n;
566
+ } else {
567
+ throw new Error(`Invalid allow list entry "${entry}": unknown flag "${flag}". Supported flags: os, rn, cl=N.`);
568
+ }
569
+ }
570
+ return result;
571
+ }
572
+
532
573
  /**
533
574
  * Parses a string to a list of allowed elements.
534
- * Each encoded is expected to be of one of the following formats
535
- * `I:${address}`
536
- * `I:${address}:${selector}`
537
- * `C:${classId}`
538
- * `C:${classId}:${selector}`
575
+ * Each entry is expected to be of one of the following formats:
576
+ * `I:${address}:${selector}` — instance (contract address) with function selector
577
+ * `C:${classId}:${selector}` — class with function selector
578
+ *
579
+ * An optional flags segment can be appended after the selector:
580
+ * `I:${address}:${selector}:${flags}` or `C:${classId}:${selector}:${flags}`
581
+ * where flags is a `+`-separated list of: `os` (onlySelf), `rn` (rejectNullMsgSender), `cl=N` (calldataLength).
539
582
  *
540
583
  * @param value The string to parse
541
584
  * @returns A list of allowed elements
@@ -548,31 +591,37 @@ export function parseAllowList(value: string): AllowedElement[] {
548
591
  }
549
592
 
550
593
  for (const val of value.split(',')) {
551
- const [typeString, identifierString, selectorString] = val.split(':');
552
- const selector = selectorString !== undefined ? FunctionSelector.fromString(selectorString) : undefined;
594
+ const trimmed = val.trim();
595
+ if (!trimmed) {
596
+ continue;
597
+ }
598
+ const [typeString, identifierString, selectorString, flagsString] = trimmed.split(':');
599
+
600
+ if (!selectorString) {
601
+ throw new Error(
602
+ `Invalid allow list entry "${trimmed}": selector is required. Expected format: I:address:selector or C:classId:selector`,
603
+ );
604
+ }
605
+
606
+ const selector = FunctionSelector.fromString(selectorString);
607
+ const flags = flagsString ? parseFlags(flagsString, trimmed) : {};
553
608
 
554
609
  if (typeString === 'I') {
555
- if (selector) {
556
- entries.push({
557
- address: AztecAddress.fromString(identifierString),
558
- selector,
559
- });
560
- } else {
561
- entries.push({
562
- address: AztecAddress.fromString(identifierString),
563
- });
564
- }
610
+ entries.push({
611
+ address: AztecAddress.fromString(identifierString),
612
+ selector,
613
+ ...flags,
614
+ });
565
615
  } else if (typeString === 'C') {
566
- if (selector) {
567
- entries.push({
568
- classId: Fr.fromHexString(identifierString),
569
- selector,
570
- });
571
- } else {
572
- entries.push({
573
- classId: Fr.fromHexString(identifierString),
574
- });
575
- }
616
+ entries.push({
617
+ classId: Fr.fromHexString(identifierString),
618
+ selector,
619
+ ...flags,
620
+ });
621
+ } else {
622
+ throw new Error(
623
+ `Invalid allow list entry "${trimmed}": unknown type "${typeString}". Expected "I" (instance) or "C" (class).`,
624
+ );
576
625
  }
577
626
  }
578
627
 
@@ -359,11 +359,10 @@ export class AttestationPool {
359
359
  }
360
360
 
361
361
  const address = sender.toString();
362
+ const ownKey = this.getAttestationKey(slotNumber, proposalId, address);
362
363
 
363
- await this.checkpointAttestations.set(
364
- this.getAttestationKey(slotNumber, proposalId, address),
365
- attestation.toBuffer(),
366
- );
364
+ await this.checkpointAttestations.set(ownKey, attestation.toBuffer());
365
+ this.metrics.trackMempoolItemAdded(ownKey);
367
366
 
368
367
  this.log.debug(`Added own checkpoint attestation for slot ${slotNumber} from ${address}`, {
369
368
  signature: attestation.signature.toString(),
@@ -429,6 +428,7 @@ export class AttestationPool {
429
428
  const attestationEndKey = new Fr(oldestSlot).toString();
430
429
  for await (const key of this.checkpointAttestations.keysAsync({ end: attestationEndKey })) {
431
430
  await this.checkpointAttestations.delete(key);
431
+ this.metrics.trackMempoolItemRemoved(key);
432
432
  numberOfAttestations++;
433
433
  }
434
434
 
@@ -526,6 +526,7 @@ export class AttestationPool {
526
526
 
527
527
  // Add the attestation
528
528
  await this.checkpointAttestations.set(key, attestation.toBuffer());
529
+ this.metrics.trackMempoolItemAdded(key);
529
530
 
530
531
  // Track this attestation in the per-signer-per-slot index for duplicate detection
531
532
  const slotSignerKey = this.getSlotSignerKey(slotNumber, signerAddress);
@@ -73,7 +73,7 @@ export class PoolInstrumentation<PoolObject extends Gossipable> {
73
73
  private defaultAttributes;
74
74
  private meter: Meter;
75
75
 
76
- private txAddedTimestamp: Map<bigint, number> = new Map<bigint, number>();
76
+ private mempoolItemAddedTimestamp: Map<bigint | string, number> = new Map<bigint | string, number>();
77
77
 
78
78
  constructor(
79
79
  telemetry: TelemetryClient,
@@ -114,22 +114,26 @@ export class PoolInstrumentation<PoolObject extends Gossipable> {
114
114
  }
115
115
 
116
116
  public transactionsAdded(transactions: Tx[]) {
117
- const timestamp = Date.now();
118
- for (const transaction of transactions) {
119
- this.txAddedTimestamp.set(transaction.txHash.toBigInt(), timestamp);
120
- }
117
+ transactions.forEach(tx => this.trackMempoolItemAdded(tx.txHash.toBigInt()));
121
118
  }
122
119
 
123
120
  public transactionsRemoved(hashes: Iterable<bigint> | Iterable<string>) {
124
- const timestamp = Date.now();
125
121
  for (const hash of hashes) {
126
- const key = BigInt(hash);
127
- const addedAt = this.txAddedTimestamp.get(key);
128
- if (addedAt !== undefined) {
129
- this.txAddedTimestamp.delete(key);
130
- if (addedAt < timestamp) {
131
- this.minedDelay.record(timestamp - addedAt);
132
- }
122
+ this.trackMempoolItemRemoved(BigInt(hash));
123
+ }
124
+ }
125
+
126
+ public trackMempoolItemAdded(key: bigint | string): void {
127
+ this.mempoolItemAddedTimestamp.set(key, Date.now());
128
+ }
129
+
130
+ public trackMempoolItemRemoved(key: bigint | string): void {
131
+ const timestamp = Date.now();
132
+ const addedAt = this.mempoolItemAddedTimestamp.get(key);
133
+ if (addedAt !== undefined) {
134
+ this.mempoolItemAddedTimestamp.delete(key);
135
+ if (addedAt < timestamp) {
136
+ this.minedDelay.record(timestamp - addedAt);
133
137
  }
134
138
  }
135
139
  }
@@ -158,7 +158,7 @@ Checked before adding a transaction to the pending pool:
158
158
 
159
159
  | Rule | Purpose |
160
160
  |------|---------|
161
- | `NullifierConflictRule` | Handles transactions with conflicting nullifiers. Higher priority tx wins. |
161
+ | `NullifierConflictRule` | Handles transactions with conflicting nullifiers. Higher priority tx wins. For RPC submissions, a configurable price bump percentage is required. |
162
162
  | `FeePayerBalancePreAddRule` | Ensures fee payer has sufficient balance for all their pending txs. |
163
163
  | `LowPriorityPreAddRule` | Rejects txs when pool is full and new tx has lowest priority. |
164
164
 
@@ -233,6 +233,14 @@ await pool.updateConfig({
233
233
  });
234
234
  ```
235
235
 
236
+ ### Price Bump (RPC Transaction Replacement)
237
+
238
+ When a transaction is submitted via RPC and clashes on nullifiers with an existing pool transaction, the incoming tx must pay at least `priceBumpPercentage`% more in priority fee (i.e. `>= existingFee + existingFee * bump / 100`) to replace it. This prevents spam via small fee increments. The same bump applies when the pool is full and the incoming tx needs to evict the lowest-priority tx.
239
+
240
+ - **Env var**: `P2P_RPC_PRICE_BUMP_PERCENTAGE` (default: 10)
241
+ - **Scope**: RPC submissions only. P2P gossip uses `comparePriority` (fee + hash tiebreaker) with no bump.
242
+ - Even with a 0% bump, a replacement tx must pay at least 1 unit more than the existing fee.
243
+
236
244
  ## Return Values
237
245
 
238
246
  ### AddTxsResult
@@ -34,7 +34,7 @@ export class FeePayerBalanceEvictionRule implements EvictionRule {
34
34
  }
35
35
 
36
36
  if (context.event === EvictionEvent.CHAIN_PRUNED) {
37
- await this.worldState.syncImmediate(context.blockNumber);
37
+ await this.worldState.syncImmediate();
38
38
  const feePayers = pool.getPendingFeePayers();
39
39
  return await this.evictForFeePayers(feePayers, this.worldState.getSnapshot(context.blockNumber), pool);
40
40
  }
@@ -35,6 +35,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
35
35
  // Create combined list with incoming tx
36
36
  const allTxs: Array<{
37
37
  txHash: string;
38
+ txHashBigInt: bigint;
38
39
  priorityFee: bigint;
39
40
  feeLimit: bigint;
40
41
  claimAmount: bigint;
@@ -42,6 +43,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
42
43
  }> = [
43
44
  ...existingTxs.map(t => ({
44
45
  txHash: t.txHash,
46
+ txHashBigInt: t.txHashBigInt,
45
47
  priorityFee: t.priorityFee,
46
48
  feeLimit: t.feeLimit,
47
49
  claimAmount: t.claimAmount,
@@ -49,6 +51,7 @@ export class FeePayerBalancePreAddRule implements PreAddRule {
49
51
  })),
50
52
  {
51
53
  txHash: incomingMeta.txHash,
54
+ txHashBigInt: incomingMeta.txHashBigInt,
52
55
  priorityFee: incomingMeta.priorityFee,
53
56
  feeLimit: incomingMeta.feeLimit,
54
57
  claimAmount: incomingMeta.claimAmount,
@@ -100,7 +100,15 @@ export type TxPoolRejectionError =
100
100
  availableBalance: bigint;
101
101
  feeLimit: bigint;
102
102
  }
103
- | { code: typeof TxPoolRejectionCode.NULLIFIER_CONFLICT; message: string; conflictingTxHash: string }
103
+ | {
104
+ code: typeof TxPoolRejectionCode.NULLIFIER_CONFLICT;
105
+ message: string;
106
+ conflictingTxHash: string;
107
+ /** Minimum fee needed to replace the conflicting tx (only set when price bump applies). */
108
+ minimumPriceBumpFee?: bigint;
109
+ /** Incoming tx's priority fee. */
110
+ txPriorityFee?: bigint;
111
+ }
104
112
  | { code: typeof TxPoolRejectionCode.INTERNAL_ERROR; message: string };
105
113
 
106
114
  /**
@@ -121,6 +129,8 @@ export interface PreAddResult {
121
129
  export interface PreAddContext {
122
130
  /** If true, compare priority fee only (no tx hash tiebreaker). Used for RPC submissions. */
123
131
  feeComparisonOnly?: boolean;
132
+ /** Percentage-based price bump required for tx replacement. Only set for RPC submissions. */
133
+ priceBumpPercentage?: bigint;
124
134
  }
125
135
 
126
136
  /**
@@ -45,8 +45,8 @@ export class InvalidTxsAfterReorgRule implements EvictionRule {
45
45
  txsByBlockHash.get(blockHashStr)!.push(meta.txHash);
46
46
  }
47
47
 
48
- // Ensure world state is synced to this block before accessing the snapshot
49
- await this.worldState.syncImmediate(context.blockNumber);
48
+ // Sync without a block number to ensure the world state processes the prune event.
49
+ await this.worldState.syncImmediate();
50
50
  const db = this.worldState.getSnapshot(context.blockNumber);
51
51
 
52
52
  // Check which blocks exist in the archive
@@ -5,7 +5,7 @@ import { EvictionEvent } from './interfaces.js';
5
5
 
6
6
  /**
7
7
  * Eviction rule that removes low-priority transactions when the pool exceeds configured limits.
8
- * Only triggers on TXS_ADDED events.
8
+ * Triggers on TXS_ADDED and CHAIN_PRUNED events.
9
9
  */
10
10
  export class LowPriorityEvictionRule implements EvictionRule {
11
11
  public readonly name = 'LowPriorityEviction';
@@ -18,7 +18,7 @@ export class LowPriorityEvictionRule implements EvictionRule {
18
18
  }
19
19
 
20
20
  async evict(context: EvictionContext, pool: PoolOperations): Promise<EvictionResult> {
21
- if (context.event !== EvictionEvent.TXS_ADDED) {
21
+ if (context.event !== EvictionEvent.TXS_ADDED && context.event !== EvictionEvent.CHAIN_PRUNED) {
22
22
  return {
23
23
  reason: 'low_priority',
24
24
  success: true,
@@ -51,15 +51,19 @@ export class LowPriorityEvictionRule implements EvictionRule {
51
51
  this.log.info(`Evicting low priority txs. Pending tx count above limit: ${currentTxCount} > ${this.maxPoolSize}`);
52
52
  const numberToEvict = currentTxCount - this.maxPoolSize;
53
53
  const txsToEvict = pool.getLowestPriorityPending(numberToEvict);
54
- const toEvictSet = new Set(txsToEvict);
55
- const numNewTxsEvicted = context.newTxHashes.filter(newTxHash => toEvictSet.has(newTxHash)).length;
56
54
 
57
55
  if (txsToEvict.length > 0) {
58
- this.log.info(`Evicted ${txsToEvict.length} low priority txs, including ${numNewTxsEvicted} newly added txs`);
56
+ if (context.event === EvictionEvent.TXS_ADDED) {
57
+ const toEvictSet = new Set(txsToEvict);
58
+ const numNewTxsEvicted = context.newTxHashes.filter(newTxHash => toEvictSet.has(newTxHash)).length;
59
+ this.log.info(`Evicted ${txsToEvict.length} low priority txs, including ${numNewTxsEvicted} newly added txs`);
60
+ } else {
61
+ this.log.info(`Evicted ${txsToEvict.length} low priority txs after chain prune`);
62
+ }
59
63
  await pool.deleteTxs(txsToEvict, this.name);
60
64
  }
61
65
 
62
- this.log.debug(`Evicted ${txsToEvict.length} low priority txs, including ${numNewTxsEvicted} newly added txs`, {
66
+ this.log.debug(`Evicted ${txsToEvict.length} low priority txs`, {
63
67
  txHashes: txsToEvict,
64
68
  });
65
69
 
@@ -1,6 +1,6 @@
1
1
  import { createLogger } from '@aztec/foundation/log';
2
2
 
3
- import { type TxMetaData, comparePriority } from '../tx_metadata.js';
3
+ import { type TxMetaData, comparePriority, getMinimumPriceBumpFee } from '../tx_metadata.js';
4
4
  import {
5
5
  type EvictionConfig,
6
6
  type PreAddContext,
@@ -48,10 +48,14 @@ export class LowPriorityPreAddRule implements PreAddRule {
48
48
  }
49
49
 
50
50
  // Compare incoming tx against lowest priority tx.
51
- // feeOnly mode (RPC): use strict fee comparison only — avoids churn from hash ordering
52
- // Default (gossip): use full comparePriority (fee + tx hash tiebreaker) for determinism
51
+ // feeOnly mode (RPC): use strict fee comparison only — avoids churn from hash ordering.
52
+ // When price bump is also set, require the bumped fee threshold.
53
+ // Default (gossip): use full comparePriority (fee + tx hash tiebreaker) for determinism.
53
54
  const isHigherPriority = context?.feeComparisonOnly
54
- ? incomingMeta.priorityFee > lowestPriorityMeta.priorityFee
55
+ ? context.priceBumpPercentage !== undefined
56
+ ? incomingMeta.priorityFee >=
57
+ getMinimumPriceBumpFee(lowestPriorityMeta.priorityFee, context.priceBumpPercentage)
58
+ : incomingMeta.priorityFee > lowestPriorityMeta.priorityFee
55
59
  : comparePriority(incomingMeta, lowestPriorityMeta) > 0;
56
60
 
57
61
  if (isHigherPriority) {
@@ -66,6 +70,11 @@ export class LowPriorityPreAddRule implements PreAddRule {
66
70
  }
67
71
 
68
72
  // Incoming tx has equal or lower priority - ignore it (it would be evicted anyway)
73
+ const minimumFee =
74
+ context?.feeComparisonOnly && context.priceBumpPercentage !== undefined
75
+ ? getMinimumPriceBumpFee(lowestPriorityMeta.priorityFee, context.priceBumpPercentage)
76
+ : lowestPriorityMeta.priorityFee + 1n;
77
+
69
78
  this.log.debug(
70
79
  `Pool at capacity (${currentCount}/${this.maxPoolSize}), ignoring ${incomingMeta.txHash} ` +
71
80
  `(priority ${incomingMeta.priorityFee}) - lower than existing minimum (priority ${lowestPriorityMeta.priorityFee})`,
@@ -75,8 +84,8 @@ export class LowPriorityPreAddRule implements PreAddRule {
75
84
  txHashesToEvict: [],
76
85
  reason: {
77
86
  code: TxPoolRejectionCode.LOW_PRIORITY_FEE,
78
- message: `Tx does not meet minimum priority fee. Required: ${lowestPriorityMeta.priorityFee + 1n}, got: ${incomingMeta.priorityFee}`,
79
- minimumPriorityFee: lowestPriorityMeta.priorityFee + 1n,
87
+ message: `Tx does not meet minimum priority fee. Required: ${minimumFee}, got: ${incomingMeta.priorityFee}`,
88
+ minimumPriorityFee: minimumFee,
80
89
  txPriorityFee: incomingMeta.priorityFee,
81
90
  },
82
91
  });
@@ -15,11 +15,12 @@ export class NullifierConflictRule implements PreAddRule {
15
15
 
16
16
  private log = createLogger('p2p:tx_pool_v2:nullifier_conflict_rule');
17
17
 
18
- check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess, _context?: PreAddContext): Promise<PreAddResult> {
18
+ check(incomingMeta: TxMetaData, poolAccess: PreAddPoolAccess, context?: PreAddContext): Promise<PreAddResult> {
19
19
  const result = checkNullifierConflict(
20
20
  incomingMeta,
21
21
  nullifier => poolAccess.getTxHashByNullifier(nullifier),
22
22
  txHash => poolAccess.getMetadata(txHash),
23
+ context?.priceBumpPercentage,
23
24
  );
24
25
 
25
26
  if (result.shouldIgnore) {
@@ -7,6 +7,6 @@ export {
7
7
  type PoolReadAccess,
8
8
  DEFAULT_TX_POOL_V2_CONFIG,
9
9
  } from './interfaces.js';
10
- export { type TxMetaData, type TxState, buildTxMetaData, comparePriority } from './tx_metadata.js';
10
+ export { type TxMetaData, type TxState, buildTxMetaData, comparePriority, stubTxMetaData } from './tx_metadata.js';
11
11
  export { TxArchive } from './archive/index.js';
12
12
  export { DeletedPool } from './deleted_pool.js';
@@ -44,6 +44,10 @@ export type TxPoolV2Config = {
44
44
  minTxPoolAgeMs: number;
45
45
  /** Maximum number of evicted tx hashes to remember for metrics tracking */
46
46
  evictedTxCacheSize: number;
47
+ /** The probability (0-1) that a transaction is discarded. 0 disables dropping. For testing purposes only. */
48
+ dropTransactionsProbability: number;
49
+ /** Minimum percentage fee increase required to replace an existing tx via RPC (0 = no bump). */
50
+ priceBumpPercentage: bigint;
47
51
  };
48
52
 
49
53
  /**
@@ -54,6 +58,8 @@ export const DEFAULT_TX_POOL_V2_CONFIG: TxPoolV2Config = {
54
58
  archivedTxLimit: 0, // 0 = disabled
55
59
  minTxPoolAgeMs: 2_000,
56
60
  evictedTxCacheSize: 10_000,
61
+ dropTransactionsProbability: 0,
62
+ priceBumpPercentage: 10n,
57
63
  };
58
64
 
59
65
  /**
@@ -107,12 +113,12 @@ export interface TxPoolV2 extends TypedEventEmitter<TxPoolV2Events> {
107
113
  addPendingTxs(txs: Tx[], opts?: { source?: string; feeComparisonOnly?: boolean }): Promise<AddTxsResult>;
108
114
 
109
115
  /**
110
- * Checks if a transaction can be added without modifying the pool.
111
- * Performs the same validation as addPendingTxs but doesn't persist changes.
116
+ * Checks if the pool would accept a transaction without modifying state.
117
+ * Used as a pre-check before expensive proof verification.
112
118
  * @param tx - Transaction to check
113
- * @returns Result: 'accepted', 'ignored' (if already in pool or undesirable), or 'rejected' (if validation fails)
119
+ * @returns 'accepted' if the pool would accept, 'ignored' if already in pool or undesirable
114
120
  */
115
- canAddPendingTx(tx: Tx): Promise<'accepted' | 'ignored' | 'rejected'>;
121
+ canAddPendingTx(tx: Tx): Promise<'accepted' | 'ignored'>;
116
122
 
117
123
  /**
118
124
  * Adds transactions as immediately protected for a given slot.
@@ -165,7 +171,7 @@ export interface TxPoolV2 extends TypedEventEmitter<TxPoolV2Events> {
165
171
  * and validates them before returning to pending.
166
172
  * @param latestBlock - The latest valid block ID after the prune
167
173
  */
168
- handlePrunedBlocks(latestBlock: L2BlockId): Promise<void>;
174
+ handlePrunedBlocks(latestBlock: L2BlockId, options?: { deleteAllTxs?: boolean }): Promise<void>;
169
175
 
170
176
  /**
171
177
  * Handles failed transaction execution.