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

Fix bug failing CS-RAA resend order on pending commitment signatures #3149

Open alecchendev opened 2 days ago

alecchendev commented 2 days ago

Across disconnects we may end up in a situation where we need to send a commitment_signed and then revoke_and_ack. We need to make sure that if the signer is pending for CS but not RAA, we don't screw up the order by sending the RAA first. We defer sending the RAA by setting the flag signer_pending_revoke_and_ack, which will lead to us generating an RAA upon signer_unblocked.

We test this for both the case where we send messages after a channel reestablish, as well as restoring a channel after persisting a monitor update asynchronously.

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 52.94118% with 8 lines in your changes missing coverage. Please review.

Project coverage is 89.79%. Comparing base (3ccf064) to head (536b6b4).

Files Patch % Lines
lightning/src/ln/channel.rs 52.94% 5 Missing and 3 partials :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3149 +/- ## ========================================== - Coverage 89.80% 89.79% -0.02% ========================================== Files 121 121 Lines 99314 99319 +5 Branches 99314 99319 +5 ========================================== - Hits 89187 89180 -7 - Misses 7522 7531 +9 - Partials 2605 2608 +3 ```

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