AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 53 Bitcoin

Resume channels awaiting a completed monitor persistence on load

Public commit record

What the developer wrote

Authored by auto-pr-bot

81/100 · Strong
Resume channels awaiting a completed monitor persistence on load

A channel serialized with MONITOR_UPDATE_IN_PROGRESS was only resumed on
load through its tracked in-flight ChannelMonitorUpdates, but the initial
ChannelMonitor write (from funding_created/funding_signed) is never tracked
as one, and blocked updates the monitor already applied are dropped at load.
A channel whose monitor persistence completed after the last ChannelManager
write was therefore loaded with the flag set and nothing to ever clear it,
leaving it stuck: as funder the funding transaction was never broadcast and
channel_ready was never sent for confirmed funding, as acceptor channel_ready
was never sent for the peer's confirmed funding. This state is reached with
deferred monitor writes (where the background processor writes the
ChannelManager before flushing the new monitor) or a Persist that returns
InProgress for new channels, whenever the node goes down between the monitor
write and the next ChannelManager write.

If a channel is still awaiting a monitor update on load, the monitor is
present, and it has nothing in-flight or blocked, the persistence it was
waiting on must have completed since we were last serialized, so queue a
MonitorUpdatesComplete background event at the monitor's latest update_id,
the same way completed in-flight updates are handled. Channels with blocked
updates still go through AttemptUnblockMonitorUpdates and those with
in-flight updates through the existing replay logic, so the new branch is
exclusive with both.

Adds test_outbound_reload_with_completed_init_mon, mirroring the existing
test_outbound_reload_without_init_mon but handing the monitor back on
reload, and extends test_event_replay_causing_monitor_replay, which
exercised the blocked-update variant of the same gap: the channel is now
resumed on startup, so it expects the PaymentPathSuccessful produced by the
resume and verifies a payment can be sent afterwards.

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5603
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in the Lightning Dev Kit where a newly-created channel could get permanently stuck after a restart. If the channel's first monitor save finished after the last ChannelManager save, the channel would reload believing it was still waiting for that save, but nothing would ever clear the wait. As a result, the funding transaction was never broadcast and the channel could never become usable. The fix detects this situation on load and resumes the channel automatically. It is a reliability/availability bug, not a direct theft-of-funds vulnerability, because the channel simply fails to open rather than funds being stolen.

Recommended action

Review and merge the fix, then backport to maintained release branches. Operators running nodes with deferred monitor writes or custom Persist implementations returning InProgress should upgrade to avoid channels getting stuck after unclean restarts. No immediate incident response is required because the bug causes channels to stall rather than exposing keys or funds.

Security signals we found

01

Denial-of-service/availability impact: new channels can become permanently stuck after restart

02

State inconsistency between ChannelManager serialization and ChannelMonitor persistence

03

Fix includes regression tests for both completed-initial-monitor and blocked-update replay scenarios

04

No direct funds-loss path identified in the diff; stuck channel prevents funding broadcast

Risk score

Why this scored 53/100

Our methodology →
Potential impact 18/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.