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

Enforce that node_ids are sorted in channel_announcements

Public commit record

What the developer wrote

Authored by Matt Corallo

91/100 · Strong
Enforce that node_ids are sorted in channel_announcements

We already enforced that nodes can't have a chanel with themselves,
but the spec was updated to require strict ordering at
https://github.com/lightning/bolts/pull/1333 so we enforce this as
well.

Test fixes by claude.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit tightens validation of Lightning network gossip messages. It now rejects channel announcements where the two node IDs are not in sorted (ascending) order, replacing a weaker rule that only blocked a node from announcing a channel with itself. This aligns the code with an updated Lightning protocol specification. The change is defensive and reduces the risk of inconsistent or duplicate channel records being accepted from the network.

Recommended action

No immediate action required. This is a defensive spec-compliance change. Operators should upgrade to a version containing this commit to ensure their node rejects non-compliant channel announcements, which improves network consistency and reduces attack surface from malformed gossip.

Security signals we found

01

Protocol conformance enforcement for channel_announcement node_id ordering

02

Replacement of equality check with strict ordering check

03

Error action remains IgnoreError, so invalid announcements are dropped rather than causing disconnect

04

Test infrastructure updated to generate spec-compliant announcements automatically

Risk score

Why this scored 40/100

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