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
mempool: Update fraud proof data. #2804
Merged
Merged
Conversation
This file contains 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
rstaudt2
force-pushed
the
mempool-fraud-proof
branch
from
November 13, 2021 15:23
dafbfb6
to
b881d57
Compare
davecgh
approved these changes
Nov 13, 2021
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 good. The tests offer great coverage and hit all possible combinations of updates. I also tested it locally on simnet with a few transactions to ensure they do in fact come back up of the RPC server with the updated information as expected.
chappjc
reviewed
Nov 13, 2021
rstaudt2
force-pushed
the
mempool-fraud-proof
branch
from
November 16, 2021 02:49
b881d57
to
29ad82a
Compare
This updates a mempool test to compare the values of hashes rather than the pointers as intended.
This updates the fraud proof data on transaction inputs as necessary when entering the mempool. The fraud proof data will ultimately get filled in properly when miners create a block template. However, ensuring that it is filled in properly when entering the mempool is beneficial so that it is correct when relaying the transaction or returning it from an RPC API.
This updates mempool to now set the check fraud proof flag to true for blockchain.CheckTransactionInputs since mempool now ensures that the fraud proof is correct for all transaction inputs prior to this check.
This adds a blockHeight parameter to the AddFakeUTXO test function so that it can be mocked rather than always being set to wire.NullBlockIndex.
This adds tests to validate that the fraud proof of transaction inputs is corrected as necessary when entering the mempool under a variety of conditions.
rstaudt2
force-pushed
the
mempool-fraud-proof
branch
from
November 16, 2021 03:46
29ad82a
to
d111bae
Compare
matheusd
approved these changes
Nov 16, 2021
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.
This is rebased on #2802.This updates the fraud proof data on transaction inputs as necessary when entering the mempool. The fraud proof data will ultimately get filled in properly when miners create a block template. However, ensuring that it is filled in properly when entering the mempool is beneficial so that it is correct when relaying the transaction or returning it from an RPC API.
Additionally, this updates mempool to now set the check fraud proof flag to true for
blockchain.CheckTransactionInputs
since mempool now ensures that the fraud proof is correct for all transaction inputs prior to this check.Finally, this adds tests to validate that the fraud proof of transaction inputs is corrected as necessary when entering the mempool under a variety of conditions.