Skip to content
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

Add support for splices #430

Merged
merged 26 commits into from
Apr 11, 2023
Merged

Add support for splices #430

merged 26 commits into from
Apr 11, 2023

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Mar 30, 2023

Most commits are preparatory or intermediate steps, most of the work happens in:

Tests based on flows in https://gist.github.com/t-bast/1ac31f4e27734a10c5b9847d06db8d86 need to be added.

@pm47 pm47 requested a review from t-bast March 30, 2023 17:39
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

I focused on the first commits that implement the splice protocol, without looking at the interaction with payments: can we separate this to another PR? I believe that all the commits starting at a15eac1 can be extracted to another future PR to allow merging the splice protocol to master early, as it doesn't have any negative impact on the rest of the codebase.

pm47 added 4 commits April 4, 2023 11:51
Replace `makeFirstCommitTxs` by `makeCommitTxsWithoutHtlcs` which
generates a pair of commitments for arbitrary `fundingTxIndex` and
`commitmentIndex`.
pm47 added 7 commits April 4, 2023 13:18
We introduce a new model for channel commands, that allows for better
typing, and is suitable with `replyTo` pattern.
An important side-effect is that we do not eagerly prune initial
funding txs as soon as one of the rbf confirms. We could, but it is
better to be consistent with the splice case, where we must wait for the
counterparty to send their `splice_locked` before pruning.
@pm47
Copy link
Member Author

pm47 commented Apr 4, 2023

I believe that all the commits starting at a15eac1 can be extracted to another future PR to allow merging the splice protocol to master early, as it doesn't have any negative impact on the rest of the codebase.

Done in #436, also rebased this PR on master.

@pm47 pm47 requested a review from t-bast April 4, 2023 17:00
pm47 added 4 commits April 5, 2023 13:09
- if we have a channel in `Normal`, we use it
- if we have no channels, or if none of them will ever be suitable for
splice, we request a new channel
- in all other cases we do nothing and wait
To compute the remote reserve, we discard the local contribution. It's
okay if they go below reserve because we added capacity to the channel
with a splice-in.
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Looks mostly good, I have added fixups and tests in #438

- add comments in complex parts of the code
- match whole outpoint instead of just txid when possible
- rename `Splice.Response.Success` to `Splice.Response.Created`
- send `splice_locked` in the non-zero-conf case
- correctly overwrite splice status when disconnecting
- add tests
@pm47
Copy link
Member Author

pm47 commented Apr 11, 2023

🥁 🥁 🥁

@pm47 pm47 merged commit 725c2af into master Apr 11, 2023
2 checks passed
@pm47 pm47 deleted the splices branch April 11, 2023 14:50
@remyers remyers mentioned this pull request Dec 11, 2023
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.

None yet

2 participants