Skip to content

Conversation

@Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Jun 10, 2022

In this commit, we implement the new option_any_segwit feature bit which enables us to start sending P2TR addresses for co-op closes as well as for upfront shutdown addresses. Along the way, we tighten up our validation a bit to only allow segwit v0 and v1 addresses.

@Roasbeef Roasbeef added channel closing Related to the closing of channels cooperatively and uncooperatively needs review PR needs review by regular contributors labels Jun 10, 2022
@Roasbeef Roasbeef added this to the v0.15.1 milestone Jun 10, 2022
Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

looks good! left one question about possible interop bug in future world where witness versions 2-16 are a thing. My interpretation of the spec is that if we advertise this bit, the peer will think it is fine for them to send a shutdown script of these witness version. With this pr, we will error out if they do so

@Roasbeef
Copy link
Member Author

The refactoring I did in #6770 should make it easier to write unit tests for this change as well.

@lightninglabs-deploy
Copy link

@Roasbeef, remember to re-request review from reviewers when ready

@Roasbeef Roasbeef force-pushed the segwit-any-shutdown branch from 32e22b8 to 8c3cb95 Compare August 5, 2022 02:11
@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 5, 2022

Ok, I think this is g2g now: just pushed up fixes, a new unit test, and also an itest to make sure negotiation works e2e.

@Roasbeef Roasbeef requested review from Crypt-iQ and ellemouton August 5, 2022 02:16
Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

Copy link
Collaborator

@Crypt-iQ Crypt-iQ left a comment

Choose a reason for hiding this comment

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

lgtm but one comment

@Roasbeef Roasbeef force-pushed the segwit-any-shutdown branch from 8c3cb95 to 543a59b Compare August 9, 2022 01:26
@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 9, 2022

Proper version should be pushed up now (w/o the commit that bumps the Go version).

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a quirk of updating to Go 1.19 btw...

@Roasbeef Roasbeef force-pushed the segwit-any-shutdown branch from 543a59b to 369cee7 Compare August 9, 2022 02:35
In this commit, we add awareness of the option_shutdown_anysegwit that
permits both sides to send newer segwit based addresses. This'll
eventually enable us to send taproot addresses for co-op close.
In this commit, we catch up our logic with the latest version of the
spec that removed support for normal p2kh and p2sh addresses for co-op
closes, in order to make dust calculations more uniform.
We only want to allow p2wkh, p2tr, and p2wsh addresses, so we'll utilize
the newly public wallet function to restrict this.
If the ShutdownAnySegwitOptional option is active, then we can safely
send these newer addresses.
@Roasbeef Roasbeef force-pushed the segwit-any-shutdown branch from 369cee7 to cd7c705 Compare August 11, 2022 01:44
@Roasbeef Roasbeef merged commit a1cd773 into lightningnetwork:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel closing Related to the closing of channels cooperatively and uncooperatively needs review PR needs review by regular contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants