Merge bitcoin/bitcoin#17860: fuzz: BIP 30, CVE-2018-17144 #1145
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.
Backport of Bitcoin Core PR bitcoin#17860
Original Bitcoin PR: bitcoin#17860
Summary
This backport adds a validation fuzz test for BIP 30 and CVE-2018-17144, along with improvements to the test utility infrastructure.
Changes Included
fa2d8b61f9- fuzz: BIP 42, BIP 30, CVE-2018-17144 (MarcoFalke)faae7d5c00- Move LoadVerifyActivateChainstate to ChainTestingSetup (MarcoFalke)fa26e3462a- Avoid dereferencing interruption_point if it is nullptr (MarcoFalke)fa846ee074- test: Add util to mine invalid blocks (MarcoFalke)Dash-Specific Adaptations
MineBlock()to returnCOutPointinstead of using witness scriptsCScript() << OP_TRUE) instead of P2WSHLoadChainstateandVerifyLoadedChainstatefunction signaturesFiles Modified
src/Makefile.test.include- Added new fuzz test to build systemsrc/bench/block_assemble.cpp- Updated to use new MineBlock APIsrc/node/coinstats.cpp- Minor path update (kernel/coinstats.cpp)src/test/fuzz/tx_pool.cpp- Updated to use new MineBlock APIsrc/test/fuzz/utxo_total_supply.cpp- New fuzz test (adapted for Dash)src/test/util/mining.cpp- Enhanced block mining utilities with validation state trackingsrc/test/util/mining.h- Updated function signaturessrc/test/util/setup_common.cpp- Added LoadVerifyActivateChainstate() methodsrc/test/util/setup_common.h- Updated TestingSetup constructor signatureTesting Notes
src/test/andsrc/bench/)Backport Source: bitcoin/bitcoin@322ec63