Skip to content

refactor(proto): Introduce CanonicalIpPort to fix IP canonicalization issues#629

Merged
matheus23 merged 4 commits into
mainfrom
matheus23/canonical-ip-port
Apr 30, 2026
Merged

refactor(proto): Introduce CanonicalIpPort to fix IP canonicalization issues#629
matheus23 merged 4 commits into
mainfrom
matheus23/canonical-ip-port

Conversation

@matheus23
Copy link
Copy Markdown
Member

Description

  • Introduces a CanonicalIpPort wrapper around IpPort that makes sure IpAddr::to_canonical is called.
  • Fixes a bug in check_remote_address so it compares the canonical address instead of mixing the compared types.
  • Makes next_probe_addr return an IpPort and mark_probe_sent take an IpPort to save needless conversions.

Notes & open questions

This should unblock n0-computer/iroh#4213 and seems to fix the test problems with ipv4-only hosts.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.

@matheus23 matheus23 self-assigned this Apr 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

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

Last updated: 2026-04-30T12:39:59Z

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Performance Comparison Report

015682af6bdc19a4940d7ce03cd0d35ef0ceaf59 - artifacts

No results available

---
8eb1bb1889d01f2f46cd876e1d1387facb560fca - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5981.6 Mbps 7948.6 Mbps -24.7% 95.3% / 101.0%
medium-concurrent 5460.6 Mbps 7918.4 Mbps -31.0% 94.4% / 101.0%
medium-single 4489.7 Mbps 4749.2 Mbps -5.5% 96.6% / 150.0%
small-concurrent 3919.5 Mbps 5310.5 Mbps -26.2% 99.6% / 152.0%
small-single 3556.2 Mbps 4771.9 Mbps -25.5% 93.5% / 101.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3061.7 Mbps 4046.4 Mbps -24.3%
lan 782.4 Mbps 818.2 Mbps -4.4%
lossy 69.9 Mbps 69.9 Mbps ~0%
wan 83.8 Mbps 83.8 Mbps ~0%

Summary

noq is 23.3% slower on average

---
f001f5ed8902b4d233a639b72189e373f71f0e76 - artifacts

Raw Benchmarks (localhost)

Scenario noq upstream Delta CPU (avg/max)
large-single 5666.7 Mbps 7990.5 Mbps -29.1% 95.9% / 100.0%
medium-concurrent 5434.1 Mbps 7724.3 Mbps -29.6% 95.0% / 147.0%
medium-single 3946.0 Mbps 4733.1 Mbps -16.6% 99.4% / 150.0%
small-concurrent 3929.8 Mbps 5197.6 Mbps -24.4% 92.9% / 101.0%
small-single 3586.3 Mbps 4730.3 Mbps -24.2% 93.8% / 100.0%

Netsim Benchmarks (network simulation)

Condition noq upstream Delta
ideal 3100.6 Mbps N/A N/A
lan 782.5 Mbps N/A N/A
lossy 69.8 Mbps N/A N/A
wan 83.8 Mbps N/A N/A

Summary

noq is 25.7% slower on average

@n0bot n0bot Bot added this to iroh Apr 30, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Apr 30, 2026
@matheus23 matheus23 enabled auto-merge April 30, 2026 12:36
@matheus23 matheus23 added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit c711967 Apr 30, 2026
63 of 65 checks passed
@matheus23 matheus23 deleted the matheus23/canonical-ip-port branch April 30, 2026 13:04
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Apr 30, 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.

2 participants