Skip to content

Explicitly fail build when we cannot decode persisted AddressPool. - #1238

Merged
tnull merged 1 commit into
lightningdevkit:mainfrom
randomlogin:nov-26-fail-on-undecodable-address-pool
Nov 19, 2026
Merged

tnull merged 1 commit into
lightningdevkit:mainfrom
randomlogin:nov-26-fail-on-undecodable-address-pool

Conversation

@randomlogin

@randomlogin randomlogin commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1212.

As with other storage readings, we fail the build if we cannot read it (despite the fact that failing to read AddressPool is less severe than other failed readings).

NotFound stays a fresh pool: every node upgrading from v0.7.x has no record yet, and revealing fresh indices is correct for them.

@ldk-reviews-bot

ldk-reviews-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

I've assigned @tnull 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.

@Camillarhi Camillarhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this. I left a few comments

Nit: the commit message says "losing handed addresses", but the addresses lost are pooled ones that were never handed out. Something like "skipping pooled derivation indices" would be more accurate. Also a double space in "decode persisted".

Comment thread src/wallet/persist.rs Resolved
Comment thread src/wallet/mod.rs Resolved
@randomlogin
randomlogin force-pushed the nov-26-fail-on-undecodable-address-pool branch from ea4b91e to 0f9a345 Compare November 17, 2026 22:19
@randomlogin

Copy link
Copy Markdown
Contributor Author

Amended the commit.

@Camillarhi Camillarhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. LGTM!

@tnull tnull 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.

Thanks! To be honest I'm not fully sure hard failure is preferable here, but it is in-line with what we do elsewhere, so might as well keep it consistent for now.

Just a few nits.

Comment thread src/builder.rs Resolved
Comment thread src/wallet/persist.rs Resolved
Previously we continued the build after failing to decode the persisted
`AddressPool`, which skipped the pooled derivation indices: they stayed
revealed but were never handed out. Now we explicitly fail the build in
that case. A missing record still starts a fresh pool, as for wallets
that predate the pool.
@randomlogin
randomlogin force-pushed the nov-26-fail-on-undecodable-address-pool branch from 0f9a345 to c272dfb Compare November 18, 2026 13:31
@tnull
tnull merged commit e2a76ee into lightningdevkit:main Nov 19, 2026
13 of 27 checks passed
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.

Established wallets silently lose pooled addresses when the pool record is missing or undecodable

4 participants