fix(txpool): Preserve Rejected Insertion State - #4236
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019fb8af-13c3-700b-91e9-d81ed7e58c7c Co-authored-by: Amp <amp@ampcode.com>
🟡 Heimdall Review Status
|
Review SummaryThe changes are well-structured and correct. Both fixes address real side-effect bugs in the 2D nonce pool: Channelized path ( Nonce-free path ( Sidecar listeners ( Tests: Good coverage of the key invariants — stale nonce rejection leaves lane cursor, hashes, and sender IDs untouched; underpriced replacement preserves lane state; full listener channels stay subscribed while closed channels get cleaned up. No issues found. |
Summary
This makes rejected 2D nonce pool insertions side-effect free by completing stale nonce and replacement-price checks before mutating pool state. It also keeps bounded sidecar listeners subscribed when their channels are temporarily full, while still removing closed listeners. Regression tests cover lane cursors, sender identifiers, pool views, and listener delivery after backpressure.