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!
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
Technical analysis
Evidence from the diff
The commit adds test_gossmap_lost_node in tests/test_gossip.py. It creates a 4-node line graph, closes a channel, waits for the close to propagate, records l1’s view of channels and nodes, restarts l1, and asserts that the post-restart gossip view matches the pre-restart view. The test is decorated with @pytest.mark.xfail(strict=True) because it currently fails: a node_announcement is lost on restart when a channel_announcement does not precede it in the gossip_store, causing gossmap to ignore the node announcement. The commit does not include any fix.
Changed components
tests/test_gossip.pygossipd gossip store handlinggossmap
This commit is a simple documentation revert. It undoes a previous change that told macOS users to install GNU make and GNU patch from Homebrew and to put those tools first in their command path. The reverted instructions now omit gpatch a…
This commit re-adds an old-style 'x' prefix to a string comparison in a test helper script. It is a test-only change with no effect on the actual Core Lightning node software, user funds, network behavior, or security. The change simply re…
This commit only updates macOS installation instructions in the documentation. It tells macOS users to install newer GNU versions of 'make' and 'patch' from Homebrew because Apple's built-in tools are too old for building and running sourc…