fix: scan-rpc ignores wallet birthday#60
Open
GuiSchet wants to merge 1 commit into
Open
Conversation
nymius
approved these changes
May 18, 2026
Collaborator
|
I had to fix something before merge, could you rebase? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #59.
scan-rpcwas constructing thebdk_bitcoind_rpc::Emitterwithstart_height = 0, so every invocation began emitting blocks from genesis and crawled the entire chain history regardless of the wallet'sbirthday.This change mirrors the logic that
scan-cbfalready implements.Notes to the reviewers
No tests were added: there are no existing tests under
cli/v2/andjust check/just testare both configured to excludebdk_sp_cli_v2.Execution trace
Demo setup on signet:
304930299930(= tip − 5000)00000012361b7baaa62a7b357c4127d463a4ed7cdfc5a243bbdaca90dad2ce9bFor each run a fresh DB was used (
sp-cli2 create --network signet --birthday-height 299930 --birthday-hash <hash>), thensp-cli2 scan-rpcagainst a fully-synced local bitcoind. The CLI's existing periodic print reportssynced to <hash> @ <height>— the<height>column is what tells us where the emitter is actually iterating.Before (
master,start_height = 0)After 90 s the scanner is still around height
~38000.After (
fix/scan-rpc-birthday)The first 6 s print already shows the emitter at height
299977— only 47 blocks past the wallet birthday — and the scanner iterates forward from there toward the tip.Checklists
All Submissions:
just p(fmt, clippy and test) before committing