Uh oh!
There was an error while loading. Please reload this page.
Broadcast holder commitment for currently confirmed funding - #3939
Conversation
👋 Thanks for assigning @jkczyz as a reviewer! |
a783444 to
a8ae4b7CompareCodecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #3939 +/- ##
==========================================
- Coverage 88.93% 88.76% -0.18%
==========================================
Files 174 173 -1 Lines 123842 124326 +484 Branches 123842 124326 +484 ==========================================
+ Hits 110142 110357 +215 - Misses 11254 11553 +299 + Partials 2446 2416 -30
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:
|
ldk-reviews-bot
commented
Jul 21, 2025
🔔 1st Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
Uh oh!
There was an error while loading. Please reload this page.
ldk-reviews-bot
commented
Jul 22, 2025
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
a8ae4b7 to
86b53faCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
86b53fa to
48629c7Compare48629c7 to
60d97d0CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ldk-reviews-bot
commented
Jul 26, 2025
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
ldk-reviews-bot
commented
Jul 28, 2025
🔔 2nd Reminder Hey @jkczyz! This PR has been waiting for your review. |
Uh oh!
There was an error while loading. Please reload this page.
582ad71 to
511fdc8Compareldk-reviews-bot
commented
Jul 30, 2025
🔔 3rd Reminder Hey @jkczyz! This PR has been waiting for your review. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| debug_assert!(self.alternative_funding_confirmed.is_none()); | ||
| self | ||
| .pending_funding | ||
| .drain(..) |
There was a problem hiding this comment.
This looks like it needs to handle multiple incomplete 0conf fundings too, though - we can accept one 0conf splice then another before either confirm, or accept another after the first only has 1 conf. We'd need to handle that here by only dropping some fundings...
I kinda feel like we should just drop the last commit and do it later, rather than trying to support it right now.
There was a problem hiding this comment.
Ah right, the key aspect here is that the zero conf splices chain upon one another, unlike RBFs.
511fdc8 to
9051703Compare9051703 to
919b1d8Compareldk-reviews-bot
commented
Aug 2, 2025
🔔 4th Reminder Hey @TheBlueMatt@jkczyz! This PR has been waiting for your review. |
ldk-reviews-bot
commented
Aug 2, 2025
🔔 1st Reminder Hey @TheBlueMatt@jkczyz! This PR has been waiting for your review. |
ldk-reviews-bot
commented
Aug 4, 2025
🔔 5th Reminder Hey @TheBlueMatt@jkczyz! This PR has been waiting for your review. |
ldk-reviews-bot
commented
Aug 4, 2025
🔔 2nd Reminder Hey @TheBlueMatt@jkczyz! This PR has been waiting for your review. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
919b1d8 to
88b2c22Compare| debug_assert!(self.no_further_updates_allowed()); | ||
| debug_assert_ne!(self.funding.funding_txid(), entry.txid); | ||
| if let Err(_) = self.promote_funding(entry.txid) { | ||
| log_error!(logger, "Missing scope for alternative funding confirmation with txid {}", entry.txid); |
There was a problem hiding this comment.
When would this happen in practice? I assume it's some corner case, but is there any danger in this happening? What would a user do if it happened?
There was a problem hiding this comment.
It shouldn't happen at all. It would mean that the scope was somehow removed, and the only way to do that currently is via promote_funding. The monitor is already not accepting updates so that's good, but it could lead to not being able to claim funds from a closed channel.
Uh oh!
There was an error while loading. Please reload this page.
Whether it's a splice, or a dual-funded RBF, we need to know which funding transaction out of all of the negotiated ones is currently confirmed in case we need to broadcast the holder commitment.
A `FundingScope` can only be promoted once a `ChannelMonitorUpdateStep::RenegotiatedFundingLocked` is applied, or if the monitor is no longer accepting updates, once the renegotiated funding 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.
88b2c22 to
89ce01dCompare
jkczyz
left a comment
There was a problem hiding this comment.
LGTM, but should let @TheBlueMatt take a final pass as I'm not intimately familiar with this code.
ldk-reviews-bot
commented
Aug 6, 2025
🔔 3rd Reminder Hey @TheBlueMatt! This PR has been waiting for your review. |
TheBlueMatt
left a comment
There was a problem hiding this comment.
A few assertion nits and one real question that IMO should be addressed, but doesn't have to be in this PR. Gonna land to unblock progress.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A splice's
FundingScopecan only be promoted once aChannelMonitorUpdateStep::RenegotiatedFundingLockedis applied, or if the monitor is no longer accepting updates, once the splice transaction is no longer under reorg risk. Because of this, our currentFundingScopemay not reflect the latest confirmed state in the chain. Before making a holder commitment broadcast, we must check whichFundingScopeis currently confirmed to ensure that it can propagate throughout the network.