diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 10168d7f390..631e968da7f 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -195,8 +195,6 @@ static constexpr double MAX_ADDR_RATE_PER_SECOND{0.1}; * based increments won't go above this, but the MAX_ADDR_TO_SEND increment following GETADDR * is exempt from this limit). */ static constexpr size_t MAX_ADDR_PROCESSING_TOKEN_BUCKET{MAX_ADDR_TO_SEND}; -/** The compactblocks version we support. See BIP 152. */ -static constexpr uint64_t CMPCTBLOCKS_VERSION{2}; /** For private broadcast, send a transaction to this many peers. */ static constexpr size_t NUM_PRIVATE_BROADCAST_PER_TX{3}; /** Private broadcast connections must complete within this time. Disconnect the peer if it takes longer. */ diff --git a/src/net_processing.h b/src/net_processing.h index 8b3f026d051..4ae48f84e4b 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -48,6 +48,8 @@ static const unsigned int MAX_CMPCTBLOCKS_INFLIGHT_PER_BLOCK = 3; /** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends * less than this number, we reached its tip. Changing this value is a protocol upgrade. */ static const unsigned int MAX_HEADERS_RESULTS = 2000; +/** The compactblocks version we support. See BIP 152. */ +static constexpr uint64_t CMPCTBLOCKS_VERSION{2}; struct CNodeStateStats { int nSyncHeight = -1; diff --git a/src/test/fuzz/CMakeLists.txt b/src/test/fuzz/CMakeLists.txt index fc82fdc03a2..f2add17217d 100644 --- a/src/test/fuzz/CMakeLists.txt +++ b/src/test/fuzz/CMakeLists.txt @@ -26,6 +26,7 @@ add_executable(fuzz chain.cpp checkqueue.cpp cluster_linearize.cpp + cmpctblock.cpp coins_view.cpp coinscache_sim.cpp connman.cpp diff --git a/src/test/fuzz/cmpctblock.cpp b/src/test/fuzz/cmpctblock.cpp new file mode 100644 index 00000000000..3e4268cb658 --- /dev/null +++ b/src/test/fuzz/cmpctblock.cpp @@ -0,0 +1,503 @@ +// Copyright (c) 2026 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include