-
Notifications
You must be signed in to change notification settings - Fork 901
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
Dual-funding: handle failures #4424
Merged
rustyrussell
merged 6 commits into
ElementsProject:master
from
niftynei:nifty/df-aborts
Mar 15, 2021
Merged
Dual-funding: handle failures #4424
rustyrussell
merged 6 commits into
ElementsProject:master
from
niftynei:nifty/df-aborts
Mar 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
niftynei
force-pushed
the
nifty/df-aborts
branch
from
March 11, 2021 18:12
62f62e7
to
bb030ba
Compare
Merged
rustyrussell
approved these changes
Mar 15, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 1becab4
Allows us to clean up an in-progress open that we won't be completing Changelog-Added: EXPERIMENTAL JSON-RPC: Permit user-initiated aborting of in-progress opens. Only valid for not-yet-committed opens and RBF-attempts
is_v2 instead of protocol == OPEN_CHANNEL
Makes it easiser to figure out what's going on. Also, make sure that every 'fail_destination' error description includes quote escapes.
There's a version of this that keeps the PSBT in memory and does some fancy addition/subtraction of unuseable parts for the v2's, however it's much easier and simpler to simply error on the peer and re-start from the very beginning. This only works if we haven't gotten commitments from the peer yet (in fact either method would only work if we haven't got commitments from the peer yet), so if we've got commitments from them we simply mark them as failed an go again. In a perfect world, we'd remember what inputs we used last time, and reuse those again on the re-attempt, which would pefectly guarantee both that the failed opens (ones w/ commitments exchanged) would be canceled after this completes (and we could re-try the failed again). As it is, this is not perfect. It is, however, servicable.
Previously this ported errors around as JSON. A nicer thing to do is to deconstruct/reconstruct it; this also allows us to create our own errors from within the multifundchannel family.
rustyrussell
force-pushed
the
nifty/df-aborts
branch
from
March 15, 2021 01:32
1becab4
to
7b0be0c
Compare
Trivial conflict resolve rebase. Ack 7b0be0c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this, multifundchannels that involved v2 opens were left in a bit of a lurch if any of the v2 peers had issues while opening.
In theory, we should be able to 'live-action' update the PSBT for the remaining peers, if any has an issue, however this would require quite a bit of re-writing of the redo code in
multifundchannel
.Plus, it's only really an option is something happens while we're still in the
update
mode.More easily, we can merely signal to the peer that we're going to restart the negotiation, by sending an error which fails the in-progress negotiation, and then cleanly restart.
For peers that have reached the 'commitment exchange' already, there's no saving these without spending an input so we just ignore them/mark as failed and retry.