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

pytest: add test to demonstrate gossip_store misordering node announcements.

Public commit record

What the developer wrote

Authored by Rusty Russell

95/100 · Strong
pytest: add test to demonstrate gossip_store misordering node announcements.

We usually lose the node announcement on restart, because the
node_announcement message is ignored by gossmap, as it doesn't (yet!) know of the node, since the
channel_announcement does not precede the node_announcement.

This is supposed to be detected and fixed by gossipd, but this simple test shows that it is not!

```
FAILED tests/test_gossip.py::test_gossmap_lost_node - AssertionError: assert {'nodes': [{'nodeid': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'alias': 'SILENTARTIST-v25.12-2-g703851b', 'color': '022d22', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}, {'nodeid': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'alias': 'JUNIORBEAM-v25.12-2-g703851b', 'color': '0266e4', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}, {'nodeid': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d'}, {'nodeid': '0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199', 'alias': 'JUNIORFELONY-v25.12-2-g703851b', 'color': '0382ce', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}]} == {'nodes': [{'nodeid': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'alias': 'SILENTARTIST-v25.12-2-g703851b', 'color': '022d22', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}, {'nodeid': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'alias': 'JUNIORBEAM-v25.12-2-g703851b', 'color': '0266e4', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}, {'nodeid': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d', 'alias': 'HOPPINGFIRE-v25.12-2-g703851b', 'color': '035d2b', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}, {'nodeid': '0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199', 'alias': 'JUNIORFELONY-v25.12-2-g703851b', 'color': '0382ce', 'last_timestamp': 1765172273, 'features': '8898880a8a59a1', 'addresses': []}]}

Differing items:
{'nodes': [{'addresses': [], 'alias': 'SILENTARTIST-v25.12-2-g703851b', 'color': '022d22', 'features': '8898880a8a59a1...}, {'addresses': [], 'alias': 'JUNIORFELONY-v25.12-2-g703851b', 'color': '0382ce', 'features': '8898880a8a59a1', ...}]} != {'nodes': [{'addresses': [], 'alias': 'SILENTARTIST-v25.12-2-g703851b', 'color': '022d22', 'features': '8898880a8a59a1...}, {'addresses': [], 'alias': 'JUNIORFELONY-v25.12-2-g703851b', 'color': '0382ce', 'features': '8898880a8a59a1', ...}]}

Full diff:
{
'nodes': [
{
'addresses': [],
'alias': 'SILENTARTIST-v25.12-2-g703851b',
'color': '022d22',
'features': '8898880a8a59a1',
'last_timestamp': 1765172273,
'nodeid': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59',
},
{
'addresses': [],
'alias': 'JUNIORBEAM-v25.12-2-g703851b',
'color': '0266e4',
'features': '8898880a8a59a1',
'last_timestamp': 1765172273,
'nodeid': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518',
},
{
- 'addresses': [],
- 'alias': 'HOPPINGFIRE-v25.12-2-g703851b',
- 'color': '035d2b',
- 'features': '8898880a8a59a1',
- 'last_timestamp': 1765172273,
'nodeid': '035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d',
},
{
'addresses': [],
'alias': 'JUNIORFELONY-v25.12-2-g703851b',
'color': '0382ce',
'features': '8898880a8a59a1',
'last_timestamp': 1765172273,
'nodeid': '0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199',
},
],
}

```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ 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 that demonstrates a bug: after restarting a Core Lightning node, one node's announcement information can disappear from the local network view. The test is marked as expected to fail, so it documents the problem rather than fixing it. There is no immediate security exploit here, but it shows a reliability issue in how the node stores and reloads network gossip data.

Recommended action

Treat this as a bug-report test. A follow-up fix should ensure gossipd correctly reorders or reprocesses node_announcements relative to channel_announcements after restart, and the xfail marker should be removed once the underlying issue is resolved. No immediate patch or deployment action is required from this commit alone.

Security signals we found

01

gossip_store message ordering defect

02

node_announcement dropped on restart

03

gossmap ignores node announcement without prior channel_announcement

04

test marked xfail documenting unfixed behavior

Risk score

Why this scored 28/100

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