#34264 fuzz: Extend `spend` coverage

full analysis

https://github.com/bitcoin/bitcoin/pull/34264 · Chand-ra · +63/-21 in 1 files, 4 commits · labels: Needs rebase, Fuzzing

Goal

  • Catch bugs in wallet transaction creation and funding by fuzzing sequential operations together

Refactors the wallet spend fuzz target into a stateful loop using CallOneOf, allowing multiple wallet operations to be interleaved within the same test execution. Adds coverage for FundTransaction, ListCoins, and mutating CCoinControl to select or unselect inputs.

Problem: The wallet spend fuzz target was stateless and omitted coverage for important wallet creation and funding APIs such as FundTransaction and ListCoins.

Category: Wallet (#56 of 84)

P3 · test coverage

  • P3 because it expands fuzz testing across multi-step transaction creation and coin selection
  • It improves test robustness without addressing an immediate fund-safety defect

Adds valuable fuzz test coverage and statefulness to wallet transaction creation, funding, and coin control logic, but does not address an immediate fund-safety bug or user-reported defect.

Membership: Directly modifies src/wallet/test/fuzz/spend.cpp to exercise wallet transaction creation, funding, and coin control.

Factors: security/stability 1, bug 0, performance 0, user value 0, leverage 1

Reviewability: Stale: Needs rebase

  • Needs a rebase onto master to resolve merge conflicts
  • Author has been inactive for over 200 days

The PR has merge conflicts with master and the author has been inactive for over 200 days.

Author status: silent since 2026-01-22

Open concerns:

  • Needs rebase onto master to incorporate #35790 so coin selection reaches success paths.
  • Suggestions from frankomosh to assert on non-negative fee results and output value ranges.

Resolved concerns:

  • CI clang-tidy warnings regarding unnecessary temporaries and unused return values were resolved by earlier pushes.
  • Locking requirements clarified: FundTransaction does not require cs_wallet whereas ListCoins does.

Agreement: Strong

  • Strong support for expanding fuzz coverage of transaction funding and coin listing (frankomosh)
  • Suggested adding assertions on fee results and output ranges (frankomosh)

Strong support from frankomosh citing good coverage on FundTransaction and ListCoins

frankomosh gave Concept ACK with explicit rationale praising the coverage improvements and provided suggestions for further assertions; there are no objections.

  • frankomosh: 'Concept ACK. Good coverage on FundTransaction and ListCoins. Please do a rebase to pick #35790, which makes coin selection becomes reachable.'

Review verdicts (DrahtBot): 0

Files

File list not available for this run.

Card

Refactors the wallet spend fuzz target to make it stateful and adds coverage for FundTransaction, ListCoins, and coin control input selection. It improves automated testing and fuzzing for wallet spending paths. frankomosh provided Concept ACK support with suggestions to add result assertions following a rebase onto #35790. Review is currently blocked by merge conflicts and extended author inactivity.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T15:50, confidence high, input hash b40ef525b8507fbc