Page MenuHomePhabricator

Add simulation-based CCoinsViewCache fuzzer
ClosedPublic

Authored by PiRK on May 16 2024, 12:25.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCda80299db64c: Add simulation-based CCoinsViewCache fuzzer
Summary

The fuzzer goes through a sequence of operations that get applied to both a
real stack of CCoinsViewCache objects, and to simulation data, comparing
the two at the end.

Add CCoinsViewCache::SanityCheck() and use it in fuzz test

Add deterministic mode to CCoinsViewCache

with a new LIMITED_WHILE macro from core#22649

This is a backport of core#27011

Test Plan
mkdir build_fuzz
cd build_fuzz/
cmake -GNinja ..   -DCMAKE_C_COMPILER=clang   -DCMAKE_CXX_COMPILER=clang++   -DENABLE_SANITIZERS="fuzzer;address;undefined"
ninja bitcoin-fuzzers
export DIR_FUZZ_IN=~/dev/qa-assets/fuzz_seed_corpus
./test/fuzz/test_runner.py -g ${DIR_FUZZ_IN}  coinscache_sim

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.May 16 2024, 12:25
Fabien requested changes to this revision.May 17 2024, 09:36
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/test/fuzz/coinscache_sim.cpp
227 ↗(On Diff #47817)

layout

539 ↗(On Diff #47817)

?

This revision now requires changes to proceed.May 17 2024, 09:36
This revision is now accepted and ready to land.May 17 2024, 12:16