fix: Respect tx-pool suspend commands before popping verify tasks#5237
Conversation
Security ReviewResult: 1 confirmed finding Validation:
Notes:
|
| return; | ||
| } | ||
|
|
||
| self.refresh_status(); |
There was a problem hiding this comment.
I believe this 4 lines of change is redundant, since we have line of 111 and 116 in same block.
There was a problem hiding this comment.
or we should remove line 111 and 116 check?
There was a problem hiding this comment.
I think we should move L111 to L115?
There was a problem hiding this comment.
Moved the first status refresh after the exit-signal check. I kept the second refresh/check before pop_front, because is_empty().await can yield and a suspend command may arrive during that await; we need to re-read the watch state before taking a transaction from the queue.
…gnore-tx-pool-suspend-command
What problem does this PR solve?
Tx-pool verify workers cache the current chunk command in
self.status, but that cached status was only updated when the outertokio::select!received a command notification. If a queue notification triggered processing first, or if a suspend command arrived while the worker was already insideprocess_inner(), the worker could keep looping with a staleResumestatus and continue popping queued transactions. This weakened the suspend mechanism used during block processing and could let remote transaction traffic keep verification workers consuming CPU.What is changed and how it works?
Refresh the worker command status from the watch receiver before each
process_inner()iteration and again before popping a transaction from the verify queue. The command notification branch now usesborrow_and_update()to keep the receiver state consistent. With this change, a worker observes the latest Suspend command before taking more queued verification work.Related changes
owner/repo:Check List
Tests
Side effects