Bitcoin Core 31.99.0
P2P Digital Currency
cmpctblock.cpp
Go to the documentation of this file.
1// Copyright (c) 2026 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <addrman.h>
6#include <blockencodings.h>
7#include <chain.h>
8#include <chainparams.h>
9#include <coins.h>
10#include <consensus/amount.h>
11#include <consensus/consensus.h>
12#include <consensus/merkle.h>
13#include <net.h>
14#include <net_processing.h>
15#include <netmessagemaker.h>
16#include <node/blockstorage.h>
17#include <policy/truc_policy.h>
18#include <primitives/block.h>
20#include <protocol.h>
21#include <script/script.h>
22#include <serialize.h>
23#include <sync.h>
25#include <test/fuzz/fuzz.h>
26#include <test/fuzz/util.h>
27#include <test/fuzz/util/net.h>
28#include <test/util/net.h>
29#include <test/util/random.h>
30#include <test/util/script.h>
32#include <test/util/time.h>
34#include <txmempool.h>
35#include <uint256.h>
36#include <util/check.h>
37#include <util/time.h>
38#include <validation.h>
39#include <validationinterface.h>
40
41#include <boost/multi_index/detail/hash_index_iterator.hpp>
42
43#include <cstddef>
44#include <cstdint>
45#include <functional>
46#include <iterator>
47#include <memory>
48#include <optional>
49#include <string>
50#include <utility>
51#include <vector>
52
53namespace {
54
56
58const CAmount AMOUNT_FEE{1000};
60std::vector<std::pair<COutPoint, CAmount>> g_mature_coinbase;
62uint32_t g_nBits;
64struct BlockInfo {
65 std::shared_ptr<CBlock> block;
66 uint256 hash;
67 uint32_t height;
68};
70class FuzzedCBlockHeaderAndShortTxIDs : public CBlockHeaderAndShortTxIDs
71{
73
74public:
75 void AddPrefilledTx(PrefilledTransaction&& prefilledtx)
76 {
77 prefilledtxn.push_back(std::move(prefilledtx));
78 }
79
80 void RemoveCoinbasePrefill()
81 {
82 prefilledtxn.erase(prefilledtxn.begin());
83 }
84
85 void InsertCoinbaseShortTxID(uint64_t shorttxid)
86 {
87 shorttxids.insert(shorttxids.begin(), shorttxid);
88 }
89
90 void EraseShortTxIDs(size_t index)
91 {
92 shorttxids.erase(shorttxids.begin() + index);
93 }
94
95 size_t PrefilledTxCount() {
96 return prefilledtxn.size();
97 }
98
99 size_t ShortTxIDCount() {
100 return shorttxids.size();
101 }
102};
103
104
105} // namespace
106
107extern void MakeRandDeterministicDANGEROUS(const uint256& seed) noexcept;
108
110{
111 FakeNodeClock init_clock{}; // Uses the existing mock time
112 static const auto testing_setup = MakeNoLogFileContext<TestingSetup>();
113 g_setup = testing_setup.get();
114 g_nBits = Params().GenesisBlock().nBits;
115 // Replace validation_signals before creating chainman and mempool so they use it.
116 testing_setup->m_node.validation_signals = std::make_unique<ValidationSignals>(std::make_unique<ImmediateBackgroundTaskRunner>());
117 g_mature_coinbase = ResetChainmanAndMempool(*g_setup, init_clock);
118}
119
121{
123 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
124
125 FakeNodeClock node_clock{1610000000s}; // 2021-01-07, arbitrary
126 FakeSteadyClock steady_clock;
127
128 auto setup = g_setup;
129 auto& mempool = *setup->m_node.mempool;
130 auto& chainman = static_cast<TestChainstateManager&>(*setup->m_node.chainman);
131 chainman.ResetIbd();
132 chainman.DisableNextWrite();
133 const size_t initial_index_size{WITH_LOCK(chainman.GetMutex(), return chainman.BlockIndex().size())};
134
135 AddrMan addrman{*setup->m_node.netgroupman, /*deterministic=*/true, /*consistency_check_ratio=*/0};
136 auto& connman = *static_cast<ConnmanTestMsg*>(setup->m_node.connman.get());
137 auto peerman = PeerManager::make(connman, addrman,
138 /*banman=*/nullptr, chainman,
139 mempool, *setup->m_node.warnings,
141 .deterministic_rng = true,
142 });
143 connman.SetMsgProc(peerman.get());
144
145 setup->m_node.validation_signals->RegisterValidationInterface(peerman.get());
146 setup->m_node.validation_signals->SyncWithValidationInterfaceQueue();
147
149
150 std::vector<CNode*> peers;
151 for (int i = 0; i < 4; ++i) {
152 peers.push_back(ConsumeNodeAsUniquePtr(fuzzed_data_provider, steady_clock, i).release());
153 CNode& p2p_node = *peers.back();
154 FillNode(fuzzed_data_provider, connman, p2p_node);
155 connman.AddTestNode(p2p_node);
156 }
157
158 // Stores blocks generated this iteration.
159 std::vector<BlockInfo> info;
160
161 // Coinbase UTXOs for this iteration.
162 std::vector<std::pair<COutPoint, CAmount>> mature_coinbase = g_mature_coinbase;
163
164 const uint64_t initial_sequence{WITH_LOCK(mempool.cs, return mempool.GetSequence())};
165
166 auto create_tx = [&]() -> CTransactionRef {
167 CMutableTransaction tx_mut;
170
171 // Choose an outpoint from the mempool, created blocks, or coinbases.
172 CAmount amount_in;
173 COutPoint outpoint;
174 unsigned long mempool_size = mempool.size();
175 if (mempool_size != 0 && fuzzed_data_provider.ConsumeBool()) {
176 size_t random_idx = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, mempool_size - 1);
177 CTransactionRef tx = WITH_LOCK(mempool.cs, return mempool.txns_randomized[random_idx].second->GetSharedTx(););
178 outpoint = COutPoint(tx->GetHash(), 0);
179 amount_in = tx->vout[0].nValue;
180 } else if (info.size() != 0 && fuzzed_data_provider.ConsumeBool()) {
181 // These blocks (and txs) may be invalid, use a spent output, or not be in the main chain.
182 auto info_it = info.begin();
183 std::advance(info_it, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, info.size() - 1));
184 auto tx_it = info_it->block->vtx.begin();
185 std::advance(tx_it, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, info_it->block->vtx.size() - 1));
186 outpoint = COutPoint(tx_it->get()->GetHash(), 0);
187 amount_in = tx_it->get()->vout[0].nValue;
188 } else {
189 auto coinbase_it = mature_coinbase.begin();
190 std::advance(coinbase_it, fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, mature_coinbase.size() - 1));
191 outpoint = coinbase_it->first;
192 amount_in = coinbase_it->second;
193 }
194
196 const auto script_sig = CScript{};
197 const auto script_wit_stack = std::vector<std::vector<uint8_t>>{WITNESS_STACK_ELEM_OP_TRUE};
198
199 CTxIn in;
200 in.prevout = outpoint;
201 in.nSequence = sequence;
202 in.scriptSig = script_sig;
203 in.scriptWitness.stack = script_wit_stack;
204 tx_mut.vin.push_back(in);
205
206 const CAmount amount_out = amount_in - AMOUNT_FEE;
207 tx_mut.vout.emplace_back(amount_out, P2WSH_OP_TRUE);
208
209 auto tx = MakeTransactionRef(tx_mut);
210 return tx;
211 };
212
213 auto create_block = [&]() {
214 uint256 prev;
215 uint32_t height;
216
217 if (info.size() == 0 || fuzzed_data_provider.ConsumeBool()) {
218 LOCK(cs_main);
219 prev = chainman.ActiveChain().Tip()->GetBlockHash();
220 height = chainman.ActiveChain().Height() + 1;
221 } else {
222 size_t index = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, info.size() - 1);
223 prev = info[index].hash;
224 height = info[index].height + 1;
225 }
226
227 const auto new_time = WITH_LOCK(::cs_main, return chainman.ActiveChain().Tip()->GetMedianTimePast() + 1);
228
229 CBlockHeader header;
230 header.nNonce = 0;
231 header.hashPrevBlock = prev;
232 header.nBits = g_nBits;
233 header.nTime = new_time;
235
236 std::shared_ptr<CBlock> block = std::make_shared<CBlock>();
237 *block = header;
238
239 CMutableTransaction coinbase_tx;
240 coinbase_tx.vin.resize(1);
241 coinbase_tx.vin[0].prevout.SetNull();
242 coinbase_tx.vin[0].scriptSig = CScript() << height << OP_0;
243 coinbase_tx.vout.resize(1);
244 coinbase_tx.vout[0].scriptPubKey = CScript() << OP_TRUE;
245 coinbase_tx.vout[0].nValue = COIN;
246 block->vtx.push_back(MakeTransactionRef(coinbase_tx));
247
248 const auto mempool_size = mempool.size();
249 if (fuzzed_data_provider.ConsumeBool() && mempool_size != 0) {
250 // Add txns from the mempool. Since we do not include parents, it may be an invalid block.
251 size_t num_txns = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, mempool_size);
252 size_t random_idx = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, mempool_size - 1);
253
254 LOCK(mempool.cs);
255 for (size_t i = random_idx; i < random_idx + num_txns; ++i) {
256 CTransactionRef mempool_tx = mempool.txns_randomized[i % mempool_size].second->GetSharedTx();
257 block->vtx.push_back(mempool_tx);
258 }
259 }
260
261 // Create and add (possibly invalid) txns that are not in the mempool.
263 size_t new_txns = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 10);
264 for (size_t i = 0; i < new_txns; ++i) {
265 CTransactionRef non_mempool_tx = create_tx();
266 block->vtx.push_back(non_mempool_tx);
267 }
268 }
269
270 CBlockIndex* pindexPrev{WITH_LOCK(::cs_main, return chainman.m_blockman.LookupBlockIndex(prev))};
271 chainman.GenerateCoinbaseCommitment(*block, pindexPrev);
272
273 bool mutated;
274 block->hashMerkleRoot = BlockMerkleRoot(*block, &mutated);
275 FinalizeHeader(*block, chainman);
276
277 BlockInfo block_info;
278 block_info.block = block;
279 block_info.hash = block->GetHash();
280 block_info.height = height;
281
282 return block_info;
283 };
284
286 CSerializedNetMsg net_msg;
287 bool sent_net_msg = true;
288 bool requested_hb = false;
289 bool sent_sendcmpct = false;
290 bool valid_sendcmpct = false;
291
292 CallOneOf(
294 [&]() {
295 // Send a compact block.
296 std::shared_ptr<CBlock> cblock;
297
298 // Pick an existing block or create a new block.
299 if (fuzzed_data_provider.ConsumeBool() && info.size() != 0) {
300 size_t index = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, info.size() - 1);
301 cblock = info[index].block;
302 } else {
303 BlockInfo block_info = create_block();
304 cblock = block_info.block;
305 info.push_back(block_info);
306 }
307
308 uint64_t nonce = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
309 FuzzedCBlockHeaderAndShortTxIDs cmpctblock(*cblock, nonce);
310
312 CBlockHeaderAndShortTxIDs base_cmpctblock = cmpctblock;
313 net_msg = NetMsg::Make(NetMsgType::CMPCTBLOCK, base_cmpctblock);
314 return;
315 }
316
317 int prev_idx = 0;
318 size_t num_erased = 1;
319 size_t num_txs = cblock->vtx.size();
320
321 for (size_t i = 0; i < num_txs; ++i) {
322 if (i == 0) {
323 // Handle the coinbase specially. We either keep it prefilled or remove it.
324 if (fuzzed_data_provider.ConsumeBool()) continue;
325
326 // Remove the prefilled coinbase.
327 num_erased = 0;
328 uint64_t coinbase_shortid = cmpctblock.GetShortID(cblock->vtx[0]->GetWitnessHash());
329 cmpctblock.RemoveCoinbasePrefill();
330 cmpctblock.InsertCoinbaseShortTxID(coinbase_shortid);
331 continue;
332 }
333
334 if (fuzzed_data_provider.ConsumeBool()) continue;
335
336 uint16_t prefill_idx = num_erased == 0 ? i : i - prev_idx - 1;
337 prev_idx = i;
338 CTransactionRef txref = cblock->vtx[i];
339 PrefilledTransaction prefilledtx = {/*index=*/prefill_idx, txref};
340 cmpctblock.AddPrefilledTx(std::move(prefilledtx));
341
342 // Remove from shorttxids since we've prefilled. Subtract however many txs have been prefilled.
343 cmpctblock.EraseShortTxIDs(i - num_erased);
344 ++num_erased;
345 }
346
347 assert(cmpctblock.PrefilledTxCount() + cmpctblock.ShortTxIDCount() == num_txs);
348
349 CBlockHeaderAndShortTxIDs base_cmpctblock = cmpctblock;
350 net_msg = NetMsg::Make(NetMsgType::CMPCTBLOCK, base_cmpctblock);
351 },
352 [&]() {
353 // Send a blocktxn message for an existing block (if one exists).
354 size_t num_blocks = info.size();
355 if (num_blocks == 0) {
356 sent_net_msg = false;
357 return;
358 }
359
360 // Fetch an existing block and randomly choose transactions to send over.
361 size_t index = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, num_blocks - 1);
362 const BlockInfo& block_info = info[index];
363 BlockTransactions block_txn;
364 block_txn.blockhash = block_info.hash;
365 std::shared_ptr<CBlock> cblock = block_info.block;
366
367 for (size_t i = 0; i < cblock->vtx.size(); i++) {
368 if (fuzzed_data_provider.ConsumeBool()) continue;
369
370 block_txn.txn.push_back(cblock->vtx[i]);
371 }
372
373 net_msg = NetMsg::Make(NetMsgType::BLOCKTXN, block_txn);
374 },
375 [&]() {
376 // Send a headers message for an existing block (if one exists).
377 size_t num_blocks = info.size();
378 if (num_blocks == 0) {
379 sent_net_msg = false;
380 return;
381 }
382
383 // Choose an existing block and send a HEADERS message for it.
384 size_t index = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(0, num_blocks - 1);
385 CBlock block = *info[index].block;
386 block.vtx.clear(); // No tx in HEADERS.
387 std::vector<CBlock> headers;
388 headers.emplace_back(block);
389
391 },
392 [&]() {
393 // Send a sendcmpct message, optionally setting hb mode.
396 net_msg = NetMsg::Make(NetMsgType::SENDCMPCT, /*high_bandwidth=*/hb, /*version=*/version);
397 requested_hb = hb;
398 sent_sendcmpct = true;
399 valid_sendcmpct = version == CMPCTBLOCKS_VERSION;
400 },
401 [&]() {
402 // Mine a block, but don't send it.
403 BlockInfo block_info = create_block();
404 info.push_back(block_info);
405 sent_net_msg = false;
406 },
407 [&]() {
408 // Send a transaction.
409 CTransactionRef tx = create_tx();
411 },
412 [&]() {
413 // Set mock time randomly or to tip's time.
415 node_clock.set(ConsumeTime(fuzzed_data_provider));
416 } else {
417 const NodeSeconds tip_time = WITH_LOCK(::cs_main, return chainman.ActiveChain().Tip()->Time());
418 node_clock.set(tip_time);
419 }
420
421 sent_net_msg = false;
422 });
423
424 if (!sent_net_msg) {
425 continue;
426 }
427
428 CNode& random_node = *PickValue(fuzzed_data_provider, peers);
429 connman.FlushSendBuffer(random_node);
430 (void)connman.ReceiveMsgFrom(random_node, std::move(net_msg));
431
432 bool more_work{true};
433 while (more_work) {
434 random_node.fPauseSend = false;
435
436 more_work = connman.ProcessMessagesOnce(random_node);
437 peerman->SendMessages(random_node);
438 }
439
440 std::vector<CNodeStats> stats;
441 connman.GetNodeStats(stats);
442
443 // We should have at maximum 3 HB peers.
444 int num_hb = 0;
445 for (const CNodeStats& stat : stats) {
446 if (stat.m_bip152_highbandwidth_to) {
447 // HB peers cannot be feelers or other "special" connections (besides addr-fetch).
448 CNode* hb_peer = peers[stat.nodeid];
449 if (!hb_peer->fDisconnect) num_hb += 1;
450 assert(hb_peer->IsInboundConn() || hb_peer->IsOutboundOrBlockRelayConn() || hb_peer->IsManualConn() || hb_peer->IsAddrFetchConn());
451 }
452 }
453 assert(num_hb <= 3);
454
455 if (sent_sendcmpct && !random_node.fDisconnect) {
456 // If the fuzzer sent SENDCMPCT with proper version, check the node's state matches what it sent.
457 const CNodeStats& random_node_stats = stats[random_node.GetId()];
458 if (valid_sendcmpct) assert(random_node_stats.m_bip152_highbandwidth_from == requested_hb);
459 }
460 }
461
462 setup->m_node.validation_signals->SyncWithValidationInterfaceQueue();
463 setup->m_node.validation_signals->UnregisterAllValidationInterfaces();
464 connman.StopNodes();
465
466 const size_t end_index_size{WITH_LOCK(chainman.GetMutex(), return chainman.BlockIndex().size())};
467 const uint64_t end_sequence{WITH_LOCK(mempool.cs, return mempool.GetSequence())};
468
469 if (initial_index_size != end_index_size || initial_sequence != end_sequence) {
471 g_mature_coinbase = ResetChainmanAndMempool(*g_setup, node_clock);
472 }
473}
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
constexpr CAmount COIN
The amount of satoshis in one BTC.
Definition: amount.h:15
const TestingSetup * g_setup
const CChainParams & Params()
Return the currently selected parameters.
Stochastic address manager.
Definition: addrman.h:110
std::vector< CTransactionRef > txn
CBlockHeaderAndShortTxIDs()=default
Dummy for deserialization.
Nodes collect new transactions into a block, hash them into a hash tree, and scan through nonce value...
Definition: block.h:27
uint32_t nNonce
Definition: block.h:35
uint32_t nBits
Definition: block.h:34
uint32_t nTime
Definition: block.h:33
int32_t nVersion
Definition: block.h:30
uint256 hashPrevBlock
Definition: block.h:31
Definition: block.h:74
std::vector< CTransactionRef > vtx
Definition: block.h:77
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:94
const CBlock & GenesisBlock() const
Definition: chainparams.h:94
Information about a peer.
Definition: net.h:683
bool IsInboundConn() const
Definition: net.h:843
bool IsOutboundOrBlockRelayConn() const
Definition: net.h:778
NodeId GetId() const
Definition: net.h:928
bool IsManualConn() const
Definition: net.h:798
bool IsAddrFetchConn() const
Definition: net.h:827
std::atomic_bool fPauseSend
Definition: net.h:751
std::atomic_bool fDisconnect
Definition: net.h:745
bool m_bip152_highbandwidth_from
Definition: net.h:209
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:29
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:406
static constexpr uint32_t CURRENT_VERSION
Definition: transaction.h:284
An input of a transaction.
Definition: transaction.h:62
uint32_t nSequence
Definition: transaction.h:66
CScript scriptSig
Definition: transaction.h:65
CScriptWitness scriptWitness
Only serialized through CTransaction.
Definition: transaction.h:67
COutPoint prevout
Definition: transaction.h:64
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
Definition: time.h:54
Helper to initialize the global MockableSteadyClock, let a duration elapse, and reset it after use in...
Definition: time.h:29
T ConsumeIntegralInRange(T min, T max)
static Mutex g_msgproc_mutex
Mutex for anything that is only accessed via the msg processing thread.
Definition: net.h:1044
static std::unique_ptr< PeerManager > make(CConnman &connman, AddrMan &addrman, BanMan *banman, ChainstateManager &chainman, CTxMemPool &pool, node::Warnings &warnings, Options opts)
256-bit opaque blob.
Definition: uint256.h:196
static const uint256 ZERO
Definition: uint256.h:204
void MakeRandDeterministicDANGEROUS(const uint256 &seed) noexcept
Internal function to set g_determinstic_rng.
Definition: random.cpp:595
FUZZ_TARGET(cmpctblock,.init=initialize_cmpctblock)
Definition: cmpctblock.cpp:120
void initialize_cmpctblock()
Definition: cmpctblock.cpp:109
for(const auto &cache :caches)
LIMITED_WHILE(provider.remaining_bytes(), 10000)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
Definition: merkle.cpp:77
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
Definition: cs_main.cpp:8
HTTPHeaders headers
uint64_t sequence
unsigned int nonce
CSerializedNetMsg Make(std::string msg_type, Args &&... args)
constexpr const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
Definition: protocol.h:123
constexpr const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
Definition: protocol.h:206
constexpr const char * BLOCKTXN
Contains a BlockTransactions.
Definition: protocol.h:218
constexpr const char * SENDCMPCT
Contains a 1-byte bool and 8-byte LE version number.
Definition: protocol.h:200
constexpr const char * TX
The tx message transmits a single transaction.
Definition: protocol.h:117
Definition: basic.cpp:11
constexpr uint64_t CMPCTBLOCKS_VERSION
The compactblocks version we support.
constexpr TransactionSerParams TX_WITH_WITNESS
Definition: transaction.h:180
static CTransactionRef MakeTransactionRef(Tx &&txIn)
Definition: transaction.h:404
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:403
@ OP_TRUE
Definition: script.h:85
@ OP_0
Definition: script.h:77
A mutable version of CTransaction.
Definition: transaction.h:358
std::vector< CTxOut > vout
Definition: transaction.h:360
std::vector< CTxIn > vin
Definition: transaction.h:359
std::vector< std::vector< unsigned char > > stack
Definition: script.h:581
void ResetIbd()
Reset the ibd cache to its initial state.
Definition: validation.cpp:46
Testing setup that configures a complete environment.
Definition: setup_common.h:115
#define LOCK(cs)
Definition: sync.h:268
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
Definition: sync.h:299
SeedRandomStateForTest(SeedRand::ZEROS)
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
Definition: net.cpp:450
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, FakeSteadyClock &clock, const std::optional< NodeId > &node_id_in=std::nullopt)
Definition: net.h:310
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
Definition: util.cpp:34
uint32_t ConsumeSequence(FuzzedDataProvider &fuzzed_data_provider) noexcept
Definition: util.cpp:155
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
Definition: util.h:57
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
Definition: util.h:37
void FinalizeHeader(CBlockHeader &header, const ChainstateManager &chainman)
Definition: util.h:367
@ ZEROS
Seed with a compile time constant of zeros.
const std::vector< uint8_t > WITNESS_STACK_ELEM_OP_TRUE
Definition: script.h:12
const CScript P2WSH_OP_TRUE
Definition: script.h:13
std::vector< std::pair< COutPoint, CAmount > > ResetChainmanAndMempool(TestingSetup &setup, FakeNodeClock &node_clock)
Definition: validation.cpp:108
static int setup(void)
Definition: tests.c:8154
constexpr decltype(CTransaction::version) TRUC_VERSION
Definition: truc_policy.h:20
std::chrono::time_point< NodeClock, std::chrono::seconds > NodeSeconds
Definition: time.h:35
assert(!tx.IsCoinBase())
FuzzedDataProvider & fuzzed_data_provider
Definition: fees.cpp:45