Race condition causing a tx to be added to SubPool::Queued
instead of SubPool::Pending
#12287
Closed
1 task done
Labels
C-bug
An unexpected or incorrect behavior
S-needs-triage
This issue needs to be labelled
S-stale
This issue/PR is stale and will close with no further activity
Describe the bug
Look at this fn in
crates/transaction-pool/src/lib.rs
:Anything can happen between
self.validate(...)
andself.pool.add_transactions(...)
call. One possible scenario is:self.validate(...)
is called, returnsstate_nonce = 42
.self.pool.add_transactions
is called, use the oldstate_nonce
(42).This scenario causes the following the loop in
crates/transaction-pool/src/pool/txpool.rs
to break in the first iteration:As a result, the incoming transaction is added to
SubPool::Queued
instead ofSubPool::Pending
, which is a pre-condition to cause #12286.Steps to reproduce
Apply this change to
crates/transaction-pool/src/lib.rs
.Then, run some spammers to a lot of transactions.
Node logs
No response
Platform(s)
Mac (Apple Silicon)
What version/commit are you on?
v1.1.0
What database version are you on?
N/A
Which chain / network are you on?
N/A
What type of node are you running?
Archive (default)
What prune config do you use, if any?
No response
If you've built Reth from source, provide the full command you used
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: