Skip to content

Conversation

wpaulino
Copy link
Contributor

This also caught a bug where we weren't including signatures for pending HTLCs in the initial commitment_signed for the splice.

Depends on #4054.

@wpaulino wpaulino added this to the 0.2 milestone Sep 11, 2025
@wpaulino wpaulino self-assigned this Sep 11, 2025
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 11, 2025

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

@ldk-reviews-bot
Copy link

👋 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.

While we did consider the pending HTLCs when generating the signatures,
we did not include them in the resulting `commitment_signed` message
sent because we assumed it was only used within a dual-funding context
where there are no pending HTLCs.
This ensures a valid commitment transaction is broadcast according to
the different stages of a splice:

1. Negotiated but unconfirmed
2. Confirmed but not locked
3. Locked
When adding support for emitting these events in the channel monitor, we
only covered the case where one of the splice transaction candidates
confirmed. We also need to emit an event when none of them can confirm
due to a commitment transaction confirming (and no longer under reorg
risk) for the pre-splice funding.
@wpaulino wpaulino force-pushed the test-splice-commitment-broadcast branch from 527c78a to 7456483 Compare September 18, 2025 00:15
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 96.96970% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.66%. Comparing base (c71334e) to head (7456483).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/splicing_tests.rs 97.14% 2 Missing and 2 partials ⚠️
lightning/src/ln/channel.rs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4068      +/-   ##
==========================================
+ Coverage   88.63%   88.66%   +0.03%     
==========================================
  Files         176      176              
  Lines      131920   132078     +158     
  Branches   131920   132078     +158     
==========================================
+ Hits       116927   117110     +183     
+ Misses      12325    12305      -20     
+ Partials     2668     2663       -5     
Flag Coverage Δ
fuzzing 21.59% <8.00%> (-0.01%) ⬇️
tests 88.50% <96.96%> (+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.

@@ -5591,6 +5591,17 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
OnchainEvent::FundingSpendConfirmation { commitment_tx_to_counterparty_output, .. } => {
self.funding_spend_confirmed = Some(entry.txid);
self.confirmed_commitment_tx_counterparty_output = commitment_tx_to_counterparty_output;
if self.alternative_funding_confirmed.is_none() && !self.pending_funding.is_empty() {
for funding in self.pending_funding.drain(..) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to look at alternative_funding_confirmed and possibly skip one of the pending fundings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's only relevant with RBF and it should be covered already by OnchainEvent::AlternativeFundingConfirmation maturing and us calling promote_funding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants