Skip to content

Conversation

@wpaulino
Copy link
Contributor

@wpaulino wpaulino commented Dec 3, 2025

Previously, we'd emit a FundingTransactionReadyForSigning event once the initial commitment_signed is exchanged for a splicing/dual-funding attempt and require users to call back with their signed inputs using ChannelManager::funding_transaction_signed. While this approach worked in practice, it prevents us from abandoning a splice if we cannot or no longer wish to sign as the splice has already been committed to by this point.

This commit reworks the API such that this is now possible. After exchanging tx_complete, we will no longer immediately send our initial commitment_signed. We will now emit the
FundingTransactionReadyForSigning event and wait for the user to call back before releasing both our initial commitment_signed and our tx_signatures. As a result, the event is now persisted, as there is only one possible path in which it is generated. Note that we continue to only emit the event if a local contribution to negotiated transaction was made.

Future work will expose a cancellation API such that we can abandon splice attempts safely (we can just force close the channel with dual-funding).

@wpaulino wpaulino added this to the 0.3 milestone Dec 3, 2025
@wpaulino wpaulino requested a review from jkczyz December 3, 2025 18:47
@wpaulino wpaulino self-assigned this Dec 3, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 3, 2025

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

Previously, we'd emit a `FundingTransactionReadyForSigning` event once
the initial `commitment_signed` is exchanged for a splicing/dual-funding
attempt and require users to call back with their signed inputs using
`ChannelManager::funding_transaction_signed`. While this approach worked
in practice, it prevents us from abandoning a splice if we cannot or no
longer wish to sign as the splice has already been committed to by this
point.

This commit reworks the API such that this is now possible. After
exchanging `tx_complete`, we will no longer immediately send our initial
`commitment_signed`. We will now emit the
`FundingTransactionReadyForSigning` event and wait for the user to call
back before releasing both our initial `commitment_signed` and our
`tx_signatures`. As a result, the event is now persisted, as there is
only one possible path in which it is generated. Note that we continue
to only emit the event if a local contribution to negotiated transaction
was made.

Future work will expose a cancellation API such that we can abandon
splice attempts safely (we can just force close the channel with
dual-funding).
@wpaulino wpaulino force-pushed the funding-transaction-signed-rework branch from 61719cf to 135605f Compare December 3, 2025 19:35
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 74.57143% with 89 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.31%. Comparing base (de384ff) to head (135605f).

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 69.59% 39 Missing and 6 partials ⚠️
lightning/src/ln/channelmanager.rs 67.59% 29 Missing and 6 partials ⚠️
lightning/src/ln/splicing_tests.rs 90.78% 2 Missing and 5 partials ⚠️
lightning/src/events/mod.rs 87.50% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4257      +/-   ##
==========================================
- Coverage   89.33%   89.31%   -0.03%     
==========================================
  Files         180      180              
  Lines      139042   139030      -12     
  Branches   139042   139030      -12     
==========================================
- Hits       124219   124172      -47     
- Misses      12196    12217      +21     
- Partials     2627     2641      +14     
Flag Coverage Δ
fuzzing 35.96% <5.38%> (-0.01%) ⬇️
tests 88.68% <74.57%> (-0.03%) ⬇️

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