Implement V2 channel establishment
This PR aims to do the following:
- [ ] Introduce V2 prefunded channel types with state specific to dual-funding.
- [ ] Add functionality to
ChannelManagerto create and accept dual-funded channels.- [ ] Can set config
contribute_to_dual_funded_channelsif the user would like to contribute inputs to incoming dual-funded channels. In this case, these channels will need to be accepted manually, indicated by a newOpenChannelV2Requestevent so that inputs can be provided. If the above flag is false (default), then no inputs will be contributed and the channel is accepted on the user's behalf gated by all the commonly enforced rules. Other policies and functionality to automate funding of incoming channels may be introduced in the future.
- [ ] Can set config
- [ ] Introduce dual-funded channel feature bits
Codecov Report
Attention: Patch coverage is 73.02780% with 359 lines in your changes missing coverage. Please review.
Project coverage is 89.70%. Comparing base (
07f3380) to head (365aac8).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #2302 +/- ##
==========================================
- Coverage 89.90% 89.70% -0.20%
==========================================
Files 121 121
Lines 99170 100033 +863
Branches 99170 100033 +863
==========================================
+ Hits 89159 89735 +576
- Misses 7408 7687 +279
- Partials 2603 2611 +8
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This isn't blocked on anything anymore, right? Is there anything you want early feedback on here?
This isn't blocked on anything anymore, right? Is there anything you want early feedback on here?
Technically blocked on interactive txs. But yeah, a few things I need to update before some conceptual/approach review here.
Also now blocked on the 2077 fixups.
Technically blocked on interactive txs. But yeah, a few things I need to update before some conceptual/approach review here.
If this is blocked on review interactive txs on the spec-side, I can do a round here. Though dunno which PRs it’s blocked on.
If this is blocked on review interactive txs on the spec-side, I can do a round here. Though dunno which PRs it’s blocked on.
Oh sorry, I meant the interactive txs implementation. Jurvis had two sketches up in his fork and will be putting a PR together as per the first action item here: https://gist.github.com/jurvis/98215abd6fd392a3f2f0ded03c5c6fff. I'll mark this as blocked on that, but it will be at least ready for some conceptual review after I rebase the changes in #2382.
Jurvis had two sketches up in his fork and will be putting a PR together as per the first action item here: https://gist.github.com/jurvis/98215abd6fd392a3f2f0ded03c5c6fff.
@jurvis If you have a branch available for early conceptual review, happy to have a look and see how it scores compared to the specification, the ongoing changes in the mempool and LDK current interfaces :)
@ariard we just finalised an approach for the TX constructor we are happy with so I’m working to put together a proof of concept rn for review. Should be ready in the next couple of days!
Should be ready in the next couple of days!
Many thanks, left a couple of review feedback on the new poc PR. If Duncan or you can maintain a dual-funding / splicing issue like Wilmer is doing for anchor output, this is very welcome to coordinate review and pin feedback backlog. I’ll have a look on the gist too, have to catchup with spec first.
If Duncan or you can maintain a dual-funding / splicing issue like Wilmer is doing for anchor output, this is very welcome to coordinate review and pin feedback backlog.
@ariard see https://github.com/lightningdevkit/rust-lightning/issues/1621.
@ariard see https://github.com/lightningdevkit/rust-lightning/issues/1621.
Just added this PR there and will continue to keep fleshing it out.
It seems that interactive_tx_signing_session is not reset at the end of the process. In a test with a payment being done after a V2 establishment, a new commitment was mis-handled to commitment_signed_initial_v2(). I think interactive_tx_signing_session should be reset (e.g. at the end of tx_signatures()).
[!IMPORTANT]
Auto Review Skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository.To trigger a single review, invoke the
@coderabbitai reviewcommand.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit-tests for this file.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit tests for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository from git and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit tests.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
Working through a rebase on #2981 at the moment, then will start addressing feedback above :pray:
I see I've missed some error handling todo!()s. I'll push them up soon. As for checking the sighashes, I'm still working on figuring out the best way we're going to do that.
Just resolved some conflicts and addressed a few comments. Still busy addressing Jeff's other initial review comments.
Pushed some fixes for feedback. Working on remaining ones.
Split out https://github.com/lightningdevkit/rust-lightning/pull/3137 which should be easier to review and lower risk since it involves no contribution of funds.
This PR will be rebased on that.
Ok, rebasing will now be fun after #3137 merge.