Problem
process_message and process_messages keep the node in IBD (ResetIbd()) and
mine their coinbases with the default bare-OP_TRUE output script. As a result
net_processing returns early at the IsInitialBlockDownload() check and never
reaches the transaction-handling path; and even if it did, a tx spending a
bare-OP_TRUE coinbase is rejected as NONSTANDARD by
ValidateInputsStandardness. The reused mempool therefore always stays empty and
that path is never exercised.
Changes
Both targets now get the same treatment:
- Toggle IBD from the test input — a
booldecides whether to alsoJumpOutOfIbd(), exercising both the IBD and non-IBD paths. Inprocess_messageit is consumed last, so existing corpus entries readfalseand are unchanged. Inprocess_messagesthe messages run in a loop, so the bool must be consumed first (see the corpus note below). - Use a spendable
P2WSH_OP_TRUEcoinbase — both anyone-can-spend (anOP_TRUEwitness, no signature) and a standard witness output, so a fuzz-built tx spending a mature coinbase can actually be accepted into the mempool. - Reset the rng before rebuilding (preparation) — rebuilding the chainman
(and, in the next commit, the mempool) consumes the global PRNG. Reset it with
MakeRandDeterministicDANGEROUS()first so the rebuild is deterministic across iterations. Mirrors thecmpctblockharness. - Reset the reused mempool — now that the mempool can become non-empty,
rebuild it together with the chainman in
ResetChainmanAndMempool()when the block index grew or the mempool changed. A dirty mempool is detected by its sequence number rather than its size, since a tx can be added and removed within one iteration (leaving the size unchanged).
Corpus note
In process_messages the IBD bool is consumed before the message loop (first
integral read), which shifts the FuzzedDataProvider layout. Existing
process_messages corpus entries can be migrated by appending a single 0x00
byte at the end (read as false, keeping the IBD path); every other consumed
value stays the same. This is a qa-assets change accompanying this PR.