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

Include recent blocks in the `synchronize_listeners`-returned cache

Public commit record

What the developer wrote

Authored by Matt Corallo

85/100 · Strong
Include recent blocks in the `synchronize_listeners`-returned cache

When `synchronize_listeners` runs, it returns a cache of the
headers it needed when doing chain difference-finding. This allows
us to ensure that when we start running normally we have all the
recent headers in case we need them to reorg.

Sadly, in some cases it was returning a mostly-empty cache.
Because it was only being filled during block difference
reconciliation it would only get a block around each listener's
fork point. Worse, because we were calling `disconnect_blocks` with
the cache the cache would assume we were reorging against the main
chain and drop blocks we actually want.

Instead, we avoid dropping blocks on `disconnect_blocks` calls and
ensure we always add connected blocks to the cache.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This patch fixes a bug in rust-lightning's initial blockchain synchronization where the header cache returned to callers was often nearly empty. The cache is meant to keep recent block headers so the node can handle chain reorganizations after startup. Because the cache was being incorrectly cleared during synchronization, a node could start normal operation without the recent headers it needs to safely detect and respond to reorgs. This is a correctness/reliability fix in chain-sync logic, not a direct remote-exploitable vulnerability.

Recommended action

Treat as a reliability/correctness fix. Review whether the partial cache fix fully covers all reorg scenarios during startup, and consider adding explicit documentation or tests for cache behavior under deep reorgs. No immediate security response is indicated by the commit alone.

Security signals we found

01

Header cache eviction during initial sync could leave node without recent headers

02

Missing recent headers impairs safe reorg handling after startup

03

New `retain_on_disconnect` flag changes cache eviction semantics during synchronization

04

Test assertions added to verify main-chain headers retained and fork headers excluded

05

No explicit security framing, CVE, or advisory in commit message

Risk score

Why this scored 45/100

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