mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
Merge #20789: fuzz: Rework strong and weak net enum fuzzing
eeee43bc48fuzz: Use ConsumeWeakEnum for ServiceFlags (MarcoFalke)fa9949b914fuzz: Add ConsumeWeakEnum helper, Extract ALL_NET_PERMISSION_FLAGS (MarcoFalke)faaef9434cfuzz: [refactor] Extract ALL_CONNECTION_TYPES constant (MarcoFalke)fa42da2d54fuzz: Use ConsumeNode in process_message target (MarcoFalke)fa121f058ffuzz: Use ConsumeNode in process_messages target (MarcoFalke) Pull request description: The fuzz tests have several problems: * The array passed to the fuzz engine to pick `net_permission_flags` is outdated * The process_message* targets has the service flags as well as connection type hardcoded, limiting potential coverage * The service flags deserialization from the fuzz engine doesn't allow for easy "exact matches". The fuzz engine has to explore a 64-bit space to hit an "exact match" (only one bit set) Fix all issues in the commits in this pull ACKs for top commit: mzumsande: ACKeeee43bc48after rebase. Tree-SHA512: 1ad9520c7e708b7f4994ae8f77886ffca33d7c542756e2a3e07dbbbe59e360f9fcaccf2e2fb57d9bc731d4aeb4938fb1c5c546e9d2744b007af5626f5cb377fe
This commit is contained in:
@@ -30,4 +30,35 @@ struct ConnmanTestMsg : public CConnman {
|
||||
bool ReceiveMsgFrom(CNode& node, CSerializedNetMsg& ser_msg) const;
|
||||
};
|
||||
|
||||
constexpr ServiceFlags ALL_SERVICE_FLAGS[]{
|
||||
NODE_NONE,
|
||||
NODE_NETWORK,
|
||||
NODE_BLOOM,
|
||||
NODE_WITNESS,
|
||||
NODE_COMPACT_FILTERS,
|
||||
NODE_NETWORK_LIMITED,
|
||||
};
|
||||
|
||||
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]{
|
||||
NetPermissionFlags::PF_NONE,
|
||||
NetPermissionFlags::PF_BLOOMFILTER,
|
||||
NetPermissionFlags::PF_RELAY,
|
||||
NetPermissionFlags::PF_FORCERELAY,
|
||||
NetPermissionFlags::PF_NOBAN,
|
||||
NetPermissionFlags::PF_MEMPOOL,
|
||||
NetPermissionFlags::PF_ADDR,
|
||||
NetPermissionFlags::PF_DOWNLOAD,
|
||||
NetPermissionFlags::PF_ISIMPLICIT,
|
||||
NetPermissionFlags::PF_ALL,
|
||||
};
|
||||
|
||||
constexpr ConnectionType ALL_CONNECTION_TYPES[]{
|
||||
ConnectionType::INBOUND,
|
||||
ConnectionType::OUTBOUND_FULL_RELAY,
|
||||
ConnectionType::MANUAL,
|
||||
ConnectionType::FEELER,
|
||||
ConnectionType::BLOCK_RELAY,
|
||||
ConnectionType::ADDR_FETCH,
|
||||
};
|
||||
|
||||
#endif // BITCOIN_TEST_UTIL_NET_H
|
||||
|
||||
Reference in New Issue
Block a user