Skip to content

Exchange dual funding sigs and wait for channel confirmation#2261

Closed
t-bast wants to merge 9 commits into
masterfrom
dual-funding-confirmation
Closed

Exchange dual funding sigs and wait for channel confirmation#2261
t-bast wants to merge 9 commits into
masterfrom
dual-funding-confirmation

Conversation

@t-bast
Copy link
Copy Markdown
Member

@t-bast t-bast commented May 9, 2022

We exchange signatures for the funding tx and commit tx, and wait for the funding tx to confirm.

Note that there is one main deviation from the single-funder case: while we're waiting for a funding tx to confirm, we never force-close, because we still don't know which version of the funding tx will confirm and our closing code doesn't handle multiple local commitments (yet). It's ok, we can just wait for one of the funding txs to confirm or double-spend them all (currently outside of eclair, in the future we could add an RPC for that if necessary) to unblock the channel.

NB: this builds on top of #2255

t-bast added 8 commits April 27, 2022 08:31
This is easier to use than having to decide which params we should look
into (local or remote). It will also be easier to integrate with dual funding.
This name was very confusing. This feerate only applies to the commit tx,
so we make that explicit.
We use a codec trick to make the channelReserve field in LocalParams and
RemoteParams an Option[Satoshi].
* Use u16 instead of varint for lengths
* Revert channel flags extension
* Remove support for non-native segwit inputs
We implement the first step of the dual funding protocol: exchanging
`open_channel2` and `accept_channel2`.

We currently stop after exchanging these two messages. Future commits will
add the interactive-tx protocol used to build the funding transaction.
We build the funding transaction based on the interactive-tx protocol.

We currently stop before exchanging signatures. Future commits will add
the signature exchange and complete the dual funding flow.
We exchange commit and funding signatures for a dual-funded channel.

Once we've signed the funding transaction, we must start to remember this
channel as our peer may publish it.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 9, 2022

Codecov Report

Merging #2261 (728344a) into master (f099409) will increase coverage by 0.22%.
The diff coverage is 90.25%.

@@            Coverage Diff             @@
##           master    #2261      +/-   ##
==========================================
+ Coverage   84.30%   84.52%   +0.22%     
==========================================
  Files         194      199       +5     
  Lines       14383    15022     +639     
  Branches      589      612      +23     
==========================================
+ Hits        12125    12698     +573     
- Misses       2258     2324      +66     
Impacted Files Coverage Δ
...n/scala/fr/acinq/eclair/balance/CheckBalance.scala 64.89% <0.00%> (-1.42%) ⬇️
...main/scala/fr/acinq/eclair/db/DbEventHandler.scala 93.42% <ø> (ø)
...n/scala/fr/acinq/eclair/json/JsonSerializers.scala 94.11% <ø> (ø)
...ire/internal/channel/version0/ChannelCodecs0.scala 96.15% <ø> (+0.61%) ⬆️
...ire/internal/channel/version1/ChannelCodecs1.scala 97.91% <ø> (+1.00%) ⬆️
...ire/internal/channel/version2/ChannelCodecs2.scala 99.21% <ø> (+0.77%) ⬆️
...q/eclair/wire/protocol/LightningMessageTypes.scala 95.12% <0.00%> (-2.38%) ⬇️
...inq/eclair/channel/fsm/SingleFundingHandlers.scala 81.08% <42.85%> (ø)
...la/fr/acinq/eclair/channel/fsm/ErrorHandlers.scala 78.75% <61.90%> (-2.89%) ⬇️
...acinq/eclair/channel/fsm/DualFundingHandlers.scala 80.00% <80.00%> (ø)
... and 31 more

We wait for the funding tx to confirm and handle various error cases.

We avoid force-closing while we don't know which funding tx will confirm.
Instead we just wait for either one of the funding txs to confirm or all
funding attempts to be double-spent, which we check regularly.
@t-bast t-bast force-pushed the dual-funding-confirmation branch from c744de6 to 728344a Compare May 11, 2022 12:55
@t-bast t-bast marked this pull request as draft May 12, 2022 12:30
@t-bast
Copy link
Copy Markdown
Member Author

t-bast commented May 17, 2022

Closing in favor of a better alternative (coming soon).

@t-bast t-bast closed this May 17, 2022
@t-bast t-bast deleted the dual-funding-confirmation branch May 17, 2022 07:39
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.

2 participants