rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Allow sending closing tx signatures asynchronously

Open alecchendev opened this issue 1 year ago • 3 comments

Another async signing PR, this time for sign_closing_transaction!

If you've reviewed the other PRs, you know the drill: try to go about business as usual, if we fail to get the signature, do everything except for send the message, and mark our signer_pending_closing flag. The user then needs to call signer_unblocked, and we'll try again to get the signature, then create + send the message. In this case we not only need to send the message, but also 1. broadcast the fully signed closing tx, 2. broadcast a channel update, and 3. remove the channel from our map.

I added some additional state to track everything we need to do everything we need (rebuild the tx, fully sign, send our closing_signed msg, etc.) upon the signer being unblocked. This state is not persisted.

alecchendev avatar Jul 02 '24 06:07 alecchendev

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.12%. Comparing base (33e6995) to head (6e2071a). Report is 108 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channel.rs 92.98% 3 Missing and 1 partial :warning:
lightning/src/util/test_channel_signer.rs 0.00% 1 Missing and 3 partials :warning:
lightning/src/ln/channelmanager.rs 80.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3153      +/-   ##
==========================================
+ Coverage   89.78%   91.12%   +1.33%     
==========================================
  Files         123      126       +3     
  Lines      102330   114900   +12570     
  Branches   102330   114900   +12570     
==========================================
+ Hits        91876   104701   +12825     
+ Misses       7763     7708      -55     
+ Partials     2691     2491     -200     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 02 '24 06:07 codecov-commenter

rebased because of conflicts

alecchendev avatar Jul 11 '24 18:07 alecchendev

Taking a look!

valentinewallace avatar Aug 06 '24 21:08 valentinewallace

rebased because of conflicts as well

alecchendev avatar Aug 14 '24 21:08 alecchendev

Feel free to squash, lets get this over the line!

TheBlueMatt avatar Aug 19 '24 17:08 TheBlueMatt

addressed latest nits and squashed

alecchendev avatar Aug 19 '24 18:08 alecchendev

Sorry for the delay, release process is always fun. I think this LGTM.

TheBlueMatt avatar Aug 23 '24 14:08 TheBlueMatt

squashed

alecchendev avatar Aug 23 '24 18:08 alecchendev