52 static const auto testing_setup{
77 chainman.DisableNextWrite();
83 node.addrman = std::make_unique<AddrMan>(*
node.netgroupman,
true, 0);
88 .reconcile_txs = true,
89 .deterministic_rng = true,
91 connman.SetMsgProc(
node.peerman.get());
92 connman.SetAddrman(*
node.addrman);
94 node.validation_signals->RegisterValidationInterface(
node.peerman.get());
98 std::vector<CNode*> peers;
115 if (
jump_out_of_ibd && chainman.IsInitialBlockDownload()) chainman.JumpOutOfIbd();
135 }
catch (
const std::ios_base::failure&) {
140 node.validation_signals->SyncWithValidationInterfaceQueue();
141 node.validation_signals->UnregisterValidationInterface(
node.peerman.get());
142 node.connman->StopNodes();
const TestingSetup * g_setup
Information about a peer.
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
Helper to initialize the global MockableSteadyClock, let a duration elapse, and reset it after use in...
std::string ConsumeBytesAsString(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
static Mutex g_msgproc_mutex
Mutex for anything that is only accessed via the msg processing thread.
static std::unique_ptr< PeerManager > make(CConnman &connman, AddrMan &addrman, BanMan *banman, ChainstateManager &chainman, CTxMemPool &pool, node::Warnings &warnings, Options opts)
static const uint256 ZERO
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
constexpr unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
void MakeRandDeterministicDANGEROUS(const uint256 &seed) noexcept
Internal function to set g_determinstic_rng.
void initialize_process_messages()
void ObserveReachabilityGoal(bool reached, const ReachabilityGoal &goal)
Record whether a registered goal is satisfied by at least one fuzz input.
void RegisterReachabilityGoal(const ReachabilityGoal &goal)
Register a goal before executing any fuzz inputs.
void Reset()
Reset the internal state.
A reachability condition explicitly registered by a fuzz target.
Testing setup that configures a complete environment.
std::unique_ptr< ValidationSignals > validation_signals
Issues calls about blocks and transactions.
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
SeedRandomStateForTest(SeedRand::ZEROS)
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, FakeSteadyClock &clock, const std::optional< NodeId > &node_id_in=std::nullopt)
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
@ ZEROS
Seed with a compile time constant of zeros.
std::vector< std::pair< COutPoint, CAmount > > ResetChainmanAndMempool(TestingSetup &setup, FakeNodeClock &node_clock, const ResetOptions &opts)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider