connectd: remove enable-autotor-v2-mode option

Changelog-Removed: lightningd: removed `enable-autotor-v2-mode` option (deprecated v0.10.1)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-05-17 10:11:01 +09:30
parent 8dd51d127f
commit 8b62e2584f
11 changed files with 15 additions and 46 deletions

View File

@@ -1437,8 +1437,7 @@ setup_listeners(const tal_t *ctx,
toraddr = tor_autoservice(tmpctx,
&proposed_wireaddr[i],
tor_password,
localaddr,
daemon->use_v3_autotor);
localaddr);
if (!(proposed_listen_announce[i] & ADDR_ANNOUNCE)) {
continue;
@@ -1534,7 +1533,6 @@ static void connect_init(struct daemon *daemon, const u8 *msg)
&proxyaddr, &daemon->always_use_proxy,
&daemon->dev_allow_localhost, &daemon->use_dns,
&tor_password,
&daemon->use_v3_autotor,
&daemon->timeout_secs,
&daemon->websocket_helper,
&daemon->websocket_port,

View File

@@ -206,9 +206,6 @@ struct daemon {
/* File descriptors to listen on once we're activated. */
const struct listen_fd **listen_fds;
/* Allow to define the default behavior of tor services calls*/
bool use_v3_autotor;
/* Our features, as lightningd told us */
struct feature_set *our_features;

View File

@@ -18,7 +18,6 @@ msgdata,connectd_init,use_tor_proxy_always,bool,
msgdata,connectd_init,dev_allow_localhost,bool,
msgdata,connectd_init,use_dns,bool,
msgdata,connectd_init,tor_password,wirestring,
msgdata,connectd_init,use_v3_autotor,bool,
msgdata,connectd_init,timeout_secs,u32,
msgdata,connectd_init,websocket_helper,wirestring,
msgdata,connectd_init,websocket_port,u16,
1 #include <bitcoin/block.h>
18 msgdata,connectd_init,use_dns,bool,
19 msgdata,connectd_init,tor_password,wirestring,
20 msgdata,connectd_init,use_v3_autotor,bool, msgdata,connectd_init,timeout_secs,u32,
msgdata,connectd_init,timeout_secs,u32,
21 msgdata,connectd_init,websocket_helper,wirestring,
22 msgdata,connectd_init,websocket_port,u16,
23 msgdata,connectd_init,announce_websocket,bool,

View File

@@ -86,7 +86,6 @@ static void discard_remaining_response(struct rbuf *rbuf)
static struct wireaddr *make_onion(const tal_t *ctx,
struct rbuf *rbuf,
const struct wireaddr *local,
bool use_v3_autotor,
u16 port)
{
char *line;
@@ -101,25 +100,18 @@ static struct wireaddr *make_onion(const tal_t *ctx,
if (!strstarts(line, "VERSION Tor="))
continue;
if (use_v3_autotor)
if (strstr(line, "\"0.0") ||
strstr(line, "\"0.1") ||
strstr(line, "\"0.2") ||
strstr(line, "\"0.3")) {
use_v3_autotor = false;
status_unusual("Autotor: fallback to try a V2 onion service, your Tor version is smaller than 0.4.x.x");
}
};
if (strstr(line, "\"0.0") ||
strstr(line, "\"0.1") ||
strstr(line, "\"0.2") ||
strstr(line, "\"0.3")) {
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Autotor: your Tor version is smaller than 0.4.x.x");
}
}
if (!use_v3_autotor) {
tor_send_cmd(rbuf,
tal_fmt(tmpctx, "ADD_ONION NEW:RSA1024 Port=%d,%s Flags=DiscardPK,Detach",
port, fmt_wireaddr(tmpctx, local)));
} else {
tor_send_cmd(rbuf,
tor_send_cmd(rbuf,
tal_fmt(tmpctx, "ADD_ONION NEW:ED25519-V3 Port=%d,%s Flags=DiscardPK,Detach",
port, fmt_wireaddr(tmpctx, local)));
}
while ((line = tor_response_line(rbuf)) != NULL) {
const char *name;
@@ -268,8 +260,7 @@ static void negotiate_auth(struct rbuf *rbuf, const char *tor_password)
struct wireaddr *tor_autoservice(const tal_t *ctx,
const struct wireaddr_internal *tor_serviceaddr,
const char *tor_password,
const struct wireaddr *laddr,
const bool use_v3_autotor)
const struct wireaddr *laddr)
{
int fd;
struct wireaddr *onion;
@@ -290,7 +281,7 @@ struct wireaddr *tor_autoservice(const tal_t *ctx,
rbuf_init(&rbuf, fd, buffer, tal_count(buffer), buf_resize);
negotiate_auth(&rbuf, tor_password);
onion = make_onion(ctx, &rbuf, laddr, use_v3_autotor, tor_serviceaddr->u.torservice.port);
onion = make_onion(ctx, &rbuf, laddr, tor_serviceaddr->u.torservice.port);
/*on the other hand we can stay connected until ln finish to keep onion alive and then vanish */
//because when we run with Detach flag as we now do every start of LN creates a new addr while the old

View File

@@ -9,8 +9,7 @@
struct wireaddr *tor_autoservice(const tal_t *ctx,
const struct wireaddr_internal *tor_serviceaddr,
const char *tor_password,
const struct wireaddr *localaddr,
const bool use_v3_autotor);
const struct wireaddr *localaddr);
struct wireaddr *tor_fixed_service(const tal_t *ctx,
const struct wireaddr_internal *tor_serviceaddr,

View File

@@ -261,7 +261,6 @@ On failure, one of the following error codes may be returned:
"autolisten": true,
"proxy": "127.0.0.1:9050",
"disable-dns": "false",
"enable-autotor-v2-mode": "false",
"encrypted-hsm": false,
"rpc-file-mode": "0600",
"log-level": "DEBUG",
@@ -282,4 +281,4 @@ Vincenzo Palazzo \fI<vincenzo.palazzo@protonmail.com\fR> wrote the initial versi
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:8d8f73010f55f3af6e050c944cf7670109224b3cf3166cc754047f6e20beef20
\" SHA256STAMP:c55d5a93c5917bbab0be1633f0f9f06196cfdde6b79434ef012e9dfc2fbbcca9

View File

@@ -188,7 +188,6 @@ EXAMPLE JSON RESPONSE
"autolisten": true,
"proxy": "127.0.0.1:9050",
"disable-dns": "false",
"enable-autotor-v2-mode": "false",
"encrypted-hsm": false,
"rpc-file-mode": "0600",
"log-level": "DEBUG",

View File

@@ -554,7 +554,6 @@ int connectd_init(struct lightningd *ld)
ld->proxyaddr, ld->always_use_proxy || ld->pure_tor_setup,
IFDEV(ld->dev_allow_localhost, false), ld->config.use_dns,
ld->tor_service_password ? ld->tor_service_password : "",
ld->config.use_v3_autotor,
ld->config.connection_timeout_secs,
websocket_helper_path,
ld->websocket_port,

View File

@@ -62,9 +62,6 @@ struct config {
/* Minimal amount of effective funding_satoshis for accepting channels */
u64 min_capacity_sat;
/* Allow to define the default behavior of tor services calls*/
bool use_v3_autotor;
/* This is the key we use to encrypt `hsm_secret`. */
struct secret *keypass;

View File

@@ -793,8 +793,6 @@ static const struct config testnet_config = {
/* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */
.min_capacity_sat = 10000,
.use_v3_autotor = true,
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,
@@ -859,9 +857,6 @@ static const struct config mainnet_config = {
/* Sets min_effective_htlc_capacity - at 1000$/BTC this is 10ct */
.min_capacity_sat = 10000,
/* Allow to define the default behavior of tor services calls*/
.use_v3_autotor = true,
/* 1 minute should be enough for anyone! */
.connection_timeout_secs = 60,
@@ -1168,10 +1163,6 @@ static void register_opts(struct lightningd *ld)
opt_register_early_noarg("--disable-dns", opt_set_invbool, &ld->config.use_dns,
"Disable DNS lookups of peers");
if (deprecated_apis)
opt_register_noarg("--enable-autotor-v2-mode", opt_set_invbool, &ld->config.use_v3_autotor,
opt_hidden);
opt_register_noarg("--encrypted-hsm", opt_set_hsm_password, ld,
"Set the password to encrypt hsm_secret with. If no password is passed through command line, "
"you will be prompted to enter it.");

View File

@@ -1853,7 +1853,7 @@ plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)
json_add_string(req->stream, "network", chainparams->network_name);
if (ld->proxyaddr) {
json_add_address(req->stream, "proxy", ld->proxyaddr);
json_add_bool(req->stream, "torv3-enabled", ld->config.use_v3_autotor);
json_add_bool(req->stream, "torv3-enabled", true);
json_add_bool(req->stream, "always_use_proxy", ld->always_use_proxy);
if (deprecated_apis)
json_add_bool(req->stream, "use_proxy_always",