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

gossipd: don't compact on startup.

Public commit record

What the developer wrote

Authored by Rusty Russell

68/100 · Adequate
gossipd: don't compact on startup.

We now only need to walk it if we're doing an upgrade.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: `gossipd` no longer compacts gossip_store on startup (improving start times significantly).
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change stops Core Lightning's gossip daemon from automatically 'compacting' (cleaning up and rewriting) its gossip store file every time the node starts. Instead, it only rewrites the file when an actual version upgrade is needed. The main benefit is faster startup. The patch also tightens error handling when creating a fresh store file. There is no direct evidence in the commit that this fixes a known security vulnerability; it reads primarily as a performance and robustness improvement.

Recommended action

Treat as a normal code-quality/performance patch. Reviewers should verify that skipping compaction does not allow corrupt or maliciously crafted store records to persist across restarts in a way that affects routing or memory safety, and that the new hard-error paths during store creation are exercised. No immediate security response is indicated by the commit content.

Security signals we found

01

Reduced startup I/O and file rewrite reduces the attack surface for race-condition or crash-induced store corruption during startup.

02

New hard failure (status_failed) if the initial uuid/version cannot be written to a freshly created store, preventing silent creation of an invalid empty store.

03

Removal of unconditional compaction means malformed/deleted records are no longer silently dropped on every restart; they persist until an upgrade or normal runtime deletion occurs.

04

The 'populated' heuristic now uses st_mtime and a size check before deciding the store looks usable, which could affect recovery behavior on stale/corrupt files.

Risk score

Why this scored 26/100

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