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

Correct gossip forwarding criteria while doing background sync

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Correct gossip forwarding criteria while doing background sync

If we're doing gossip backfill to a peer, we first forward all our
`channel_announcement`s and `channel_update`s in SCID-order. While
doing so, we don't forward any fresh `channel_update` messages for
any channels which we haven't yet backfilled (as we'll eventually
send the new update anyway, and it might get rejected without the
corresponding `channel_announcement`).

Sadly, our comparison for this was the wrong way, so we actually
*only* forwarded updates which were for channels we haven't yet
backfilled, and dropped updates for channels we already had
backfilled.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a flipped comparison in Lightning Dev Kit's gossip message forwarding. During a background sync, nodes share old channel announcements in order. To avoid sending updates before their matching announcements, the code was supposed to temporarily hold back fresh updates for channels not yet synced. Instead, the comparison was backwards, so it held back updates for already-synced channels and forwarded only updates for not-yet-synced channels. The fix changes the comparison direction and adds a test to confirm the correct behavior.

Recommended action

Apply the patch to correct the comparison and run the new regression test. Monitor for any related gossip synchronization issues in deployed nodes, particularly those doing full sync with peers.

Security signals we found

01

Logic error in gossip forwarding filter

02

Inverted comparison operator in sync-state guard

03

New regression test added for forwarding behavior

04

Test helper added to expose encoded message contents

Risk score

Why this scored 36/100

Our methodology →
Potential impact 8/30
Exploitability 3/25
Stealth signal 6/15
Affected reach 7/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.