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

channeldb: persist local updates the peer acked before our first revoke (#11268)

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

96/100 · Strong
channeldb: persist local updates the peer acked before our first revoke (#11268)

* channeldb: persist local updates the peer acked before our first revoke

In this commit, we fix AdvanceCommitChainTail so it always persists our
updates the peer acknowledged but hasn't signed for yet. It used to
return early when no unsigned acked updates were stored, which skipped
that write. Nothing stores the unsigned acked updates until we first
revoke a commitment of our own, so every channel takes that path until
then, not only nodes that are upgrading, as the comment assumed.

The window matters for fee updates. If the initiator's first update is a
fee update, the peer revokes, and the connection drops before the peer's
commitment_signed arrives, the initiator restores without the fee update.
It then rejects the peer's valid signature for a commitment that covers
the fee, and the link force closes the channel. The new test runs that
sequence, and fails without the fix.

Settles and fails can't hit this, since removing an HTLC needs it locked
in, which means we already revoked once. The mirror test's restart step
found this.

* docs: add release note for the unsigned acked updates fix
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in LND's channel database where a specific type of fee update could be lost if a node restarted at a very precise moment during a Lightning channel's setup. If triggered, the node would reject a valid signature from its peer and force-close the channel, potentially causing funds to be locked on-chain and transaction fees to be paid unnecessarily. The bug only affects the channel initiator's first update if it is a fee change, and only if the connection drops before the peer sends a commitment signature. The fix ensures these acknowledged-but-not-yet-signed local updates are always saved to disk.

Recommended action

Apply the patch and include the regression test. Nodes running affected versions should upgrade, especially those that frequently initiate fee updates on newly opened channels. Monitor for unexpected force-closures after restarts.

Security signals we found

01

Force-closure of a Lightning channel due to state desynchronization after restart

02

Loss of locally initiated fee updates before first local revocation

03

Regression test reproduces restart scenario leading to signature rejection

04

Fix removes early return that skipped persisting unsigned acknowledged updates

05

Release notes explicitly describe the bug and its force-close consequence

Risk score

Why this scored 66/100

Our methodology →
Potential impact 22/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.