Skip to content

Add support for the official splicing protocol#2887

Open
t-bast wants to merge 5 commits intomasterfrom
splicing-official
Open

Add support for the official splicing protocol#2887
t-bast wants to merge 5 commits intomasterfrom
splicing-official

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Jul 23, 2024

We replace our experimental version of splice_init, splice_ack and splice_locked by their official version (see lightning/bolts#1160). If our peer is using the experimental feature bit, we convert our outgoing messages to use the experimental encoding and incoming messages to the official messages.

We also change the TLV fields added to tx_add_input, tx_signatures and splice_locked to match the spec version. We always write both the official and experimental TLV to updated nodes (because the experimental one is odd and will be ignored) but we drop the official TLV if our peer is using the experimental feature, because they won't understand the even TLV field.

We do the same thing for the commit_sig TLV. For peers who support the official splicing version, we insert the start_batch message before the batch of commit_sig messages as specified in lightning/bolts#1160.

We also support both the legacy and official reconnection logic (TLV fields in channel_reestablish). It is a bit painful because both protocols use TLV 1, but for different purposes, so we need to do it in a somewhat hacky way at the codec level.

This ensures that we're able to create splice transactions, even with non-upgraded nodes (full backwards-compatibility). It would be best to make sure Phoenix users upgrade to a version that uses the official protocol though, to allow cleaning up the codebase and guarantee that we haven't missed an edge case.

Builds on top of #3261

E2E tests:

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants