33 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(
35 {.extra_args = {
"-txreconciliation"}});
36 g_setup = testing_setup.get();
40 g_setup->m_node.validation_signals->SyncWithValidationInterfaceQueue();
55 std::vector<CNode*> peers;
57 for (
int i = 0; i < num_peers_to_add; ++i) {
59 CNode& p2p_node = *peers.back();
61 FillNode(fuzzed_data_provider, connman, p2p_node);
70 const auto mock_time =
ConsumeTime(fuzzed_data_provider);
74 net_msg.
m_type = random_message_type;
88 }
catch (
const std::ios_base::failure&) {
90 g_setup->m_node.peerman->SendMessages(&random_node);
93 g_setup->m_node.validation_signals->SyncWithValidationInterfaceQueue();
94 g_setup->m_node.connman->StopNodes();
Information about a peer.
std::atomic_bool fPauseSend
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 const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
FUZZ_TARGET(process_messages,.init=initialize_process_messages)
void initialize_process_messages()
std::vector< unsigned char > data
bool ReceiveMsgFrom(CNode &node, CSerializedNetMsg &&ser_msg) const
void AddTestNode(CNode &node)
void Handshake(CNode &node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface bool ProcessMessagesOnce(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
void FlushSendBuffer(CNode &node) const
Testing setup that configures a complete environment.
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
int64_t 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
COutPoint MineBlock(const NodeContext &node, const node::BlockAssembler::Options &assembler_options)
Returns the generated coin.
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.