Repository navigation
Conversation
👁️ Cyclops Security Review✅ Reviewed 2c41e5f (latest) · Coverage: partial · no open findings · report |
There was a problem hiding this comment.
I reviewed the latest push and found no bugs. The follow-up commit fixes my earlier test nit: the new test now checks that the re-added tail is the one discarded. This changes pending-eviction policy in a crate with CODEOWNERS, so a human look is still worthwhile.
What was reviewed:
evict_2d_pending_tx: the pending run fromdescendant_txs(id)starts with the selected pending tx, solast()is always a pending tx in the same lane.remove_transaction_by_idupdates pending count and size and clears the independent entry only when head and tail are the same tx.- Dropping the second queued-limit pass in
discard(): neither path changes queued state any more. Removing a lane's tail demotes nothing, and expiring-nonce eviction never touched queued.demote_descendantsstill has another caller (line 1020), so it is not dead code. - Loop termination: every iteration removes one pending tx or breaks. A cheap head now causes its own lane to be removed from the tail end, which can discard more txs than the old remove-and-demote did (for example, all 5 attacker txs in the renamed test). Whether that trade-off is acceptable is a policy call for a human.
- Not done: I did not run
cargo +nightly fmtor the tests.
Extended reasoning...
The change touches only crates/transaction-pool/src/tt_2d_pool.rs. It changes how pending transactions are evicted in the AA 2D pool: the selected lane now loses its tail instead of losing the selected tx and demoting its descendants. The redundant queued-limit re-check is removed, and the tests are updated. It touches no auth, crypto or data-exposure code, and eviction policy is not consensus. Approval was ruled out because CODEOWNERS covers crates/transaction-pool/ and because this is a mempool eviction-policy decision. The earlier inline nit was addressed by commit 2c41e5f.
Pending eviction in the AA 2D pool removed the lowest-priority pending transaction wherever it sat in its lane and demoted every transaction after it, which were promoted again as soon as the gap was refilled.
Eviction now removes the last pending transaction of the selected lane, like the reth pool evicts a sender's highest nonce, so a lane's pending run stays contiguous and eviction never demotes. The extra queued-limit pass after pending eviction is no longer needed.