Skip to content

Conversation

@dignifiedquire
Copy link
Contributor

This is a next step into the world of configurable transports. We now allow disabling the IP based transports entirely.
Internally this starts to prepare for a world where the user can configure multiple different transports, IP, relay and others in the future.

Closes #2957

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3651/docs/iroh/

Last updated: 2025-11-17T10:34:52Z

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: dcb118b

@n0bot n0bot bot added this to iroh Nov 12, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Nov 12, 2025
@dignifiedquire dignifiedquire marked this pull request as ready for review November 12, 2025 17:47
impl From<RelayMode> for Option<TransportConfig> {
fn from(mode: RelayMode) -> Self {
match mode {
RelayMode::Disabled => None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in behavior, isn't? Currently RelayMode::Disabled means the endpoint has no home relay, but it will still dial the home relays of other peers if you get addrs with relay urls. Now, it would mean the relay transport is entirely disabled, right?

But it makes sense, and the previous variant can still be done by setting RelayMode::Custom with an empty relay map I guess? Should be clearly documented though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I think this is the more "correct" interpretation of Disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some docs

@dignifiedquire dignifiedquire force-pushed the feat-multipath-transports branch from d7d3df2 to 6fe4d5b Compare November 13, 2025 18:16
Copy link
Member

@ramfox ramfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! two nits

Only question mark was around disable_ip and disable_relay methods. I think we are good to have them, especially since we have the expectation of only ip or relay in our other APIs. But curious what this will look like as we add transports or allow others to put in custom transports.

LGTM

#[derive(Default, Debug, Clone)]
pub struct ConnectOptions {
transport_config: Option<Arc<TransportConfig>>,
transport_config: Option<Arc<quinn::TransportConfig>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be wrapping this foreign type?

@ramfox
Copy link
Member

ramfox commented Nov 13, 2025

oh also, lot's of TODO: docs, which should be addressed before merging, unless we are going to fix them before the multipath merge to main

@dignifiedquire dignifiedquire force-pushed the feat-multipath-transports branch from 6fe4d5b to c82c149 Compare November 14, 2025 11:32
@Frando Frando linked an issue Nov 17, 2025 that may be closed by this pull request
pub const DEFAULT_FAKE_ADDR: SocketAddrV6 = SocketAddrV6::new(
Ipv6Addr::new(
u16::from_be_bytes([ADDR_PREFIXL, 21]),
u16::from_be_bytes([7, 10]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any meaning to these numbers? In either case, maybe a short comment on how they're chosen would be nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are the same numbers we use for the other fake addrs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a comment

@dignifiedquire dignifiedquire force-pushed the feat-multipath-transports branch from c82c149 to effd5e3 Compare November 17, 2025 10:31
@dignifiedquire dignifiedquire merged commit 7f17d98 into feat-multipath Nov 17, 2025
27 of 28 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Nov 17, 2025
@dignifiedquire dignifiedquire deleted the feat-multipath-transports branch November 17, 2025 10:52
Frando added a commit that referenced this pull request Nov 17, 2025
## Description

Remove the test-only `Endpoint::path_selection` API and instead use
`Endpoint::clear_ip_transports` for `PathSelection::RelayOnly `, now
that this public API was added in
#3651.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist
<!-- Remove any that are not relevant. -->
- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
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:
    - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc)
    - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip)
    - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs)
    - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe)
    - [ ] [`sendme`](https://github.com/n0-computer/sendme)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Enable a relay-only mode for testing

5 participants