Skip to content

Account for missing balance in splice max commitment output tracking#4417

Open
wpaulino wants to merge 1 commit intolightningdevkit:mainfrom
wpaulino:fix-splice-funding-scope-max-commitment-output
Open

Account for missing balance in splice max commitment output tracking#4417
wpaulino wants to merge 1 commit intolightningdevkit:mainfrom
wpaulino:fix-splice-funding-scope-max-commitment-output

Conversation

@wpaulino
Copy link
Contributor

When a splice creates new funding, the monotonicity debug assertion trackers were initialized to the raw 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.

When a splice creates new funding, the monotonicity debug assertion
trackers were initialized to the raw 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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wpaulino wpaulino added this to the 0.3 milestone Feb 13, 2026
@wpaulino wpaulino requested a review from tankyleo February 13, 2026 00:11
@wpaulino wpaulino self-assigned this Feb 13, 2026
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 13, 2026

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.07%. Comparing base (0b45bfd) to head (27bf59a).

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4417      +/-   ##
==========================================
- Coverage   86.07%   86.07%   -0.01%     
==========================================
  Files         156      156              
  Lines      103442   103463      +21     
  Branches   103442   103463      +21     
==========================================
+ Hits        89033    89051      +18     
- Misses      11894    11898       +4     
+ Partials     2515     2514       -1     
Flag Coverage Δ
tests 86.07% <96.29%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants