lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.11k stars 342 forks source link

Handle fallible per commitment point for RAA #3150

Open alecchendev opened 2 days ago

alecchendev commented 2 days ago

Builds on #3149.

This is the first PR to handle async get_per_commitment_point, and only handles the Err cases for retrieving revoke_and_ack. We still need to handle this during funding (#3109) and channel reestablish (no PR yet) in upcoming PRs.

For all async signing, we try to go about our normal business, and when we fail to get a signature from our signer, we pause our channel, and only unpause upon the user calling ChannelManager::signer_unblocked. With the signer_pending_revoke_and_ack flag being added in the prereq PR, we simply set the flag and allow get_last_revoke_and_ack to return an Option. We also make sure that in cases where we must send RAA then CS, that we defer sending a CS (even if it's available) until the signature for the RAA is unblocked.

codecov-commenter commented 2 days ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 75.80645% with 30 lines in your changes missing coverage. Please review.

Project coverage is 89.78%. Comparing base (3ccf064) to head (a079267).

Files Patch % Lines
lightning/src/ln/channel.rs 73.87% 22 Missing and 7 partials :warning:
lightning/src/util/test_channel_signer.rs 75.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3150 +/- ## ========================================== - Coverage 89.80% 89.78% -0.02% ========================================== Files 121 121 Lines 99314 99359 +45 Branches 99314 99359 +45 ========================================== + Hits 89187 89210 +23 - Misses 7522 7540 +18 - Partials 2605 2609 +4 ```

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