-
Notifications
You must be signed in to change notification settings - Fork 120
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
Send mined transaction IDs to the download/verify task for cancellation #2786
Conversation
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.
This looks like a well-structured PR.
I think I've mostly commented about performance issues you're already aware of.
Happy to re-review after #2777 merges.
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.
Answered some comments, but will still work further on this
3239f9c
to
eba7315
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.
b973272
to
13bc5d2
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.
Looks great!
The new code is readable and efficient, and the tests check that it works.
Motivation
When a block is mined, there is no reason for the mempool to keep downloading/verifying transactions with the same ID, since they won't be mined again. Therefore, cancel any downloads with those IDs.
Specifications
Designs
Solution
Use
ChainTipChange
to check when a block was mined and for each of its transactions, cancel any outstanding download/verify tasks for that txid.Closes #2711
Review
This is a draft for now because it may depend on #2777
It's also lacking tests.
Reviewer Checklist
Follow Up Work