Skip to content

Add --rescan-from-height CLI argument#196

Open
tnull wants to merge 3 commits into
lightningdevkit:mainfrom
tnull:2026-04-rescan-from-height-arg
Open

Add --rescan-from-height CLI argument#196
tnull wants to merge 3 commits into
lightningdevkit:mainfrom
tnull:2026-04-rescan-from-height-arg

Conversation

@tnull

@tnull tnull commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Based on lightningdevkit/ldk-node#884

We expose --rescan-from-height and --force-wallet-full-scan CLI arguments. First we bump the LDK Node dependency though, to include the changes from #884.

@ldk-reviews-bot

ldk-reviews-bot commented Apr 21, 2026

Copy link
Copy Markdown

👋 Hi! This PR is now in draft status.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@tnull tnull marked this pull request as draft April 21, 2026 13:09
tnull added 3 commits June 30, 2026 10:08
Use the latest LDK Node main revision now that wallet recovery
support has landed upstream.

Keep ldk-server compiling across the dependency's API changes so
the remaining branch commits can focus on startup flags.

Co-Authored-By: HAL 9000
Expose a startup option for bitcoind-backed wallet recovery
without silently accepting unsupported chain sources.

Pass the height through to LDK Node only when the bitcoind
RPC chain source is configured.

Co-Authored-By: HAL 9000
Expose a startup option for Electrum and Esplora wallet
recovery without accepting it for bitcoind RPC.

Pass the request through LDK Node sync config so a full scan
is forced until one succeeds.

Co-Authored-By: HAL 9000
@tnull tnull force-pushed the 2026-04-rescan-from-height-arg branch from bc347e8 to 879e589 Compare June 30, 2026 08:19
@tnull tnull marked this pull request as ready for review June 30, 2026 08:20
@tnull tnull requested a review from benthecarman June 30, 2026 08:20

@benthecarman benthecarman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you excluded these from the toml config, makes sense because its not really something you set persistently, just for a single run. Should we exclude the env variations for these too then? Env variables feel similar to me but maybe that's just my systemd preference coming out

if self.force_wallet_full_scan {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"`--force-wallet-full-scan` requires the Electrum or Esplora chain source.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should reference rescan-from-height in this error message

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, could you expand what you're thinking of there? Seems they are slightly orthogonal, so not sure why we need the cross-referencing?

if self.rescan_from_height.is_some() {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"`--rescan-from-height` requires the bitcoind RPC chain source.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should reference --force-wallet-full-scan in this error message

if self.rescan_from_height.is_some() {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"`--rescan-from-height` requires the bitcoind RPC chain source.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants