#35342 test: fuzz wallet_rpc target

ReviewabilityReviewsAgreementSize
#35342 kevkevinpal test: fuzz wallet_rpc targetWaiting on author0 -1Mild0 + 530 tests
  • Add fuzz testing for wallet RPC commands with randomized arguments
  • Protects wallet RPC parameter parsing and validation against malformed inputs
  • Waiting on author to reply to an open objection from brunoerg
  • Approach objection: fuzzing wallet RPCs without context like blocks or coins has minimal value (brunoerg)
  • Unaddressed objection: keypool limits for performance further degrade fuzzing efficacy (brunoerg)
  • Questions raised about the performance of calling multiple wallet RPCs per run (maflcko)
  • 0 lines added or modified outside tests
  • 530 lines added or modified in tests
  • 176 lines removed in total
  • 6 files, 2 commits
Test infrastructure#39 of 54
P4 · test coverage
  • P4 after comparing with the other PRs here (assessed alone as P3): Lowered to P4: reviewers argue fuzzing wallet RPCs without chain state or UTXOs has very low efficacy, so the claimed coverage gain is weakly supported.
  • P3 because expanding fuzz coverage to unexercised RPC parameter parsing paths improves test coverage
  • Fuzzing wallet RPCs in isolation does not exercise consensus or P2P code paths
Wallet#86 of 92
P4 · test coverage
  • P4 after comparing with the other PRs here (assessed alone as P3): Lowered from P3: fuzzing wallet RPCs without chain state or UTXOs yields very little real coverage, making the benefit weakly justified.
  • P3 because hardening wallet RPC parameter parsing and input validation protects against malformed inputs
  • Testing in isolation without full wallet state limits the coverage of stateful wallet operations
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

This pull request introduces a new `wallet_rpc` fuzz target to test wallet RPC commands with randomized arguments. It also extracts shared RPC argument generation logic into a common test utility file (`src/test/fuzz/util/rpc.{h,cpp}`).

Problem: Wallet RPC methods have zero fuzz coverage on OSS-Fuzz, leaving wallet RPC parameter parsing and validation less tested against malformed inputs.

Reviewability

Paused · Waiting on author

Open objection from brunoerg with no author reply for 158 days; review would repeat what has been asked.

Agreement

Mild

objection that needs a change was answered, no reply from the objector (brunoerg (NACK): fuzzing wallet RPCs in isolation without context such as blocks or spendable coins yields minimal testing value); objection that needs an answer has none yet (brunoerg)

Thread notes: First read of the PR. brunoerg raised an approach objection noting that fuzzing wallet RPCs without state/context has low efficacy, and maflcko raised questions about performance.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
brunoerg (contributor)objection, approachfuzzing wallet RPCs in isolation without context such as blocks or spendable coins yields minimal testing valueanswered · reply on record; standing not assessed yet · v1, not yet re-checkedchangedyes2026-05-21: 'This is basically fuzzing the RPC without any other context that might affect the RPCs. I mean, what would be the efficacy of fuzzing the RPC `listsinceblock` if this harness is not producing blocks?'
brunoerg (contributor)objection, approachlimiting keypool size to 1 to avoid performance issues further degrades the effectiveness of fuzzing RPCs like getnewaddressopen · v1, not yet re-checkedansweredno2026-05-21: 'We usually need to set the keypool size to 1 in wallet targets to avoid performance issues, and this is one more reason that fuzzing some of these RPCs would not have much effect'

Participants:

  • brunoerg (contributor, objection, 4 statements 2026-05-21 to 2026-05-27): tended toward approach NACK over low efficacy of fuzzing wallet RPCs without context
  • maflcko (member, question, 2 statements 2026-05-22 to 2026-05-26): asked about the performance of calling several wallet RPCs per run

Files

706 lines under test/bench/ci.

  • src/wallet/test/fuzz/rpc.cpp +302/-0
  • src/test/fuzz/util/rpc.cpp +195/-0
  • src/test/fuzz/rpc.cpp +4/-176
  • src/test/fuzz/util/rpc.h +27/-0
  • src/test/fuzz/util/CMakeLists.txt +1/-0
  • src/wallet/test/fuzz/CMakeLists.txt +1/-0

Card

The short text the ranking pass compares across PRs.

This PR adds a wallet_rpc fuzz target and refactors RPC argument fuzzing helpers into a shared utility. It aims to provide fuzz coverage for wallet RPCs, which currently have zero coverage on OSS-Fuzz. Reviewers expressed strong approach doubts, arguing that fuzzing wallet RPCs without blockchain context or UTXOs has very low efficacy and that multi-call chaining would suffer poor performance. The author has not responded to the latest reviewer comments for nearly four months.

Data

dossier JSON · extract JSON · model ledger, generated 2026-09-18T03:30, confidence high, input hash 6d792c136fa46889
thread read through 2026-05-27 (10 statements), head 9d2b44b752
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Tests

Categories

Test infrastructure

P4 · test coverage (assessed alone as P3; Lowered to P4: reviewers argue fuzzing wallet RPCs without chain state or UTXOs has very low efficacy, so the claimed coverage gain is weakly supported.)

Extracts shared fuzz harness utility code and introduces fuzzing for RPC endpoints that previously had zero OSS-Fuzz coverage. While fuzzing wallet RPCs in isolation does not touch consensus or P2P code paths, expanding fuzz harness coverage to unexercised parameter parsing paths is worthwhile test infrastructure work.

Membership: Matches label 'Tests', modifies fuzz harness utilities in 'src/test/fuzz/util/rpc.{cpp,h}', and creates a new fuzz harness

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

Wallet

P4 · test coverage (assessed alone as P3; Lowered from P3: fuzzing wallet RPCs without chain state or UTXOs yields very little real coverage, making the benefit weakly justified.)

Addresses the lack of fuzz testing for wallet RPC parameter parsing and input validation. While isolated fuzzing without full state limits coverage of stateful wallet operations, hardening wallet RPC entry points against malformed inputs provides genuine stability value.

Membership: Adds a wallet-specific fuzz harness in 'src/wallet/test/fuzz/rpc.cpp' targeting wallet RPC methods

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