Commit Graph
2487 Commits
Author SHA1 Message Date
Ruediger Klaehn fc1044a0ec WIP add global address validation token store
Without this the token store gets recreated for each connection, which defeats its purpose.
2026-06-08 12:30:28 +03:00
Philipp Krüger 295a7158ab fix(iroh): Correctly abandon paths when new are opened with worse RTT (#4296)
## Description

Locally, `test_paths_watcher` and `endpoint_two_direct_add_relay` fairly
consistently failed for me.
I dug into `test_paths_watcher`, this was what was going on:
1. A new connection is established via IP path
2. The test waits for both relay and IP path to be established with a 1s
timeout
3. The connection immediately tries to add a relay path after it was
established via IP path, but it can't yet because of missing remote
CIDs, so it schedules a later path open for the relay path.
4. <lots and lots of path open events, many many new paths opened and
immedaitely closed>
5. Scheduled path open for the relay path triggers, but it fails because
MaxPathIdReached. Unlike RemoteCidsExhausted, it doesn't re-schedule
this path open.
6. 1s timeout triggers

The weird thing was that the max path ID limit wasn't increased. This
was because the hole-punched paths that were opened were never cleaned
up - no path was ever abandoned.

Digging deeper I found out that our logic for abandoning redundant IP
paths wasn't triggered when the newly hole-punched path wasn't better
than our current paths.

This PR fixes that.

During investigation I also found out that we would never re-try opening
the relay path in case you get a `MaxPathIdReached` error, which seems
bad, so now we explicitly handle this case as well.

## Breaking Changes

None

## Notes & open questions

Arguably, we could also decide to not match on the particular error that
causes us to not be able to open a path and always re-schedule path
opening on error?

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-06-01 18:01:02 +02:00
dignifiedquire ee8b6a3d93 chore: Release v1.0.0-rc.1 2026-05-27 10:56:35 +02:00
Friedel Ziegelmayer 502b57935d feat!: update to noq@1.0.0-rc.1 (#4287) 2026-05-27 10:53:05 +02:00
Matthias Beyer f8b066cc34 refactor(base): expose SignatureParsingError (#4285)
This was missed in the public API cleanup

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2026-05-26 21:02:19 +02:00
Floris Bruynooghe 4eea244047 fix(iroh): Do not close abandoned paths on all connections (#4284)
## Description

If a path is abandoned on one connection we now leave it alone, if the
path is unusable other connections will abandon it in their own time.

Any scheduling on a bad path should be handled better inside
noq. Adding this complexity to iroh does not buy us much.

Supercedes #4245 and #4257.


## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
2026-05-22 18:21:26 +02:00
Floris Bruynooghe 49c5d54a21 deps(noq): update noq and adjust for api change (#4283)
## Description

Previously noq always allowed the server to migrate during the
handshake. So now we just always override that setting.

## Breaking Changes

n/a

## Notes & open questions

Some tests manually create noq::TransportConfig, they have been manually
adjusted. From the public API this isn't possible.

## Change checklist

- [ ] Self-review.
2026-05-22 17:50:52 +02:00
Franz HeinzmannandFloris Bruynooghe b8a596844a feat(iroh): noq patch to support holepunching when server is behind a hard NAT (#4254)
## Description

Patches noq to https://github.com/n0-computer/noq/pull/672
Makes iroh successfully holepunch when the server is behind a hard NAT
and the client is behind an easy NAT. The reverse aready worked before.

## Breaking Changes

n/a

## Notes & open questions

(@flub hijacked this PR)

Once https://github.com/n0-computer/noq/pull/672 is merged I'll update
this PR to point to noq main again before merging.

## Change checklist

- [x] Self-review.
- [x] Tests if relevant.

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-05-22 17:35:55 +02:00
70751de320 feat(iroh)!: Configurable path selection (#4232)
## Description

An attempt to make path selection more flexible for complex custom
transport use cases.

Path selection is now via a dynable trait `PathSelector`. The only fn
select takes a `PathSelectionContext` that has the current path as well
as a way to iterate over a flat list of `PathSelectionData` structs.

`PathSelectionData` currently just has the address and the stats, but in
the future could be extended to contain more detailed information such
as the congestion controller metrics `noq_proto::ControllerMetrics` etc.
I think cc metrics would be quite helpful to make good decisions about
path selection.

`select` returns a PathSelection struct that is at this time a newtype
over an Option<Addr>. add is first writer wins, all subsequent calls
will ignore the addr and emit a warning. But we can change this in the
future to allow multiple addrs.

The entire mechanism is only pub under the `unstable-custom-transports`
flag, so we can change it in the future. But there are some additive
changes we could do without breakage. For example we could allow
PathSelection to also keep track of paths to be closed.

## Breaking Changes

Removes some public methods on the endpoint builder that are too
opinionated if you want to make path selection fully generic:

`endpoint::Builder::transport_bias(kind, bias)`: removed
`endpoint::transports::TransportBias`: removed

And some changes involving the unstable_custom_transport API.

## Notes & open questions

Note: the new signature tries to anticipate that in the future we might
want to select multiple transports, but as of now it will just ignore
these.

## 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: Frando <frando@unbiskant.org>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-05-22 17:27:06 +02:00
Franz Heinzmann 107e37e27e refactor(iroh-relay)!: Replace AccessConfig enum with AccessControl trait and allow to track connections (#4276)
## Description

Replaces the `AccessConfig` with a new trait `AccessControl` with
`on_connect` and `on_disconnect` functions. `on_connect` returns the
`Access::Allow/Deny` enum, like the callback did previously.

To allow to revoke access dynamically, this now assigns each connection
a `ConnectionId` early on, and includes this id in the `on_connect` hook
(through `ClientRequest:::connection_id`). When the connection closes,
`on_disconnect` is called with the same id. This allows AccessControl
impls to maintain a map of active connections and their tokens, so that
when revoking a token no-longer permitted clients can be disconnected.

## Breaking Changes
Breaking Changes

- removed: `iroh_relay::server::AccessConfig` (enum) and
`iroh_relay::server::AccessCheck` (type alias), replaced by the new
`AccessControl` trait.
- changed: `iroh_relay::server::client::Client` is no longer public. It
had no public methods and could not be used from outside of the crate.
- changed: `iroh_relay::server::RelayConfig::access` is `Arc<dyn
DynAccessControl>` instead of `AccessConfig`.
`iroh_relay::server::http_server::RelayService::new` and
`iroh::test_utils::run_relay_server_with_access` take `Arc<dyn
DynAccessControl>` instead of `AccessConfig`.
- changed: `iroh_relay::server::Access::Deny` is now a struct variant
`Deny { reason: Option<String> }`; `Access` is no longer `Copy`.
- changed: `iroh_relay::server::ClientRequest::new` takes `(EndpointId,
ProtocolVersion, http::request::Parts)` instead of `(EndpointId,
http::request::Parts)`, i.e. it now also takes the negotiated protocol
version.
- changed:
`iroh_relay::protos::handshake::SuccessfulAuthentication::authorize_if`
takes `Access` instead of `bool`.
- changed: `iroh_relay::server::client::Config::new` takes
`(OnDisconnectGuard, RelayedStream, ProtocolVersion)` instead of
`(EndpointId, RelayedStream, ProtocolVersion)`, and the public
`Config::endpoint_id` field is replaced by `Config::guard`. Build the
guard with `OnDisconnectGuard::empty`, or use the value returned by
`SuccessfulAuthentication::authorize_with`.
- added: `iroh_relay::server::AccessControl`,
`iroh_relay::server::DynAccessControl`, `iroh_relay::server::AllowAll`,
`iroh_relay::server::ConnectionId`,
`iroh_relay::server::OnDisconnectGuard`.
## Notes & open questions

This is another alternative to #4274 and #4275

In contrast to 4275, this allows the AccessControl to close connections
by itself without requiring network roundtrips. However, for such
AccessControl impls it comes with the cost to maintain a connection
index.

See the `runtime_auth` test for how this looks in practice.

## 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-05-22 16:51:05 +02:00
Franz Heinzmann 77e6c31acf refactor(iroh)!: Use FourTuple in send paths (#4281)
## Description

Use a new `transport::FourTuple` throughout the send path. Adds a src
argument to CustomSender::poll_send. Replaces the recently added
`TransportFourTuple` with the new `transports::FourTuple`.

Motivations:
* We noted that it would be nicer if the TransportFourTuple introduced
in #4273 would be an enum, so that we cannot have mismatches between the
transport kinds of local and remote addresses. I agree. What prevented
it was that we had to convert to `transports::Addr` many times, which is
not free.
* I noticed that custom transports don't get a `src: Option<CustomAddr>`
in their `poll_send`. I think it should be there, because custom
transports *can* set a CustomAddr on which incoming packets were
received, so to mirror the features of the IP transport they should be
able to pin to an interface when replying as well, if the transport has
a notion of multiple interfaces

This PR fixes both by replacing the `remote_state::TransportFourTuple`
with a `transports::FourTuple` that is used throughout the send path,
including custom transports.


## Breaking Changes

* `iroh::endpoint::transports::CustomSender::poll_send` now has an
additional arg `src: Option<&CustomAddr>`


## 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.
- [ ] 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-05-22 16:02:24 +02:00
Franz Heinzmann 14bae032bd refactor(iroh)!: Use FourTuple for selected path (#4273)
## Description

Track the selected path in the RemoteStateActor by FourTuple.

Handling and exposing the local address is .. weird:

 * For IP transports, it is the address of the local socket, if known
* For relay transports, we never set the local_ip in the recv meta.
* For custom transports, the custom transport implementation can set a
`CustomAddr` in `RecvMeta`, which we convert to a mapped addr with port
0 internally in the recv path

The address we get back from noq for a path is this address. We don't
want to ever expose mapped addresses, so we need to convert this address
into something else. We have a precedent: We recently introduced a
`IncomingLocalAddr` which is basically this.

So I decided to reuse this type and renam eit to `LocalTransportAddr`,
which mirrors `TransportAddr` nicely.
The conversions are nothing to be happy about, but I don't see a solid
alternative right now without larger refactors.


## Breaking Changes

* changed: The variants of `iroh::endpoint::PathEvent` are now marked
`#[non_exhaustive]`
* renamed: `iroh::endpoint::IncomingLocalAddr` ->
`iroh::endpoint::LocalTransportAddr`, and the `Relay` variant is now a
tuple variant

## Notes & open questions

Instead of reusing and renaming the exisitng `IncomingLocalAddr`, we
could also expose local_addr as `Option<LocalTransportAddr>`, with `enum
LocalTransportAddr { Ip(IpAddr), Custom(CustomAddr) }`, i.e. remove the
`Relay` case. I had this in an earlier version but then found yet
another public address type a bit too much so instead went for the
existing `IncomingLocalAddr`.

## 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-05-22 14:26:49 +02:00
Philipp Krüger 0c608510af chore(deps): Update noq to latest main (#4279)
## Description

Updates to the latest main, including `#[non_exhaustive]` changes to
`PathEvent`: https://github.com/n0-computer/noq/pull/648

## Notes & open questions

Adding a `#[cfg(test)] panic!()` to ensure we keep the versions in noq
and iroh in sync and see iroh tests failing when we add more path
events.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-05-22 12:32:35 +02:00
Philipp Krüger c61757322c fix(iroh): Shut down faster by skipping the draining period on Endpoint::close (#4270)
## Description

This makes `Endpoint::close` in most cases (no packet loss) much faster:
- It is basically instant (or rather - its performance independent of
the network) when all connections that were open were already closed
remotely (we waited for `connection.closed().await` before calling
`Endpoint::close`).
- It takes ~1 RTT (the worst RTT among all connections that is), when we
initiated the close locally immediately before calling
`Endpoint::close`. The round trip is the CONNECTION_CLOSE frame going
one way and coming back. This only works if we didn't experience any
packet loss.

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

This is a sort of "batch" of work to make this happen:
- It depends on the noq feature to only wait for *entering* the draining
state, not exiting it, allowing us to close the socket earlier:
https://github.com/n0-computer/noq/pull/651
- It fixes [a
bug](https://github.com/n0-computer/iroh/blob/main/iroh/src/socket/transports.rs#L252-L254)
where we cut off all packet receiving after *entering* `Endpoint::close`
(this is too early! it doesn't allow `noq::Endpoint::wait_idle` to do
its job!)
- It fixes another bug in `Runtime::close` where that would always wait
for all `EndpointDriver` and `ConnectionDriver`s to run to completion,
even if we know we can short-circuit (because we know we've waited for
`wait_idle`!).

It also contains some small logging impovements (I was able to remove
`Socket::public_key` because it was only used for logging in a redundant
way).

## Breaking Changes

None.

## Notes & open questions

- [x] Depends on one noq PR to be merged.

## 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.
2026-05-21 15:35:11 +02:00
Franz HeinzmannandPhilipp Krüger 720829eae5 fix(iroh): Fix race condition in the remote map that can lead to double-spawned RemoteStateActors (#4272)
## Description

Adds a regression test and fix for this bug:

When a RemoteStateActor is terminating, and a new message to the actor
is sent *before* `poll_cleanup` is called, we would check if the sender
is closed and, if so, spawn a new RemoteStateActor. When `poll_cleanup`
then processes the task of the terminated actor, it would
unconditionally remove the sender of the just-spawned actor.


## Notes & open questions

I am pretty sure my solution is fine, but would like an additional set
of eyes. I'm also thinking if we can add a small abstraction to make
this more foolproof, but not sure. Let's get the fix in first.

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

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-05-21 14:13:11 +02:00
Franz Heinzmann a7d896b634 chore: improve check-external-types setup (#4250)
## Description

Define the list of allowed types per crate instead of globally, and add
a `cargo make` task to run the checks locally.

## Change checklist
- [x] Self-review.
2026-05-19 11:43:04 +02:00
Franz Heinzmann b229f57a70 fix(iroh): Don't stop the RemoteStateActor if there are pending ResolveRemote requests (#4271)
## Description

`Endpoint::connect` starts a RemoteStateActor with a `ResolveRemote`
message that contains a oneshot sender as reply channel. The
RemoteStateActor starts address lookup, and triggers the reply channel
when the first result arrives. The RemoteStateActor has an idle timeout
of 60s. Before this fix, we did not check for pending resolve requests
when the idle timeout expires: The actor stopped and the reply channel
sender are dropped, which propagated as `InternalConsistencyError` back
to the caller.

This PR fixes it such that we only consider a RemoteStateActor to be
idle when there are no outstanding `ResolveRemote` requests.

Fixes #4265 and comes with a regression test.

## Notes & open questions

With this change, `Endpoint::connect` will hang forever if the
configured AddressLookup services remain pending forever (i.e. don't
return any results and don't close their result stream). Will address
this in a followup.

## 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.
2026-05-19 10:50:26 +02:00
Franz Heinzmann 86123dd850 refactor(iroh): Split RemoteStateActor struct into connections and state (#4268)
## Description

By splitting the `RemoteStateActor` struct into `connections` and
`state`, we can write and use util methods on `state` while also mutably
borrowing into `connections`. This e.g. allows us to have
`open_path_on_conn` to repeat less code.

## 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.
2026-05-19 09:04:02 +02:00
Franz Heinzmann d5e4395463 refactor(iroh): pass strong connection to RemoteStateActor (#4267)
## Description

We currently pass a `WeakConnectionHandle` to the `RemoteStateActor`
when a connection's handshake completed, but then await until the actor
confirms the registration, to then resolve to user code with the
connection. So we *always* keep the connection alive until the actor
confirms, which means there's no benefit to downgrading and upgrading
here. The change saves us one fallible upgrade and a level of
indentation in the RemoteStateActor with no downsides.

## Change checklist

- [x] Self-review.
2026-05-15 15:56:19 +02:00
Matthias Beyer 9246b7f0a6 docs(iroh): update tls- feature names (#4263)
Fixes 387c2e4fcb where the features were
introduced, but the documentation was wrong.

CC: Philipp Krüger <philipp.krueger1@gmail.com>


Closes https://github.com/n0-computer/iroh/issues/4262

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2026-05-15 12:01:48 +02:00
Asmir Avdicevic ec7b9e3fd8 fix(ci): force non-PIE crt1.o for static musl release builds (#4258)
Fixes https://github.com/n0-computer/iroh/issues/4252

`musl-gcc -static` produces an `ET_EXEC` binary using musl's `Scrt1.o`,
but `rustc` with `+crt-static` was linking its bundled `rcrt1.o` (the
static-PIE startup) into the same image. The PIE startup code then
treats the absent `.dynamic` section as `_DYNAMIC == 0` and segfaults in
`_start_c` before reaching `main`.

Adding `-C relocation-model=static` makes rustc pick the non-PIE
`crt1.o`, which matches the ET_EXEC output and yields a fully static,
truly portable binary. Verified on the x86_64 musl CI runner against
Alpine, Ubuntu 22.04, Ubuntu 24.04, and Debian bookworm.

## 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-05-14 12:34:46 +02:00
Floris Bruynooghe a470146132 test(iroh): fix racy connection shutdown (#4243)
## Description

Waiting for stopped when the peer is about to shutdown is flaky and
not the recommended shutdown protocol. The CONNECTION_CLOSE could be
sent before all packets have been acked. And if the close arrives
before some acks then stopped (on the server) will fail with an
error.

CONNECTION_CLOSE is supposed to include any un-acked packets, but this
is only a best-effort and not a guarantee. This may not include all
packets if an ACK was already considered in-flight.

## Breaking Changes

n/a

## Notes & open questions

QUIC shutdown, it still gets us...

## Change checklist

- [x] Self-review.
- [x] Tests if relevant.
2026-05-14 10:22:44 +02:00
Floris Bruynooghe 54ea953c86 deps: Update to noq main for PathEvent::Established (#4248)
## Description

This is only a rename for now.


## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
2026-05-11 13:48:40 +02:00
Friedel ZiegelmayerandChristian Visintin f8cd43c22a feat(iroh-relay): expose Bucket rate-limit primitive (#4242)
> Updated version of #4231 

Embedders that mount the relay protocol via custom HTTP servers (e.g.
axum integration in holochain/kitsune2) cannot use the existing
RateLimited<S: AsyncRead> wrapper because their stream layer is already
WS-framed by the time the relay handler runs. Exposing Bucket lets these
embedders apply iroh's bucket semantics at the frame layer.

Visibility-only change: Bucket struct, Bucket::new and Bucket::consume
become pub. Fields stay private. InvalidBucketConfig was already pub.
Adds rustdocs to satisfy deny(missing_docs).

No behavior change.

Co-authored-by: Christian Visintin <christian.visintin@veeso.dev>
2026-05-07 17:33:31 +02:00
dignifiedquire 96b4b0e80d chore: Release v1.0.0-rc.0 2026-05-07 16:59:04 +02:00
dignifiedquire 1d0ff852aa chore: fixup relative deps 2026-05-07 16:58:46 +02:00
Friedel Ziegelmayer 20350e9bf6 feat!: update to 1.0.0-rc.0 deps (#4237)
## Description

Update deps to their latest versions

Depends on 

- [x] https://github.com/n0-computer/patchbay/pull/40
- [x] https://github.com/n0-computer/net-tools/pull/141

## Breaking Changes
⚠️  Bumps MSRV to `1.91`

The MSRV bump is required due to a dependency on `cargo-meta` which is
already on 1.91.
2026-05-07 16:53:06 +02:00
Franz Heinzmann 3e82de5088 refactor(iroh)!: redesign path observation API (#4188)
## Description

This replaces the current `PathWatcher` with a new combination of primitives.

- `Connection::paths` returns `PathList<'conn>`, a list of the currently-open paths. Iteration yields `Path<'conn>` with access to the remote address, selection state, and path stats. The `PathList` is a snapshot in time (ie., once returned from `Connection::paths` won't change for changes in the path list). It is also lifetime-bound to the `Connection` (which gives us unconditional access to path stats right out of the noq state).
- `Connection::path_events()`  returns a   `PathEventStream` of path events. This stream is lifetime-free, can be sent to other tasks, and does not keep the `Connection` alive. The subscription is registered immediately at call time so pairing it with a subsequent `paths()` read produces a race-free check-then-wait loop.
- `Connection::paths_stream`  returns a stream that yields `PathList<'conn>` whenever the path list changes (ie. on path open/close or selection change)


`PathEvent` has four variants: `Opened`, `Closed` (with `last_stats` inline), `Selected`, and a `Lagged` (with the missed count) to account for the (rare) case of a broadcast stream lag.

Closed paths are no longer retained in `Paths`. Consumers that need totals over the connection's lifetime accumulate from `PathEvent:: Closed`; the `transfer.rs` example's `spawn_stats_collector` demonstrates this pattern.

Internally, the path store splits into two handles sharing an `Mutex<State>`, containing a `SmallVec` of `(PathId, TransportAddr)` plus the selected path id. `PathStateSender`, owned by the `RemoteStateActor`, is the sole mutator and holds the broadcast `Sender`. `PathStateReceiver`, held by the `Connection`, reads via `ArcSwap` and subscribes via a `WeakSender`. When the `ConnectionState` is dropped, the broadcast `Sender` is dropped with it and outstanding event streams end naturally; new subscriptions on a closed connection where the remote state actor already dropped its state then  yield an already-closed stream.

Final per-path statistics now come from `noq::Closed::path_stats` at connection close time, via  https://github.com/n0-computer/noq/pull/617.

## Breaking Changes

- removed: `iroh::endpoint::PathWatcher`, `iroh::endpoint::PathInfo`, `iroh::endpoint::PathInfoList`, `iroh::endpoint::PathInfoListIter`.
- changed: `Connection::paths` returns `PathList<'_>` instead of `PathWatcher`. `Path<'_>` replaces `PathInfo`; `Path::stats` is now infallible
- changed: `ConnectionInfo::paths` is removed in favour of `ConnectionInfo::path_events`. `ConnectionInfo::selected_path` now returns `Option<TransportAddr>` instead of `Option<PathInfo>`.
- added: `iroh::endpoint::Path`, `iroh::endpoint::Paths`, `iroh::endpoint::PathEvent` (with `Opened`, `Closed`, `Selected`, `Lagged` variants), `iroh::endpoint::PathEventStream`, `Connection::path_events`, `ConnectionInfo::path_events`.

## 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).
- [x] Tests updated.
- [x] All breaking changes documented.
2026-05-07 14:33:29 +02:00
Franz Heinzmann f246242ff1 refactor(iroh)!: Improve feature-gating for unstable-custom-transports (#4228)
## Description

Makes the `iroh::endpoint::transports` module gated behind the
`custom-transports` feature.

## Breaking Changes

- changed: `iroh::endpoint::transports` is now gated on the
`unstable-custom-transports` feature

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-05-07 13:37:38 +02:00
Rüdiger Klaehn 7d3e4857ee fix(iroh)!: remove noq Written reexport (#4236)
## Description

Remove Written noq reexport

This struct has been removed from the noq public API

## Breaking Changes

`iroh::endpoint::Written`: removed

## 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-05-07 11:41:48 +02:00
Franz Heinzmann 63ed351706 refactor(iroh): apply path status for path selection (#4233)
## Description

This changes the logic how we apply a change in path selection. We now
consistently set the selected path to `PathStatus::Available`, and all
non-selected paths to `PathStatus::Backup`. It also unifies the
application of the path status and the closing of redundant IP paths
into a single loop over all connections and paths.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-05-07 10:10:43 +02:00
Franz Heinzmann 7955bea420 refactor(iroh)!: remove portmapper metrics from public API (#4235)
## Description

Removes the `portmapper` crate from the public API of `iroh`. The
`portmapper::Metrics` were re-exported as
`iroh::metrics::PortmapMetrics` and held in
`EndpointMetrics::portmapper`, which forced the `portmapper` crate into
our public API and our `external-types.toml` allow-list.

In its place, `iroh::metrics::NetReportMetrics` gains two minimal
counters: `portmap_attempts` and `portmap_external_address_updated`.
These are incremented from the socket actor when a port mapping is
requested and when the watcher reports a new external address. The
internal `portmapper` module no longer takes an `EndpointMetrics` and
constructs the underlying portmapper client with its default metrics.

The `metrics` feature no longer toggles the `portmapper/metrics`
feature, since portmapper's own metrics are no longer exposed.

## Breaking changes

- removed: `iroh::metrics::PortmapMetrics` re-export.
- removed: `iroh::metrics::EndpointMetrics::portmapper` field.
- added: `iroh::metrics::NetReportMetrics::portmap_attempts` counter.
- added:
`iroh::metrics::NetReportMetrics::portmap_external_address_updated`
counter.
- changed: the `metrics` feature no longer enables `portmapper/metrics`.

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-05-07 08:56:59 +02:00
Rüdiger Klaehn dd418df092 refactor: Remove obsolete fn transport_bias from endpoint builder. (#4234)
## Description

This is the part of https://github.com/n0-computer/iroh/pull/4232 that
removes something from the non feature gated public API.

If (as seems likely) we won't get
https://github.com/n0-computer/iroh/pull/4232 in for this release, this
would prevent having to break the stable (non feature gated) public API
when adding https://github.com/n0-computer/iroh/pull/4232 in the next
release.

## Breaking Changes

Removes some public methods on the endpoint builder that are too
opinionated if you want to make path selection fully generic:

endpoint::Builder::transport_bias: removed from the public api
endpoint::transports::TransportBias: removed from the public api

## Notes & open questions

Note: I did a quick check in all notable custom transports I am aware
of:

n0-computer/iroh-tor-transport
n0-computer/iroh-nym-transport
mcginty/iroh-ble-transport

None of them does use transport_bias, not even in examples. Most of them
just remove the ip transport. So this won't break any downstream crate I
am aware of.

## 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-05-06 16:27:58 +02:00
Franz Heinzmann 1dc6fe837a feat(iroh, iroh-relay)!: support setting auth tokens for relays (#4205)
## Description

This adds an `auth_token` field to `RelayConfig`. The client sends the
token to the relay so the relay can decide whether to admit the
connection.

On native targets the token is sent as an `Authorization: Bearer TOKEN`
header on the WebSocket upgrade request. In browsers, where you can't
set headers on WebSocket requests, it is sent as a `?token=TOKEN` query
parameter instead.

On the server side, `ClientRequest::auth_token()` (passed to the
`AccessConfig::Restricted` hook) returns the token regardless of which
path the client used. It accepts the `Bearer` scheme case-insensitively,
walks all `Authorization` headers, and falls back to the `token` query
parameter if no header carries one.

## Breaking Changes

None against 0.98. Against main:

* removed: `iroh_relay::client::ClientBuilder::query_param(key, value)`
(was added in #4207). Replaced by [`ClientBuilder::auth_token`] for the
currently intended use case; arbitrary URL query parameters on the
upgrade request are no longer settable on the client for now.
* changed: `iroh_relay::server::AccessCheck` type alias. The returned
future may now borrow from the `&ClientRequest` argument: `for<'a>
Fn(&'a ClientRequest) -> Pin<Box<dyn Future<Output = Access> + Send +
'a>>` instead of `Fn(&ClientRequest) ->
n0_future::future::Boxed<Access>`. Closures that build the future with
`async move { ... }.boxed()` keep compiling.


## Notes & open questions

* How do we want people to set a relay auth token in iroh? This PR does
it via a new field in `RelayConfig` (plus `RelayMap::with_auth_token` to
apply one token across all entries). That works for entries in the relay
map, but there's no way to set a token for a relay URL that wasn't in
the map (e.g. one that comes back from address lookup).
* There's no way to surface a failed authentication to the user
currently, all you get is warn logs.

## 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.
- [ ] Tests if relevant.
- [x] All breaking changes documented.
2026-05-06 15:07:10 +02:00
Franz Heinzmann 88c9eedd0f test(iroh-relay): integration tests for embedding the relay (#4206)
## Description

Adds two integration tests that demonstrate embedding the relay inside
an external HTTP server:

- `tests/relay_hyper.rs`: serves a `RelayServiceWithNotify` directly via
hyper.
- `tests/relay_axum.rs`: uses axum, its `Router` and its
`WebSocketUpgrade` for the `/relay` route. Then passes the client stream
to the relay `Clients`. Does not use `RelayServeWthNotfy`.

Also exports the type aliases
`iroh_relay::server::http_server::BytesBody`, `HyperError`, and
`HyperResult` so that external code can name the response and error
types of `RelayServiceWithNotify`'s hyper service.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-05-06 11:53:21 +02:00
Asmir Avdicevic 5f578daac1 chore(ci): fix docker releases and musl linking (#4230) 2026-05-06 11:15:45 +02:00
Franz Heinzmann 217ec7cc3b refactor(iroh): adapt for noq::Closed return type of Connection::closed (#4229)
## Description

Updates `noq` and adapts iroh to the changes in
https://github.com/n0-computer/noq/pull/617 by reexporting
`noq::Closed`.

## Breaking Changes

* changed: The `OnClosed` future returned from
`iroh::endpoint::WeakConnectionHandle::closed` now resolves to
`iroh::endpoint::Closed`, a struct with public fields for the close
reason, connection stats, and path stats.

## Notes & open questions

It would be nice to have the `TransportAddr` available for the path
stats, but we don't have that info available for paths that were already
closed earlier. Use the new APIs in #4188 instead if this needed.

## 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-05-05 19:13:52 +02:00
Franz Heinzmann 54e4a291d2 fix(iroh-dns): Document how to use iroh on Android and run tests in Android emulator (#4183)
## Description

When constructing our DnsResolver we call into
`hickory_resolver::read_system_conf`, which on Android uses JNI by going
through `ndk_context` to call `LinkProperties.getDnsServers()`. This
works fine when `ndk_context` has been initialized with a real `JavaVM`
and `Application` context but panics unconditionally if `ndk_context`
has not been initialized. The initialization can either be done manually
or, usually, through a glue crate like `android-activity` or `ndk-glue`.

This means that constructing an iroh endpoint on Android panics if
`ndk_context` hasn't been initialized.

This PR documents the Android requirement and adds an init helper. Using
iroh on Android requires `ndk_context` to be initialized before the
resolver is constructed, otherwise the build panics at the JNI boundary.
The PR adds docs around that on `DnsResolver`,
`Builder::with_system_defaults`, and `Endpoint`, and re-exports the
`ndk_context` init function as `iroh_dns::install_android_jni_context`
so that consumers can init manually. The system-DNS fallback log was
also bumped from `debug` to `warn` so the silent-fallback path actually
surfaces.

Finally, this PR adds CI to run the full iroh test suite in the Android
emulator. When running unit tests in the emulator, we don't have a Java
context. To bypass the panic in debug builds (which is what the test
suite runs as) we wrap the JNI call in `std::panic::catch_unwind` and
let the resolver fall back to public DNS if the ndk_context call panics
(which it does). Release builds let the panic propagate, since
uninitialized `ndk_context` in production is a programming error and
should surface loudly. This is a little ugly I admit, but I have not
found another way around this. Very open to suggestions. But - the test
suite passes! Had to do a couple of tricks to properly wait for
networking on the GitHub-hosted emulator. One regression test in
`iroh/src/socket.rs` is ignored on Android because the emulator's
network stack flakes on rapid rebinds. Will open an issue for that.

## Breaking Changes


## Notes & open questions

Follow-up PRs: 
* #4209 adds an APK-based smoke test that exercises the JNI path through
a real `NativeActivity` against `ConnectivityService`.

## 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-05-05 15:47:33 +02:00
Floris Bruynooghe cb8775cbf6 refactor(iroh): express IPv6 ULA constants in hex (#4225)
## Description

We see those as hex in the logs because that is how you display an
IPv6 address. So write them in hex, it's easier to recognise things
that way.

## Breaking Changes

none

## Notes & open questions

Please double check I didn't make any mistakes converting decimal to
hex.

## 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.
2026-05-05 14:42:27 +02:00
00f961bb00 feat(iroh)!: update QNT config defaults & update to latest noq main (#4213)
## Description

- Updates to latest noq main & applies fixes
- Renames `QuicTransportConfig::set_max_remote_nat_traversal_addresses`
to `QuicTransportConfig::max_remote_nat_traversal_addresses` for
consistency with noq & other configuration function names
- Changes the defaults for maximum number of QNT addresses and multipath
paths according to discussions in
https://github.com/n0-computer/noq/issues/613 and
[here](https://github.com/n0-computer/noq/pull/620#pullrequestreview-4196031518)

## Breaking Changes

- Renamed `QuicTransportConfig::set_max_remote_nat_traversal_addresses`
to `QuicTransportConfig::max_remote_nat_traversal_addresses`

## 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] All breaking changes documented.
- [x] List all breaking changes in the above "Breaking Changes" section.

---------

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-05-05 13:54:38 +02:00
Franz Heinzmann eebb60fef9 refactor!: Mark more items as non-exhaustive (#4226)
## Description

Adds `#[non_exhaustive]` to more public structs and enums, so that
fields and variants can be added without a breaking change.

For each struct that has at least one field without a reasonable default
a `new()` constructor is added that takes those required values and
leaves the rest at their defaults. Remaining fields are then assigned
through their public field directly. Structs that already had a
`Default` impl keep it.

Internal callers (the `iroh-relay` binary, `iroh::test_utils`, and the
patchbay integration tests) are updated to use the new constructors and
field assignment instead of struct literals.

## Breaking changes

`iroh-base`:

- `iroh_base::endpoint_addr::CustomAddrParseError` is now
`#[non_exhaustive]`.

`iroh`: 

- `iroh::endpoint::BeforeConnectOutcome` is now `#[non_exhaustive]`.
- `iroh::endpoint::AfterHandshakeOutcome` is now `#[non_exhaustive]`.

`iroh-relay`:

- `iroh_relay::server::ServerConfig` is now `#[non_exhaustive]`. Already
had a `Default` impl; construct via `ServerConfig::default()` and assign
fields, e.g. `let mut c = ServerConfig::default(); c.relay =
Some(...);`.
- `iroh_relay::server::RelayConfig` is now `#[non_exhaustive]`. Added
`RelayConfig::new(http_bind_addr: impl Into<SocketAddr>) -> Self`, which
leaves `tls = None`, `limits = Limits::default()`, `key_cache_capacity =
None`, and `access = AccessConfig::Everyone`.
- `iroh_relay::server::AccessConfig` is now `#[non_exhaustive]`.
- `iroh_relay::server::QuicConfig` is now `#[non_exhaustive]`. Added
`QuicConfig::new(bind_addr: impl Into<SocketAddr>) -> Self`.
- `iroh_relay::server::TlsConfig` is now `#[non_exhaustive]`. Added
`TlsConfig::new(https_bind_addr: impl Into<SocketAddr>, cert:
CertConfig) -> Self`.
- `iroh_relay::server::Limits` is now `#[non_exhaustive]`. Use the
`Default` impl and then set fields as needed.
- `iroh_relay::server::ClientRateLimit` is now `#[non_exhaustive]`.
Added `ClientRateLimit::new(bytes_per_second: NonZeroU32) -> Self`,
which leaves `max_burst_bytes = None`.
- `iroh_relay::server::CertConfig` is now `#[non_exhaustive]`.
- `iroh_relay::server::client::Config<S>` is now `#[non_exhaustive]`.
Added `Config::new(endpoint_id: EndpointId, stream: RelayedStream<S>,
protocol_version: ProtocolVersion) -> Self`, which fills `write_timeout`
from `defaults::timeouts::SERVER_WRITE_TIMEOUT` and `channel_capacity`
from `protos::relay::PER_CLIENT_SEND_QUEUE_DEPTH`.
- `iroh_relay::http::ProtocolVersion` is now `#[non_exhaustive]`.
- `iroh_relay::protos::handshake::Mechanism` (cfg `server`) is now
`#[non_exhaustive]`.

`iroh-dns-server`:

- `iroh_dns_server::config::DnsConfig` is now `#[non_exhaustive]`. Added
`DnsConfig::new(port: u16, default_soa: String, default_ttl: u32,
origins: Vec<String>) -> Self`, which leaves `bind_addr = None` and the
apex `rr_a`, `rr_aaaa`, `rr_ns` records at `None`. There is no `Default`
impl: SOA, origins and port are deployment-specific and have no neutral
default.

## 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-05-05 12:02:44 +02:00
Franz Heinzmann 927addfdb3 refactor(iroh)!: Make Source private and trim its variants (#4227)
## Description

`iroh::endpoint::Source` wasn't used in any public API anymore, so this
makes the enum `pub(crate)`. We also had many unused variants, those are
removed. The `_0: Private` marker is removed as well now that the enum
is not public anymore.

Also removes the `IpPort` type from `socket::remote_map`, which was
`pub` but neither re-exported nor used anywhere.

## Breaking changes

- removed: `iroh::endpoint::Source`. The type is now `pub(crate)` in
`iroh::socket::remote_map` and is not part of the public API.

## 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-05-05 11:28:46 +02:00
dependabot[bot]andFriedel Ziegelmayer b8d3f4bb7d chore(deps): bump simple-dns from 0.9.3 to 0.11.2 (#4169)
Bumps [simple-dns](https://github.com/balliegojr/simple-dns) from 0.9.3
to 0.11.2.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/ba352f6e819e09538e25cc315ff75c65368f27ce"><code>ba352f6</code></a>
update version and changelog</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/6ad40f1d2e63c553fc97fa5ab5534955a9c9304d"><code>6ad40f1</code></a>
Fix name compression when the offset is too large</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/32b2ad2028e32b391005e4f43be44f24bdf5ad37"><code>32b2ad2</code></a>
update version and changelog</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/c96d11ec38ca483ae49730d6278b51b7e6f0b4bf"><code>c96d11e</code></a>
Fix macos workflow (<a
href="https://redirect.github.com/balliegojr/simple-dns/issues/52">#52</a>)</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/baf845f73c0585f374880372ebeca9682551ebd1"><code>baf845f</code></a>
fix CharacterString display implementation to prevent panic!</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/245e88147375e335f7c9da91ce1ecf83f7045de5"><code>245e881</code></a>
do not use rust-lld for bind9 tests</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/68ac4df22bdda7cbda6f55be47aebd8a1b363f69"><code>68ac4df</code></a>
copy license for all crates</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/78c9a11f4c55582870c496a2e01bbfb87183dec1"><code>78c9a11</code></a>
update version and changelog</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/f2bd57c18d8a7155d21c69952fcece5e075a405f"><code>f2bd57c</code></a>
move bench to a separate crate</li>
<li><a
href="https://github.com/balliegojr/simple-dns/commit/e210ce3e879fff38233c9cc82ff09caaddcacdca"><code>e210ce3</code></a>
fix workflow</li>
<li>Additional commits viewable in <a
href="https://github.com/balliegojr/simple-dns/compare/simple-dns/0.9.3...simple-dns/0.11.2">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>
Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-05-04 13:28:34 +02:00
Friedel Ziegelmayer 67a23a8abf chore(deps): update to latest hickory (#4224) 2026-05-04 13:14:05 +02:00
Teoh Han HuiandFriedel Ziegelmayer 80dfb19383 feat(iroh-base): impl From<&[u8; 32]> for SecretKey (#4181)
## Description

Add `From<&[u8; 32]>` implementation for `SecretKey`

## 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.
- [ ] 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-05-04 11:52:22 +02:00
dependabot[bot] 2b99847263 chore(deps): bump lru from 0.16.3 to 0.18.0 (#4218)
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.16.3 to 0.18.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md">lru's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/jeromefroe/lru-rs/tree/0.18.0">v0.18.0</a> -
2026-04-27</h2>
<ul>
<li>Fix unconstrained lifetime in
<code>get_or_insert_mut_ref</code>.</li>
</ul>
<h2><a
href="https://github.com/jeromefroe/lru-rs/tree/0.17.0">v0.17.0</a> -
2026-04-14</h2>
<ul>
<li>Upgrade <code>hashbrown</code> to 0.17.0 and update MSRV to
1.85.0.</li>
</ul>
<h2><a
href="https://github.com/jeromefroe/lru-rs/tree/0.16.4">v0.16.4</a> -
2026-04-13</h2>
<ul>
<li>Add <code>get_or_insert_with_key</code> and variants.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/dac07e3edc896f6caec5180ac179b89044399c59"><code>dac07e3</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/234">#234</a>
from jeromefroe/jerome/prepare-0-18-0-release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/03353156d0f1a4c5f79001bcbc59bb2ff8f6b041"><code>0335315</code></a>
Prepare 0.18.0 release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/e40bbdc53db7c433e0d8f46cfd903485c8091eac"><code>e40bbdc</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/233">#233</a>
from paolobarbolini/get_or_insert_mut_ref-unconstrain...</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/a615a5b29f21de6dd222394da91ab4e2c6918016"><code>a615a5b</code></a>
Fix unconstrained lifetime in
<code>LruCache::get_or_insert_mut_ref</code></li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/13321a9f96059b2355aa3697c2a1613b16fd83e5"><code>13321a9</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/232">#232</a>
from jeromefroe/jerome/prepare-0-17-0-release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/f7d0ecea8e85d4d912b6ee7caf6f31cf72195a37"><code>f7d0ece</code></a>
Prepare 0.17.0 release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/2d3d6d51db940e791d69cc4afef8896f1170863e"><code>2d3d6d5</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/231">#231</a>
from xtqqczze/deps/hashbrown</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/346e2fea450e32e69d5ee67aed4ac2b30b23f6fd"><code>346e2fe</code></a>
Bump hashbrown to 0.17.0</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/1302b4e5b5bbcffb1f7f9537ec08cc614f16a8b1"><code>1302b4e</code></a>
Update MSRV to 1.85.0</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/d8c7f5ca51a86a8f561c14e21508a0f757aa05ad"><code>d8c7f5c</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/230">#230</a>
from jeromefroe/jerome/prepare-0-16-4-release</li>
<li>Additional commits viewable in <a
href="https://github.com/jeromefroe/lru-rs/compare/0.16.3...0.18.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=lru&package-manager=cargo&previous-version=0.16.3&new-version=0.18.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-04 09:28:55 +02:00
Emil Sayahi 800ac00d42 chore(deps): update sha2 and sha1 to 0.11 2026-05-04 09:28:29 +02:00
Franz Heinzmann 3e0c25f252 chore(ci): enforce external type allow-list in public API (#4204)
## Description

Foreign types in our public API block semver-breaking updates of those
crates during 1.0. #3177 tracks reducing that surface to a curated
allow list.

This adds a `check_external_types` CI job that runs
[`cargo-check-external-types`] against all workspace crates against a
shared `external-types.toml` at the workspace root.

Closes #3177.

[`cargo-check-external-types`]:
https://github.com/awslabs/cargo-check-external-types

## 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.
2026-04-30 17:52:28 +02:00
Rüdiger Klaehn c953d9b398 refactor: prefer loop over zip (#4215)
## Description

Zip is slow, so we already prefer a manual loop in one place. This makes
loop use consistent over all similar places.

Possibly more notably there is a semantic change. Functions will now
always panic early when given buffers of different size, whereas zip
just ignores the extra items in the second and third buffer.

## 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-30 15:22:56 +02:00
Rüdiger Klaehn eb588eccc8 refactor: Prefer release assert for locations where a bounds check follows (#4214)
## Description

Prefer release assert for locations where a bounds check follows. The
compiler has to insert a bounds check in release mode for the array
access if the bounds check is not present, so there is no runtime cost
for this.

Also it gives better panic messages in case of a buggy noq_udp UDP
socket impl or a very broken custom transport impl.

## 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-30 13:58:36 +02:00