lightning icon indicating copy to clipboard operation
lightning copied to clipboard

CLN should connect to all peer addresses as redunancy

Open heyambob opened this issue 2 years ago • 1 comments

Issue and Steps to Reproduce

I have an issue with a peer. He's on both ipv4 and tor.

I have an obligation to make a channel to him When my node connect with his ipv4. We appears to be connected, but will be disconnected a few minutes later and I couldn't fundchannel. I see my node sent the opening request and it was hanging there until disconnected.

However, when I connected him with TOR, the connection stays on, and I was able to fundchannel.

Now, my impression is, CLN prefer ipv4 over TOR. So I'm seeing this peer on and off after I restarted my node recently. Or maybe his node prefer ipv4 and connecting to my ipv4. It's likely that any htlc request won't get to his node when we are on ipv4.

Is it possible to tell CLN to pick TOR over ipv4 on this particular node.

Ideally, CLN should learn which connection to a peer is more stable/faster and prefer it over others. Or I'm not sure if it's bad idea, if we could just make connection to all announced addresses whether or not we are the one who make connection or our peer makes connection. And we try them all in the order of response time/ stability in the last 24hrs or something.

getinfo output

"version": "v0.12.0",

heyambob avatar Sep 08 '22 06:09 heyambob

You're actually only allowed a single connection to each peer, so we need to pick one in this case. We'll fall back if one doesn't work at all, but if it's just unreliable we don't.

rustyrussell avatar Sep 15 '22 07:09 rustyrussell