Skip to content

Conversation

@jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Dec 4, 2025

Some splicing use cases require to simultaneously splice in and out in the same splice transaction. Add support for such splices using the funding inputs to pay the appropriate fees just like the splice-in case, opposed to using the channel value like the splice-out case. This requires using the contributed input value when checking if the inputs are sufficient to cover fees, not the net contributed value. The latter may be negative in the net splice-out case.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 4, 2025

👋 Thanks for assigning @TheBlueMatt 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.

@jkczyz jkczyz self-assigned this Dec 4, 2025
@jkczyz jkczyz force-pushed the 2025-12-splice-in-and-out branch 2 times, most recently from fc608ab to a89b894 Compare December 5, 2025 21:08
@jkczyz jkczyz marked this pull request as ready for review December 5, 2025 21:09
@jkczyz jkczyz force-pushed the 2025-12-splice-in-and-out branch from a89b894 to d9f02da Compare December 5, 2025 21:13
When adding support for mixed splice-in and splice-out, the contribution
amount will need to be computed based on the splice-in and splice-out
values. Rather than add a third variant to SpliceContribution, which
could have an invalid contribution amount, use a more general struct
that can represent splice-in, splice-out, and mixed. Constructors are
provided for the typical splice-in and splice-out case whereas support
for the mixed case will be added in an independent change.
Some splicing use cases require to simultaneously splice in and out in
the same splice transaction. Add support for such splices using the
funding inputs to pay the appropriate fees just like the splice-in case,
opposed to using the channel value like the splice-out case. This
requires using the contributed input value when checking if the inputs
are sufficient to cover fees, not the net contributed value. The latter
may be negative in the net splice-out case.
@jkczyz jkczyz force-pushed the 2025-12-splice-in-and-out branch from d9f02da to c9cade5 Compare December 5, 2025 22:40
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 98.80240% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.34%. Comparing base (de384ff) to head (c9cade5).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 95.45% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #4261    +/-   ##
========================================
  Coverage   89.33%   89.34%            
========================================
  Files         180      180            
  Lines      139042   139228   +186     
  Branches   139042   139228   +186     
========================================
+ Hits       124219   124393   +174     
- Misses      12196    12207    +11     
- Partials     2627     2628     +1     
Flag Coverage Δ
fuzzing 34.99% <57.31%> (-0.98%) ⬇️
tests 88.71% <98.80%> (+<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

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants