diff --git a/connectd/connectd.c b/connectd/connectd.c index deb604f45..e20bf7f7f 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -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, diff --git a/connectd/connectd.h b/connectd/connectd.h index f820ca2d1..72161b122 100644 --- a/connectd/connectd.h +++ b/connectd/connectd.h @@ -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; diff --git a/connectd/connectd_wire.csv b/connectd/connectd_wire.csv index 67af1dca0..91d0fdb6d 100644 --- a/connectd/connectd_wire.csv +++ b/connectd/connectd_wire.csv @@ -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, diff --git a/connectd/tor_autoservice.c b/connectd/tor_autoservice.c index a790c8615..33b6b970f 100644 --- a/connectd/tor_autoservice.c +++ b/connectd/tor_autoservice.c @@ -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 diff --git a/connectd/tor_autoservice.h b/connectd/tor_autoservice.h index 8bdb8bb9d..dce91a637 100644 --- a/connectd/tor_autoservice.h +++ b/connectd/tor_autoservice.h @@ -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, diff --git a/doc/lightning-listconfigs.7 b/doc/lightning-listconfigs.7 index e781d0019..79e816783 100644 --- a/doc/lightning-listconfigs.7 +++ b/doc/lightning-listconfigs.7 @@ -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 wrote the initial versi Main web site: \fIhttps://github.com/ElementsProject/lightning\fR -\" SHA256STAMP:8d8f73010f55f3af6e050c944cf7670109224b3cf3166cc754047f6e20beef20 +\" SHA256STAMP:c55d5a93c5917bbab0be1633f0f9f06196cfdde6b79434ef012e9dfc2fbbcca9 diff --git a/doc/lightning-listconfigs.7.md b/doc/lightning-listconfigs.7.md index 5b285b663..823ee79ba 100644 --- a/doc/lightning-listconfigs.7.md +++ b/doc/lightning-listconfigs.7.md @@ -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", diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 144f77710..0fe758048 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -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, diff --git a/lightningd/lightningd.h b/lightningd/lightningd.h index ae74a635f..5e3a1edb7 100644 --- a/lightningd/lightningd.h +++ b/lightningd/lightningd.h @@ -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; diff --git a/lightningd/options.c b/lightningd/options.c index 826b87b64..34e6f6db4 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -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."); diff --git a/lightningd/plugin.c b/lightningd/plugin.c index e0dff8188..1497439cc 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -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",