Skip to content

Release tx_signatures after async monitor update completes#4472

Open
wpaulino wants to merge 1 commit intolightningdevkit:mainfrom
wpaulino:release-tx-signatures-after-async-monitor-update-completion
Open

Release tx_signatures after async monitor update completes#4472
wpaulino wants to merge 1 commit intolightningdevkit:mainfrom
wpaulino:release-tx-signatures-after-async-monitor-update-completion

Conversation

@wpaulino
Copy link
Contributor

@wpaulino wpaulino commented Mar 9, 2026

In 83b2d3e, we reworked ChannelManager::funding_transaction_signed such that it would also for a user to cancel a splice up until they send commitment_signed. Previously, we would would only emit Event::FundingTransactionReadyForSigning when both nodes exchanged commitment_signed and the corresponding monitor update completed. With the event now being generated immediately after the nodes exchange tx_complete, we now need to handle the monitor update not having completed by the time we are ready to send tx_signatures. Unfortunately, we also did not have test coverage, allowing this to go unnoticed until being caught by the fuzzer due to a debug assertion. Doing so avoids a potential funds-loss scenario if the funding transaction confirms without the counterparty's signature for our commitment being durably persisted.

In 83b2d3e, we reworked `ChannelManager::funding_transaction_signed`
such that it would also for a user to cancel a splice up until they send
`commitment_signed`. Previously, we would would only emit
`Event::FundingTransactionReadyForSigning` when both nodes exchanged
`commitment_signed` and the corresponding monitor update completed. With
the event now being generated immediately after the nodes exchange
`tx_complete`, we now need to handle the monitor update not having
completed by the time we are ready to send `tx_signatures`.
Unfortunately, we also did not have test coverage, allowing this to go
unnoticed until being caught by the fuzzer due to a debug assertion.
Doing so avoids a potential funds-loss scenario if the funding
transaction confirms without the counterparty's signature for our
commitment being durably persisted.
@wpaulino wpaulino added this to the 0.3 milestone Mar 9, 2026
@wpaulino wpaulino requested a review from TheBlueMatt March 9, 2026 18:04
@wpaulino wpaulino self-assigned this Mar 9, 2026
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Mar 9, 2026

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

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 86.42857% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.00%. Comparing base (36d04c3) to head (c8c5dc0).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 82.29% 16 Missing and 1 partial ⚠️
lightning/src/ln/channelmanager.rs 95.12% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4472      +/-   ##
==========================================
- Coverage   86.08%   86.00%   -0.08%     
==========================================
  Files         159      159              
  Lines      105186   105489     +303     
  Branches   105186   105489     +303     
==========================================
+ Hits        90546    90727     +181     
- Misses      12131    12249     +118     
- Partials     2509     2513       +4     
Flag Coverage Δ
tests 86.00% <86.42%> (-0.08%) ⬇️

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.

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.

2 participants