Skip to content

Conversation

@ddustin
Copy link
Collaborator

@ddustin ddustin commented Jun 18, 2025

Implemented a test for a splice-in into two channels at the same time using one transaction.

The test revealed three issues:

  1. We need to sign the shared output earlier in the splicing process 52bd2db
  2. We need to ignore SIGHASH setting while computing interactive-tx diffs a9d1dbf
  3. Some signatures were dropped when passing between the two splices a9d1dbf

This PR fixes those issues, adds a pytest for them, and makes basic two channel splices work, lets goooo 🔥

@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch 6 times, most recently from 4c4360f to 165e36b Compare June 19, 2025 22:34
@ddustin ddustin added this to the v25.09 milestone Jul 20, 2025
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch 11 times, most recently from e13b398 to 2c29e41 Compare July 22, 2025 23:49
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch 10 times, most recently from 43ee765 to 154d5e5 Compare August 4, 2025 20:20
@ddustin ddustin requested a review from niftynei August 4, 2025 20:20
@madelinevibes madelinevibes added the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Aug 6, 2025
Copy link
Collaborator

@niftynei niftynei left a comment

Choose a reason for hiding this comment

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

few things need updating, otherwise lgtm!

Make the failure reason more clear by adding more information to the signature failure message.
We used to use a check on the active psbt to see if our splice signature was in it — but now we need to generate the signature early.

So we have to add a field tracking if we’ve sent it and add it to the database, wire protocols, and inflight objects.
ddustin added 10 commits August 13, 2025 14:17
Use the new i_sent_sigs field to track if we’ve sent our peer our user sigs.
Previous behavior was to fail on abort when we have signatures in the inflight — change this behavior to fail on abort if we have sent our peer our signatures.
When doing a multi channel splice, we need to break the deadlock by signing the shared output early (even though it is not sent to the peer until later).
Add more information to funding issue failure messages when splicing
Adding verbose logging option to introspect into what interactive tx is doing with inputs.
When doing a cross channel splice, inputs move from having no SIGHASH to having SIGHASH_ALL assigned.

This causes psbt_get_changeset to flag the input as having changed, as the sighash value is compared.

This causes the second channel splice to `tx_remove_input` the input as it doesn’t match anymore, breaking the splice.

We fix this by removing the sighash value from input comparisions.
Since the signature data may vary, we must copy the new psbt into splicing->current_psbt.

This never occured during normal operation, but when doing a cross splice there may be vital signature(s) in the psbt that came from another splice that get dropped without this step.
A python test that splices into two channels at the same time with on transaction.

Changelog-Added: Adding support for cross-channel splicing.
Counting remote inputs needing sigs can be in its own method
@rustyrussell rustyrussell force-pushed the ddustin/cross_splice_testing branch from e6d1a68 to 9ea0643 Compare August 13, 2025 04:48
@rustyrussell rustyrussell enabled auto-merge (rebase) August 13, 2025 04:48
@rustyrussell
Copy link
Contributor

Doing trivial squash rebase now...

@rustyrussell rustyrussell removed the Status::Ready for Review The work has been completed and is now awaiting evaluation or approval. label Aug 13, 2025
@rustyrussell rustyrussell merged commit c602a8a into ElementsProject:master Aug 13, 2025
105 of 114 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.

4 participants