fix: Spammer nonce issue #120
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the previous implementation of spammer, when the max queued limit is hit, processing of any transaction is stopped.
The root cause is in this Reth function. It drops the tx from the sender until the pool is under the limit, which creates a gap in our nonce, and doesn't return any errors.
The PR resolves this issue through an asynchronous status checker for pool size, which will reset the nonce once it detects a mismatch with the expected one.
Note: It can happen that after spamming some tx stay in the pool, but that's because the timeout stopped the algorithm. As soon as the spam runs with the same signer again, they will continue to be processed.