Skip to content

Conversation

wpaulino
Copy link
Contributor

This also includes a couple small bug fixes found along the way.

@wpaulino wpaulino added this to the 0.2 milestone Sep 18, 2025
@wpaulino wpaulino requested a review from jkczyz September 18, 2025 00:20
@wpaulino wpaulino self-assigned this Sep 18, 2025
@ldk-reviews-bot
Copy link

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

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @jkczyz! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@ldk-reviews-bot
Copy link

🔔 2nd Reminder

Hey @jkczyz! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@ldk-reviews-bot
Copy link

🔔 3rd Reminder

Hey @jkczyz! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

@wpaulino wpaulino force-pushed the test-splice-reestablish branch from aa5ab88 to e841721 Compare September 24, 2025 16:36
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

❌ Patch coverage is 97.40634% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.66%. Comparing base (a9ddf3f) to head (9588403).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/functional_test_utils.rs 93.54% 2 Missing and 2 partials ⚠️
lightning/src/ln/splicing_tests.rs 98.02% 2 Missing and 2 partials ⚠️
lightning/src/ln/channel.rs 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4079      +/-   ##
==========================================
+ Coverage   88.53%   88.66%   +0.13%     
==========================================
  Files         179      179              
  Lines      134413   134717     +304     
  Branches   134413   134717     +304     
==========================================
+ Hits       119002   119451     +449     
+ Misses      12653    12507     -146     
- Partials     2758     2759       +1     
Flag Coverage Δ
fuzzing 21.22% <15.05%> (-0.02%) ⬇️
tests 88.50% <97.40%> (+0.13%) ⬆️

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.

@TheBlueMatt
Copy link
Collaborator

Needs rebase :(

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.
@wpaulino wpaulino force-pushed the test-splice-reestablish branch from e841721 to 9588403 Compare September 25, 2025 15:56
Comment on lines +8608 to +8612
if signing_session.holder_tx_signatures().is_some() {
// Our `tx_signatures` either should've been the first time we processed them,
// or we're waiting for our counterparty to send theirs first.
return Ok((None, None));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to hit the error below (i.e. when there is no signing session) if a duplicate event is processed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, yeah they would. Not sure what else we can do here though if they're genuinely calling this at the wrong time? We'll keep the session around until channel_ready/splice_locked so maybe we can also avoid returning an error if funding_txid_signed == self.funding.get_funding_txid()?

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

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.

4 participants