-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PSBT: add no_publish flag for safe batch channel opens v2 #4455
PSBT: add no_publish flag for safe batch channel opens v2 #4455
Conversation
The first channels of a batch shouldn't publish the batch TX to avoid problems if some of the funding flows can't be completed. Only the last channel of a batch should publish. We set the channel flag accordingly depending on the flag in the assembler.
3242342
to
0f2abc0
Compare
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.
LGTM 🐝
0f2abc0
to
2abb509
Compare
@cfromknecht There is a use case for the --no_publish flag even outside the context of PSBT: when using "zeroconf" channels (#4424). |
2abb509
to
4ec878e
Compare
Seems useful, but out of the scope of this PR, as we just want to modify the existing behavior for the PSBT case specifically. |
cc @joostjager PTAL |
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.
LGTM ✔️
Not sure if my approval should fully count as I wrote the PR originally.
To make it safer to open multiple channels in one batch, we add the
--no_publish
flag tolncli openchannel
(calledno_publish
in thePsbtShim
in RPC).When opening multiple channels in the same transaction, the
--no_publish
flag should be set for every channel but the last one. That way only after the last channel is negotiated successfully the batch transaction is published to the network. If that isn't done, it could lead to loss of funds if one of the peers involved times out and no commitment transactions were signed for that channel.Shepherding #4417 since @guggero is offline for now.