-
Notifications
You must be signed in to change notification settings - Fork 912
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
fundchannel_cancel
channel_id
infelicities
#3785
Comments
ZmnSCPxj
added a commit
to ZmnSCPxj/lightning
that referenced
this issue
Jun 24, 2020
… a `channel_id` argument. Fixes: ElementsProject#3785 Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
ZmnSCPxj
added a commit
to ZmnSCPxj/lightning
that referenced
this issue
Jun 27, 2020
… a `channel_id` argument. Fixes: ElementsProject#3785 Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
ZmnSCPxj
added a commit
to ZmnSCPxj/lightning
that referenced
this issue
Jun 30, 2020
… a `channel_id` argument. Fixes: ElementsProject#3785 Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
ZmnSCPxj
added a commit
to ZmnSCPxj/lightning
that referenced
this issue
Jul 1, 2020
… a `channel_id` argument. Fixes: ElementsProject#3785 Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
ZmnSCPxj
added a commit
that referenced
this issue
Jul 2, 2020
… a `channel_id` argument. Fixes: #3785 Changelog-Changed: `fundchannel_cancel` no longer requires its undocumented `channel_id` argument after `fundchannel_complete`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let me describe the current infelicity:
Supposedly
fundchannel_cancel
has an optionalchannel_id
parameter.If you have a
fundchannel_start
but have not yet donefundchannel_complete
with a peer, then you can just give the peer ID without giving thechannel_id
at all. In factchannel_id
is ignored, you can literally put valid JSON garbage into it and it will not affect the operation offundchannel_cancel
at all.On the other hand, after you have done
fundchannel_complete
, you should give achannel_id
:(actually if you have not recently closed a channel with that peer you do not need the channel ID, because
fundchannel_cancel
will only fail if there is ambiguity, but if you are trying to make a robust plugin that implementsmultifundchannel
you have to give the channel ID, because you cannot be sure of the previous history with that peer, and it is far simpler (==robuster) to just always give the channel ID all the time than check if we are still remembering a recently-closed channel with that peer)This translates to a kind of inconsistent use of
fundchannel_cancel
: you have to give a channel ID afterfundchannel_complete
, but you cannot get a channel ID fromfundchannel_start
--- a channel ID is derived from inputs tofundchannel_complete
, which is itself derived from outputs offundchannel_start
.--
So, to get a consistent usage of
fundchannel_cancel
, we can do a variety of things.I am not certain what is the best, so let me present the two options I can think of for now.
fundchannel_cancel
removes itschannel_id
parameter as unnecessary.fundchannel_cancel
is done afterfundchannel_complete
, it autosearches for the channel that is currentlyCHANNELD_AWAITING_LOCKIN
; because there can only be one active channel at a time, only up to one channel can be inCHANNELD_AWAITING_LOCKIN
.channel_id
parameter forfundchannel_cancel
.fundchannel_start
returns atemporary_channel_id
that is used when doing afundchannel_cancel
betweenfundchannel_start
andfundchannel_complete
, thenfundchannel_complete
returns the realchannel_id
that should be used forfundchannel_cancel
afterwards.temporary_channel_id
betweenaccept_channel
(== the end offundchannel_start
) andfunding_created
(== the beginning offundchannel_complete
).I lean more to the former; it seems unlikely we will support more than one channel per peer in the foreseeable future anyway, so
fundchannel_cancel
should just apply to "whatever channel is being funded with the peer"; previous, already-closed channels should not be considered as one of the possible channels to cancel and thus requiring disambiguation.On the other hand if we eventually move to multiple channels per peer, then the latter option means that all
multifundchannel
andfundchannel
implementations written today will continue to work in the future with multiple-channels-per-peer (since those implementations will be handling the channel ID anyway).(It is helpful to point out as well that
channel_id
parameter infundchannel_cancel
is completely undocumented; not evenlightning-cli help fundchannel_cancel
hints whatchannel_id
is.)What does everyone think?
The text was updated successfully, but these errors were encountered: