Comments (2)
This is a temporary patch for the case ADDR_TYPE_TOR_V3:
switch case at https://github.com/ElementsProject/lightning/blob/v23.08.1/connectd/connectd.c#L827 that allowed me to run my node as intended:
case ADDR_TYPE_TOR_V3:
if (use_proxy) /* hand it to the proxy */
break;
if (!use_dns) { /* ignore DNS when we can't use it */
tal_append_fmt(&connect->errors,
"%s: dns disabled. ",
type_to_string(tmpctx,
struct wireaddr_internal,
addr));
goto next;
}
/* Resolve with getaddrinfo */
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
hints.ai_protocol = 0;
hints.ai_flags = AI_ADDRCONFIG;
gai_err = getaddrinfo(fmt_wireaddr_without_port(tmpctx, &addr->u.wireaddr.wireaddr), // use fmt_wireaddr_without_port() to extract the .onion hostname
tal_fmt(tmpctx, "%d",
addr->u.wireaddr.wireaddr.port),
&hints, &ais);
if (gai_err != 0) {
tal_append_fmt(&connect->errors,
"%s: getaddrinfo error '%s'. ",
type_to_string(tmpctx,
struct wireaddr_internal,
addr),
gai_strerror(gai_err));
goto next;
}
/* create new addrhints on-the-fly per result ... */
for (aii = ais; aii; aii = aii->ai_next) {
addrhint.itype = ADDR_INTERNAL_WIREADDR;
addrhint.u.wireaddr.is_websocket = false;
if (aii->ai_family == AF_INET) {
sa4 = (struct sockaddr_in *) aii->ai_addr;
wireaddr_from_ipv4(&addrhint.u.wireaddr.wireaddr,
&sa4->sin_addr,
addr->u.wireaddr.wireaddr.port);
} else if (aii->ai_family == AF_INET6) {
sa6 = (struct sockaddr_in6 *) aii->ai_addr;
wireaddr_from_ipv6(&addrhint.u.wireaddr.wireaddr,
&sa6->sin6_addr,
addr->u.wireaddr.wireaddr.port);
} else {
/* skip unsupported ai_family */
continue;
}
tal_arr_expand(&connect->addrs, addrhint);
/* don't forget to update convenience pointer */
addr = &connect->addrs[connect->addrnum];
}
freeaddrinfo(ais);
goto next;
The code was copied from the case ADDR_TYPE_DNS:
switch case (https://github.com/ElementsProject/lightning/blob/v23.08.1/connectd/connectd.c#L836) and modified to resolve the .onion domain instead.
Running a patched node for a week with some open channels without any connectivity issues, having both clearnet and Tor connections to peers.
Not closing the issue because the main CLN's repository continues with a broken logic for handling .onion addresses in connectd.c
and I expect some maintainer/contributor to make a cleaner patch. Note that always-use-proxy
should determine whether to enforce use-proxy
or not in that particular situation.
from lightning.
I wanted to try Lightning and came across this issue here.
First of all, thank you @tmpgithubissue102 for providing a patch that helped me to avoid wasting time on debugging the issue myself. It works as expected.
Secondly, I am not sure why the 'bug' tag wasn't assigned yet, since it's not about personal preferences here but about how software is supposed to work by default - without assuming there is a need of a proxy if we need to resolve an .onion address, since Tor instance is capable of being a standalone router and has appropriate configurations for routing the network traffic through itself.
Core Lightning refuses to resolve .onion addresses if there is no proxy specified, which is a bug.
@cdecker @rustyrussell @vincenzopalazzo hope you can clarify this.
from lightning.
Related Issues (20)
- Add configuration to subscribe to list of notifications
- Documentation consolidation based on OpenRPC standards
- Disable clnrest.py HOT 1
- onchain invoice payments should warn if payment after expiry HOT 4
- channeld should tell lightningd once reestablish exchanged
- utxoset table unexpectedly large
- adding FetchInvoice grpc call to node proto
- renepay: Probability costs for small amounts zero? HOT 2
- Error when using 12 words for lightning-hsmtool generatehsm HOT 1
- Remove `msat` suffix from all clnrest responses
- Install takes forever(?) HOT 10
- Feature Engineering in renepay seems a bit unstructured and arbitrary HOT 1
- Remove the JSON decoder global override to convert _msat fields to Millisatoshi
- channeld sent bad reestablish revocation_number: 0 vs 158147 HOT 1
- My lightningd cannot run as systemd service HOT 2
- splice: HSM WIRE_HSMD_SIGN_SPLICE_TX capability not correctly checked
- hsmd, splicing: wrong remote per-commit point provided when signing splice remote tx HOT 2
- cln-application: bkpr dashboard rpc methods HOT 2
- signet: unable to fund channel with peer until I run listpeers
- submit commitment transaction and anchor bump together via submitpackage rpc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning.