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
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16174