Commit Graph
2435 Commits
Author SHA1 Message Date
dependabot[bot] 2b6e07f656 chore(deps): bump redb from 3.1.3 to 4.1.0 (#4172)
Bumps [redb](https://github.com/cberner/redb) from 3.1.3 to 4.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cberner/redb/releases">redb's
releases</a>.</em></p>
<blockquote>
<h2>4.1.0</h2>
<p><strong>This release contains a large number of bug fixes discovered
by AI coding agents</strong></p>
<ul>
<li>Fix a bug where <code>MultimapValue::len()</code> and
<code>is_empty()</code> returned stale counts after
consuming entries via <code>next_back()</code>.</li>
<li>Fix a bug where <code>restore_savepoint()</code> used in a
non-<code>Immediate</code> durability transaction and when
there are persistent savepoints newer than the one being restored, could
fail
with <code>SavepointError::InvalidSavepoint</code>, but the savepoint
would actually be partially applied.
The call now fails up front with
<code>SavepointError::ImmediateDurabilityRequired</code>.</li>
<li>Fix a bug in <code>restore_savepoint()</code> where modifications
made earlier in the transaction might
not be reverted.</li>
<li>Fix a bug where renaming a table that was already modified in the
same transaction could cause
the database to become corrupted.</li>
<li>Fix a bug where calling <code>restore_savepoint()</code> after
modifying a table in the same
transaction could cause the table to become corrupted in a future
transaction.</li>
<li>Fix a panic when <code>delete_table()</code> was called on a table
that had been modified in the same
transaction.</li>
<li>Fix a panic in <code>restore_savepoint()</code> when passed a
<code>Savepoint</code> from a different <code>Database</code>.
<code>SavepointError::InvalidSavepoint</code> is now returned
instead.</li>
<li>Fix a bug where a transaction that created a persistent savepoint
and was then
aborted could cause the database file to grow excessively, until the
<code>Database</code> was dropped.</li>
<li>Fix a panic in <code>check_integrity()</code> when called while
another transaction is still alive.
<code>DatabaseError::TransactionInProgress</code> is now returned
instead.</li>
<li>Fix a bug where aborting a transaction that called
<code>restore_savepoint()</code> with a savepoint
when a newer savepoint existed could cause database space to be
leaked.</li>
<li>Fix a bug where aborting a transaction that called
<code>restore_savepoint()</code> would leave more
recent savepoints invalid.</li>
<li>Improve performance when reading concurrently from multiple threads.
Around 15% speedup on some benchmarks.</li>
<li>Optimize cache usage, and general write performance. Around 1.5x
speedup on some benchmarks.</li>
<li>Optimize memory usage.</li>
<li>Other performance optimizations.</li>
</ul>
<h2>4.0.0</h2>
<ul>
<li>Implement <code>Drop</code> on <code>AccessGuardMut</code> and
<code>AccessGuardMutInPlace</code>, which requires that these be dropped
before the <code>Table</code> they borrow from.
This fixes a critical bug where the accessor could outlive the
<code>Table</code>, and be dropped after the
transaction had already committed. This could cause data loss due to the
data in the accessor
being written out after the transaction had already completed.</li>
<li>Remove <code>Legacy</code> type. To migrate off the
<code>Legacy</code> type, use the <code>Legacy</code> type in the 3.x
release
and copy the data to a table with plain tuples, before upgrading to the
4.x release.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/cberner/redb/blob/master/CHANGELOG.md">redb's
changelog</a>.</em></p>
<blockquote>
<h2>4.1.0 - 2026-04-19</h2>
<p><strong>This release contains a large number of bug fixes discovered
by AI coding agents</strong></p>
<ul>
<li>Fix a bug where <code>MultimapValue::len()</code> and
<code>is_empty()</code> returned stale counts after
consuming entries via <code>next_back()</code>.</li>
<li>Fix a bug where <code>restore_savepoint()</code> used in a
non-<code>Immediate</code> durability transaction and when
there are persistent savepoints newer than the one being restored, could
fail
with <code>SavepointError::InvalidSavepoint</code>, but the savepoint
would actually be partially applied.
The call now fails up front with
<code>SavepointError::ImmediateDurabilityRequired</code>.</li>
<li>Fix a bug in <code>restore_savepoint()</code> where modifications
made earlier in the transaction might
not be reverted.</li>
<li>Fix a bug where renaming a table that was already modified in the
same transaction could cause
the database to become corrupted.</li>
<li>Fix a bug where calling <code>restore_savepoint()</code> after
modifying a table in the same
transaction could cause the table to become corrupted in a future
transaction.</li>
<li>Fix a panic when <code>delete_table()</code> was called on a table
that had been modified in the same
transaction.</li>
<li>Fix a panic in <code>restore_savepoint()</code> when passed a
<code>Savepoint</code> from a different <code>Database</code>.
<code>SavepointError::InvalidSavepoint</code> is now returned
instead.</li>
<li>Fix a bug where a transaction that created a persistent savepoint
and was then
aborted could cause the database file to grow excessively, until the
<code>Database</code> was dropped.</li>
<li>Fix a panic in <code>check_integrity()</code> when called while
another transaction is still alive.
<code>DatabaseError::TransactionInProgress</code> is now returned
instead.</li>
<li>Fix a bug where aborting a transaction that called
<code>restore_savepoint()</code> with a savepoint
when a newer savepoint existed could cause database space to be
leaked.</li>
<li>Fix a bug where aborting a transaction that called
<code>restore_savepoint()</code> would leave more
recent savepoints invalid.</li>
<li>Improve performance when reading concurrently from multiple threads.
Around 15% speedup on some benchmarks.</li>
<li>Optimize cache usage, and general write performance. Around 1.5x
speedup on some benchmarks.</li>
<li>Optimize memory usage.</li>
<li>Other performance optimizations.</li>
</ul>
<h2>4.0.0 - 2026-04-02</h2>
<ul>
<li>Implement <code>Drop</code> on <code>AccessGuardMut</code> and
<code>AccessGuardMutInPlace</code>, which requires that these be dropped
before the <code>Table</code> they borrow from.
This fixes a critical bug where the accessor could outlive the
<code>Table</code>, and be dropped after the
transaction had already committed. This could cause data loss due to the
data in the accessor
being written out after the transaction had already completed.</li>
<li>Remove <code>Legacy</code> type. To migrate off the
<code>Legacy</code> type, use the <code>Legacy</code> type in the 3.x
release
and copy the data to a table with plain tuples, before upgrading to the
4.x release.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/cberner/redb/commit/6ed1f981ba4deab0b2adbdd7bccb46ec409b2191"><code>6ed1f98</code></a>
Bump version to 4.1.0</li>
<li><a
href="https://github.com/cberner/redb/commit/0a87cb7c6bbef9d42a3d13317b5beaf4063e16e6"><code>0a87cb7</code></a>
Update changelog</li>
<li><a
href="https://github.com/cberner/redb/commit/03966a5050a3a6bef1045032d698f65b84a1eec9"><code>03966a5</code></a>
Require callers of get_page to provide a PageHint</li>
<li><a
href="https://github.com/cberner/redb/commit/a75927ff26d64f389e0050140654a39f239213a3"><code>a75927f</code></a>
Remove some TODO comments</li>
<li><a
href="https://github.com/cberner/redb/commit/a39779be8857b644476e64ddbe557082dd03644d"><code>a39779b</code></a>
Avoid allocating a page for a branch that will be immediately
merged</li>
<li><a
href="https://github.com/cberner/redb/commit/6374134252e7e128e5f98a4f04cf8bfdab9b3191"><code>6374134</code></a>
Document that Table{,Multimap}Definition::new panic on empty names</li>
<li><a
href="https://github.com/cberner/redb/commit/ba043e3816a81d93734e4533bc87465885496f61"><code>ba043e3</code></a>
Avoid copying keys in leaf overwrite paths</li>
<li><a
href="https://github.com/cberner/redb/commit/f42c468e008cfb7331d685ab2b675934bcec12ca"><code>f42c468</code></a>
Fix MultimapValue::next_back() not decrementing remaining counter</li>
<li><a
href="https://github.com/cberner/redb/commit/3756148e34e912206a382ef4224b3942d2d8aaa4"><code>3756148</code></a>
Clarify API contract for Key and Value traits</li>
<li><a
href="https://github.com/cberner/redb/commit/45523720a87ca0803264335e28538baabe6e04ae"><code>4552372</code></a>
Consolidate WriteTransaction savepoint lifecycle state</li>
<li>Additional commits viewable in <a
href="https://github.com/cberner/redb/compare/v3.1.3...v4.1.0">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-30 10:27:21 +02:00
Asmir Avdicevic a1871300fc chore(ci): make sccache fail gracefully (#4208)
## Description

Wraps the sccache config into a check so if infra fails for some reason
it retries and if that fails too it moves on to complete the job without
it.

## 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)
2026-04-30 09:55:19 +02:00
Rüdiger Klaehn 639754c234 refactor!(iroh): remove AccessLimit and associated tests (#4211)
## Description

Remove AccessLimit and associated tests. It lives in the new iroh-util
crate now.

## Breaking Changes

`iroh::protocol::AccessLimit`: removed, moved to iroh-util crate

## 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)
2026-04-30 09:23:31 +02:00
Rüdiger Klaehn 872d8ee931 docs: Add post quantum key exchange examples (#4196)
## Description

Add two examples related to post quantum key exchange.

One prefers pq key exchange, but allows also classical ones. This one
works with our current relays.

One requires pq key exchange and only works without relays.

## Breaking Changes

None

## 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)
2026-04-29 14:13:30 +02:00
Franz Heinzmann 9bfc8da3ca refactor(iroh)!: replace ConnectionInfo with WeakConnectionHandle (#4189)
## Description

`WeakConnectionHandle` replaces `ConnectionInfo`. It is returned by
`Connection::weak_handle` (formerly `to_info`) and can be upgraded to a
strong `Connection`. It also exposes some static information about the
connection and a `closed` future. Path watchers and stats are no longer
on the handle itself, call sites can just `upgrade` and operate on the
`Connection`.

`EndpointHooks::after_handshake` now receives `&Connection`. The doc on
the trait method spells out that implementations should not clone the
`Connection` out of the hook because a strong handle disables
close-on-drop, which the primary use sites of the connection might
expect. Implementations that need a long-lived reference should call
`weak_handle` and store the result.

## Breaking Changes

* removed: `iroh::endpoint::ConnectionInfo`. Replaced by
`iroh::endpoint::WeakConnectionHandle`.
* changed: `Connection::to_info() -> ConnectionInfo` is now
`Connection::weak_handle() -> WeakConnectionHandle`.
* removed: `WeakConnectionHandle` misses most functions that existed on
`ConnectionInfo`. Use `WeakConnectionHandle::upgrade` and call the
corresponding `Connection` methods.
* changed: `EndpointHooks::after_handshake` parameter changed from
`&WeakConnectionHandle` to `&Connection`.

## Notes & open questions


## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-29 13:35:22 +02:00
Franz Heinzmann 7bee17b4fb feat(iroh-relay)!: pass a ClientRequest to AccessConfig and let the client set query params (#4207)
This adds a `query_param` function to the iroh-relay `ClientBuilder` to
set URL query parameters on the URL for the WebSocket request. The
indended usecase is to allow optionally setting an authentication token.
This replaces #4202 which used HTTP headers for this purpose. However,
in the browser you cannot set headers on a WebSocket request, thus this
approach would break or Wasm-In-Browser support. So we use URL query
parameters now.

To make use of the parameters when authenticating clients on the relay
server, the `AccessConfig::Restricted` callback now receives a
`ClientRequest` that exposes both the `EndpointId` and some parts from
the HTTP request with which the client connected (i.e. the WebSocket
request). `ClientRequest` for now exposes the headers, the request URI
and a utility function to get the query pairs

# Breaking changes

* changed: `iroh_relay::server::AccessConfig::Restricted` closure now
takes `&ClientRequest` instead of `EndpointId`. The boxed closure type
is exposed as `iroh_relay::server::AccessCheck`. Existing closures need
to read `request.endpoint_id()`.
* changed: `iroh_relay::server::AccessConfig::is_allowed` signature is
now `is_allowed(&self, request: &ClientRequest) -> bool`.

## Notes & open questions



## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-29 12:29:47 +02:00
Philipp Krüger d636e54755 refactor(iroh-relay)!: Make AccessConfig non-exhaustive (#4190)
## Description

This marks the `AccessConfig` enum in `iroh-relay` `non_exhaustive`.

The idea is to enable more types of access configs that are
backwards-compatible in terms of API.

## Breaking Changes

- `iroh_relay::server::AccessConfig` is now non-exhaustive.

## Notes & open questions

The motivating change was to pass HTTP headers to the function in
`Restricted`, but I think it'd be nice to first get this change out, and
then in another PR consider whether we'd want to change the exiting
`Restricted` or add another case.

## Change checklist
<!-- Remove any that are not relevant. -->
- [X] Self-review.
2026-04-28 15:48:44 +02:00
dependabot[bot] a1ad4fc05c chore(deps): bump rustls-platform-verifier from 0.6.2 to 0.7.0 (#4170)
Bumps
[rustls-platform-verifier](https://github.com/rustls/rustls-platform-verifier)
from 0.6.2 to 0.7.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rustls/rustls-platform-verifier/releases">rustls-platform-verifier's
releases</a>.</em></p>
<blockquote>
<h2>0.7.0</h2>
<p>The reason this release is semver-incompatible is the upgrade from
jni 0.21 to 0.22, which should only affect Android targets (and
substantially reuse dependency duplication). Additionally there are
several fixes for behavior on Windows.</p>
<h2>What's Changed</h2>
<ul>
<li>update cc to fix regression during macabi build by <a
href="https://github.com/conradludgate"><code>@​conradludgate</code></a>
in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/209">rustls/rustls-platform-verifier#209</a></li>
<li>update real world certificates by <a
href="https://github.com/conradludgate"><code>@​conradludgate</code></a>
in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/207">rustls/rustls-platform-verifier#207</a></li>
<li>remove outdated oncecell comment by <a
href="https://github.com/conradludgate"><code>@​conradludgate</code></a>
in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/205">rustls/rustls-platform-verifier#205</a></li>
<li>fix confusing target doc cfg by <a
href="https://github.com/conradludgate"><code>@​conradludgate</code></a>
in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/210">rustls/rustls-platform-verifier#210</a></li>
<li>fix win7 crash due to CERT_CHAIN_ENGINE_CONFIG by <a
href="https://github.com/cstkingkey"><code>@​cstkingkey</code></a> in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/213">rustls/rustls-platform-verifier#213</a></li>
<li>try with extra roots when root is untrusted by <a
href="https://github.com/cstkingkey"><code>@​cstkingkey</code></a> in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/215">rustls/rustls-platform-verifier#215</a></li>
<li>remove nix flake, CI testing by <a
href="https://github.com/cpu"><code>@​cpu</code></a> in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/225">rustls/rustls-platform-verifier#225</a></li>
<li>Update Android setup instructions to include library usecase
examples by <a
href="https://github.com/skeet70"><code>@​skeet70</code></a> in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/223">rustls/rustls-platform-verifier#223</a></li>
<li>Upgrade jni to 0.22 by <a
href="https://github.com/djc"><code>@​djc</code></a> in <a
href="https://redirect.github.com/rustls/rustls-platform-verifier/pull/193">rustls/rustls-platform-verifier#193</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/996b1c903491641b17b3c9afb65d1352f6fc6b76"><code>996b1c9</code></a>
Bump version to 0.7.0</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/89a83ffbbbcefc79a457a947eea68f12ddcc303d"><code>89a83ff</code></a>
Upgrade jni to 0.22</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/ffe03d3d2302568915531d8dd7f9cd055d06eecf"><code>ffe03d3</code></a>
Bump MSRV to 1.85.0 (for jni)</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/64b561ecfe3a319a39ade394e991c3810f7bd1cc"><code>64b561e</code></a>
tests: update real-world test certificates</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/f60951917d1e8069e0c22cae1125294b3f653423"><code>f609519</code></a>
Take semver-compatible dependency updates</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/dafabbed58982012603e325e839cded1feb3b898"><code>dafabbe</code></a>
Update Android setup instructions to include library usecase
examples</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/554923dd410d889cd0f4db98da7e56e2d6a2adf0"><code>554923d</code></a>
remove nix flake, CI testing</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/bbc27c70babe0bab255ec6415cba56bac7f60caf"><code>bbc27c7</code></a>
try with extra roots when root is untrusted</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/e50903a306c60f374823a0288e9506522c72ba01"><code>e50903a</code></a>
Update real world test certificates</li>
<li><a
href="https://github.com/rustls/rustls-platform-verifier/commit/31bf3fa5ae33973e9b986ee107924107a2d06d07"><code>31bf3fa</code></a>
Take semver-compatible dependency updates</li>
<li>Additional commits viewable in <a
href="https://github.com/rustls/rustls-platform-verifier/compare/v/0.6.2...v/0.7.0">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-28 14:46:43 +02:00
Franz Heinzmann 36c5c6d1b7 deps: pin pkcs8 and der (#4197)
## Description

We need to pin the exact RC versions that `ed25519-dalek` needs,
otherwise a newer `pkcs8` version is being used that has breaking
changes.


## Change checklist

- [x] Self-review.
2026-04-28 13:17:11 +02:00
Franz Heinzmann 89ad5d89a2 refactor(iroh-relay): Make MaybeTlsStream public again (#4193)
## Description

We recently made `MaybeTlsStream` private, because I thought it wouldn't
appear in the public API. I was mistaken, it does though in a hidden
way: The `hyper::Service` impl of `RelayServiceWithNotify` only works if
is invoked with `io` being an instance of `MaybeTlsStream`. In the
websocket handler we downcast the `hyper::Upgrade` to `MaybeTlsStream`
and return a runtime error if this fails.

Also makes `MaybeTlsStream` non-exhaustive and adds a doctest example to
`RelayServiceWithNotify`.

## Notes & open questions

This brings `tokio_rustls` into our public API again. I think it is
acceptable, `rustls` is in the public API anyway and `tokio_rustls` is
maintained by the `rustls` team and usually updated with `rustls`, so it
should be fine to not be able to bump `tokio_rustls` in a
semver-breaking way during iroh 1.0.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-28 10:33:36 +02:00
Asmir Avdicevic e95ac068a3 chore(ci): fix musl/gnu build setup (#4184)
## Description

Ensures we independently build for both gnu and musl instead of musl for
some and gnu for others.

Closes https://github.com/n0-computer/iroh/pull/4184

## 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)
2026-04-28 09:36:14 +02:00
Asmir Avdicevic eb67669ea6 feat(metrics): add cache metrics to dns-server (#3800) 2026-04-27 15:57:23 +02:00
Asmir Avdicevic 4f22f1a535 chore(ci): fix sccache for netsim (#4176)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

## 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)
2026-04-27 12:37:10 +02:00
Franz HeinzmannandGustavo Inacio a1fa579039 fix(iroh): Don't abort connection attempts when an empty EndpointAddr is added concurrently (#4177)
## Description

When two `Endpoint::connect` calls to the same peer run concurrently and
no address is known yet, the first call correctly waits for address
discovery, but the second call wrongly signals "no addresses found" to
the first, causing it to fail with `NoAddress` even though discovery is
still running and about to succeed. The second call then waits for
discovery and succeeds. Result: one of two concurrent `connect` calls
fails spuriously.

The fix makes the "addresses arrived" notification fire only when we
actually learn about new addresses, not on every call that brings none.

Original report and fix by @gusinacio.

Fixes #4148.


## 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. -->
- [x] Self-review.
- [x] Tests if relevant.

---------

Co-authored-by: Gustavo Inacio <incio.gusta@gmail.com>
2026-04-27 11:49:25 +02:00
Rüdiger Klaehn db1b335146 fix: Protect against division by zero in process_datagram (#4178)
## Description

Protect against division by zero in process_datagram

This protects against the valid case of being sent an empty packet, and
for completeness sake also handles the weird case where we get stride =
0, len > 0.

I decided to fix and proceed instead of erroring out since this is a
loop.

Fixes https://github.com/n0-computer/iroh/issues/4144

## Breaking Changes

None

## Notes & open questions

Throw exception instead, as suggested in the issue? This would mean that
we would not process items after the weird RecvMeta, so I don't like it.

This will probably never happen unless we got an error in the udp socket
impl, but 1. stranger things have happened and 2. with custom transports
people can send us some weird stuff.

## 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)
2026-04-24 14:28:27 +02:00
Franz Heinzmann 4ed44b7e7c refactor(iroh-dns-server)!: Reduce public API surface, improve docs, cleanup visibilities (#4160)
## Description

`iroh-dns-server` is usually used as a binary. However, currently it
exposes a rather wide and unstructured public APIs. We don't know of
anyone actually using this; and a closer look reveals that the API is
not actually well usable because while it is widely open, some items are
actually missing so some structs cannot be constructed or only with
defaults.

In preparation of iroh 1.0 (which will include iroh-dns-server), this PR
severly reduces the public surface of `iroh-dns-server` when used as a
library. It also fixes and improves the docs for public items and
reduces internal visibility of items.

This PR does not have any changes to functionality or the format of the
TOML config.

What remains public is only the `Server` struct to start a server, the
`Metrics`, and the `Config` plus all sub-configs. The `Config` needs to
be stable for 1.0 in any case, because it is the format of the TOML that
the `iroh-dns-server` binary exepcts.

Link to docs for public items:
https://n0-computer.github.io/iroh/pr/4160/docs/iroh_dns_server/index.html

If a need arises to embed the iroh-dns-server parts into other binaries
in a more fine-grained way, we can always make more things public later.

Additionally, this PR marks all config structs and enums as
`#[non_exhaustive]`.

## Breaking Changes

* removed: `iroh_dns_server::dns`, `iroh_dns_server::http`,
  `iroh_dns_server::metrics`, `iroh_dns_server::server`, and
  `iroh_dns_server::state` modules. These are now private; the items
  that were genuinely part of the public API are re-exported at the
  crate root or under `iroh_dns_server::config`.
* removed: `iroh_dns_server::ZoneStore` re-export. The store is no
  longer part of the public API; use `Server::bind` to run the server.
* added: `iroh_dns_server::Metrics` and `iroh_dns_server::Server`
  re-exports at the crate root.
* changed: `iroh_dns_server::config::ZoneStoreOptions` is replaced by
  `iroh_dns_server::config::StoreConfig`, with the same fields. The
  private `signed_packets::Options` type is no longer exposed.
* Various structs and enums in `config` are now `#[non_exhaustive]`
  (`Config`, `HttpConfig`, `HttpsConfig`, `MetricsConfig`,
  `MainlineConfig`, `StoreConfig`, `CertMode`, `RateLimitConfig`).


## Change checklist
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-24 14:05:46 +02:00
Franz Heinzmann 5a984c6ab4 refactor(iroh-relay)!: Do not depend on tokio-rustls-acme in public API (#4166)
## Description

`iroh-relay` with the `server` feature currently has `tokio-rustls-acme`
in its public API, through the `AcmeState` being part of the
`ServerConfig`. This PR makes the construction of the `AcmeState`
internal to the relay server, instead exposing a `AcmeConfig` to set the
ACME client properties. To make this viable, it moves the rustls
`ServerConfig` into the `CertMode` enum, because for the ACME case, we
only have a partial builder (which misses the resolver, which we now
build internally). It also collapses the `Manual` and `Reloading` cases,
because those do not actually need to be treated differently internally
(only in the construction of the `ServerConfig`, which happens before
passing it to the server builder).

This lead to one issue: Before, users would always pass a readily-built
`ServerConfig` to both `TlsConfig` and `QuicConfig`, duplicating it for
both. This can't work with the change, because for the ACME mode, the
`ServerConfig` is now only built while binding the server, not outside.
So I made `QuicConfig::server_config` be an `Option<ServerConfig>`, and
if set to `None` it will use the `ServerConfig` from the relay server
(i.e., in ACME mode, the one that was built internally from the builder
and the AcmeConfig). When `QuicConfig::server_config` is unset and
`ServerConfig::tls` is also unset, then binding fails with an error
`QuicSpawnError::TlsNotConfigured`.

Also removed `Server::certificates`, it already only worked when using
the manual mode - and in that case, the user has the certs available
before spawning the server anyway and can clone them to wherever they
need them.

## Breaking Changes

* removed: `tokio_rustls_acme::AcmeState` from iroh-relay's public API.
`tokio_rustls_acme` is no longer referenced by any public type.
* removed: `iroh_relay::server::TlsConfig::quic_bind_addr`. We always
use the value from `iroh_relay::server::QuicConfig::bind_addr` now
* changed: `iroh_relay::server::ServerConfig<EC, EA>` -> `ServerConfig`
(no generics).
* changed: `iroh_relay::server::RelayConfig<EC, EA>` -> `RelayConfig`
(no generics).
* changed: `iroh_relay::server::TlsConfig<EC, EA>` -> `TlsConfig` (no
generics). The `server_config: rustls::ServerConfig` field is removed;
the `rustls::ServerConfig` now lives inside the `CertConfig` variant
(`Manual::server_config`, or injected via
`LetsEncrypt::server_config_builder`).
* changed: `iroh_relay::server::CertConfig<EC, EA>` -> `CertConfig` (no
generics). `LetsEncrypt { state: AcmeState<EC, EA> }` -> `LetsEncrypt {
acme_config: AcmeConfig, server_config_builder:
rustls::ConfigBuilder<rustls::ServerConfig,
rustls::server::WantsServerCert> }`. `Manual { certs:
Vec<CertificateDer<'static>> }` -> `Manual { server_config:
rustls::ServerConfig }`.
* removed: `CertConfig::Reloading` variant. Use `CertConfig::Manual`
with a `rustls::ServerConfig` whose cert resolver performs reloading
(for example one built with `iroh_relay::server::reloading_resolver`).
* added: `iroh_relay::server::AcmeConfig`, a builder for
`CertConfig::LetsEncrypt`. Constructors:
`AcmeConfig::new(directory_url)`, `AcmeConfig::letsencrypt(production)`.
Builder methods: `domains`, `contact`, `cache_path`.
* changed: `iroh_relay::server::QuicConfig::server_config` changed type
from `rustls::ServerConfig` to `Option<rustls::ServerConfig>`. When
`None`, the QUIC server reuses `RelayConfig::tls`; if neither is set,
`Server::spawn` fails with `SpawnError::QuicSpawn { source:
QuicSpawnError::TlsNotConfigured }`.
* removed: `iroh_relay::server::Server::certificates`. The server no
longer retains the certificate chain; callers that need the certs should
keep them alongside whatever they pass to `CertConfig::Manual`.
* changed: `iroh_relay::server::Server::spawn` is no longer generic.
Signature: `pub async fn spawn(config: ServerConfig) -> Result<Self,
SpawnError>` (previously `pub async fn spawn<EC, EA>(config:
ServerConfig<EC, EA>) -> Result<Self, SpawnError>` with `EC: Debug +
'static`, `EA: Debug + 'static`).


## Notes and open questions

The relay server config can likely be improved further. I tried to keep
the changes minimal here. I might do another PR to clean things up more.

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-04-24 11:49:32 +02:00
dependabot[bot] 53f30bdc7b chore(deps): bump ctor from 0.8.0 to 0.10.1 (#4173)
Bumps [ctor](https://github.com/mmastrac/rust-ctor) from 0.8.0 to
0.10.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/mmastrac/rust-ctor/blob/master/CHANGELOG.md">ctor's
changelog</a>.</em></p>
<blockquote>
<h2>ctor [0.10.1] - 2026-04-22</h2>
<h2>dtor [0.8.1] - 2026-04-22</h2>
<h2>link-section [0.2.1] - 2026-04-22</h2>
<h3>Added</h3>
<ul>
<li>Included licenses in all files.</li>
<li>Bumped proc-macro dependency versions.</li>
<li><code>dtor</code> crate exports <code>native</code> module with
<code>at_binary_exit</code> and <code>at_library_exit</code>
functions.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fix MSRV in ctor docs.</li>
<li>Various hardening fixes under Miri.</li>
<li>Adding priority to <code>ctor</code>s accidentally enabled the
anonymous flag.</li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>link-section</code> crate no longer offers <code>const</code>
section pointers.</li>
<li><code>ctor</code> exports all <code>dtor</code> macros from
<code>dtor</code> crate rather than reimplementing them.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/mmastrac/rust-ctor/commits">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-24 10:56:50 +02:00
Franz Heinzmann d20e72a647 refactor(iroh, iroh-relay)!: Reduce visibility of items (#4168)
## Description

* Make `iroh_relay::server::streams::MaybeTlsStream` private. I don't
see it being used in any public API, and it exposes `tokio_rustls` in
the public API
* Add `deny(unreachable_pub)` to all crates and fixup accordingly

## Breaking Changes

* removed: `iroh_relay::server::streams::MaybeTlsStream` is no longer
part of the public API

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-04-23 21:11:09 +02:00
Franz HeinzmannandFriedel Ziegelmayer f904fc3db5 refactor(iroh)!: use ArcSwap in DnsResolver for synchronous reset (#4141)
## Description

`DnsResolver::reset` was `async` and awaited a write lock on the inner
`RwLock<dyn Resolver>`. The socket actor's network-change handler
awaited it, blocking the actor for the duration of the reset. This means
we would potentially block the main actor loop for network IO because
the write lock can only be acquired once all reads are done, and the
reads are blocked for the duration of a DNS lookup (limited to `2s`
usually).

This change stores the resolver in `ArcSwap<Box<dyn Resolver>>` instead
of `RwLock`. The `reset` call can now become synchronous - we build a
fresh resolver and atomically swap it in via `compare_and_swap`. A
`tokio::sync::Notify` wakes any in-flight lookup so it retries against
the new resolver.

Lookups go through an internal `op` helper that races the lookup future,
the reset notification, and a per-attempt timeout in a biased `select!`.
The `notified` future is enabled before the resolver is loaded, which
together with the swap-then-notify ordering in `reset` ensures that in
case of a reset all running futures are aborted and restarted against
the new resolver.

Under concurrent `reset` calls only the first CAS lands and only the
winner notifies. Losers drop their freshly-built resolver. This is fine,
and won't happen in practice because `reset` calls are serialized
through the socket actor loop.

## Breaking Changes

- changed: `iroh_relay::dns::Resolver::reset` signature changed from `fn
reset(&mut self)` to `fn reset(&self) -> Box<dyn Resolver>`.
Implementations now return a fresh resolver rather than mutating in
place.
- changed: `iroh_relay::dns::DnsResolver::reset` and
`DnsResolver::clear_cache` are no longer `async`.
- changed: `DnsError::Timeout` no longer carries a
`tokio::time::error::Elapsed` source. The
`From<tokio::time::error::Elapsed>` impl is removed.

## Notes & open questions

The `op` timeout is per-attempt: a reset-triggered retry starts a fresh
`sleep(timeout)`. This is intentional, since a fresh attempt against a
just-changed network should not inherit the previous attempt's remaining
time, but it does mean the wall-clock total can exceed `timeout`. I
think this is fine and preferable.

## Change checklist

- [x] Self-review.
- [x] Documentation updates.
- [ ] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-04-23 16:37:51 +02:00
Asmir Avdicevic c08ccf80af chore(ci): introduce alt runners (#4164)
## Description

We've signed up with blacksmith for a trial run to test out if the added
bandwidth helps our queue times. I've selectively converted some but not
all of the jobs. Will do similar on noq.

## 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)

<!-- codesmith:footer -->
---
<a
href="https://app.blacksmith.sh/n0-computer/codesmith/iroh/pr/4164"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-light.svg"><img
alt="View in Codesmith"
src="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-dark.svg"></picture></a>
<sup>Codesmith can help with this PR — just tag <code>@codesmith</code>
or enable autofix.</sup>

- [ ] Autofix CI and bot reviews
<!-- /codesmith:footer -->
2026-04-23 15:47:49 +02:00
Rüdiger Klaehn 5dc3a064ca refactor: Remove the two optional address lookups (#4167)
## Description

Remove the two optional address lookups

Starting with the next release, they will live in
https://github.com/n0-computer/iroh-address-lookups and be published as
separate crates.

This allows us to keep them out of the 1.0 API

## Breaking Changes

- `iroh::address_lookup::MdnsAddressLookup`: removed (moved to
[`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup))
- `iroh::address_lookup::MdnsAddressLookupBuilder`: removed (moved to
[`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup))
- `iroh::address_lookup::DiscoveryEvent`: removed (moved to
[`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup))
- `iroh::address_lookup::DhtAddressLookup`: removed (moved to
[`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup))
- `iroh::address_lookup::pkarr::dht`: removed (moved to
[`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup))
- `address-lookup-mdns` cargo feature: removed
- `address-lookup-pkarr-dht` cargo feature: removed
- `dht_address_lookup` example: removed (moved to
[`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup/examples))
- `mdns_address_lookup` example: removed (moved to
[`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup/examples))

## 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)
2026-04-23 15:47:34 +02:00
Franz Heinzmann 6e81cab3a5 refactor(iroh-dns)!: don't expose simple-dns in errors (#4161)
## Description

Don't expose `simple_dns` in the public errors in `iroh-dns` so that we
don't depend on it in the public API.

## Breaking Changes

* changed: The `source` field of
`iroh_dns::SignedPacketBuildError::DnsError` and
`SignedPacketVerifyError::DnsError` is now of type `n0_error::AnyError`
2026-04-23 14:56:46 +02:00
Franz Heinzmann a46d62bcbb refactor(iroh-relay)!: Remove http_body_util and tokio_util from public API surface (#4162)
## Description

Two small iroh-relay API cleanups that reduce the public API surface:

- `Server::task_handle` returned a mutable reference to an
`AbortOnDropHandle<Result<(), SupervisorError>>`. It is replaced by
`Server::join`, an `async` method that awaits the supervisor task and
returns its result. This removes `tokio_util` from the public API of
`iroh_relay::server::Server`.

- The relay's internal `BytesBody` is now a boxed
`hyper::body::Body<Data = Bytes, Error = Infallible>` trait object
rather than a concrete `http_body_util::Full<Bytes>`. Through this, the
non-1.0 crate `http_body_util` no longer is part of the public API for
iroh-relay, at the cost of one additional boxing per HTTP response,
which I don't think would be observable perf-wise in any way.

## Breaking Changes

* removed: `iroh_relay::server::Server::task_handle(&mut self) -> &mut
AbortOnDropHandle<Result<(), SupervisorError>>`. Replaced by
`iroh_relay::server::Server::join(&mut self) -> Result<Result<(),
SupervisorError>, JoinError>`. Callers that previously did `(&mut
*server.task_handle()).await` can use `server.join().await` instead.
* changed: `iroh_relay::server::http_server::BytesBody` is now `Box<dyn
Send + Unpin + hyper::body::Body<Data = hyper::body::Bytes, Error =
Infallible>>` instead of `http_body_util::Full<hyper::body::Bytes>`.
`http_body_util`
  is no longer part of the public API surface.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the style guide
- [x] All breaking changes documented.
2026-04-23 13:43:43 +02:00
Franz Heinzmann 734f8e0ad4 refactor(iroh-relay)!: don't expose strum and num_enum in public API (#4163)
## Description

Three foreign types were leaking through iroh-relay's public API via
derives: `num_enum::TryFromPrimitive`,
`num_enum::TryFromPrimitiveError`,
and `strum::VariantArray`. Replaced with equivalents that don't impl a
foreign trait:

- `FrameType`: `num_enum::TryFromPrimitive` -> `strum::FromRepr` (gives
  an inherent `from_repr(u32) -> Option<Self>`). `IntoPrimitive` is kept
  since it only impls `From<Self> for u32`.
- `ProtocolVersion`: drops `strum::VariantArray` in favor of a manual
  `ProtocolVersion::ALL`. A `cfg(test)`-only `strum::EnumCount` derive
  powers a drift test asserting `ALL.len() == COUNT`.

## Breaking Changes

* removed: `impl TryFrom<u32> for iroh_relay::protos::common::FrameType`
  (and its `num_enum::TryFromPrimitive` impl). Use the inherent
  `FrameType::from_repr(v: u32) -> Option<FrameType>` instead.
* removed: `iroh_relay::http::ProtocolVersion::VARIANTS` and the
  `strum::VariantArray` impl. Use `ProtocolVersion::ALL` instead, which
is ordered newest-first (previously oldest-first, reversed by `all()`).

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-04-23 12:53:51 +02:00
Franz Heinzmann 9f3c4f3304 refactor(iroh-relay)!: remove rustls_cert_reloadable_resolver from public API (#4157)
## Description

The `rustls_cert_reloadable_resolver::ReloadingResolver` struct and its
generic `Loader` type parameter were part of the public API of
`iroh_relay::server`. This PR removes it from the API surface and only
keeps a single public async factory function `reloading_resolver` that
returns an `Arc<dyn rustls::ResolvesServerCert>`.

For more configurability, users can use
`rustls_cert_reloadable_resolver` themselves.

## Breaking Changes

* removed: `iroh_relay::server::ReloadingResolver` (and its `init`,
`shutdown`, and `reload` methods) is no longer public. The struct is now
a private implementation detail of `iroh-relay`.
* added: `iroh_relay::server::reloading_resolver` async factory function
returning `Result<Arc<dyn ResolvesServerCert>, n0_error::AnyError>`. It
takes a `&CryptoProvider`, `cert_path: PathBuf`, `key_path: PathBuf`,
and `interval: std::time::Duration`. Use this in place of constructing a
`ReloadingResolver` directly.


## Change checklist
- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.
2026-04-23 11:05:00 +02:00
Rüdiger Klaehn 0527bd5494 refactor!: Move EndpointInfo and friends to iroh-dns (#4094)
## Description

As suggested by @Frando: move more dns related stuff from iroh-relay to
iroh-dns.

Builds on top of https://github.com/n0-computer/iroh/pull/4026

## Breaking Changes

- `iroh_relay::dns`: moved to `iroh_dns::dns`
- `iroh_relay::dns::Resolver`: moved to `iroh_dns::dns::Resolver`
- `iroh_relay::dns::DnsResolver`: moved to `iroh_dns::dns::DnsResolver`
- `iroh_relay::dns::Builder`: moved to `iroh_dns::dns::Builder`
- `iroh_relay::dns::DnsError`: moved to `iroh_dns::dns::DnsError`
- `iroh_relay::dns::DnsProtocol`: moved to `iroh_dns::dns::DnsProtocol`
- `iroh_relay::dns::LookupError`: moved to `iroh_dns::dns::LookupError`
- `iroh_relay::dns::StaggeredError`: moved to
`iroh_dns::dns::StaggeredError`
- `iroh_relay::dns::TxtRecordData`: moved to
`iroh_dns::dns::TxtRecordData`
- `iroh_relay::dns::N0_DNS_ENDPOINT_ORIGIN_PROD`: moved to
`iroh_dns::dns::N0_DNS_ENDPOINT_ORIGIN_PROD`
- `iroh_relay::dns::N0_DNS_ENDPOINT_ORIGIN_STAGING`: moved to
`iroh_dns::dns::N0_DNS_ENDPOINT_ORIGIN_STAGING`
- `iroh_relay::dns::DNS_TIMEOUT`: moved to `iroh_dns::dns::DNS_TIMEOUT`
- `iroh_relay::endpoint_info`: moved to `iroh_dns::endpoint_info`
- `iroh_relay::endpoint_info::EndpointInfo`: moved to
`iroh_dns::endpoint_info::EndpointInfo`
- `iroh_relay::endpoint_info::EndpointData`: moved to
`iroh_dns::endpoint_info::EndpointData`
- `iroh_relay::endpoint_info::AddrFilter`: moved to
`iroh_dns::endpoint_info::AddrFilter`
- `iroh_relay::endpoint_info::UserData`: moved to
`iroh_dns::endpoint_info::UserData`
- `iroh_relay::endpoint_info::MaxLengthExceededError`: moved to
`iroh_dns::endpoint_info::MaxLengthExceededError`
- `iroh_relay::endpoint_info::EncodingError`: moved to
`iroh_dns::EncodingError`
- `iroh_relay::endpoint_info::ParseError`: moved to
`iroh_dns::ParseError`
- `iroh_relay::endpoint_info::IROH_TXT_NAME`: moved to
`iroh_dns::IROH_TXT_NAME`
- `iroh_dns::attrs`: made private
- `iroh_dns::attrs::IrohAttr`: made private
- `iroh_dns::attrs::TxtAttrs`: made private
- `iroh_dns::attrs::endpoint_id_from_txt_name`: made private

## 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)
2026-04-23 09:48:56 +02:00
Franz Heinzmann 306c35dc4f refactor(iroh-relay)!: use AnyError instead of concrete websocket and postcard errors (#4156)
## Description

This hides `postcard`, `tokio_websocket` and `ws_wasm_stream` from the
public API surface of iroh-relay by replacing their errors with
`AnyError` in the public error enums.

## Breaking Changes

* changed: `iroh_relay::protos::streams::StreamError` is now a type
alias for `n0_error::AnyError` on all platforms (previously
`tokio_websockets::Error` on non-`wasm_browser`, `ws_stream_wasm::WsErr`
on `wasm_browser`). The concrete type is still accessible via
`AnyError::downcast_ref`, but that downcast is not covered by semver.
* changed: `iroh_relay::client::ConnectError::Websocket { source }`: the
`source` field type changed from a cfg-gated `tokio_websockets::Error` /
`ws_stream_wasm::WsErr` to `n0_error::AnyError`.
* changed: `iroh_relay::client::conn::SendError::StreamError { source
}`: the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::client::conn::RecvError::StreamError { source
}`: the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::protos::handshake::Error::Websocket { source }`:
the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::protos::handshake::Error::DeserializationError {
source, .. }`: the `source` field type changed from `postcard::Error` to
`n0_error::AnyError`.
* removed: `iroh_relay::protos::relay::Error::SerDe { source:
postcard::Error }` variant. `postcard` is no longer exposed from this
error

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.
2026-04-22 18:04:08 +02:00
Franz Heinzmann 54250090e7 refactor(iroh)!: Remove ipnet, hickory_net and netmon from public API surface by replacing their errors with variants or AnyError (#4155)
## Description

This removes a few foreign errors from our public API to reduce
semver-relevant API surface.

- Remove `ipnet::PrefixLenError` from public API, just the variant is
enough (doesn't add further details anyway)
- Replace `hickory_net::Error` with `AnyError` to not have a dependency
on `hickory_net` in public API
- Replace `netmon::Error` with `AnyError` to not have a dependency on
`netmon` in public API

## Breaking Changes

* changed: `iroh_relay::dns::DnsError::Timeout`: the `source:
tokio::time::error::Elapsed` field has been removed. The variant is now
an empty struct variant (`Timeout {}`) and no longer exposes `tokio` in
the public API.
* changed: `iroh_relay::dns::DnsError::Resolve { source }`: the `source`
field type changed from `hickory_resolver::net::NetError` to
`n0_error::AnyError`. `hickory_resolver` is no longer part of the public
API surface of this error.
* changed: `iroh::endpoint::BindError::CreateNetmonMonitor { source }`:
the `source` field type changed from `netmon::Error` to
`n0_error::AnyError`. `netmon` is no longer part of the public API
surface of this error.
* removed: `iroh::endpoint::bind::InvalidSocketAddr::InvalidPrefix {
source: ipnet::PrefixLenError }` variant.
* added: `iroh::endpoint::bind::InvalidSocketAddr::InvalidPrefixLength
{}` variant, replacing `InvalidPrefix`. The underlying
`ipnet::PrefixLenError` is no longer exposed.

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.
2026-04-22 16:01:46 +02:00
Franz Heinzmann fe6148de90 refactor(iroh, iroh-relay)!: remove reqwest from public API and enforce our DNS resolver (#4150)
## Description

This changes our interaction with `reqwest` such that we could swap to
another HTTP client library during 1.0.

* Remove the public `impl reqwest::dns::Resolver for DnsResolver`.
Instead we now have a private wrapper struct, thus not exposing this as
public API
* Remove reqwest errors from our errors, replaced with `AnyError`
* Enforce that we always use the `DnsResolver` configured on the
endpoint. In net_report we previously used reqwest's default DNS
resolver. Now we always use the one configured on the endpoint
* Streamline the pkarr address lookup constructors to always take a
`DnsResolver`. When used outside of iroh's address lookup you can just
pass `Default::default` (done in tests or examples).

With this `reqwest`  no longer shows up anywhere in the public API.

## Breaking Changes

changed: `iroh::address_lookup::pkarr::PkarrRelayClient::new` now takes
a `DnsResolver` as a third argument (non-`wasm_browser` builds):
`PkarrRelayClient::new(pkarr_relay_url, tls_config, dns_resolver)`. Pass
`DnsResolver::default()` to preserve previous behavior.
* changed: `iroh::address_lookup::pkarr::PkarrRelayClient::new` in
`wasm_browser` builds no longer takes a `tls_config` argument:
`PkarrRelayClient::new(pkarr_relay_url)`.
* removed: `iroh::address_lookup::pkarr::PkarrRelayClient::builder`.
Construct a `PkarrRelayClient` directly via `PkarrRelayClient::new` and
pass the desired `DnsResolver`.
* removed:
`iroh::address_lookup::pkarr::PkarrRelayClientBuilder::set_dns_resolver`.
The DNS resolver is now a required constructor argument on
`PkarrRelayClient::new`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpSend { source
}`: the `source` field type changed from `reqwest::Error` to
`n0_error::AnyError`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpPayload {
source }`: the `source` field type changed from `reqwest::Error` to
`n0_error::AnyError`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpRequest {
status }`: the `status` field type changed from `reqwest::StatusCode` to
`http::StatusCode`.
* removed: `impl reqwest::dns::Resolve for
iroh_relay::dns::DnsResolver`. `DnsResolver` is no longer usable
directly as a `reqwest` resolver; wrap it yourself if you need that
integration

## Notes & open questions

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

## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.
2026-04-22 15:07:10 +02:00
Friedel Ziegelmayer 7c853c04d8 feat: update to hickory 0.26 (#4151)
- Update iroh-dns-server to use `hickory-server@0.26` and
`hickory-resolver@0.26`
- Update `swarm-discovery` to `0.6.0`
2026-04-22 14:08:06 +02:00
Franz Heinzmann c6b1b6e1c4 feat(iroh): expose home relay connection status (#4149)
## Description

Currently, the only API to check whether an endpoint successfully
connected to a home relay is `Endpoint::online`. However, this API
neither provides a notification in case the connection is lost, nor does
it provide any insight in case the connection fails.

This PR adds `Endpoint::home_relay_status`, exposing the connection
status of the home relay. It returns a watcher over `Vec<RelayStatus>`.
Currently the vec will never have more than one entry, but we're keeping
the API aligned to other relay APIs in preparation of a potential
multi-home-relays feature during 1.0.

The `RelayStatus` is a struct that internally contains a non-public enum
with the actual status. For now, it only provides methods
`is_connected() -> bool` and `last_error() -> Option<Arc<AnyError>>`,
which should provide reasonable introspectability while allowing us to
add more information in the future.

Fixes #3940


## 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. -->
- [x] Self-review.
- [x] 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.
2026-04-22 13:01:44 +02:00
Franz Heinzmann d8abb11cd1 refactor(iroh-relay)!: remove lru_cache from public API (#4152)
## Description

We had `lru_cache` in the public API for iroh-relay (with `server`
feature). This removes it by hiding the enum behind a struct.

## Breaking Changes

* changed: `iroh_relay::KeyCache` now is a struct (was an enum). All
methods are unchanged.


## Change checklist

- [x] Self-review.
- [x] 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.
- [x] All breaking changes documented.
2026-04-22 11:15:28 +02:00
Asmir Avdicevic 4f8e278c1a ci: fix release build targets (#4146) 2026-04-21 15:27:37 +02:00
Franz Heinzmann 3ea82803bb refactor(iroh): don't track paths by address (#4131)
## Description

We shouldn't track paths by their address, because noq allows to have
multiple paths per remote address. Even though we currently don't ever
get into this situation (I think) we shouldn't have a data structure
that conflicts with noq's contract here, unless we specifically would
want to enforce this here.

So this PR removes the `paths_by_addr` map in the RemoteStateActor.
Instead, we iterate over the path list. Because the number of paths is
small-ish, this should have no perf effect.

## Change checklist

- [x] Self-review.
2026-04-20 16:37:24 +02:00
dignifiedquire 8e6562d4cc chore: Release v0.98.1 2026-04-20 14:22:35 +02:00
Franz Heinzmann 28b4cfea00 fix(iroh): reduce await points in socket actor loop (#4143)
## Description

We needlessly await the return channel from messages sent to
`RemoteStateActor`s within the main socket actor loop. This moves the
await point out of the actor loop:
- For `remote_info`, we can just use the read-only copy of the remote
actor sender map, because this should not start a new actor anyways
- for `add_connection` we can await the reply channel outside of the
actor loop, as in #4138


## Change checklist

- [x] Self-review.
2026-04-20 14:04:34 +02:00
Asmir Avdicevic aed36e1a24 fix: set default crypto provider for iroh-dns-server binary (#4142)
## Description

This fixes the panic in 0.98 on the dns server.

Same fix as in #4087 

## 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)
2026-04-20 13:31:42 +02:00
Franz Heinzmann c7dba4a265 fix(iroh): don't block socket actor loop on address lookups (#4138)
## Description

When calling `Endpoint::connect`, the first thing happening internally
is checking if we have *any* address for the endpoint ID, and if not,
wait for address lookup to return at least one address (because
attempting to connect without any address is worthless). Due to changes
in unrelated refactors, we moved the `await` on the return channel from
the `RemoteStateActor` (which handles the address lookup) *into the main
socket actor loop*. This is a bug, because it means the socket actor
loop may be blocked waiting for address lookup, which can take a long
time.

This PR fixes this by passing through the return channel and only
awaiting it at the call site, i.e. out of the actor loop.

Included is a test that fails without the fix and passes now.

## Breaking Changes

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

## Notes & open questions

Ideally, the actor loop should not have any `await` points outside of
the main `tokio::select!`. However, this is not feasable in the current
architecture, because we need to send into bounded channels. This is
fine, too, as those sends should all be fast and only apply necessary
backpressure in rare conditions. However, it means we need to review all
`await` points in the branches of the select most precisely by hand, to
be sure to not have any potentially long-running awaits block the actor
loop.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Tests if relevant.
2026-04-20 12:38:29 +02:00
Asmir Avdicevic 867471dd76 fix(ci): fix arm builds and some cleanup (#4139)
## Description

Should fix
https://github.com/n0-computer/iroh/actions/runs/24570219857/job/71841008990

Passes as expected here now:
https://github.com/n0-computer/iroh/actions/runs/24657515016/job/72094689852

## 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)
2026-04-20 11:28:09 +02:00
dignifiedquire 42d698348b chore: Release v0.98.0 2026-04-17 16:24:44 +02:00
dignifiedquire 08c6454ac6 chore: fix changelog generation 2026-04-17 16:22:25 +02:00
Franz Heinzmann 1b04d345a3 fix(iroh): don't falsely report home relay as connected on change (#4136)
## Description

Follow-up to #4115. `RelayActor::on_network_change` was inferring
`HomeRelayStatus::Connected` from `active_relays.contains_key()`, but a
present entry only means the actor task exists, not that it has finished
dialing.

If the newly selected home relay already had an `ActiveRelayActor`
running as a non-home relay (because we reached a peer via it) and that
actor was still dialing or in `Disconnected` backoff, `Endpoint::online`
would return immediately, defeating the guarantee added in #4115.

## Change checklist

- [x] Self-review.
2026-04-17 16:21:35 +02:00
Franz Heinzmann 481c8703c1 refactor(iroh)!: improve address lookup registry (#4130)
## Description

While working on #4126 I realized that our `ConcurrentAddressLookup`
really is a struct from way back when address lookup configuration on
the endpoint worked differently. It now is an integral part of the
`Endpoint`, and there's no reason (I think) for users to create one
themselves, because they can work on `Endpoint::address_lookup()`
directly.

This renames it to `AddressLookupServices` and changes it to no longer
implement `AddressLookup` by itself. This allows then for a more
sensible return type in `Self::resolve`, basically moving what #4126 did
into the correct place.

Also removes a few methods that were unused.

## Breaking Changes

* renamed: `iroh::address_lookup::ConcurrentAddressLookup` ->
`iroh::address_lookup::AddressLookupServices`.
* `AddressLookupServices` no longer implements the `AddressLookup`
trait. It is owned by the `Endpoint` and used directly via its inherent
methods.
* removed: `ConcurrentAddressLookup::empty()` and
`ConcurrentAddressLookup::from_services()`. Construct with
`AddressLookupServices::default()` and register services with
`AddressLookupServices::add` / `AddressLookupServices::add_boxed`.
* removed: `impl<T: IntoIterator<Item = Box<dyn AddressLookup>>> From<T>
for ConcurrentAddressLookup`. Construct with
`AddressLookupServices::default()` and add services explicitly.
* `iroh::Endpoint::address_lookup` now returns
`Result<&AddressLookupServices, EndpointError>` (was
`Result<&ConcurrentAddressLookup, EndpointError>`).
* `AddressLookupServices::resolve` now returns `impl Stream<Item =
Result<Item, AddressLookupFailed>>` instead of
`Option<BoxStream<Result<Item, Error>>>`. The stream is always returned:
if no services are configured it yields a single
`AddressLookupFailed::NoServiceConfigured` error and then ends. Callers
that previously unwrapped the `Option` (e.g. with `.expect("...")`)
should drop the unwrap and use the stream directly.


<!-- 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. -->
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-17 12:20:14 +02:00
Franz Heinzmann 2ad657ad22 tests(iroh): improve patchbay NAT matrix (#4135)
## Description

This expands the NAT testing matrix, and defines the NAT types inline.

It tests the full matrix for 4 NAT kinds. See the extensive docs for the
different kinds. These are, I think, the most widely deployed ones.
There are more possible variations, but these are the ones that matter
most IMO.

Tests that don't pass are ignored, with a note of which used to pass in
iroh 0.35. The ones that we currently regressed ones are where one side
is `Hard` and the other is `None` or `Easiest` - those we should get to
pass again. `Hard x Hard` and `Hard x Easy` (and reverse) fail on iroh
0.35 as well - they would need port guessing (birthday paradox) which we
never did so far.

I back-ported these tests to iroh 0.35 for a comparison:
https://github.com/n0-computer/iroh/tree/patchbay-0.35

## 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)
2026-04-17 11:56:37 +02:00
Franz HeinzmannandFriedel Ziegelmayer 321443d01d fix(iroh)!: don't stop address lookup when one service errors (#4126)
## Description

We currently abort address lookup on the first error from *any* service.
This is a bug, we should run each service to completion and only abort
once all completed or failed.

Fixes #4125

Turns out our current errors were not equipped to handle this well.
Refactored into
a) The error returned from an individual address lookup service. This is
just a struct now, because `NoServicesConfigured` didn't ever make sense
here, and `NoResults` is expressed by returning `None` without yielding
items.
b) The error returned from a lookup across all services now has
`NoServicesConfigured` and `NoResults` variants only, where the latter
can contain the errors emitted from individual services


## Breaking Changes

* changed: `iroh::address_lookup::Error` is now a struct. Existing
constructor methods are unchanged.
* changed: `iroh::endpoint::ConnectWithOptsError::NoAddress { source }`:
The `source` field now has type `AddressLookupFailed`, which is a new
error type that can hold errors for *all* failed lookup services

## Notes & open questions

It might be more appropriate to move the new format of the stream right
into `ConcurrentAddressLookup`. However, with the different error type,
it could no longer implement `AddressLookup` - which it arguably doesn't
have to. Maybe that would be the cleaner refactor?

See #4130 

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-04-17 10:12:51 +02:00
Franz HeinzmannandFriedel Ziegelmayer 3424c6daf8 fix(iroh): Endpoint::online should only return once connected to a relay (#4115)
## Description

Currently, `Endpoint::online` returns once *net_report selected the home
relay*, not once connected to it. This is unintuitive, and leads to
races especially in tests.

This fixes it by exposing the connection status of the home relay to the
upper Socket layers. It reuses the existing `my_relay` watchable, but
adds a `HomeRelayStatus` to its value.

## Breaking Changes

Behavior change: `Endpoint::online` now returns once the endpoint is
connected to its home relay. Previously, it would return once the home
relay is selected but before having connected to it.

## Notes & open questions

We have a terminology mix in our code between "my_relay" and
"home_relay". We should clean this up, but not in this 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)

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-04-16 21:18:21 +02:00
Franz Heinzmann 1c92a395bd fix(iroh-relay): treat frames not allowed in a protocol version as error (#4127)
## Description

#3955 added a new relay protocol version. This PR fixes the contract: We
should only allow frames that are defined for the negotiated protocol
version, and abort if we receive a frame not allowed in the negotiated
version.

## Breaking Changes

None

## Change checklist
- [x] Self-review.
- [x] 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.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-16 18:10:58 +02:00
Rüdiger Klaehn 382bf3620e refactor: Move to_z32/from_z32 into iroh-base and remove EndpointIdExt trait (#4133)
## Description

Move to_z32/from_z32 into iroh-base and remove EndpointIdExt trait

Ext traits are just not very nice for our users.

## Breaking Changes

removed: iroh_relay::endpoint_info::EndpointIdExt trait and its
re-export from iroh_dns. The to_z32 / from_z32 methods are now inherent
on iroh_base::PublicKey (and therefore EndpointId, which is a type
alias). Callers should drop the use
iroh_relay::endpoint_info::EndpointIdExt; import — the methods resolve
without it.

## 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)
2026-04-16 15:29:03 +02:00
Rüdiger Klaehn 3ab6222bc2 feat: vendor pkarr implementation (#4026)
## Description

On main we use the pkarr dependency, which comes with an entire tree of
dependencies and is not under our control. But we do not use the reqwest
based client at all in the dns discovery, instead we have our own. So
what we use is just the encoding and decoding of DNS records.

It seems less than optimal to have a big dependency for just that. So
this PR removes the pkarr dependency, inlines the DNS record encoding
with the help of simple-dns, and implements the dht part manually,
directly using the mainline crate.

Note for reviewers: just do cargo doc -p iroh_dns --open to see the API
of the new crate. Almost everything is just copied, with the exception
of using mainline directly to publish to the DHT.

(In a subsequent PR I might also try to get rid of the mainline dep)

## Breaking Changes

- new crate: iroh-dns — published as a separate crate containing
SignedPacket, Timestamp, EndpointIdExt, TxtAttrs, IrohAttr,
IROH_TXT_NAME, ParseError, EncodingError. iroh and iroh-relay no longer
depend on the third-party pkarr crate directly.
- removed: iroh_relay::endpoint_info::DecodingError — no longer exists.
Callers that matched on it should now handle iroh_base::KeyParsingError
instead.
- changed: iroh_relay::endpoint_info::EndpointIdExt::from_z32 — return
type changed from Result<EndpointId, DecodingError> to
Result<EndpointId, iroh_base::KeyParsingError>.
- changed: iroh_relay::endpoint_info::EncodingError — the
InvalidTxtEntry { source: pkarr::dns::SimpleDnsError } variant is
removed. Only FailedBuildingPacket remains, and its source type is now
iroh_dns::pkarr::SignedPacketBuildError (no longer the third-party
pkarr::errors::SignedPacketBuildError).
- changed: iroh_relay::endpoint_info::ParseError::DecodingError — the
source field type changed from DecodingError to
iroh_base::KeyParsingError.
- changed: iroh_relay::endpoint_info::EndpointInfo::from_txt_lookup —
signature relaxed from impl Iterator<Item = crate::dns::TxtRecordData>
to impl Iterator<Item = impl Display>. Also no longer
#[cfg(not(wasm_browser))]-gated.
- changed:
iroh_relay::endpoint_info::EndpointInfo::{from_pkarr_signed_packet,
to_pkarr_signed_packet} — the SignedPacket parameter/return type is now
iroh_dns::pkarr::SignedPacket instead of the third-party
pkarr::SignedPacket.
- changed: iroh::address_lookup::pkarr::PkarrError::PublicKey — source
field type changed from pkarr::errors::PublicKeyError to
iroh_base::KeyParsingError.
- changed: iroh::address_lookup::pkarr::PkarrError::Verify — source
field type is now iroh_dns::pkarr::SignedPacketVerifyError (not
pkarr::errors::SignedPacketVerifyError).
- removed:
iroh::address_lookup::pkarr::dht::Builder::client(pkarr::Client) —
replaced by dht_builder(mainline::DhtBuilder). The DHT is now driven by
mainline directly rather than via pkarr::Client.
- removed: iroh::address_lookup::pkarr::dht::Builder::pkarr_relay(Url) —
the DHT address lookup no longer publishes to pkarr relays; it only uses
the Mainline DHT. Use PkarrPublisher for relay publishing.
- removed:
iroh::address_lookup::pkarr::dht::Builder::n0_dns_pkarr_relay() — same
reason as above.
- removed: iroh::address_lookup::pkarr::dht::Builder::dht(bool) — DHT is
always enabled for DhtAddressLookup; the toggle is gone.
- changed: cargo feature address-lookup-pkarr-dht — now pulls in
mainline instead of pkarr/dht + pkarr/relays.
- removed (internal crate deps): z32 and pkarr are no longer direct
dependencies of iroh, iroh-relay, or iroh-dns-server. Downstream users
who pulled those through iroh's dependency tree must depend on them
explicitly (or use the re-exports from iroh-dns).

## Notes & open questions

Note: I am using simple-dns for en/decoding. We could even inline this,
but it is very lightweight compared to hickory or even hickory-proto. I
was originally planning to use hickory-proto, but it has a lot of deps
even with default features disabled. Simple-dns is not a new dependency
- we used to have it via pkarr.

~~Note: this adds a dep to iroh-relay to iroh-dns-server, just for the
pkarr SignedPacket impl. We could alternatively let iroh-relay-server
depend on pkarr (it's not so critical regarding deps), or have a tiny
iroh-pkarr crate.~~

Note: we are no longer using pkarr client (which has relay and dht built
in) for the dht lookup. So there is a functionality change: the dht
lookup can now **only** look up via the DHT. Before you could configure
it with relays.

But I think that is fine, we already have a way to look up via relays.

Note: I also added a few comments and tests regarding storage on
iroh-dns-server. These are unrelated but should do no harm.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] 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)
2026-04-16 14:16:46 +02:00