-
Notifications
You must be signed in to change notification settings - Fork 418
Broadcast holder commitment for currently confirmed funding #3939
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?
Broadcast holder commitment for currently confirmed funding #3939
Conversation
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
This is a new `ChannelMonitorUpdateStep` variant intended to be used whenever a new funding transaction that was negotiated and applied via the `RenegotiatedFunding` update reaches its intended confirmation depth and both sides of the channel exchange `channel_ready`/`splice_locked`. This commit primarily focuses on its use for splices, but future work will expand where needed to support RBFs for a dual funded channel. This monitor update ensures that the monitor can safely drop all prior commitment data since it is now considered invalid/unnecessary. Once the update is applied, only state for the new funding transaction is tracked going forward, until the monitor receives another `RenegotiatedFunding` update.
It's only intended to be set during initialization and used to check if the channel is v1 or v2. We rename it to `first_negotiated_funding_txo` to better reflect its purpose.
A `ChannelMonitor` will always consider a channel closed once a confirmed spend for the funding transaction is detected. This is no longer the case with splicing, as the channel will remain open and capable of accepting updates while its funding transaction is being replaced.
A splice's `FundingScope` can only be promoted once a `ChannelMonitorUpdateStep::RenegotiatedFundingLocked` is applied, or if the monitor is no longer accepting updates, once the splice transaction is no longer under reorg risk. Because of this, our current `FundingScope` may not reflect the latest confirmed state in the chain. Before making a holder commitment broadcast, we must check which `FundingScope` is currently confirmed to ensure that it can propogate throughout the network.
a783444
to
a8ae4b7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3939 +/- ##
==========================================
- Coverage 89.02% 88.92% -0.10%
==========================================
Files 166 167 +1
Lines 121374 121985 +611
Branches 121374 121985 +611
==========================================
+ Hits 108049 108475 +426
- Misses 10927 11077 +150
- Partials 2398 2433 +35
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:
|
🔔 1st Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
A splice's
FundingScope
can only be promoted once aChannelMonitorUpdateStep::RenegotiatedFundingLocked
is applied, or if the monitor is no longer accepting updates, once the splice transaction is no longer under reorg risk. Because of this, our currentFundingScope
may not reflect the latest confirmed state in the chain. Before making a holder commitment broadcast, we must check whichFundingScope
is currently confirmed to ensure that it can propagate throughout the network.Depends on #3894.