Skip to content

Conversation

wpaulino
Copy link
Contributor

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.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jun 26, 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

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

@ldk-reviews-bot
Copy link

🔔 4th 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

🔔 5th 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

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

@wpaulino wpaulino force-pushed the renegotiated-funding-locked-monitor-update branch 2 times, most recently from 00e8bb3 to c1ead6a Compare July 9, 2025 23:25
@wpaulino wpaulino requested a review from jkczyz July 9, 2025 23:26
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 65.44118% with 47 lines in your changes missing coverage. Please review.

Project coverage is 88.99%. Comparing base (c48e0a8) to head (22d5428).
Report is 194 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/chain/channelmonitor.rs 14.28% 24 Missing ⚠️
lightning/src/ln/channelmanager.rs 65.62% 20 Missing and 2 partials ⚠️
lightning/src/chain/onchaintx.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3894      +/-   ##
==========================================
- Coverage   89.65%   88.99%   -0.67%     
==========================================
  Files         164      167       +3     
  Lines      134658   121836   -12822     
  Branches   134658   121836   -12822     
==========================================
- Hits       120734   108432   -12302     
+ Misses      11246    10988     -258     
+ Partials     2678     2416     -262     
Flag Coverage Δ
fuzzing 22.71% <30.14%> (?)
tests 88.82% <65.44%> (?)

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.

@wpaulino wpaulino force-pushed the renegotiated-funding-locked-monitor-update branch from c1ead6a to a6d4b1e Compare July 14, 2025 18:33
@wpaulino wpaulino requested review from jkczyz and TheBlueMatt July 14, 2025 18:33
jkczyz
jkczyz previously approved these changes Jul 14, 2025
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.

Note that rustfmt/MSRV are failing.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 16, 2025
@wpaulino wpaulino dismissed stale reviews from coderabbitai[bot] and jkczyz via 3bdf268 July 16, 2025 00:31
@wpaulino wpaulino force-pushed the renegotiated-funding-locked-monitor-update branch from a6d4b1e to 3bdf268 Compare July 16, 2025 00:31
@wpaulino wpaulino force-pushed the renegotiated-funding-locked-monitor-update branch from 3bdf268 to 6c43f5d Compare July 17, 2025 17:35
@wpaulino wpaulino requested review from jkczyz and TheBlueMatt July 18, 2025 22:17
@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @TheBlueMatt @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

🔔 1st Reminder

Hey @TheBlueMatt @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 renegotiated-funding-locked-monitor-update branch from 6c43f5d to aa625f0 Compare July 21, 2025 23:25
@wpaulino wpaulino requested a review from TheBlueMatt July 21, 2025 23:25
wpaulino added 2 commits July 21, 2025 18:34
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.
@wpaulino wpaulino force-pushed the renegotiated-funding-locked-monitor-update branch from aa625f0 to 22d5428 Compare July 22, 2025 01:35
@wpaulino wpaulino requested a review from TheBlueMatt July 22, 2025 16:41
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.

The only real changes since @jkczyz's ACK were monitor update application fixes, which I plan to lean up in a followup by fixing the internal API. Gonna land this to keep things moving but a post-merge second glance if you think its work it would be fine to @jkczyz

@TheBlueMatt TheBlueMatt merged commit 4e4f128 into lightningdevkit:main Jul 22, 2025
27 of 28 checks passed
@wpaulino wpaulino deleted the renegotiated-funding-locked-monitor-update branch July 22, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants