Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle fallible commitment secret #3152

Merged

Conversation

alecchendev
Copy link
Contributor

@alecchendev alecchendev commented Jul 2, 2024

Builds on #3149, #3150. Most of the logic for this was added in the prerequisite PRs. Here we just set the signer_pending_revoke_and_ack flag if we fail to get the commitment secret.

@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 12 lines in your changes missing coverage. Please review.

Project coverage is 90.08%. Comparing base (6ed398d) to head (3413032).
Report is 28 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channel.rs 31.25% 11 Missing ⚠️
lightning/src/util/test_channel_signer.rs 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3152      +/-   ##
==========================================
+ Coverage   89.83%   90.08%   +0.25%     
==========================================
  Files         121      121              
  Lines      100612   102971    +2359     
  Branches   100612   102971    +2359     
==========================================
+ Hits        90380    92766    +2386     
- Misses       7564     7571       +7     
+ Partials     2668     2634      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alecchendev alecchendev force-pushed the 2024-06-async-commit-secret-raa branch 2 times, most recently from cf058bc to 18acc2a Compare July 10, 2024 01:22
@TheBlueMatt
Copy link
Collaborator

This needs rebase now 🎉

@alecchendev alecchendev force-pushed the 2024-06-async-commit-secret-raa branch from 18acc2a to e296b74 Compare July 16, 2024 23:23
@alecchendev
Copy link
Contributor Author

Rebased! Btw, for the missing test coverage in #3150, I'll get to those in the PR where I handle fallible per commitment point for the channel reestablish case (as opposed to here), since I think those cases will require that - hoping to make that PR this week

@alecchendev alecchendev force-pushed the 2024-06-async-commit-secret-raa branch 2 times, most recently from 50df53a to e4ad15b Compare July 16, 2024 23:38
@TheBlueMatt
Copy link
Collaborator

CI is very, very sad.

@TheBlueMatt
Copy link
Collaborator

Otherwise basically LGTM, nice and easy PR :)

@alecchendev alecchendev force-pushed the 2024-06-async-commit-secret-raa branch from e4ad15b to 3413032 Compare July 17, 2024 17:58
@alecchendev
Copy link
Contributor Author

lol yesterday i thought i fixed the CI error but didn't commit anything and did an empty force push 😆

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nits, feel free to land!

@@ -10,18 +10,21 @@
//! Tests for asynchronous signing. These tests verify that the channel state machine behaves
//! properly with a signer implementation that asynchronously derives signatures.

use std::collections::HashSet;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in most files we have a use crate::prelude::*;, which I believe would avoid this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, think that means this file will fail to build no-std, though we can also fix that when we drop the cfg flag.

lightning/src/ln/channel.rs Show resolved Hide resolved
Comment on lines +5535 to +5536
log_trace!(logger, "Last revoke-and-ack pending in channel {} for sequence {} because the next per-commitment point is not available",
&self.context.channel_id(), self.context.holder_commitment_point.transaction_number());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think this log is redundant with the ones above

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Jul 18, 2024

Gonna land, @alecchendev can handle the followups in #3109.

@TheBlueMatt TheBlueMatt merged commit 9ce3dd5 into lightningdevkit:main Jul 18, 2024
18 of 21 checks passed
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Jul 19, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Jul 20, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Sep 16, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Sep 16, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Sep 16, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Sep 17, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Sep 18, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Nov 26, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Nov 26, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 6, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 10, 2024
This also slightly refactors get_funding_signed_msg to match the logic
more similarly, as well as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 11, 2024
For all of our async signing logic in channel establishment v1, we set
signer flags in the method where we create the raw lightning message
object. To keep things consistent, this commit moves setting the signer
flags to where we create funding_created, since this was being set
elsewhere before.

While we're doing this cleanup, this also slightly refactors our
funding_signed method to move some code out of an indent, as well
as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 11, 2024
For all of our async signing logic in channel establishment v1, we set
signer flags in the method where we create the raw lightning message
object. To keep things consistent, this commit moves setting the signer
flags to where we create funding_created, since this was being set
elsewhere before.

While we're doing this cleanup, this also slightly refactors our
funding_signed method to move some code out of an indent, as well
as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 13, 2024
For all of our async signing logic in channel establishment v1, we set
signer flags in the method where we create the raw lightning message
object. To keep things consistent, this commit moves setting the signer
flags to where we create funding_created, since this was being set
elsewhere before.

While we're doing this cleanup, this also slightly refactors our
funding_signed method to move some code out of an indent, as well
as removes a log to fix a nit from lightningdevkit#3152.
alecchendev added a commit to alecchendev/rust-lightning that referenced this pull request Dec 13, 2024
For all of our async signing logic in channel establishment v1, we set
signer flags in the method where we create the raw lightning message
object. To keep things consistent, this commit moves setting the signer
flags to where we create funding_created, since this was being set
elsewhere before.

While we're doing this cleanup, this also slightly refactors our
funding_signed method to move some code out of an indent, as well
as removes a log to fix a nit from lightningdevkit#3152.
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.

4 participants