funding: add timeout to channel batch funding#8367
Conversation
63e5d82 to
242f7f9
Compare
e95d2b0 to
d33c417
Compare
d33c417 to
b133a21
Compare
|
Ready for review - unit tests still need to be fixed and an itest will be added. |
guggero
left a comment
There was a problem hiding this comment.
Nice work! Tested this locally and it works as advertised.
Though I'd slightly refactor it to be more in line with other patterns we use in the code base (see inline comment).
fba1869 to
6d3f359
Compare
guggero
left a comment
There was a problem hiding this comment.
tACK, LGTM 🎉
Not sure if adding an itest is easy... But a unit test should be possible.
|
I wonder if we already have a timeout for the single-channel funding flow ? |
Yep we do, IIUC users wanted the batch funding attempts to time out sooner? |
6d3f359 to
89f24db
Compare
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
ebfb086 to
2be5d35
Compare
|
Haven't forgotten about this an want to pick it up soon. |
f2bd339 to
a969c19
Compare
|
I think we should keep the PR. Having a timeout is useful here, independent of the other fixes. Not having one just helped us discover the underlying issue. |
|
@Roasbeef: review reminder |
|
!lightninglabs-deploy mute |
a969c19 to
6485a81
Compare
cf66ed9 to
e36390e
Compare
e36390e to
0956abc
Compare
0956abc to
215516d
Compare
When the user aborts the psbt channel funding flow, the user normally has to wait up to 10 min for the other node to cancel the lingering funding attempt. This cmd provides the possiblity to cancel a failed funding flow faster hence signaling to the peer that he can also remove the attempt from his mappings.
|
I fixed the itests/unitests, let's see if the CI passes and then I think this is gtg (also added a new lncli commend) |
| } | ||
|
|
||
| var cancelPsbtCommand = cli.Command{ | ||
| Name: "cancelPsbtFlow", |
There was a problem hiding this comment.
nit: we normally don't use camel case for command names.
|
Ok so thought this would be very easy to solve, however we need to redesign the channel funding flow for this to work properly. The problem currently is, that we might run into the case where we already fail the first channel with the first peer, before the other channels have properly registered the ChannelRegistration, this causes all kind of side effects. So we need to maybe add a new msg to:
which currently has 3 types: something like |
|
this got addressed with #8406 |
Fixes #8362.
In this PR we add a context deadline for the batch channel funding process. This gracefully ends the funding process if one or more of the batche's peers are unresponsive. Within the deadline window, the user can abort a pending batch opening via
Ctrl+C. The blocking peers will be logged. An aborted batch will cancel all channel openings. The user has to restart with an adjusted batch.