lightningdevkit / ldk-node

A ready-to-go node implementation built using LDK.
Other
140 stars 72 forks source link

Periodically archive fully resolved channel monitors #307

Closed tnull closed 3 months ago

tnull commented 3 months ago

Fixes #300.

Previously, LDK was very conservative and kept channel monitors around ~forever or until the user manually decided to prune them. Recently it introduced the ChainMonitor::archive_fully_resolved_monitors method, which we now call periodically: every time a wallet sync succeeds, we check whether the latest archival height is 6 blocks in the past and call archive_fully_resolved_monitors.

As this is not permanently persisted, we will always try to archive any pruned monitors when the first background sync after fresh initialization succeeds, ensuring we call it regularly also on short-lived sessions, e.g, on mobile.

In the second and third commit, we fix previous omissions of sync_wallets: we now update the timestamps read by NodeStatus and also have it update the fee rate cache.

tnull commented 3 months ago

Rebased to resolve minor conflict after #141 landed.

G8XSU commented 3 months ago

Lgtm!, fix for making archive work in mobile can land independently and will make it to ldk-node when ldk is upgraded later.