feat: Limit initial scan to last N blocks - #605
Closed
rustaceanrob wants to merge 1 commit into
Closed
rustaceanrob wants to merge 1 commit into
rustaceanrob wants to merge 1 commit into
Conversation
rustaceanrob
force-pushed
the
26-9-12-filter-skip
branch
from
September 14, 2026 12:53
6884070 to
758857b
Compare
Users cannot currently omit filter scanning for new wallets. The node still needs to find the most-work chain, so syncing from some header snapshot is unavoidable, but the header commitments and filters do not have to be downloaded for that window.
rustaceanrob
force-pushed
the
26-9-12-filter-skip
branch
from
September 14, 2026 13:18
758857b to
b243fe1
Compare
There was a problem hiding this comment.
I don't feel like I'm knowledgable about the codebase enough to give a full ACK for this, but I do wanted to comment with 2 things:
- I've been focused on trying to build an intuitive and flexible API for end users of compact block filters in production, and so that comes through the bdk_kyoto crate (for me at least). If this low-level change allows positive changes on that API, I'm all for it! But if I may, I'd suggest that it'd be great to see how it comes through for the end users on the bdk_kyoto crate before merging this (unless this PR is considered a strict improvement that can happen regardless of what bdk_kyoto does with it). A PR that would explore the separation between the checkpoint slash trusted block headers and the download of CBFs would be great, since this IMO needs more clarity and flexibility than the
ScanTypecurrently allows for/expresses. - When looking at the API, I was wondering what exactly happens if some of the configurations are not consistent with each other. It's a corner case but still; if a user provides a checkpoint that was merged an hour ago but sets
Builder::scan_filters_from_tip(100_000), it feels like a footgun since the behaviour there is underfined in my mental model of what the builder will do.
Member
Author
I drafted bitcoindevkit/bdk-kyoto#165 which introduces a new type to enforce some of these constraints. There are three routes to start a sync, each one conveying what they are intended for. The builder is then constrained by switch route the user chooses. For instance, if a new wallet is the intention, the configuration introduced here is set under the hood. Other routes do not interact with this at all. |
rustaceanrob
marked this pull request as draft
September 16, 2026 11:38
Member
Author
|
#606 is preferred IMO |
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.
"Closes" #603, although additional features similar to this one may be useful in the future, so I will leave that issue open.
This introduces a method on the builder so users can take a fixed
Namount of filters from the tip, after they do headers sync. This should significantly speed up the startup time for new users that just want to interact with their wallet straight away.