-
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
change(rpc): Avoid re-verifying transactions in blocks if those transactions are in the mempool #8951
Conversation
3633bb6
to
837c077
Compare
c902901
to
1d63b0e
Compare
e1a3691
to
e0861ec
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 like how the problem is resolved in this pull request. The code and logic looks good and the test too. I left a few minor and optional comments and a question.
e0861ec
to
4d16805
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 good, i already reviewed most of this code before.
Motivation
We want the transaction verifier to avoid re-verifying transactions for the block verifier that have already been verified for the mempool.
Closes #5674.
Solution
transaction_hash
andknown_outpoint_hashes
fields ontransaction::Request::Block
.try_find_verified_unmined_tx()
method on the transaction verifier which queries the mempool for the transaction, then checks that all of its dependencies are present in the set ofknown_outpoint_hashes
.Tests
skips_verification_of_block_transactions_in_mempool
testPR Author's Checklist
PR Reviewer's Checklist