Skip to content

Fix Channel being left in indeterminite state from 9f9a7a92e1c15cad #3627

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

TheBlueMatt
Copy link
Collaborator

9f9a7a9 introduced some changes to channel state transitions but left one case where we'd leave a channel in an undefined phase (upon receiving a commitment_signed in the wrong state), which we fix here.

9f9a7a9 introduced some changes
to channel state transitions but left one case where we'd leave a
channel in an undefined phase (upon receiving a `commitment_signed`
in the wrong state), which we fix here.
@TheBlueMatt TheBlueMatt added this to the 0.2 milestone Feb 27, 2025
Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

Ugh. Sorry, I definitely messed this up after rebasing the phase refactor. :(

@TheBlueMatt
Copy link
Collaborator Author

Long PRs with many rebases and rounds of review introduce way too many bugs...

@dunxen
Copy link
Contributor

dunxen commented Feb 28, 2025

This LGTM, maybe @jkczyz could perhaps take a look and then merge as he also has context.

@@ -1534,6 +1534,7 @@ impl<SP: Deref> Channel<SP> where
res
},
_ => {
self.phase = phase;
debug_assert!(!matches!(self.phase, ChannelPhase::Undefined));
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, the debug_assert should have probably gone outside the match as is done in funding_signed. Guess it doesn't really matter since the other arms should be obviously correct.

@jkczyz jkczyz merged commit 4f68130 into lightningdevkit:main Feb 28, 2025
25 of 26 checks passed
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.

3 participants