-
Notifications
You must be signed in to change notification settings - Fork 419
Allow outgoing splice request while disconnected #4122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Allow outgoing splice request while disconnected #4122
Conversation
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.
👋 Thanks for assigning @jkczyz as a reviewer! |
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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).