It not always entirely clear which functions that indirectly depend on params being selected and the requirement can be quite far down in the call graph.
An example is from when I fuzzed EvalDescriptorStringOrObject
:
When using this harness the fuzzer managed to create the input string "addr()"
after roughly three million executions. That input triggered the following assertion failure:
0[#3170783](/bitcoin-bitcoin/3170783/) REDUCE cov: 3338 ft: 7992 corp: 325/63Kb exec/s: 1258 rss: 272Mb L: 61/4090 MS: 2 ChangeASCIIInt-EraseBytes-
1fuzzer: chainparams.cpp:385: const CChainParams &Params(): Assertion `globalChainParams' failed.
2...
3\"addr()\"
Turns out EvalDescriptorStringOrObject
calls Parse
which calls DecodeDestination
which in turn depends on params being selected.
Since the requirement can run quite deep I think we should pick a network in the general initialize()
so that harness writers don’t have to worry about crossing any code paths with params requirements that will generate faux crashes.
OTOH, I don’t feel strongly about the particular choice of network - I just choose regtest
since that seemed like the least adventurous choice :)
What would be the pros/cons of going with main
instead of going regtest
(or test
)?