-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle connection better: make connectd know which peers are important #7630
base: master
Are you sure you want to change the base?
Handle connection better: make connectd know which peers are important #7630
Commits on Aug 31, 2024
-
connectd: send self-advertizing gossip rather than having gossipd do it.
It's now trivial for us to do this ourselves, since we have gossmap. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for e30c0c8 - Browse repository at this point
Copy the full SHA e30c0c8View commit details -
connectd: get our own addresses to contact node from node_announcements.
Let lightningd feed us hints to try first, but we can extract the addresses from node_announcement messages ourselves. (Lightningd used to ask gossipd on our behalf: this is far simpler!) One side effect of this is that we don't hand back address hints given to us by lightningd: it would use these again for reconnecting. This is breaks test_sendpay_grouping, so we disable it temporarily. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for a2edbfb - Browse repository at this point
Copy the full SHA a2edbfbView commit details -
connectd: expose --dev-no-reconnect and --dev-fast-reconnect options.
Once connectd is controlling reconnections, it'll need these. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 01e8c30 - Browse repository at this point
Copy the full SHA 01e8c30View commit details -
lightningd: generalize peer_any_channel to filter on entire channel, …
…not just state. We're going to use this to ask if there are any channels which make it important to reconnect to the peer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 1a2d3cb - Browse repository at this point
Copy the full SHA 1a2d3cbView commit details -
wallet: save last known address.
If we connected out, remember that address. We always remember the last address, but that may be an incoming address. This is explicitly the last outgoing address which worked. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 92b1043 - Browse repository at this point
Copy the full SHA 92b1043View commit details -
common: routine to make wireaddr_internal from wireaddr.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 61ba409 - Browse repository at this point
Copy the full SHA 61ba409View commit details -
recovery: save last_known_addr for peer if we know it.
This is more useful than the last address, which may be it connecting to us. And use it when we restore it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 45c54f5 - Browse repository at this point
Copy the full SHA 45c54f5View commit details -
connectd: reconnect for non-transient connections.
Rather than have lightningd call us repeatedly to try to connect, have it tell us what peers are transient and aren't, and connectd will automatically try to maintain that connection. There's a new "downgrade_peer" message to tell it a peer is now transient: to make it non-transient we simply tell connectd to connect as a non-transient. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: `connectd` now handles maintaining/reconnecting to important peers, and we remember the last successful address we connected to.
Configuration menu - View commit details
-
Copy full SHA for 087b8e4 - Browse repository at this point
Copy the full SHA 087b8e4View commit details -
pytest: restore test_sendpay_grouping test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for fbe6ab3 - Browse repository at this point
Copy the full SHA fbe6ab3View commit details -
connectd: remove transient flag.
The important flag replaces it, and now we can be more intelligent about eviction in overload. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 83f84b0 - Browse repository at this point
Copy the full SHA 83f84b0View commit details -
connectd: limit to 10 connections at once.
We wait until a connection fails, or a subd is connected to the peer, before letting another one through. This should prevent us from overwhelming lightningd on large nodes, but unlike the previous back-off, it's based on how fast lightningd is, not an arbitrary time. We also let one through each second, in case we're connecting to many, but not doing anything but gossip (e.g. 100 explicit connect commands). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: Reconnecting to peers at startup should be significantly faster (dependent on machine speed).
Configuration menu - View commit details
-
Copy full SHA for 09c9242 - Browse repository at this point
Copy the full SHA 09c9242View commit details -
pytest: add test for connection ratelimiting.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Configuration menu - View commit details
-
Copy full SHA for 153bbe1 - Browse repository at this point
Copy the full SHA 153bbe1View commit details