From ce813b8fcde2637727ca8e4800833f72435fca58 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Tue, 2 May 2023 13:19:50 +0200 Subject: [PATCH 1/2] Add fuzz input maintenance docs to the readme --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f9cc9ca952b..781281b3e63 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,40 @@ # qa-assets -Bitcoin Core related blobs used for quality assurance + +Bitcoin Core related blobs used for quality assurance. + +## Fuzz inputs + +`qa-assets/fuzz_seed_corpus` contains one input corpus per fuzz target (one +folder per target named the same as each target). + +### Contributing inputs + +*For documentation on how to fuzz Bitcoin Core please see +[fuzzing.md](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md).* + +If you want to contribute fuzz inputs, please "merge" the inputs before +submitting a pull request. You can use the libFuzzer option `-merge=1` +(recommended with `-use_value_profile=1`) or the `--m_dir` option of the fuzz +runner: +[`test_runner.py`](https://github.com/bitcoin/bitcoin/blob/master/test/fuzz/test_runner.py). + +### Pruning inputs + +* Over time fuzz engines reduce inputs (produce a smaller input that yields the + same coverage statistics), which causes our copora to accumulate larger + non-reduced inputs. +* Code changes can lead to inputs losing their coverage. + +To avoid corpora bloat, stale inputs and potential CI timeouts, we usually +prune/minimize our copora around the branch-off point using the +[`delete_nonreduced_fuzz_inputs.sh`](https://raw.githubusercontent.com/bitcoin-core/bitcoin-maintainer-tools/main/delete_nonreduced_fuzz_inputs.sh) +script (Recommended to run in a fresh VM, see documentation in the script). The +script is usually run twice to ensure that the results are "somewhat" +reproducible (e.g. +https://github.com/bitcoin-core/qa-assets/pull/119#issuecomment-1518019457). + +After pruning the corpora, the coverage should not have dropped at all. + +### Pulling inputs from oss-fuzz + +Use `download_oss_fuzz_inputs.py` to pull fuzz inputs from oss-fuzz. From 0b76987467b87d0cc56789e8d8aa6bcd900dd799 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Thu, 4 May 2023 12:42:05 +0200 Subject: [PATCH 2/2] Link to readme from pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9ca8b994c69..69a0f513851 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,3 @@ -If you are adding fuzz seeds, please "merge" the seeds before submitting this -pull request, then remove the instruction text here. - -You can use the libFuzzer option `-merge=1` (recommended with -`-use_value_profile=1`) or the `--m_dir` option of the fuzz runner: -https://github.com/bitcoin/bitcoin/blob/master/test/fuzz/test_runner.py +Please see the +[README.md](https://github.com/bitcoin-core/qa-assets/blob/main/README.md) for +instructions on how to contribute new inputs.