iroh icon indicating copy to clipboard operation
iroh copied to clipboard

feat(multipath): add RemoteInfo and ConnectionInfo

Open Frando opened this issue 1 month ago • 2 comments

Description

  • Adds ConnectionInfo, which is a weak info handle to a connection (does not keep the connection alive, cannot be upgraded to a full Connection). From a ConnectionInfo some static info is directly available, and as long as the connection is alive you can access the connection stats. You can also watch for path changes, and wait for the connection to be closed (without keeping it alive).
  • Adds functions remote_info and remotes to get a RemoteInfo or list of remote all remote infos.
  • The RemoteInfo allows to get a list of ConnectionInfo that are currently active
  • It also allows to watch the currently selected path, replacing Endpoint::conn_type
    • We have to think through if this is hindering a potential future where we send on multiple paths in parallel
    • If we remove this, you would have to go through all connections, call ConnectionInfo::paths_info, and check if there is a ip path (-> direct) or only a relay path (-> relayed).
    • I'm torn a bit if we want this or not. It is a much simpler API, but maybe we shouldn't expose it?
  • It also allows to get the RTT of the currently selected path
  • Removes Endpoint::conn_type and Endpoint::latency

Breaking Changes

Notes & open questions

Change checklist

  • [ ] Self-review.
  • [ ] Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • [ ] All breaking changes documented.
    • [ ] List all breaking changes in the above "Breaking Changes" section.
    • [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

Frando avatar Nov 06 '25 11:11 Frando