Skip to content

feat: one-time stale channel monitor recovery#500

Closed
ben-kaufman wants to merge 21 commits intomasterfrom
fix/stale-monitor-recovery
Closed

feat: one-time stale channel monitor recovery#500
ben-kaufman wants to merge 21 commits intomasterfrom
fix/stale-monitor-recovery

Conversation

@ben-kaufman
Copy link
Contributor

Summary

  • On BuildError.ReadFailed, automatically retries build once with accept_stale_channel_monitors enabled
  • Persisted staleMonitorRecoveryAttempted UserDefaults flag ensures one-time only
  • Flag set on any successful build (affected or not) — zero impact on unaffected users

How to test

  1. Reproduce the stale monitor state (overwrite a channel monitor in VSS with an older update_id)
  2. Launch the app — first build fails with ReadFailed
  3. Verify the retry succeeds and the node starts
  4. Check logs for "Stale monitor recovery: build succeeded with accept_stale"
  5. Keep app open ~15s, verify "all monitors healed" in logs
  6. Kill and relaunch — verify normal startup (no retry triggered)

Dependencies

🤖 Generated with Claude Code

ben-kaufman and others added 21 commits March 16, 2026 21:29
On BuildError.ReadFailed (likely stale ChannelMonitor from migration
overwrite), automatically retry once with accept_stale_channel_monitors
enabled. The ldk-node recovery flag force-syncs the monitor's update_id
and heals commitment state via a delayed chain sync + keysend round-trip.

A persisted UserDefaults flag ensures this only triggers once — set on
any successful build (affected or not), preventing future retries.

Depends on: synonymdev/ldk-node#76

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jvsena42
Copy link
Member

replaced by #501

@jvsena42 jvsena42 closed this Mar 18, 2026
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.

2 participants