feat(fuzz): add fuzzing harness for LocalChain with CI job#2239
Open
erickcestari wants to merge 2 commits into
Open
feat(fuzz): add fuzzing harness for LocalChain with CI job#2239erickcestari wants to merge 2 commits into
LocalChain with CI job#2239erickcestari wants to merge 2 commits into
Conversation
Co-authored-by: Leonardo Lima <oleonardolima@users.noreply.github.com>
Co-authored-by: Leonardo Lima <oleonardolima@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2239 +/- ##
=======================================
Coverage 78.65% 78.65%
=======================================
Files 30 30
Lines 5909 5909
Branches 279 279
=======================================
Hits 4648 4648
Misses 1185 1185
Partials 76 76
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:
|
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.
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.cc @oleonardolima