-
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
feature request: decommission #3550
Comments
Would it be useful to provide an The "decommissioned" state should probably persist, should it not? So on restart of the daemon it is still decommissioned and it will still reject new incoming |
|
As a further step the plugin could also reject any incoming connections that do not match a channel that is to be closed, that way we truly take it offline, while still giving us a chance to close collaboratively. |
Hm, did I get this right? |
Yes, I was thinking about trying our best to close collaboratively, and only after a long timeout actually force-close. So in my mind the sequence should be:
This minimizes our onchain footprint and fees 😉 |
This suggests a third API s well:
I think a "fast" decommisision would want to push as much of the funds immediately to target address(es), you might want this in case you suspect key material replication by an unauthorized party, while you might do a "slow" decommission which wants low fees by waiting for everything to come onchain and then sending all the funds in a single tx to the target address, for example if you decide to burn the server you were using as a natural part of replacing servers. But implemeting two forms of decommission is.... twice as complicated as implementing just one. I would think the "fast" decommission where we send funds to the traget address(es) ASAP is better, since upgrading your server is not as much of an emergency as recovering from a suspected key material replication. |
@ZmnSCPxj Additionally we can offer a |
I don't quite see the complexity of switching between the two nodes: we can just have a |
Fwiw I also prefer shorter RPC names in favor of (optional) command parameters. |
@cdecker can you try to explain this on other words? Also, for fast decommission, I think we might want have an option to send LN balances to a safe node first if possible, as waiting for closures and settlement introduces risks we want to avoid in fast mode. Infact, if you think about it, fast mode and slow mode are two different operations. The one with speed and security in mind, and the other one with cost, footprint and operational continuity in mind. |
Note: I updated and rewrote parts of the mission statement in the description of this issue |
Just a bit of rambling about where we could differentiate the two modes. TL;DR: I don't think we need two completely distinct entrypoints into the decommission flow, we just need to differentiate when it comes to actually executing the
I think those are two distinct operations: drain channels followed by a decommision. Drain should be done independently of whether we are fast or economical, since it minimizes the number of outputs we need to |
See also: https://arxiv.org/pdf/2007.00764.pdf especially section 4.2, for stuff having to do with closing channels and redirecting the funds back to the owner cold wallet. |
Our options are:
|
We should probably also consider using Rather than put decommissioning status in the database (which either requires the entire commissioning flow to be in lightningd rather than a plugin, or expose some commands that allow most of the commissioning flow to be done in a plugin except for the database access commands which would be nasty footguns), how about an optional file |
Description
Add a new pair of
lightning-cli
RPC commands that allow the permanent shutdown of a node. The commands may be calleddecommission
andrecommission
. This was discussed in #3499These commands can be used to close all channels and prevent acceptance of new funded channels by remote peers. Since this is a basic operation (any node goes offline eventually) and also security related (operator may decide its host maybe compromised) we should not have this as an optional python plugin but maybe as an integrated C plugin.
Decommissioning a node for operational reasons should focus on closing channels cooperatively to keep a low onchain footprint. Decommissioning a node on a hurry for security reasons requires a shorter force-close timeout, an external address and likely higher onchain fees.
lightning-cli decommission [address_or_xpub] [timeout] [destination]
Immediately
[destination]
is given, try to send out available channel liquidity to[destination]
pubkey viakeysend
for a given (short) timeout, e.g. 5 minutes.[address_or_xpub]
, if specified.In the meantime
timeout
, defaulting to a slow decommissiontimeout
of 24hr to give remote counterparts a chance to get online in the meantime for cooperative close. If the user is on a hurry, he can repeat the command with a fastertimeout
value.[address_or_xpub]
, if specified.[address_or_xpub]
, if specified.When done
hsm_secret
file to a backup location, so the node can't accidentally be started after the decommission completes.lightning-cli recommission
Cancels an ongoing
decommission
process by:hsm_secret
backup, if priordecommission
was finished.lightning-cli commissionstate
Show the user the state an process of an ongoing decommissioning operation:
Technical Requirements and Stepstones
commission_state
and[address_or_xpub]
(if we go for xpub we also need to count key index)rpc_command('fundchannel')
openchannel
hook chainable. If multiple plugins returnclose_to
, take first one and warn about it.openchannel
for remote fundings, ifdecommission
is running, reject themcommissioned
/decommissioning
/decommissioned
state
to the RPCgetinfo
output.Open Questions and Points of Discussion
address_or_xpub
information etc. Also the user could simply/safely delete the file in oder to stopdecommission
.The text was updated successfully, but these errors were encountered: