-
Notifications
You must be signed in to change notification settings - Fork 314
refactor(multipath): move discovery into EndpointStateActor
#3645
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
base: feat-multipath
Are you sure you want to change the base?
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3645/docs/iroh/ Last updated: 2025-11-12T11:44:04Z |
flub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess most tests needs to be moved the the StaticProvider?
I don't quite follow the WantConnect stuff. Is this trying to make sure you can return an error straight from calling Endpoint::connect when you don't have any discovery results? As otherwise you'd start connecting and then the connection would time out?
iroh/src/magicsock.rs
Outdated
| // Prune our own addreses from the endpoint address. | ||
| // TODO: Move this somewhere else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please!
The EndpointStateActor should collect these addresses as usual but when choosing addresses to send to when handling SendDatagram it should filter out any that are itself. That would mean the possible remote addresses are not lost when you move network. The EndpointStateActor already has access to the local DirectAddrs so this is way more logical.
Yes, exactly. It mimics the current behavior that |
6189b7f to
196d89a
Compare
Description
Fixes #3642
This moves discovery handling fully into the
EndpointStateActor.The pub(crate) interface to trigger discovery and get a EndpointMappedAddr is now
Magicsock::resolve_remote, which sends the provided addresses to the EndpointStateActor. The actor starts discovery if it does not have a selected path and if discovery is not running. It returns either immediately if there are any known paths, or waits for discovery to produce at least one result or an error. Once this returns,resolve_remotereturns either with a EndpointMappedAddr or with the discovery error.This means the current behavior is kept: We only start
quinn::Endpoint::connectonce we have at least one transport address for the remote. If not, we return the discovery error immediately fromiroh::Endpoint::connect.This opens the door for us to easily tune when to run discovery in other siutations, e.g. when all available paths to a remote are closed. However, for now this PR still only starts discovery when
Endpoint::connectis called and no path is selected at the moment.Breaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme