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

pytest: test for crash when we have dying channels and compact the gossip_store.

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
pytest: test for crash when we have dying channels and compact the gossip_store.

Before I fixed the handling of dying channels:

```
lightning_gossipd: gossip_store: can't read hdr offset 2362/2110: Success (version v25.12-279-gb38abe6-modded)
0x6537c19ecf3a send_backtrace
common/daemon.c:38
0x6537c19f1a1d status_failed
common/status.c:207
0x6537c19e557a gossip_store_get_with_hdr
gossipd/gossip_store.c:527
0x6537c19e5613 check_msg_type
gossipd/gossip_store.c:559
0x6537c19e5a36 gossip_store_set_flag
gossipd/gossip_store.c:577
0x6537c19e5c82 gossip_store_del
gossipd/gossip_store.c:629
0x6537c19e8ddd gossmap_manage_new_block
gossipd/gossmap_manage.c:1362
0x6537c19e390e new_blockheight
gossipd/gossipd.c:430
0x6537c19e3c37 recv_req
gossipd/gossipd.c:532
0x6537c19ed22a handle_read
common/daemon_conn.c:35
0x6537c19fbe71 next_plan
ccan/ccan/io/io.c:60
0x6537c19fc174 do_plan
ccan/ccan/io/io.c:422
0x6537c19fc231 io_ready
ccan/ccan/io/io.c:439
0x6537c19fd647 io_loop
ccan/ccan/io/poll.c:470
0x6537c19e463d main
gossipd/gossipd.c:609
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit adds a test that reproduces a crash in Core Lightning's gossip daemon. The crash happens when the network's gossip store is compacted while a channel is in a 'dying' state (closing but not yet fully removed). The bug caused internal record offsets to become wrong, leading to a fatal read error and daemon crash. The commit message says the underlying handling was already fixed; this change only adds the regression test.

Recommended action

Verify that the production fix referenced in the commit message is already merged and that this regression test passes. Consider whether any other store-compaction paths (e.g., automatic compaction) could still hit the same stale-offset issue, and add coverage if needed.

Security signals we found

01

Daemon crash / denial of service in gossipd

02

Use of stale offsets after gossip store compaction

03

Regression test for previously fixed crash

04

Crash occurs during normal channel closure lifecycle

Risk score

Why this scored 58/100

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