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

graph/db: add test for SetSourceNode same timestamp behavior

Public commit record

What the developer wrote

Authored by Elle Mouton

95/100 · Strong
graph/db: add test for SetSourceNode same timestamp behavior

This commit adds TestSetSourceNodeSameTimestamp to demonstrate the
current behavior when SetSourceNode is called with the same last update
timestamp. The test reveals a difference between the SQL and bbolt
implementations:

- SQL store returns sql.ErrNoRows when attempting to update with the
same timestamp, as the upsert query's UPDATE clause requires the new
timestamp to be strictly greater than the existing one
- bbolt store silently ignores stale updates and returns no error

This behavior is important to document because our own node
announcements may change quickly with the same timestamp, unlike
announcements from other nodes where same timestamp typically means
identical parameters.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only adds a new test to document an existing inconsistency between two database backends in the Lightning Network Daemon (LND). It does not change production code. The test shows that when LND updates its own node information with the same timestamp but different details, the SQL database backend rejects it with an error, while the older bbolt backend accepts it silently. The commit message says this will be fixed later. So by itself, this commit is not a security fix and does not introduce a vulnerability, but it documents a real behavioral quirk that could affect how LND stores its own node announcements.

Recommended action

Treat this commit as a documentation/test addition, not a security patch. Monitor the follow-up commit referenced in the message that will fix the inconsistent behavior. If running the SQL backend, be aware that same-timestamp source node updates currently fail, which could delay propagation of updated node announcements but is not directly exploitable by a remote attacker.

Security signals we found

01

Behavioral inconsistency between SQL and bbolt storage backends documented

02

Same-timestamp node self-announcement may be rejected or ignored depending on backend

03

No production code change; test-only commit

04

Commit message indicates a fix is planned in a subsequent commit

Risk score

Why this scored 27/100

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