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

Merge PR 'Track refused monitor updates as pending until persisted' (#5663)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Track refused monitor updates as pending until persisted' (#5663)

from bot/5640-async-chainmonitor-completes-ref-0d0089 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5663
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ 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's handling of channel monitor updates that are refused because the channel's funding transaction was already spent on-chain. Previously, such refused updates were persisted as a full monitor snapshot rather than as a normal update, and were not tracked as 'pending' while asynchronous persistence was in progress. That meant a later update could be marked complete before the refused update (which might contain important payment data like a forwarded HTLC preimage) was actually durable on disk. The fix makes refused updates follow the same persistence and pending-tracking path as accepted updates, and also allows monitor restoration to continue even if replaying a stored update is refused.

Recommended action

Treat this as a bug-fix commit with security relevance for nodes using asynchronous ChannelMonitor persistence. Users running LDK-based nodes should upgrade to a release containing this fix to avoid potential state inconsistency after crashes or restarts involving refused monitor updates. No immediate emergency response is indicated, but operators should monitor for releases and apply updates during normal maintenance windows.

Security signals we found

01

Durability ordering bug: later MonitorEvent::Completed could imply earlier refused update was persisted

02

Refused monitor update may carry forwarded HTLC preimage, creating risk of inconsistent state across restart

03

Asynchronous persistence tracking gap for refused updates

04

Monitor restoration failure mode when replaying refused updates

Risk score

Why this scored 66/100

Our methodology →
Potential impact 22/30
Exploitability 10/25
Stealth signal 12/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.