Skip to content

Conversation

wpaulino
Copy link
Contributor

This is crucial for peers that serve liquidity for low-availability (i.e., mobile) nodes. We should allow users to queue a splice request while the peer is offline, such that it is negotiated once reconnected. Note that there currently isn't a way to time out/cancel these requests, this is planned for the near future.

The test added also includes coverage for 0-conf splices, which didn't work because they lacked test coverage to begin with.

Depends on #4079.
Fixes #1621 (comment).

We may produce duplicate `FundingTransactionReadyForSigning` events if
the user has processed an initial event but has not yet called back with
`funding_transaction_signed` and a peer reconnection occurs. If the user
also handles the duplicate events, any duplicate calls to
`funding_transaction_signed` after an initial successful one would
return an error. This doesn't make sense, as the API should remain
idempotent, so we return early on any duplicate calls.
As per the spec requirement, this was already enforced throughout the
happy case when a disconnection does not happen. If a disconnect would
happen, we always naively cleared the flag without checking whether we
did indeed exchange `tx_signatures`.
We only want to produce `tx_signatures` once we know that the monitor
update (either the initial one for a dual-funded channel, or a
`RenegotiatedFunding` one for a splice) has been persisted. If we
haven't received the counterparty's `commitment_signed` yet, then the
monitor update hasn't been created, leading us to pass the
`!awaiting_monitor_update` condition and produce a holder
`tx_signatures` message.
We'll use this in the next commit to test the resend logic for
`announcement_signatures` when reestablishing a channel that had a
pending splice become locked.
This test captures all the new spec requirements introduced for a splice
to the channel reestablish flow.
Splices negotiated with 0 confirmations require that we immediately lock
it after exchanging `tx_signatures`.
This is crucial for peers that serve liquidity for low-availability
(i.e., mobile) nodes. We should allow users to queue a splice request
while the peer is offline, such that it is negotiated once reconnected.
Note that there currently isn't a way to time out/cancel these requests,
this is planned for the near future.
Since we don't yet support contributing to an incoming splice, we need
to make sure we attempt our splice negotiation eventually if the
counterparty was also attempting a splice at the same time but they won
the quiescence tie-breaker. Since only one pending splice (without RBF)
is allowed at a time, we do this after the existing splice becomes
locked.
@wpaulino wpaulino added this to the 0.2 milestone Sep 25, 2025
@wpaulino wpaulino requested a review from jkczyz September 25, 2025 00:25
@wpaulino wpaulino self-assigned this Sep 25, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 25, 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.

Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 94.50000% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.69%. Comparing base (3e21ba3) to head (4bd54f0).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/splicing_tests.rs 95.08% 12 Missing and 13 partials ⚠️
lightning/src/ln/channelmanager.rs 82.69% 5 Missing and 4 partials ⚠️
lightning/src/ln/channel.rs 94.05% 4 Missing and 2 partials ⚠️
lightning/src/ln/functional_test_utils.rs 95.12% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4122      +/-   ##
==========================================
- Coverage   88.72%   88.69%   -0.04%     
==========================================
  Files         177      179       +2     
  Lines      133404   135001    +1597     
  Branches   133404   135001    +1597     
==========================================
+ Hits       118365   119737    +1372     
- Misses      12325    12493     +168     
- Partials     2714     2771      +57     
Flag Coverage Δ
fuzzing 21.74% <5.95%> (+0.01%) ⬆️
tests 88.53% <94.50%> (-0.04%) ⬇️

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.

Dual-funded channels and Splicing Project Tracking
2 participants