55 node.addrman = std::make_unique<AddrMan>(
56 *
node.netgroupman,
true, 0);
61 .reconcile_txs = true,
62 .deterministic_rng = true,
64 connman.SetMsgProc(
node.peerman.get());
65 connman.SetAddrman(*
node.addrman);
69 std::vector<CNode*> peers;
73 connman.AddTestNode(*peers.back());
74 node.peerman->InitializeNode(
92 if (
jump_out_of_ibd && chainman.IsInitialBlockDownload()) chainman.JumpOutOfIbd();
94 clock += std::chrono::seconds{
96 -std::chrono::seconds{10min}.count(),
104 connman.FlushSendBuffer(connection);
105 (
void)connman.ReceiveMsgFrom(connection, std::move(
net_msg));
112 more_work = connman.ProcessMessagesOnce(connection);
113 }
catch (
const std::ios_base::failure&) {
115 node.peerman->SendMessages(connection);
120 for (
const CNode* peer : peers) {
124 node.connman->StopNodes();
const TestingSetup * g_setup
Information about a peer.
std::atomic_bool fSuccessfullyConnected
fSuccessfullyConnected is set to true on receiving VERACK from the peer.
std::atomic_bool fPauseSend
std::atomic_bool fDisconnect
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...
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)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
constexpr std::chrono::minutes TIMEOUT_INTERVAL
Time after which to disconnect, after waiting for a ping response (or inactivity).
constexpr unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
const std::array ALL_NET_MESSAGE_TYPES
All known message types (see above).
ServiceFlags
nServices flags
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.
SeedRandomStateForTest(SeedRand::ZEROS)
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, FakeSteadyClock &clock, const std::optional< NodeId > &node_id_in=std::nullopt)
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.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider