Skip to content

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Sep 19, 2025

The requirements for the next_funding TLV in channel_reestablish were changed in lightning/bolts#1289. The corresponding changes were in #3886, but that PR predated the spec changes. This PR updates the implementation to reflect the spec PR.

The next_funding TLV is included in channel_reestablish when either
tx_signatures or commitment_signed is needed for an interactive-tx
session. This commit largely includes the spec requirements in the
comments, including when to retransmit commitment_signed. But it also
adds an additional check that tx_signatures has not yet been received.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Sep 19, 2025

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

@jkczyz
Copy link
Contributor Author

jkczyz commented Sep 19, 2025

It's unclear to me if and where we'd need to change the implementation to reflect the following spec change:

lightning/bolts@1d25dd1#diff-ed04ca2c673fd6aabde69389511fa9ee60cb44d6b2ef6c88b549ffaa753d6afeL2729-R2745

Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.72%. Comparing base (3564646) to head (e083a2d).
⚠️ Report is 160 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 85.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4098      +/-   ##
==========================================
+ Coverage   87.81%   88.72%   +0.90%     
==========================================
  Files         176      176              
  Lines      131770   132779    +1009     
  Branches   131770   132779    +1009     
==========================================
+ Hits       115719   117804    +2085     
+ Misses      13416    12290    -1126     
- Partials     2635     2685      +50     
Flag Coverage Δ
fuzzing 21.54% <15.00%> (-0.06%) ⬇️
tests 88.56% <85.00%> (+0.90%) ⬆️

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 TheBlueMatt added this to the 0.2 milestone Sep 20, 2025
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @TheBlueMatt @wpaulino! 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.

1 similar comment
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @TheBlueMatt @wpaulino! 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.

Comment on lines +9618 to +9620
// - if `next_commitment_number` is 1 in both the `channel_reestablish` it
// sent and received:
// - MUST retransmit `channel_ready`.
Copy link
Contributor

Choose a reason for hiding this comment

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

While testing, I noticed there's an overlap between this requirement and my_current_funding_locked when splicing. If we open a fresh channel and immediately splice it, we'll retransmit channel_ready after a reconnect since the commitments have not advanced even though we already locked the splice (either explicitly via splice_locked or implicitly via my_current_funding_locked).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mmm, probably worth skipping the channel_ready if we have a splice indicator in the reestablish.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably leave this for a follow-up? Relevant discussion in the spec: lightning/bolts#1160 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, will land this then, its otherwise trivial.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

LGTM, modulo @wpaulino's comment.

Comment on lines +9618 to +9620
// - if `next_commitment_number` is 1 in both the `channel_reestablish` it
// sent and received:
// - MUST retransmit `channel_ready`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mmm, probably worth skipping the channel_ready if we have a splice indicator in the reestablish.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Landing as its mostly comment changes and one simple change.

@TheBlueMatt TheBlueMatt merged commit 805edc2 into lightningdevkit:main Sep 25, 2025
23 of 25 checks passed
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