@aztec/p2p 0.0.1-commit.d3ec352c → 0.0.1-commit.fcb71a6

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 (152) hide show
  1. package/dest/client/factory.d.ts +2 -2
  2. package/dest/client/factory.d.ts.map +1 -1
  3. package/dest/client/factory.js +2 -3
  4. package/dest/client/p2p_client.d.ts +2 -2
  5. package/dest/client/p2p_client.d.ts.map +1 -1
  6. package/dest/client/p2p_client.js +17 -16
  7. package/dest/config.d.ts +4 -7
  8. package/dest/config.d.ts.map +1 -1
  9. package/dest/config.js +8 -11
  10. package/dest/mem_pools/attestation_pool/attestation_pool_test_suite.js +2 -2
  11. package/dest/mem_pools/attestation_pool/kv_attestation_pool.js +1 -1
  12. package/dest/mem_pools/attestation_pool/mocks.d.ts +3 -3
  13. package/dest/mem_pools/attestation_pool/mocks.d.ts.map +1 -1
  14. package/dest/mem_pools/attestation_pool/mocks.js +1 -1
  15. package/dest/mem_pools/instrumentation.d.ts +7 -1
  16. package/dest/mem_pools/instrumentation.d.ts.map +1 -1
  17. package/dest/mem_pools/instrumentation.js +29 -2
  18. package/dest/mem_pools/interface.d.ts +3 -4
  19. package/dest/mem_pools/interface.d.ts.map +1 -1
  20. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts +28 -24
  21. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.d.ts.map +1 -1
  22. package/dest/mem_pools/tx_pool/aztec_kv_tx_pool.js +262 -324
  23. package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts +18 -0
  24. package/dest/mem_pools/tx_pool/eviction/eviction_manager.d.ts.map +1 -0
  25. package/dest/mem_pools/tx_pool/eviction/eviction_manager.js +56 -0
  26. package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts +83 -0
  27. package/dest/mem_pools/tx_pool/eviction/eviction_strategy.d.ts.map +1 -0
  28. package/dest/mem_pools/tx_pool/eviction/eviction_strategy.js +5 -0
  29. package/dest/mem_pools/tx_pool/eviction/insufficient_fee_payer_balance_rule.d.ts +15 -0
  30. package/dest/mem_pools/tx_pool/eviction/insufficient_fee_payer_balance_rule.d.ts.map +1 -0
  31. package/dest/mem_pools/tx_pool/eviction/insufficient_fee_payer_balance_rule.js +88 -0
  32. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts +17 -0
  33. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.d.ts.map +1 -0
  34. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.js +84 -0
  35. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts +19 -0
  36. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.d.ts.map +1 -0
  37. package/dest/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.js +76 -0
  38. package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts +26 -0
  39. package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.d.ts.map +1 -0
  40. package/dest/mem_pools/tx_pool/eviction/low_priority_eviction_rule.js +84 -0
  41. package/dest/mem_pools/tx_pool/index.d.ts +1 -2
  42. package/dest/mem_pools/tx_pool/index.d.ts.map +1 -1
  43. package/dest/mem_pools/tx_pool/index.js +0 -1
  44. package/dest/mem_pools/tx_pool/priority.d.ts +5 -1
  45. package/dest/mem_pools/tx_pool/priority.d.ts.map +1 -1
  46. package/dest/mem_pools/tx_pool/priority.js +6 -1
  47. package/dest/mem_pools/tx_pool/tx_pool.d.ts +8 -4
  48. package/dest/mem_pools/tx_pool/tx_pool.d.ts.map +1 -1
  49. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts +1 -1
  50. package/dest/mem_pools/tx_pool/tx_pool_test_suite.d.ts.map +1 -1
  51. package/dest/mem_pools/tx_pool/tx_pool_test_suite.js +25 -20
  52. package/dest/msg_validators/attestation_validator/attestation_validator.js +1 -1
  53. package/dest/msg_validators/block_proposal_validator/block_proposal_validator.js +1 -1
  54. package/dest/msg_validators/tx_validator/archive_cache.d.ts +2 -2
  55. package/dest/msg_validators/tx_validator/archive_cache.d.ts.map +1 -1
  56. package/dest/msg_validators/tx_validator/block_header_validator.d.ts +2 -2
  57. package/dest/msg_validators/tx_validator/block_header_validator.d.ts.map +1 -1
  58. package/dest/msg_validators/tx_validator/factory.d.ts +2 -2
  59. package/dest/msg_validators/tx_validator/factory.d.ts.map +1 -1
  60. package/dest/msg_validators/tx_validator/factory.js +1 -1
  61. package/dest/msg_validators/tx_validator/metadata_validator.d.ts +2 -2
  62. package/dest/msg_validators/tx_validator/metadata_validator.d.ts.map +1 -1
  63. package/dest/msg_validators/tx_validator/test_utils.d.ts +2 -2
  64. package/dest/msg_validators/tx_validator/test_utils.d.ts.map +1 -1
  65. package/dest/services/encoding.js +1 -1
  66. package/dest/services/libp2p/libp2p_service.d.ts +4 -4
  67. package/dest/services/libp2p/libp2p_service.d.ts.map +1 -1
  68. package/dest/services/libp2p/libp2p_service.js +9 -14
  69. package/dest/services/peer-manager/metrics.d.ts +6 -1
  70. package/dest/services/peer-manager/metrics.d.ts.map +1 -1
  71. package/dest/services/peer-manager/metrics.js +17 -0
  72. package/dest/services/peer-manager/peer_manager.d.ts +1 -1
  73. package/dest/services/peer-manager/peer_manager.d.ts.map +1 -1
  74. package/dest/services/peer-manager/peer_manager.js +4 -2
  75. package/dest/services/reqresp/interface.d.ts +2 -2
  76. package/dest/services/reqresp/interface.d.ts.map +1 -1
  77. package/dest/services/reqresp/interface.js +1 -1
  78. package/dest/services/reqresp/protocols/auth.d.ts +2 -2
  79. package/dest/services/reqresp/protocols/auth.d.ts.map +1 -1
  80. package/dest/services/reqresp/protocols/auth.js +2 -2
  81. package/dest/services/reqresp/protocols/block.js +1 -1
  82. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts +2 -2
  83. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.d.ts.map +1 -1
  84. package/dest/services/reqresp/protocols/block_txs/block_txs_reqresp.js +1 -1
  85. package/dest/services/reqresp/protocols/tx.d.ts +2 -3
  86. package/dest/services/reqresp/protocols/tx.d.ts.map +1 -1
  87. package/dest/services/tx_collection/config.js +1 -1
  88. package/dest/services/tx_collection/slow_tx_collection.d.ts +3 -3
  89. package/dest/services/tx_collection/slow_tx_collection.d.ts.map +1 -1
  90. package/dest/services/tx_collection/tx_collection.d.ts +4 -4
  91. package/dest/services/tx_collection/tx_collection.d.ts.map +1 -1
  92. package/dest/services/tx_collection/tx_collection.js +1 -1
  93. package/dest/services/tx_provider.d.ts +2 -1
  94. package/dest/services/tx_provider.d.ts.map +1 -1
  95. package/dest/services/tx_provider.js +11 -2
  96. package/dest/services/tx_provider_instrumentation.d.ts +5 -2
  97. package/dest/services/tx_provider_instrumentation.d.ts.map +1 -1
  98. package/dest/services/tx_provider_instrumentation.js +14 -1
  99. package/dest/test-helpers/mock-tx-helpers.js +1 -1
  100. package/dest/test-helpers/reqresp-nodes.d.ts +2 -2
  101. package/dest/test-helpers/reqresp-nodes.d.ts.map +1 -1
  102. package/dest/testbench/p2p_client_testbench_worker.js +1 -0
  103. package/package.json +14 -14
  104. package/src/client/factory.ts +5 -10
  105. package/src/client/p2p_client.ts +26 -31
  106. package/src/config.ts +10 -16
  107. package/src/mem_pools/attestation_pool/attestation_pool_test_suite.ts +2 -2
  108. package/src/mem_pools/attestation_pool/kv_attestation_pool.ts +1 -1
  109. package/src/mem_pools/attestation_pool/mocks.ts +2 -2
  110. package/src/mem_pools/instrumentation.ts +33 -0
  111. package/src/mem_pools/interface.ts +2 -4
  112. package/src/mem_pools/tx_pool/README.md +255 -0
  113. package/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +309 -369
  114. package/src/mem_pools/tx_pool/eviction/eviction_manager.ts +71 -0
  115. package/src/mem_pools/tx_pool/eviction/eviction_strategy.ts +93 -0
  116. package/src/mem_pools/tx_pool/eviction/insufficient_fee_payer_balance_rule.ts +108 -0
  117. package/src/mem_pools/tx_pool/eviction/invalid_txs_after_mining_rule.ts +104 -0
  118. package/src/mem_pools/tx_pool/eviction/invalid_txs_after_reorg_rule.ts +91 -0
  119. package/src/mem_pools/tx_pool/eviction/low_priority_eviction_rule.ts +106 -0
  120. package/src/mem_pools/tx_pool/index.ts +0 -1
  121. package/src/mem_pools/tx_pool/priority.ts +8 -1
  122. package/src/mem_pools/tx_pool/tx_pool.ts +8 -3
  123. package/src/mem_pools/tx_pool/tx_pool_test_suite.ts +18 -13
  124. package/src/msg_validators/attestation_validator/attestation_validator.ts +1 -1
  125. package/src/msg_validators/block_proposal_validator/block_proposal_validator.ts +1 -1
  126. package/src/msg_validators/tx_validator/archive_cache.ts +1 -1
  127. package/src/msg_validators/tx_validator/block_header_validator.ts +1 -1
  128. package/src/msg_validators/tx_validator/factory.ts +1 -1
  129. package/src/msg_validators/tx_validator/metadata_validator.ts +1 -1
  130. package/src/msg_validators/tx_validator/test_utils.ts +1 -1
  131. package/src/services/encoding.ts +1 -1
  132. package/src/services/libp2p/libp2p_service.ts +14 -19
  133. package/src/services/peer-manager/metrics.ts +22 -0
  134. package/src/services/peer-manager/peer_manager.ts +4 -2
  135. package/src/services/reqresp/interface.ts +1 -1
  136. package/src/services/reqresp/protocols/auth.ts +2 -2
  137. package/src/services/reqresp/protocols/block.ts +1 -1
  138. package/src/services/reqresp/protocols/block_txs/block_txs_reqresp.ts +1 -1
  139. package/src/services/reqresp/protocols/tx.ts +1 -2
  140. package/src/services/tx_collection/config.ts +1 -1
  141. package/src/services/tx_collection/slow_tx_collection.ts +2 -2
  142. package/src/services/tx_collection/tx_collection.ts +4 -4
  143. package/src/services/tx_provider.ts +17 -2
  144. package/src/services/tx_provider_instrumentation.ts +19 -2
  145. package/src/test-helpers/mock-pubsub.ts +1 -1
  146. package/src/test-helpers/mock-tx-helpers.ts +1 -1
  147. package/src/test-helpers/reqresp-nodes.ts +1 -1
  148. package/src/testbench/p2p_client_testbench_worker.ts +2 -1
  149. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts +0 -81
  150. package/dest/mem_pools/tx_pool/memory_tx_pool.d.ts.map +0 -1
  151. package/dest/mem_pools/tx_pool/memory_tx_pool.js +0 -239
  152. package/src/mem_pools/tx_pool/memory_tx_pool.ts +0 -285
@@ -0,0 +1,255 @@
1
+ # Transaction Pool (Mempool)
2
+
3
+ This module implements the transaction pool (mempool) for the Aztec P2P network. The mempool holds unconfirmed transactions awaiting inclusion in a block.
4
+
5
+ ## Overview
6
+
7
+ The transaction pool serves as a staging area for transactions before they are included in blocks. It manages the lifecycle of transactions from initial submission through mining, handling duplicates, priority ordering, and eviction of invalid or low-priority transactions.
8
+
9
+ ## Interface: `TxPool`
10
+
11
+ The [`TxPool`](tx_pool.ts) interface defines the contract that all transaction pool implementations must fulfill:
12
+
13
+ ### Transaction Lifecycle
14
+
15
+ The lifecycle of transactions in the pool is summarised in the following table:
16
+
17
+ | State | Meaning | Possible Future States |
18
+ | --- | --- | --- |
19
+ | Pending | Available to be added to a block, can be evicted | Protected, Mined, Soft Deleted |
20
+ | Protected | Added to a proposal, must not be evicted | Mined, Pending |
21
+ | Mined | Confirmed as added to a block | Soft Deleted, Pending |
22
+ | Soft Deleted | Awaiting full deletion once state has been finalised on L1 | Pending, Deleted |
23
+ | Deleted | Removed from the pool | N/A |
24
+
25
+ **Note on why Soft Delete:**
26
+ Mined transactions are soft-deleted rather than permanently removed to support:
27
+ 1. Reorg handling — If a chain reorganization occurs, soft-deleted transactions are still available in the mempool
28
+ 2. Slash condition detection — The epoch prune watcher needs access to transactions from pruned epochs to correctly identify data withholding slash conditions. Without soft-delete, transactions invalidated by reorgs (e.g., built on removed blocks) would be lost, causing false positives for data withholding violations.
29
+
30
+ Mined transactions are permanently deleted via `cleanupDeletedMinedTxs()` once their original block is finalized on L1, ensuring theyremain available during the uncertainty window.
31
+ Alternatively, mined transactions can be permanently deleted immediately by passing the `permanent: true` option to `deleteTxs()`.
32
+
33
+ #### Transaction Lifecycle Methods
34
+
35
+ | Method | Description |
36
+ |--------|-------------|
37
+ | `addTxs(txs, opts?)` | Adds transactions to the pool. Duplicates are ignored. Returns count of newly added txs. |
38
+ | `deleteTxs(txHashes, opts?)` | Removes transactions from the pool. Supports soft-delete for mined txs. |
39
+ | `markAsMined(txHashes, blockHeader)` | Marks transactions as included in a block. |
40
+ | `markMinedAsPending(txHashes, blockNumber)` | Reverts mined transactions to pending (used during reorgs). |
41
+ | `getArchivedTxByHash(txHash)` | Retrieves archived (historical) transactions. |
42
+ | `getTxStatus(txHash)` | Returns status: `'pending'`, `'mined'`, `'deleted'`, or `undefined`. |
43
+
44
+ ### Transaction Fetching
45
+
46
+ | Method | Description |
47
+ |--------|-------------|
48
+ | `hasTx(txHash)` / `hasTxs(txHashes)` | Checks if transaction(s) exist in the pool. |
49
+ | `getTxByHash(txHash)` | Retrieves a transaction by its hash. |
50
+ | `getTxsByHash(txHashes)` | Batch retrieval of transactions by hash. |
51
+ | `getAllTxs()` / `getAllTxHashes()` | Returns all transactions or their hashes. |
52
+ | `getPendingTxHashes()` | Returns pending tx hashes **sorted by priority** (highest first). |
53
+ | `getPendingTxCount()` | Returns count of pending transactions. |
54
+ | `getMinedTxHashes()` | Returns mined tx hashes with their block numbers. |
55
+
56
+ ### Pool Management
57
+
58
+ | Method | Description |
59
+ |--------|-------------|
60
+ | `updateConfig(config)` | Updates pool configuration (max size, archive limit). |
61
+ | `markTxsAsNonEvictable(txHashes)` | Protects transactions from eviction. |
62
+ | `clearNonEvictableTxs()` | Clears non-evictable flag from all transactions. |
63
+ | `cleanupDeletedMinedTxs(blockNumber)` | Permanently removes soft-deleted txs from blocks ≤ blockNumber. |
64
+ | `isEmpty()` | Checks if the pool has no transactions. |
65
+
66
+ ### Events
67
+
68
+ The pool emits a `txs-added` event when new transactions are successfully added, allowing subscribers to react to pool changes.
69
+
70
+ ## `AztecKVTxPool`
71
+
72
+ The [`AztecKVTxPool`](aztec_kv_tx_pool.ts) is the production-grade implementation backed by a persistent key-value store. It provides:
73
+
74
+ - **Persistent storage** via `AztecAsyncKVStore`
75
+ - **Multiple indexes** for efficient queries
76
+ - **Automatic eviction** of invalid and low-priority transactions
77
+ - **Transaction archival** for historical lookups
78
+ - **Soft-delete semantics** for mined transactions
79
+
80
+ #### Storage Structure
81
+
82
+ The pool maintains several KV maps and indexes:
83
+
84
+ | Store | Purpose |
85
+ |-------|---------|
86
+ | `#txs` | Primary storage: tx hash → serialized tx buffer |
87
+ | `#minedTxHashToBlock` | Index of mined txs: tx hash → block number |
88
+ | `#pendingTxPriorityToHash` | Priority-ordered index of pending txs |
89
+ | `#deletedMinedTxHashes` | Soft-deleted mined txs: tx hash → original block number |
90
+ | `#blockToDeletedMinedTxHash` | Reverse index for cleanup: block → deleted tx hashes |
91
+ | `#txHashToHistoricalBlockHeaderHash` | Anchor block reference for each tx |
92
+ | `#historicalHeaderToTxHash` | Index from historical block → tx hashes |
93
+ | `#feePayerToTxHash` | Index from fee payer address → tx hashes |
94
+ | `#archivedTxs` | Archived transactions for historical lookup |
95
+
96
+ #### In-Memory Caches
97
+
98
+ | Cache | Purpose |
99
+ |-------|---------|
100
+ | `#pendingTxs` | Hydrated pending transactions for fast access |
101
+ | `#nonEvictableTxs` | Set of tx hashes protected from eviction |
102
+
103
+ ## Transaction Priority
104
+
105
+ Transactions are prioritized based on their **total priority fees** (see [`priority.ts`](priority.ts)):
106
+
107
+ ```typescript
108
+ priorityFee = maxPriorityFeesPerGas.feePerDaGas + maxPriorityFeesPerGas.feePerL2Gas
109
+ ```
110
+
111
+ The priority is stored as a hex string derived from a 32-byte buffer representation of the fee amount, enabling lexicographic ordering in the KV store. Pending transactions are returned in **descending priority order** (highest fees first).
112
+
113
+ ## Transaction Lifecycle in AztecKVTxPool
114
+
115
+ ### 1. Adding Transactions
116
+
117
+ When `addTxs()` is called:
118
+
119
+ 1. Check for duplicates (skip if tx already exists)
120
+ 2. Store the serialized tx in `#txs`
121
+ 3. Index the tx by its anchor block hash
122
+ 4. If not already mined, add to pending indexes:
123
+ - Priority-to-hash index (for ordering)
124
+ - Historical header index (for reorg handling)
125
+ - Fee payer index (for balance validation)
126
+ 5. Record metrics
127
+ 6. Trigger eviction rules for `TXS_ADDED` event
128
+ 7. Emit `txs-added` event
129
+
130
+ ### 2. Marking as Mined
131
+
132
+ When a block is finalized, `markAsMined()`:
133
+
134
+ 1. Move tx from pending to mined status
135
+ 2. If previously soft-deleted, restore to mined status
136
+ 3. Trigger eviction rules for `BLOCK_MINED` event
137
+
138
+ ### 3. Handling Reorgs
139
+
140
+ When blocks are pruned, `markMinedAsPending()`:
141
+
142
+ 1. Remove tx from mined index
143
+ 2. Rehydrate pending indexes
144
+ 3. Trigger eviction rules for `CHAIN_PRUNED` event
145
+
146
+ ### 4. Deleting Transactions
147
+
148
+ The `deleteTxs()` method handles two cases:
149
+
150
+ - **Pending transactions**: Permanently deleted (transactions and all indexes to the transaction)
151
+ - **Mined transactions**: Soft-deleted by default (moved to `#deletedMinedTxHashes`), with option for permanent deletion
152
+
153
+ Soft-deleted mined transactions are retained for potential future reference and can be permanently cleaned up later via `cleanupDeletedMinedTxs()`.
154
+
155
+ ## Eviction System
156
+
157
+ The eviction system automatically removes invalid or low-priority transactions based on configurable rules. See the [`eviction/`](eviction/) subdirectory for implementation details.
158
+
159
+ ### Architecture
160
+
161
+ ```
162
+ ┌─────────────────────────────────────────────────────────────────┐
163
+ │ EvictionManager │
164
+ │ Orchestrates eviction rules based on pool events │
165
+ ├─────────────────────────────────────────────────────────────────┤
166
+ │ │
167
+ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
168
+ │ │EvictionRule #1 │ │EvictionRule #2 │ │EvictionRule #N │ │
169
+ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
170
+ │ │
171
+ └─────────────────────────────────────────────────────────────────┘
172
+
173
+
174
+ ┌─────────────────┐
175
+ │ TxPoolOperations│
176
+ │ (interface) │
177
+ └─────────────────┘
178
+ ```
179
+
180
+ The [`EvictionManager`](eviction/eviction_manager.ts) coordinates eviction by:
181
+
182
+ 1. Registering multiple `EvictionRule` implementations
183
+ 2. Calling each rule when tx pool events occur
184
+ 3. Propagating configuration updates to all rules
185
+
186
+ ### Eviction Events
187
+
188
+ | Event | Trigger | Purpose |
189
+ |-------|---------|---------|
190
+ | `TXS_ADDED` | New transactions added | Enforce pool size limits |
191
+ | `BLOCK_MINED` | Block finalized | Remove invalidated transactions |
192
+ | `CHAIN_PRUNED` | Chain reorganization | Remove txs referencing pruned blocks |
193
+
194
+ ### Eviction Rules
195
+
196
+ #### 1. `InvalidTxsAfterMiningRule`
197
+
198
+ **Triggers on:** `BLOCK_MINED`
199
+
200
+ Evicts transactions that become invalid after a block is mined:
201
+
202
+ - Duplicate nullifiers: Txs with nullifiers already included in the mined block
203
+ - Expired transactions: Txs with `includeByTimestamp` ≤ mined block timestamp
204
+
205
+ #### 2. `InvalidTxsAfterReorgRule`
206
+
207
+ **Triggers on:** `CHAIN_PRUNED`
208
+
209
+ Evicts transactions that reference blocks no longer in the canonical chain:
210
+
211
+ - Checks each pending tx's anchor block hash against the archive tree
212
+ - Removes txs whose anchor blocks are not found (pruned)
213
+
214
+ #### 3. `InsufficientFeePayerBalanceRule`
215
+
216
+ **Triggers on:** `BLOCK_MINED`, `CHAIN_PRUNED`
217
+
218
+ Evicts transactions whose fee payer no longer has sufficient balance:
219
+
220
+ - Uses `GasTxValidator` to check fee payer balances against current world state
221
+
222
+ #### 4. `LowPriorityEvictionRule`
223
+
224
+ **Triggers on:** `TXS_ADDED`
225
+
226
+ Enforces maximum pool size by evicting lowest-priority (by fee) transactions:
227
+
228
+ - Configured via `maxPendingTxCount` option (0 = disabled)
229
+ - Uses `getLowestPriorityEvictable()` to find txs to evict
230
+
231
+ ### Non-Evictable Transactions
232
+
233
+ Transactions can be marked as non-evictable via `markTxsAsNonEvictable()`. This protects them from all eviction rules, typically used during block building to ensure transactions being processed aren't evicted mid-operation. The flag is cleared after block processing via `clearNonEvictableTxs()`.
234
+ The `clearNonEvictableTxs` is called upon getting new L2 block.
235
+
236
+ ## Configuration
237
+
238
+ The pool accepts configuration via `TxPoolOptions`:
239
+
240
+ ```typescript
241
+ type TxPoolOptions = {
242
+ maxPendingTxCount?: number; // Max pending txs (0 = unlimited)
243
+ archivedTxLimit?: number; // Number of archived txs to retain
244
+ };
245
+ ```
246
+
247
+ Configuration can be updated at runtime via `updateConfig()`.
248
+
249
+ ## Telemetry
250
+
251
+ The pool integrates with the telemetry system to report:
252
+
253
+ - Transaction counts (pending vs mined)
254
+ - Transaction sizes
255
+ - Store size estimates