Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
|
Curious your thoughts Elias, I understand this may be a hacky use case. See this issue for context: lightningdevkit/ldk-server#257 |
|
If the node reconnects to the peer with a stale database, we get a panic, which I think is the correct course of action here; that's been the core motivation for this offline flag. |
Hmm, I honestly would prefer to directly go for the full recovery mode we planned for a bit. Do you think this is time critical, or can we add it for v0.9? |
Yes let's go for the full recovery mode (do you have an issue describing this?) I think this can wait for 0.9, feel free to close this PR and we can re-open a separate proper recovery PR. |
No issue so far, but what we discussed was to have a special mode on builder or a separate utility that you'd give all the information you have (seed, list of known prior peers, etc) and it would try to claw all funds back that are possible, i.e., do force-close recovery but also retrieve Actually, let me see if i can do a quick draft. |
Disable all outbound Lightning connections, including explicit API requests, with one check before DNS resolution and TCP/Tor connection creation. Inbound listening is controlled by listening_addresses; chain synchronization and other networking are unaffected. Co-Authored-By: HAL 9000
18dff83 to
adff576
Compare
disable_peer_networking flagdisable_outbound_lightning_connections flag
| /// |----------------------------------------|--------------------------------------| | ||
| /// | `storage_dir_path` | /tmp/ldk_node/ | | ||
| /// | `network` | Bitcoin | | ||
| /// |`disable_outbound_lightning_connections`| false | |
There was a problem hiding this comment.
nit: This has missing whitespace (before, after).
| async fn do_connect_peer_internal( | ||
| &self, node_id: PublicKey, addr: SocketAddress, | ||
| ) -> Result<(), Error> { | ||
| if self.disable_outbound_lightning_connections { |
There was a problem hiding this comment.
Should we add a test for this, i.e., one that sets up some nodes and then restarts with the flag enabled, ensuring that they they don't reconnect?
| /// If `persist` is set to `true`, we'll remember the peer and reconnect to it on restart. | ||
| /// Outbound connection attempts fail with [`Error::ConnectionFailed`] if | ||
| /// [`Config::disable_outbound_lightning_connections`] is set. | ||
| pub fn connect( |
There was a problem hiding this comment.
Hmm, wouldn't we still want to allow manual overrides? I.e. allow the user to selectively connect peers, e.g., to trigger the channel-reestablish recovery flow?
| /// Inbound connections are controlled separately by | ||
| /// [`Config::listening_addresses`]; set it to `None` to prevent inbound connections as well. | ||
| /// Other networking, including chain synchronization, is unaffected. | ||
| pub disable_outbound_lightning_connections: bool, |
There was a problem hiding this comment.
Hmm, maybe this would be better on the builder, rather than a Config field?
Uh oh!
There was an error while loading. Please reload this page.