Skip download and verification if the transaction is already in the mempool or state#2718
Merged
Conversation
teor2345
reviewed
Aug 31, 2021
c8ff41d to
32204e5
Compare
teor2345
reviewed
Sep 1, 2021
32204e5 to
380c381
Compare
3 tasks
oxarbitrage
reviewed
Sep 7, 2021
Contributor
oxarbitrage
left a comment
There was a problem hiding this comment.
I think it will be good to make the tests, the rest looks all good to me.
conradoplg
commented
Sep 8, 2021
Collaborator
Author
conradoplg
left a comment
There was a problem hiding this comment.
Addressed some comments, I won't touch the tests for now since @oxarbitrage offered to help with them as discussed in Discord (thanks!)
dconnolly
approved these changes
Sep 8, 2021
Contributor
dconnolly
left a comment
There was a problem hiding this comment.
I have left a comment that's non-blocking but just wanted to double-check, otherwise looks great!
oxarbitrage
approved these changes
Sep 8, 2021
dconnolly
approved these changes
Sep 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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