feat(fuzz): add fuzzing harness for LocalChain with CI job - #2239
feat(fuzz): add fuzzing harness for LocalChain with CI job#2239erickcestari wants to merge 2 commits into
LocalChain with CI job#2239Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2239 +/- ##
==========================================
- Coverage 78.36% 78.31% -0.05%
==========================================
Files 30 30
Lines 5945 5950 +5
Branches 281 283 +2
==========================================
+ Hits 4659 4660 +1
- Misses 1210 1213 +3
- Partials 76 77 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
It's still missing an updated CI, fixing the conflicts and running each target+harness for an |
|
@erickcestari needs rebase |
5b47b5a to
502a20a
Compare
8f4d293 to
f508347
Compare
|
Put |
Co-authored-by: Leonardo Lima <oleonardolima@users.noreply.github.com>
Co-authored-by: Leonardo Lima <oleonardolima@users.noreply.github.com>
Done! Looking way better now |
Description
Adds an initial fuzzing harness for
bdk_chainand a CI job that runs it.Two fuzz targets in a new
fuzz/crate:local_chain_apply_update: builds aLocalChain<BlockHash>and applies random sequences ofapply_update,insert_block,disconnect_from,apply_header(_connected_to), including updates derived from the chain's own tip to hit themerge_chainseq_ptrfast path.local_chain_apply_update_header: fuzzesLocalChain<Header>, exercising placeholder resolution inapply_updateandCheckPoint::entry_itervia a virtual chain of linked headers with random reorgs.After every operation, the harness asserts that a successful op's changeset reconstructs the post-state from the pre-state, a failed op leaves the chain untouched, and chain invariants hold (strictly decreasing heights, genesis present,
is_block_in_chainconsistency).Supports AFL, honggfuzz, and libFuzzer via cargo features. The CI job runs each fuzzer on each target for 5 minutes as a smoke test.
Notes to the reviewers
fuzzcrate is its own workspace (publish = false) so fuzzer deps don't affect the main workspace.Changelog notice
LocalChain(AFL, honggfuzz, libFuzzer) with a CI job.Coverage report
cc @oleonardolima