change(rpc): Avoid re-verifying transactions in blocks if those transactions are in the mempool - #8951
Merged
Merged
Conversation
arya2
force-pushed
the
avoid-reverifying-mined-mempool-txs
branch
from
October 19, 2024 05:10
3633bb6 to
837c077
Compare
arya2
force-pushed
the
avoid-reverifying-mined-mempool-txs
branch
from
November 19, 2024 06:09
c902901 to
1d63b0e
Compare
arya2
marked this pull request as ready for review
November 21, 2024 23:55
arya2
force-pushed
the
avoid-reverifying-mined-mempool-txs
branch
from
November 22, 2024 19:53
e1a3691 to
e0861ec
Compare
oxarbitrage
previously approved these changes
Nov 29, 2024
oxarbitrage
left a comment
Contributor
There was a problem hiding this comment.
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.
arya2
force-pushed
the
avoid-reverifying-mined-mempool-txs
branch
from
December 3, 2024 17:37
e0861ec to
4d16805
Compare
oxarbitrage
approved these changes
Dec 19, 2024
oxarbitrage
left a comment
Contributor
There was a problem hiding this comment.
looks good, i already reviewed most of this code before.
upbqdn
reviewed
Dec 21, 2024
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 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_hashandknown_outpoint_hashesfields 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_mempooltestPR Author's Checklist
PR Reviewer's Checklist