Skip to content

Cross channel Splice testing #8363

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 10 commits into
base: master
Choose a base branch
from

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 two issues, adds a pytest for them, and makes basic two channel splices work, lets goooo 🔥

Make the failure reason more clear by adding more information to the signature failure message.
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch 2 times, most recently from 56e7e2d to c492e3d Compare June 18, 2025 22:56
ddustin added 2 commits June 18, 2025 18:59
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.
Use the new i_sent_sigs field to track if we’ve sent our peer our user sigs.
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch from c492e3d to d96fe7e Compare June 18, 2025 23:00
ddustin added 5 commits June 18, 2025 19:40
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.
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch 2 times, most recently from 05c99fd to 4c4360f Compare June 19, 2025 21:29
ddustin added 2 commits June 19, 2025 18:31
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.
@ddustin ddustin force-pushed the ddustin/cross_splice_testing branch from 4c4360f to 165e36b Compare June 19, 2025 22:34
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.

1 participant