Repository navigation
fuzz: Fuzzing harnesses for ActivateBestChainStep and ActivateBestChain - #34895
RobinDavid wants to merge 2 commits into
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34895. ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
Possible places where named args for integral literals may be used (e.g.
2026-04-08 21:45:47 |
68cb3c1 to
392fac5
Compare
|
@marcofleon were you planning to pick this up as well? |
|
Yes |
|
Will close for now. |
2777300 fuzz: Implement connect_block harness (Robin David) 40add91 test: Add reset to CuckooCache (Eugene Siegel) Pull request description: Adds a fuzz target that directly calls `ConnectBlock` with `fJustCheck` set to true, so it hits block/transaction validation without writing undo data or updating the chainstate. This PR is essentially #34651 with some minor tweaks and style cleanups. Additional validation harnesses (e.g. #34895) could build on this test's setup. ACKs for top commit: Crypt-iQ: ACK 2777300 nervana21: tACK 2777300 Tree-SHA512: e2dc74154a6e29e0f3eaec9caeeec53d64bcc96adb0d1739281da97712dd931c3937eaf71f977bfc9c9330f26e35b3633f72788143b76e24e17c37b0a4258ba4
2777300c68f575565dabdcef4d0498ebc91a401e fuzz: Implement connect_block harness (Robin David) 40add915be5c5d204d85474a2704362cb635ef6d test: Add reset to CuckooCache (Eugene Siegel) Pull request description: Adds a fuzz target that directly calls `ConnectBlock` with `fJustCheck` set to true, so it hits block/transaction validation without writing undo data or updating the chainstate. This PR is essentially bitcoin/bitcoin#34651 with some minor tweaks and style cleanups. Additional validation harnesses (e.g. bitcoin/bitcoin#34895) could build on this test's setup. ACKs for top commit: Crypt-iQ: ACK 2777300c68f575565dabdcef4d0498ebc91a401e nervana21: tACK 2777300c68f575565dabdcef4d0498ebc91a401e Tree-SHA512: e2dc74154a6e29e0f3eaec9caeeec53d64bcc96adb0d1739281da97712dd931c3937eaf71f977bfc9c9330f26e35b3633f72788143b76e24e17c37b0a4258ba4
Hi Bitcoin Core maintainers.
This PR is the second part of #34651 and provides the following two fuzzing harnesses:
activate_best_chain_step: Test the ActivateBestChainStep() function responsible of activatingthe most worked-chain (not selecting it). The harness is written in a way that enable the fuzzer
triggering a chain reorganization if it generates two valid branches.
activate_best_chain: Test the ActivateBestChain() function responsible of selecting and activatingthe most worked-chain.
In the two later harnesses, some internal state cleaning is required to avoid non-reproducibility issues.
Also they might produce file artifacts on disk by means of writing blocks.
These two harnesses are built upon the
connect_blockharness thus the PR shall be merged first.These harnesses enables improving function coverage on
ActivateBestChainStep,removeForBlockand tocover function uncovered by fuzzing at the time of fuzzing harness development (mid-2025).
Functions newly covered include
DisconnectTip,DisconnectBlock,ApplyTxInUndo,MaybeUpdateMempoolForReorg,removeForReorgetc.Authored by @RobinDavid and @nsurbay
(note shall be rebased on the other PR so that it only contains 1 commit)