57 if (
const auto val{std::getenv(
"LIMIT_TO_MESSAGE_TYPE")}) {
62 static const auto testing_setup{
85 chainman.DisableNextWrite();
91 node.addrman = std::make_unique<AddrMan>(*
node.netgroupman,
true, 0);
96 .reconcile_txs = true,
97 .deterministic_rng = true,
100 connman.SetMsgProc(
node.peerman.get());
101 connman.SetAddrman(*
node.addrman);
109 node.validation_signals->RegisterValidationInterface(
node.peerman.get());
126 chainman.JumpOutOfIbd();
134 }
catch (
const std::ios_base::failure&) {
138 node.validation_signals->SyncWithValidationInterfaceQueue();
139 node.validation_signals->UnregisterValidationInterface(
node.peerman.get());
140 node.connman->StopNodes();
const TestingSetup * g_setup
#define Assert(val)
Identity function.
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)
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
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_message()
const std::array ALL_NET_MESSAGE_TYPES
All known message types (see above).
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.
#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
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