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

[wallet 3/3]: group key support for channel funding #1413

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

guggero
Copy link
Member

@guggero guggero commented Feb 26, 2025

Adds the ability to fund multiple tranches of a grouped asset into a channel.

TODO:

  • Update channel closer code
  • Update sweeper code
  • Extend itest with coop and force close test cases

Corresponding itest: lightninglabs/lightning-terminal#987

Part of the group key support saga:

@coveralls
Copy link

coveralls commented Feb 26, 2025

Pull Request Test Coverage Report for Build 13571552700

Details

  • 14 of 93 (15.05%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on group-key-support at 54.566%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcserver.go 0 1 0.0%
tapchannelmsg/custom_channel_data.go 0 2 0.0%
tapdb/assets_store.go 4 7 57.14%
taprpc/tapchannelrpc/tapchannel.pb.go 0 5 0.0%
tapchannel/aux_funding_controller.go 0 68 0.0%
Totals Coverage Status
Change from base Build 13571552842: 54.6%
Covered Lines: 49008
Relevant Lines: 89814

💛 - Coveralls

@guggero guggero force-pushed the allocation-refactor branch 2 times, most recently from 86112a5 to cdc7cb2 Compare March 4, 2025 13:40
@guggero guggero force-pushed the group-key-support branch from 2639fa6 to 9f24e16 Compare March 4, 2025 13:40
@guggero guggero force-pushed the allocation-refactor branch from cdc7cb2 to be499e2 Compare March 4, 2025 16:19
@guggero guggero force-pushed the group-key-support branch 2 times, most recently from db987a5 to 206da82 Compare March 4, 2025 19:22
@guggero guggero force-pushed the allocation-refactor branch from be499e2 to bb88417 Compare March 4, 2025 19:22
@GeorgeTsagk GeorgeTsagk self-requested a review March 6, 2025 10:28
guggero added 10 commits March 6, 2025 12:30
This commit refactors the JSON formatting of the channel related custom
data fields from lnd and unit tests the JSON output.
The previous structure barely made sense with a single asset UTXO, but
is completely wrong with multiple asset UTXO committed to a single
channel.
We fix the structure and also add more data from the encoded blob to it.
The wrong error was assigned, which caused the proof delivery failures
to not surface correctly.
Not sure why the asset ID was never used in the database proof query.
But now that we potentially have multiple asset outputs with the same
script key but different asset IDs in the same anchor transaction, it's
crucial we also add this to the query.
We recently changed the semantics around transfers. We now allow
multiple virtual packets to be combined in a single transfer. Which
means we have one entry in the transfer table for each on-chain
transaction. But each transfer can have inputs and outputs from
different asset IDs (meaning different active vPackets).
This implies that it's also possible to have multiple transfer outputs
with the same script key but different asset IDs, which means we need to
change the way we identify the proof files.
One allocation entry means one on-chain output. So we should not create
multiple allocations for the same balance (e.g. if there are multiple
asset pieces with different asset IDs in the local or remote balance).
Instead we just create one allocation for the sum, then let the coin
distribution algorithm decide what output goes where.
@guggero guggero changed the base branch from allocation-refactor to main March 6, 2025 11:31
@guggero guggero force-pushed the group-key-support branch from 206da82 to ce40ed7 Compare March 6, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

2 participants