You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(mempool): tip-based eviction and nonce-ordered lanes #1123
Follow-ups from the tip-ordered mempool in #880. Two related gaps:
1. No tip-based eviction. A full pool rejects every arrival, whatever its tip. Zero-tip transactions can fill the pool and keep any higher bid out, so tip ordering does not hold under load. The pool cannot evict at admission today: MemPoolHandle is only a channel sender and does not see what the pool holds.
2. Lanes follow arrival order, not nonce. If a signer's nonce n+1 arrives before nonce n, it heads the lane, fails the nonce check and is dropped. This now happens routinely: resubmit_orphaned puts reorged transactions back with try_push, at the back. If Alice's orphaned nonce 5 comes back after her nonce 6 is already in the pool, nonce 6 is dropped.
Why they are coupled
Ordering lanes by nonce can deadlock with several signers:
tx1: {Alice: 0, Bob: 1}
tx2: {Alice: 1, Bob: 0}
Each waits on the other, so both would stay in the pool for ever. Ordering by arrival avoids this by dropping on mismatch. Ordering by nonce needs eviction or expiry to clear such transactions.
Open questions
Admission semantics. With eviction, a transaction that was accepted can be dropped later. Is that acceptable for RPC and gossip submitters? Should the RPC say "queued" rather than "accepted"?
Admission access. Share the pool behind a lock so admission can compare against what it holds, or enforce a minimum tip at admission once the pool passes a high-water mark?
Activity