Skip to content

feat(iroh): more precise information about incoming connections#3949

Merged
rklaehn merged 10 commits intomainfrom
incoming-transport-addr
Feb 27, 2026
Merged

feat(iroh): more precise information about incoming connections#3949
rklaehn merged 10 commits intomainfrom
incoming-transport-addr

Conversation

@rklaehn
Copy link
Copy Markdown
Contributor

@rklaehn rklaehn commented Feb 16, 2026

Description

Provide more precise information about incoming connections. Instead of exposing the synthetic IPV6 addr for relay connections, we translate it to a special enum IncomingAddr that has all available info for a rate limiter or access control component to make a decision.

Implements #3948

Breaking Changes

endpoint::Incoming::remote_address renamed to remote_addr, and returns IncomingAddr.
endpoint::Incoming::remote_address_validated renamed to remote_addr_validated.

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:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 16, 2026

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

Last updated: 2026-02-27T11:08:38Z

@rklaehn rklaehn requested a review from flub February 16, 2026 12:47
@rklaehn rklaehn force-pushed the incoming-transport-addr branch from af170f8 to 0ef10cb Compare February 16, 2026 12:49
@n0bot n0bot bot added this to iroh Feb 16, 2026
@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to 🏗 In progress in iroh Feb 16, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Feb 16, 2026
@rklaehn rklaehn requested a review from flub February 16, 2026 13:39
@rklaehn rklaehn force-pushed the incoming-transport-addr branch from 37c5f7b to 63e4bb4 Compare February 17, 2026 08:11
@rklaehn rklaehn enabled auto-merge February 17, 2026 13:17
@ramfox ramfox added this to the iroh: v0.97 milestone Feb 17, 2026
@matheus23
Copy link
Copy Markdown
Member

Do we have an idea why netsim is not happy here?

@Frando
Copy link
Copy Markdown
Member

Frando commented Feb 25, 2026

Do we have an idea why netsim is not happy here?

unrelated runner issue, should be fixed now

@matheus23
Copy link
Copy Markdown
Member

After the main merge, this needs a bit of thought: Do we want to pub(crate) expose Endpoint::inner? We already have a #[cfg(test)] fn inner() -> Result<EndpointInner, _> though, so ...
Perhaps we can add a to_transport_address function to Endpoint?
FWIW, this needs fixing.

@rklaehn
Copy link
Copy Markdown
Contributor Author

rklaehn commented Feb 27, 2026

After the main merge, this needs a bit of thought: Do we want to pub(crate) expose Endpoint::inner? We already have a #[cfg(test)] fn inner() -> Result<EndpointInner, _> though, so ... Perhaps we can add a to_transport_address function to Endpoint? FWIW, this needs fixing.

I did try both. I ended up doing this because it is slightly smaller diff, but if you can prefer I can also do a forwarder.

All our addresses are ..Addr.
…ped addr.

remote_address_validated=false means that the socketaddr might be spoofed and
we need to call retry to make sure, but this does not apply to relay connections.
Also mark IncomingAddr as non-exhaustive to allow adding the custom transport variant later.
remote_address to remote_addr
remote_address_validated to remote_addr_validated
IncomingAddr is just a TransportAddr with extra info.

Also comment on when to_transport_addr is expected to work.
@rklaehn rklaehn force-pushed the incoming-transport-addr branch from 888b50b to 6a31138 Compare February 27, 2026 10:48
It is still pub(crate), so no effect on the public API.
@rklaehn
Copy link
Copy Markdown
Contributor Author

rklaehn commented Feb 27, 2026

After the main merge, this needs a bit of thought: Do we want to pub(crate) expose Endpoint::inner? We already have a #[cfg(test)] fn inner() -> Result<EndpointInner, _> though, so ... Perhaps we can add a to_transport_address function to Endpoint? FWIW, this needs fixing.

Is 8d254af what you had in mind?

@rklaehn rklaehn disabled auto-merge February 27, 2026 10:55
@rklaehn rklaehn force-pushed the incoming-transport-addr branch from db7b276 to 7f94020 Compare February 27, 2026 11:05
@github-actions
Copy link
Copy Markdown

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: f5436fe

@rklaehn rklaehn added this pull request to the merge queue Feb 27, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 27, 2026
## Description

Provide more precise information about incoming connections. Instead of
exposing the synthetic IPV6 addr for relay connections, we translate it
to a special enum IncomingAddr that has all available info for a rate
limiter or access control component to make a decision.

Implements #3948

## Breaking Changes

endpoint::Incoming::remote_address renamed to remote_addr, and returns
IncomingAddr.
endpoint::Incoming::remote_address_validated renamed to
remote_addr_validated.

## 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)
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2026
@rklaehn rklaehn added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit abc349c Feb 27, 2026
52 of 54 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Feb 27, 2026
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.

5 participants