-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip download and verification if the transaction is already in the mempool or state #2718
Conversation
c8ff41d
to
32204e5
Compare
32204e5
to
380c381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be good to make the tests, the rest looks all good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed some comments, I won't touch the tests for now since @oxarbitrage offered to help with them as discussed in Discord (thanks!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have left a comment that's non-blocking but just wanted to double-check, otherwise looks great!
Motivation
We should only download/verify a transaction if it's not already in the mempool or state.
Specifications
Designs
Solution
Pass a mempool reference to the downloader. Query mempool and state to skip download if applicable.
This adds a new request to the mempool to check if a tx was rejected.
Closes #2708
Review
Since this modifies the mempool instantiation and adds a new request, it would be good to review soon to avoid conflicts.
Reviewer Checklist
Follow Up Work
Handling pushed transactions in #2727