Skip to content

Explicitly persist wallet birthday - #1250

Open
tnull wants to merge 2 commits into
lightningdevkit:mainfrom
tnull:2026-11-persist-wallet-birthday
Open

tnull wants to merge 2 commits into
lightningdevkit:mainfrom
tnull:2026-11-persist-wallet-birthday

Conversation

@tnull

@tnull tnull commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

When creating a new on-chain wallet, we insert a first checkpoint as
its birthday, but never persisted it explicitly. It only reached the
store because filling the address pool later in the build happens to
flush the wallet's staged changes. Without that side effect, a node
restarted before its first sync would reload the wallet at genesis and
try to rescan the whole chain, which never succeeds against a pruned
bitcoind.

We now persist the wallet right after applying the checkpoint, failing
the build if that doesn't succeed, so the birthday no longer depends
on unrelated wallet persistence.

When creating a new on-chain wallet, we insert a first checkpoint as
its birthday, but never persisted it explicitly. It only reached the
store because filling the address pool later in the build happens to
flush the wallet's staged changes. Without that side effect, a node
restarted before its first sync would reload the wallet at genesis and
try to rescan the whole chain, which never succeeds against a pruned
bitcoind.

We now persist the wallet right after applying the checkpoint, failing
the build if that doesn't succeed, so the birthday no longer depends
on unrelated wallet persistence.

Reported-by: vnprclanker
Co-Authored-By: HAL 9000
Nothing covered that a node restarted between its first build and its
first wallet sync keeps the wallet birthday rather than rescanning
from genesis.

We add an integration test that builds a fresh node against bitcoind,
drops it before it syncs, and checks that the rebuilt node doesn't
pick up a payment confirmed before its birthday.

Co-Authored-By: HAL 9000
@tnull tnull added this to the 0.8 milestone Nov 19, 2026
@tnull
tnull requested a review from tankyleo November 19, 2026 10:35
@ldk-reviews-bot

ldk-reviews-bot commented Nov 19, 2026 •

Copy link
Copy Markdown

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants