#34907 wallet, test: make wallet_fast_rescan robust

full analysis

https://github.com/bitcoin/bitcoin/pull/34907 · rkrux · +56/-33 in 1 files, 1 commits · labels: none

Goal

  • Make the wallet fast rescan functional test robust against silent setup failures
  • Ensure descriptor keypool top-ups are genuinely exercised during rescan tests

Follow-up improvements to test/functional/wallet_fast_rescan.py. The test now explicitly asserts that descriptor end ranges increase upon transaction broadcast to guarantee keypool top-ups occur, checks exact expected txids rather than just counts, and unloads the test wallet after generating transactions.

Problem: In the existing fast rescan test, test setup could fail to trigger the intended descriptor top-ups without failing the test, defeating its purpose.

Category: Wallet (#59 of 84)

P3 · test coverage

  • P3 because it hardens regression coverage for descriptor top-ups in fast rescan tests
  • Prevents tests from silently passing when setup fails to trigger intended top-ups

Strengthens regression testing for wallet descriptor top-ups during fast rescan. As rkrux notes, 'there is a tendency for the test code to cause the topups not being done that defeats the purpose of the test', so checking descriptor end ranges ensures the code path is properly exercised.

Membership: Changes test/functional/wallet_fast_rescan.py, which tests wallet descriptor keypool top-ups and fast rescan.

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

Reviewability: Stale: Author silent 104d

  • Author has been silent for 104 days
  • Branch is rebased with an approval on head

The author has been inactive for 104 days, exceeding the stale_author_silent_days threshold, even though the branch is rebased and has an ACK on head.

Author status: silent since 2026-06-05 after addressing reviewer suggestions

Resolved concerns:

  • w0xlt suggested asserting descriptor end range increases rather than relying on debug log messages, and checking exact expected txids rather than counts; author implemented both.
  • Bicaru20 suggested generating blocks directly when broadcasting transactions to make the test flow clearer; author adopted the suggestion.

Agreement: Strong

  • Strong support after author incorporated all reviewer improvements
  • Suggested asserting descriptor range growth and exact txids (w0xlt)
  • Approved the latest commit after simplifying the test flow (Bicaru20)

Strong: w0xlt and Bicaru20 provided concrete suggestions that were adopted, with Bicaru20 giving ACK on head.

Reviewers substantively engaged with test design and logic assertions. All reviewer feedback was incorporated and Bicaru20 ACKed the latest commit without objections.

  • w0xlt provided code suggestions for checking descriptor ranges and asserting exact txids, ACKed prior revision
  • Bicaru20 suggested combining tx broadcast and block generation loops, then gave 'lgtm ACK f217da5c59'

Review verdicts (DrahtBot): 1 (+1)

Files

89 lines under test/bench/ci.

  • test/functional/wallet_fast_rescan.py +56/-33

Card

PR 34907 hardens test/functional/wallet_fast_rescan.py by asserting that descriptor end ranges actually expand after transactions are broadcast, ensuring descriptor top-ups are genuinely triggered during fast rescan tests. It also checks exact sets of expected txids rather than only counts and cleans up the block-generation flow. Reviewers w0xlt and Bicaru20 contributed improvements and Bicaru20 ACKed the current commit, but the author has been silent for over 100 days.

Data

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