Skip to content

Channel Establishment for V3 Channels #3792

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

carlaKC
Copy link
Contributor

@carlaKC carlaKC commented May 22, 2025

This PR updates the channel establishment flow to allow and validate V3 channels (behind test flag).

Useful for the commits that follow where we add more downgrade tests.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented May 22, 2025

👋 Thanks for assigning @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@carlaKC carlaKC requested a review from TheBlueMatt May 22, 2025 15:43
@carlaKC carlaKC mentioned this pull request May 22, 2025
36 tasks
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Cool, basically all LGTM.

@@ -16153,22 +16154,28 @@ mod tests {
}

#[test]
fn test_anchors_zero_fee_htlc_tx_fallback() {
fn test_anchors_zero_fee_htlc_tx_downgrade() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Congrats, you touched it, now you get to move it out of channelmanager into some other test-specific file that isn't 15000 lines of code 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done this in a follow up in #3797 so that move + format can be reviewed separately.

Comment on lines 209 to 212
/// back to a `anchors_zero_fee_htlc` (if [`Self::negotiate_anchors_zero_fee_htlc_tx`]
/// is set) or `static_remote_key` channel.
///
/// *Implies [`Self::negotiate_anchors_zero_fee_htlc_tx`].*
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are in conflict - one says we'll fall back if its set, the other says that its implied (ie always set) if we set this flag.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@ldk-reviews-bot
Copy link

✅ Added second reviewer: @valentinewallace

@wpaulino wpaulino requested review from wpaulino and removed request for valentinewallace May 22, 2025 18:17
Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

LGTM after Matt's comments are addressed

carlaKC and others added 6 commits May 23, 2025 14:10
To allow testing along the way in this PR, turn on negotiation of
zero fee channels.

Co-authored-by: Matt Corallo <git@bluematt.me>
Sender: MUST set `feerate_per_kw` to zero
Receiver: MUST fail the channel if `feerate_per_kw` != 0

Co-authored-by: Matt Corallo <git@bluematt.me>
Like anchor channels, these channels require that the user reserves a
UTXO to bump the channel. If we automatically accept this channel type
and the user does not have such reserve available, they are at risk of
losing funds because they cannot fee bump the channel.
@carlaKC
Copy link
Contributor Author

carlaKC commented May 23, 2025

Removed conflicting docs statement + opened followup for test separation (felt wrong to do move+format in the same PR, happy to include if we want it in here).

@carlaKC carlaKC requested review from wpaulino and TheBlueMatt May 23, 2025 20:54
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