#35177 test: use MiniWallet for getblockstats test data generation

full analysis

https://github.com/bitcoin/bitcoin/pull/35177 · AgusR7 · +188/-179 in 2 files, 1 commits · labels: Tests

Goal

  • Allow regenerating getblockstats test data on builds configured without wallet support
  • Fixes test data generation failure when the wallet is disabled

Updates `rpc_getblockstats.py` to use `MiniWallet` instead of the node's internal wallet RPCs when running with `--gen-test-data`. Regenerates the `rpc_getblockstats.json` fixture data to match the output produced by the updated generator.

Problem: Running `rpc_getblockstats.py --gen-test-data` fails on builds configured without the wallet (`-DENABLE_WALLET=OFF`) because test data generation relied on legacy wallet RPCs (#31838).

Category: Test infrastructure (#27 of 45)

P3 · bug fix

  • P3 because it repairs a test maintenance script rather than normal test execution
  • Unblocks developers regenerating test fixtures when compiling without the wallet

Fixes a broken functional test maintenance tool tracked in issue #31838. While it does not affect CI runs or normal test execution, it unblocks developers regenerating test fixtures on wallet-disabled builds.

Membership: Modifies functional test data generation in rpc_getblockstats.py and updates test fixture json data.

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

Reviewability: Ready

  • Ready to review
  • Cleanly applies with passing CI and all reviewer questions answered

The PR cleanly applies, CI passes, and the author responded to all reviewer questions.

Author status: active

Resolved concerns:

  • theStack requested rebasing on master and using MiniWallet's send_to method for OP_RETURN transactions, which the author implemented.
  • sedited asked why the fixture transactions switched to segwit, and the author explained this is the default spending behavior of MiniWallet.

Agreement: Strong

  • Verified by testing fixture generation on wallet-disabled builds (theStack)
  • Question about segwit format in the regenerated data addressed by author (sedited)

Strong: theStack verified and ACKed the fix for wallet-disabled builds (#31838)

theStack provided an explicit tested ACK verifying the fix for issue #31838, and a question from sedited regarding transaction types in the regenerated fixture was answered without further contention.

  • theStack: 'ACK b7cbd80428... Verified that this PR fixes #31838 and the test data generation works without wallet (i.e. -DENABLE_WALLET=OFF build).'
  • mercie-ux: ACK d05f32e on minfee/maxfee test coverage (stale).
  • sedited asked why test data shifted to segwit, and AgusR7 clarified that MiniWallet defaults to P2TR/witness spends.

Review verdicts (DrahtBot): 1 (+1)

Files

367 lines under test/bench/ci.

  • test/functional/data/rpc_getblockstats.json +157/-157
  • test/functional/rpc_getblockstats.py +31/-22

Card

Updates rpc_getblockstats.py so that its --gen-test-data flag generates fixture data using MiniWallet instead of node wallet RPCs, and updates rpc_getblockstats.json accordingly. This fixes issue #31838 where test data generation failed on builds compiled without the wallet. Review is positive with an ACK from theStack confirming the fix works with -DENABLE_WALLET=OFF, and an author response explaining the incidental segwit fixture changes. No open blockers or dependencies remain.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T16:18, confidence high, input hash 06460c6a5f02c706