Add --rescan-from-height CLI argument#196
Draft
tnull wants to merge 1 commit intolightningdevkit:mainfrom
Draft
Conversation
Expose the ldk-node wallet-recovery API through a new top-level CLI
flag (also overridable via the `LDK_SERVER_RESCAN_FROM_HEIGHT`
environment variable). When set on a fresh node's first startup, the
value is passed through to
`Builder::set_wallet_recovery_mode(Some(RecoveryMode { rescan_from_height: Some(h) }))`
so the wallet picks up funds sent before the current chain tip.
Bitcoin Core RPC/REST chain sources honor the height precisely by
resolving the block hash at `h` and using it as the wallet birthday.
Esplora/Electrum backends cannot resolve a block hash from a height
via the BDK client APIs, so they ignore the value but still escalate
the next sync to a one-shot `full_scan` to re-discover funds on
previously-unknown addresses.
The `ldk-node` dependency is temporarily pointed at the local
`2026-04-abort-on-first-startup-tip-fetch-failure` worktree since the
`RecoveryMode` API is not yet on ldk-node's upstream main; the
Cargo.toml entry should be restored to a pinned upstream git rev once
that branch merges.
Co-Authored-By: HAL 9000
|
👋 Hi! This PR is now in draft status. |
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.
Based on lightningdevkit/ldk-node#884
Draft for now.
Expose the ldk-node wallet-recovery API through a new top-level CLI flag (also overridable via the
LDK_SERVER_RESCAN_FROM_HEIGHTenvironment variable). When set on a fresh node's first startup, the value is passed through toBuilder::set_wallet_recovery_mode(Some(RecoveryMode { rescan_from_height: Some(h) }))so the wallet picks up funds sent before the current chain tip.Bitcoin Core RPC/REST chain sources honor the height precisely by resolving the block hash at
hand using it as the wallet birthday. Esplora/Electrum backends cannot resolve a block hash from a height via the BDK client APIs, so they ignore the value but still escalate the next sync to a one-shotfull_scanto re-discover funds on previously-unknown addresses.The
ldk-nodedependency is temporarily pointed at the local2026-04-abort-on-first-startup-tip-fetch-failureworktree since theRecoveryModeAPI is not yet on ldk-node's upstream main; the Cargo.toml entry should be restored to a pinned upstream git rev once that branch merges.Co-Authored-By: HAL 9000