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

Account for missing balance in channel reserve assertions for splices

Public commit record

What the developer wrote

Authored by Wilmer Paulino

73/100 · Adequate
Account for missing balance in channel reserve assertions for splices

When we create the post-splice `FundingScope`, the monotonicity debug
assertion trackers were initialized to the post-splice balance without
accounting for pending HTLCs or anchor costs. Since splices can have
in-flight HTLCs (unlike fresh channel opens), the first commitment
transaction's actual balance was lower than the initialized max, causing
the debug assertion in `ChannelContext::build_commitment_transaction` to
fire.

Note that we don't need to recompute the full post-splice balance here.
We can rely on the pre-splice `FundingScope`'s
`holder/counterparty_max_commitment_tx_output` instead since they're
already accounted for there.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes an internal debug-only accounting bug that occurs when a Lightning channel is spliced (its funding amount is changed) while payments are still in flight. The bug made a non-release debug assertion incorrectly fire, but it did not change normal runtime behavior or allow funds to be stolen.

Recommended action

Treat as a low-severity correctness fix. No urgent security patch is required; include in normal release cycle. If running debug builds with splicing and in-flight HTLCs, update to avoid assertion crashes during testing.

Security signals we found

01

Fixes a debug assertion failure in channel reserve accounting during splices

02

Only affects #[cfg(debug_assertions)] fields, not release builds

03

Relates to splice protocol correctness with in-flight HTLCs

04

No runtime funds-at-risk logic is changed

Risk score

Why this scored 21/100

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