`fatxpool`: size limits implemented (#6262)
This PR adds size-limits to the fork-aware transaction pool. **Review Notes** - Existing [`TrackedMap`](https://github.com/paritytech/polkadot-sdk/blob/58fd5ae4/substrate/client/transaction-pool/src/graph/tracked_map.rs#L33-L41) is used in internal mempool to track the size of extrinsics: https://github.com/paritytech/polkadot-sdk/blob/58fd5ae4 /substrate/client/transaction-pool/src/graph/tracked_map.rs#L33-L41 - In this PR, I also removed the logic that kept transactions in the `tx_mem_pool` if they were immediately dropped by the views. Initially, I implemented this as an improvement: if there was available space in the _mempool_ and all views dropped the transaction upon submission, the transaction would still be retained in the _mempool_. However, upon further consideration, I decided to remove this functionality to reduce unnecessary complexity. Now, when all views drop a transaction during submission, it is automatically rejected, with the `submit/submit_and_watch` call returning `ImmediatelyDropped`. Closes: #5476 --------- Co-authored-by:Sebastian Kunert <skunert49@gmail.com> Co-authored-by:
Bastian Köcher <git@kchr.de>
parent
b601d57a
Showing
- prdoc/pr_6262.prdoc 10 additions, 0 deletionsprdoc/pr_6262.prdoc
- substrate/client/transaction-pool/src/fork_aware_txpool/dropped_watcher.rs 6 additions, 115 deletions...transaction-pool/src/fork_aware_txpool/dropped_watcher.rs
- substrate/client/transaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs 24 additions, 54 deletions...ansaction-pool/src/fork_aware_txpool/fork_aware_txpool.rs
- substrate/client/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs 107 additions, 46 deletions...ent/transaction-pool/src/fork_aware_txpool/tx_mem_pool.rs
- substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs 5 additions, 14 deletions...ient/transaction-pool/src/fork_aware_txpool/view_store.rs
- substrate/client/transaction-pool/src/graph/mod.rs 1 addition, 1 deletionsubstrate/client/transaction-pool/src/graph/mod.rs
- substrate/client/transaction-pool/src/graph/tracked_map.rs 24 additions, 4 deletionssubstrate/client/transaction-pool/src/graph/tracked_map.rs
- substrate/client/transaction-pool/tests/fatp_common/mod.rs 2 additions, 2 deletionssubstrate/client/transaction-pool/tests/fatp_common/mod.rs
- substrate/client/transaction-pool/tests/fatp_limits.rs 377 additions, 87 deletionssubstrate/client/transaction-pool/tests/fatp_limits.rs
Please register or sign in to comment