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

Remove pruned LSPS2/LSPS5 peer state entries from the `KVStore`

Public commit record

What the developer wrote

Authored by Elias Rohrer

73/100 · Adequate
Remove pruned LSPS2/LSPS5 peer state entries from the `KVStore`

Previously, we'd persist peer states to the `KVStore`, but, while we
pruned them eventually from our in-memory state, we wouldn't remove it
from the `KVStore`.

Here, we change this and regularly prune and delete peer state entries
from the `KVStore`.
Note we still prune the state-internal data on peer disconnection, but
leave removal to our (BP-driven) async `persist` calls.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change fixes a cleanup bug in a Lightning liquidity service. Previously, when peer state was pruned from memory, the corresponding saved data was left behind in the persistent key-value store. Over time this could accumulate stale entries and potentially allow old or expired peer data to be reloaded after a restart. The patch now deletes those stale store entries during regular persistence cycles.

Recommended action

Review whether previously accumulated stale KVStore entries should be cleaned up on upgrade, and verify that the async `remove` failures are handled safely without corrupting the in-memory pruning decision.

Security signals we found

01

Stale persisted peer state not deleted from KVStore

02

Potential resurrection of expired/pruned peer state after restart

03

Accumulation of orphaned persistent entries

04

In-memory pruning and persistent-store pruning were inconsistent

Risk score

Why this scored 35/100

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