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

Fix post-restart cleaner crash on replayed fulfill (#3447)

Public commit record

What the developer wrote

Authored by Fabrice Drouin

91/100 · Strong
Fix post-restart cleaner crash on replayed fulfill (#3447)

* Add test for replayed settlement after restart

After a restart, our peer may replay a settlement for one of our own
payments that is already final in the DB. `PostRestartHtlcCleaner`
then throws and stops relaying preimages upstream.

This test currently fails.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Fix post-restart cleaner crash on replayed fulfill

`PostRestartHtlcCleaner` now ignores settlements for local payments
that are no longer pending instead of throwing, and `Relayer` resumes
it on errors instead of restarting it without its state.

Reported-by: @erickcestari
Issue: 07-restart-cleaner-replayed-fulfill-preimage-loss
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in the Eclair Lightning node where, after restarting, the node could crash when a peer re-sent payment settlement messages for payments that were already finalized in the database. The crash could stop the node from relaying payment secrets (preimages) upstream, potentially causing payment failures or stuck funds. The fix makes the post-restart cleanup process ignore these duplicate settlements and ensures the cleanup actor is resumed rather than fully restarted if it encounters errors, preserving its state.

Recommended action

Apply the patch and ensure nodes are upgraded before any restart scenario where peers may replay channel updates. Monitor logs for ignored replayed settlements after restarts. Consider additional tests for trampoline payments and multi-part payment edge cases.

Security signals we found

01

Denial-of-service via post-restart message replay causing actor crash

02

Loss of preimage relay upstream after cleaner crash

03

Actor supervision strategy change from restart to resume to preserve state

04

Database state desynchronization with in-flight HTLC state after restart

Risk score

Why this scored 55/100

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