mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
wallet, test: make wallet_fast_rescan robust #34907
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!34907
Loading…
Reference in a new issue
No description provided.
Delete branch "rescan-fast"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This patch addresses my own review comments from the review of #34667 and adds some more changes that I find helpful. It was observed in the review of the earlier PR that there is a tendency for the test code to cause the topups not being done that defeats the purpose of the test. Combine that with the earlier issue where the block filter was not being updated ever since this test was written, I think it's helpful that some robustness is added in the test.
Exact details are in the commit message.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
The test already records the txids it creates, but at the end it only checks counts and that fast/slow agree with each other.
It would be stronger to flatten the generated wallet-related txids and assert each rescan result equals that exact expected set.
diff
The test doesn't need to depend on a specific debug-log string.
You can assert the same behavior more directly via
listdescriptors: get the descriptor's currentend_range, send to that address, then verify the range increases.diff
This part seems more complex than the behavior being asserted. If the goal is just to include a block with wallet-unrelated transactions, would a single unrelated tx be enough ? That would make the intent clearer.
nit:
This was intentional on my part but I see it can come across as confusing and is also not necessary. I will remove the chain.
Good suggestions, I will add them.
Added all the suggestions from w0xlt's review in latest push.
I realised that wait_until is not needed for asserting that the top is being done because adding a simple greater than assertion post send_to call is sufficient, so made that change.
ACK 292a949863b4c13e1f88ac6f1b2622eaac7c4e70 with non-blocking suggestions.
nit:
nit:
nit:
nit:
Force pushed to use suggestions from @w0xlt's review: https://github.com/bitcoin/bitcoin/pull/34907#pullrequestreview-4340246369.
reACK bf0f5d9941fb251692af58c411362c5b0e4e8396
I'm fine as leaving as it is now. But wouldn’t it be clearer to generate the blocks when we broadcast the transaction? I understand your point about wanting to separate the transaction broadcast and block generation flows to highlight when the top is being done, but I think it makes the test a little bit more confusing. I believe that if the blocks are generated in the same loop where the topups are being done, it can still be clear to follow both flows and will make the test clearer and more compact.
I'll leave the diff of how I would do it.
diff
As said at the begining I'm fine with merging as is. Seeing other people have already ack maybe is just me who find this flow confusing.
Yeah, that makes sense as it can make the test feel less contrived. I had considered it when I had raised the PR but ended up didn't doing it then.
Done now.
The Windows native, VS failure is a Github issue.
lgtm ACK
f217da5c59@w0xlt do you want to give this another look?
lgtm ACK
f217da5c59I don't think the wallet prefix in the commit title is accurate, this is not touching wallet code.
ACK
f217da5c59Base:
8c49a9abe9196e35000849df76445037216b6d75Head:
f217da5c59f43b43abca96de66b95c24ae99eed7🟡 Minor
Synchronize wallet notifications before checking range growth (test/functional/wallet_fast_rescan.py:84, head)
send_tobroadcasts throughsendrawtransaction, which queues a mempool notification for validation-interface processing. The RPC response does not guarantee that the wallet has processed the notification before thislistdescriptorscall. If the callback has not run, the range remains unchanged and the assertion fails despite correct top-up behavior. The test's own broadcasts exercise this timing path, so this is a test-reliability issue, not a production-wallet defect. Flush the validation-interface queue or wait for the range to advance before asserting.💡 Suggestion
Express the loop count directly (test/functional/wallet_fast_rescan.py:70, head)
The loop variable is unused, but
range(1, NUM_BLOCKS - 1)can look like it skips an iteration and requires readers to derive the block count.range(NUM_BLOCKS - 2)preserves the number of iterations while making the intended count explicit.Review coverage was incomplete. The archaeology review had incomplete evidence. The adversarial_glm review had incomplete evidence.
Full review report