lnd icon indicating copy to clipboard operation
lnd copied to clipboard

[3/?]: multi: add new AuxFundingController for custom external funding flows

Open Roasbeef opened this issue 1 year ago • 4 comments

Depends on https://github.com/lightningnetwork/lnd/pull/8684.

In this commit, we add the AuxFundingController interface that can be used to implement a class of custom funding channels that only requires some additional data to be inserted into the tapscript leaves for the funding/HTLC/commitment outputs. This controller also implements the MsgEndpoint interface (see https://github.com/lightningnetwork/lnd/pull/8520) as well. This allows the controller to intercept certain custom messages related to the funding process (think extra sigs for a channel factory), and even the existing funding messages.

We then create a new top level config entry for this interface. This allows an external program to instantiate a AuxFundingController, make a MsgRouter, register that, then pass both into the lnd top level config.

We also pick up where the prior PR in this series left of by using the new abstraction to map a pending chan ID (kinda like the FundingStateStep RPC) to the aux funding data. This data is then used to populate all the new custom blobs that we'll store for these new channel types, which impacts the way we construct the funding output, and also the commitment/HTLC outputs+scripts.

Link to all PRs in the saga:

  • 1/?: https://github.com/lightningnetwork/lnd/pull/8683
  • 2/?: https://github.com/lightningnetwork/lnd/pull/8684
  • 3/?: https://github.com/lightningnetwork/lnd/pull/8622
  • 4/?: https://github.com/lightningnetwork/lnd/pull/8632
  • 5/?: https://github.com/lightningnetwork/lnd/pull/8641

Roasbeef avatar Apr 05 '24 00:04 Roasbeef

[!IMPORTANT]

Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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?

Share
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 testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to 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.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 05 '24 00:04 coderabbitai[bot]

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments
guggero
🥇
25
▀▀▀
2d 21h 27m
57
▀▀▀
ellemouton
🥈
17
▀▀
4d 14h 51m
34
▀▀
bhandras
🥉
10
30m
0
Roasbeef
6
7h 40m
12
yyforyongyu
6
3h 18m
0
ProofOfKeags
4
7d 8h 54m
42
▀▀
GeorgeTsagk
4
2d 20h 31m
10
ziggie1984
4
3d 11h 1m
9
saubyk
3
3h 43m
0
Chinwendu20
3
18d 5h 35m
▀▀▀
10
hieblmi
2
21m
1
bitromortac
2
9h 44m
0
positiveblue
1
4d 21h 57m
0
Crypt-iQ
1
7d 14h 36m
4
dstadulis
1
1d 22h 10m
4
morehouse
1
2d 2h 39m
1
carlaKC
1
12h 2m
0
mohamedawnallah
1
1d 4h 44m
0

github-actions[bot] avatar Apr 05 '24 00:04 github-actions[bot]

Pushed a few new commits: we'll now include the taproot internal key in the PBST template we return for the PSBT funding flow.

Roasbeef avatar Apr 16 '24 23:04 Roasbeef

@roasbeef, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar May 15 '24 01:05 lightninglabs-deploy

Updated this PR to depend on #8660 so we have everything we need in one continuous branch. @ffranr and @GeorgeTsagk please skip the first 6 commits when reviewing this PR!

guggero avatar May 21 '24 07:05 guggero