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

Add LSPS2 replay regression coverage

Public commit record

What the developer wrote

Authored by tnull

78/100 · Adequate
Add LSPS2 replay regression coverage

Persisting LSPS2 service state can race with replayed intercepted HTLC
events after restart. Cover replaying the same intercepted HTLC after
restoring peer state so duplicate queueing is caught.

Co-Authored-By: HAL 9000
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit adds a new regression test for the LSPS2 (Lightning Service Provider Specification 2) feature in rust-lightning. It checks that if a node crashes and restarts, replaying the same intercepted payment event does not cause the service to accidentally queue or process the payment twice. The test ensures that after restoring saved peer state, replaying an already-seen HTLC returns no action, and the payment is still forwarded correctly once the channel is ready. There is no code fix here—only a new test to catch a past or potential duplicate-queueing bug.

Recommended action

Treat as a defensive regression test rather than an active vulnerability. If the project has not already shipped a production fix for the duplicate-queueing race, review OutboundJITChannel::htlc_intercepted and PeerState deserialization to ensure replayed HTLCs are correctly deduplicated before any channel-open or forward action is queued. Run the new test in CI and consider adding similar idempotency tests for inbound JIT channels and other persisted interception paths.

Security signals we found

01

Regression test for replay idempotency after state persistence

02

Race condition between persistence and replayed intercepted HTLC events

03

Potential duplicate queueing/processing of intercepted HTLCs on restart

04

No production code change—only test coverage added

Risk score

Why this scored 29/100

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