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

Add `DATA_CLOSED` class when active channel is closed (#3170)

Public commit record

What the developer wrote

Authored by Bastien Teinturier

81/100 · Strong
Add `DATA_CLOSED` class when active channel is closed (#3170)

We introduce a `DATA_CLOSED` class with minimal information about a
past channel that has been fully closed. This will let us deprecate
legacy channels without having backwards-compatibility issues with
very old closed channels inside our DB.

When channels have never been properly opened or used, we don't
bother storing them in our DB, as it would open the door to DoS
attacks.

We create a dedicated table to store `DATA_CLOSED`. We migrate the
existing DB and remove the foreign key constraint on `htlc_infos`.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit refactors how Eclair stores closed Lightning channels. Instead of keeping all closed channel data in the same table as active channels, it moves them to a dedicated table with only essential summary information. The main stated security benefit is preventing denial-of-service (DoS) attacks by not storing channels that were never properly opened or used. It also removes a database foreign-key constraint and changes the API response format for closed channels. The commit is primarily a data-model and migration change, not a fix for an active vulnerability.

Recommended action

Reviewers and operators should verify that the database migration correctly preserves all closed-channel records that need to be retained, and that removing the foreign key on `htlc_infos` does not lead to orphaned rows or inconsistent cleanup behavior. Test the `closedchannels` API for compatibility with downstream consumers. Confirm that the DoS mitigation (ignoring never-confirmed channels) does not interfere with legitimate recovery scenarios.

Security signals we found

01

DoS mitigation: channels that never confirmed or had nothing at stake are no longer persisted in the database

02

Database schema migration removes foreign key constraint on htlc_infos

03

New closed-channel data class stores only minimal, stringified fields to avoid future backwards-compatibility issues

04

API output format for closedchannels changed from RES_GET_CHANNEL_INFO to DATA_CLOSED

05

Migration code decodes legacy channel data and converts it to DATA_CLOSED; some channels may be skipped if closing type cannot be inferred

Risk score

Why this scored 29/100

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