mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
fuzz: Avoid influence on the global RNG from peerman m_rng
This should avoid the remaining non-determistic code coverage paths. Without this patch, the tool would report a diff (only when running without libFuzzer): cargo run --manifest-path ./contrib/devtools/deterministic-fuzz-coverage/Cargo.toml -- $PWD/bld-cmake/ $PWD/../qa-assets/fuzz_corpora/ p2p_headers_presync 32
This commit is contained in:
parent
faf4c1b6fc
commit
faa3ce3199
1 changed files with 6 additions and 0 deletions
|
@ -32,6 +32,12 @@ public:
|
|||
PeerManager::Options peerman_opts;
|
||||
node::ApplyArgsManOptions(*m_node.args, peerman_opts);
|
||||
peerman_opts.max_headers_result = FUZZ_MAX_HEADERS_RESULTS;
|
||||
// The peerman's rng is a global that is re-used, so it will be re-used
|
||||
// and may cause non-determinism between runs. This may even influence
|
||||
// the global RNG, because seeding may be done from the gloabl one. For
|
||||
// now, avoid it influencing the global RNG, and initialize it with a
|
||||
// constant instead.
|
||||
peerman_opts.deterministic_rng = true;
|
||||
// No txs are relayed. Disable irrelevant and possibly
|
||||
// non-deterministic code paths.
|
||||
peerman_opts.ignore_incoming_txs = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue