fuzz: reuse one fuzzed wallet across inputs

bitcoin/bitcoin: PR #36068

1 minor finding

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · Wallet resets leave fuzz execution dependent on earlier inputs

Retained descriptor state and periodic post-seed rebuilds make wallet_create_transaction history-dependent, potentially impairing crash reproduction; no divergent corpus input has been demonstrated.

Location: src/test/fuzz/util/wallet.h:45 (head).

Details and suggested fix

When destChange is CNoDestination and the recipients pass the initial checks, transaction creation reserves an internal descriptor key before coin selection. Success keeps the advanced index. Failure returns the index but leaves any expanded range and cache intact. Reset() restores neither, and DriftCheck only bounds the growth, so earlier inputs can change later change scripts and derivation paths. Separately, every 1000th reset calls Build() after the per-input reseed. Constructing the wallet consumes global randomness for its hashers, shifting the stream later used by coin selection. It also replaces the salt of m_txos, whose hash iteration order feeds AvailableCoins. A saved input may therefore follow a different path when replayed alone.

Restore a position-independent baseline for descriptors, containers, and RNG consumption rather than rebuilding according to input count. Reconstructing the wallet after every per-input reseed, as in the base revision, is one sufficient correction; an optimized reset needs to reproduce that independence.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.