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

invoices: reject stale shards at set completion

Public commit record

What the developer wrote

Authored by ziggie

68/100 · Adequate
invoices: reject stale shards at set completion

Revalidate every accepted MPP or AMP shard when a completing shard
arrives. If an existing shard no longer satisfies either CLTV delta,
cancel the accepted set, keep the invoice open, and reject the
completing shard without recording it.
✓ 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 bug in how Lightning Network invoices handle multi-part payments (MPP/AMP). Previously, a payment shard accepted early could sit until the rest of the payment arrived. By then, its timeout might be too close to the current blockchain height to safely settle, yet the system would still complete the payment. Now, when the final shard arrives, every previously accepted shard is re-checked for a safe timeout. If any shard is too close to expiring, the whole payment set is cancelled, the invoice stays open, and the final shard is rejected. This prevents a situation where funds could be released for a payment that can no longer be claimed on-chain in time.

Recommended action

Review and merge. The change is defensive and well-tested. Operators should upgrade nodes that accept MPP/AMP invoices to avoid the risk of attempting to settle shards with insufficient remaining CLTV delta. No immediate external mitigation is required beyond patching.

Security signals we found

01

Fixes stale/expiring HTLC shard acceptance in MPP/AMP invoice settlement

02

Adds revalidation loop over accepted HTLC set at completion time

03

Introduces new set-level failure result ResultHtlcSetExpiryTooSoon

04

Cancels entire HTLC set and keeps invoice open on unsafe expiry

05

Prevents settlement when a shard's CLTV delta has become insufficient while held

06

Refactors AMP reconstruction failure path to share cancellation helper

Risk score

Why this scored 62/100

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