Commit Graph
2513 Commits
Author SHA1 Message Date
Frando b40ebdfd8e dont make the addr types non_exhaustive 2026-06-15 10:10:19 +02:00
Frando 18d6a4657b fixup 2026-06-15 10:07:20 +02:00
Frando bf6c2327ce improve docs 2026-06-15 09:57:26 +02:00
Frando 8ec0ee5f0b Merge remote-tracking branch 'origin/main' into Frando/addr-non-exhaustive 2026-06-15 09:53:20 +02:00
Franz Heinzmann 9afd2bc198 feat(iroh-relay): Allow multiple hostnames with Let's encrypt TLS (#4337)
## Description

This allows to set `hostname = ["relay.foo.org", "relay.bar.org"]` in
the iroh-relay TOML config.
Setting a single string like previously, `hostname = "relay.foo.org"` ,
is still accepted as well, so this is not a breaking change to config
formats.

It also adds enviroment variables to override the ACME directory URL to
allow using the ACME adaptor with other servers than letsencrypt.

Finally, this adds a test script that tests the setup with a
locally-running `pebble` ACME server. I confirmed locally that it works.
Not sure if we want to run it in CI as well.

## 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.
- [x] Tests if relevant.
2026-06-15 09:15:43 +02:00
Friedel Ziegelmayer 8e25ecb30f feat: update relay urls to 1.0 stable (#4341) 2026-06-14 19:02:11 +02:00
Franz Heinzmann a714a10e0f Merge branch 'main' into Frando/addr-non-exhaustive 2026-06-12 13:17:53 +02:00
dependabot[bot] b0fcd4012c chore(deps): bump mainline from 6.2.0 to 7.0.0 (#4331)
Bumps [mainline](https://github.com/pubky/mainline) from 6.2.0 to 7.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pubky/mainline/releases">mainline's
releases</a>.</em></p>
<blockquote>
<h2>v7.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>refactor(rpc): simplify put query completion by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/103">pubky/mainline#103</a></li>
<li>feat(async)!: return PUT outcome from raw put by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/105">pubky/mainline#105</a></li>
<li>fix(rpc)!: stop GET queries from echoing pending PUTs by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/106">pubky/mainline#106</a></li>
<li>feat(dht): add detailed mutable GET outcome by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/107">pubky/mainline#107</a></li>
<li>feat(async)!: return <code>PutOutcome</code> from mutable puts by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/109">pubky/mainline#109</a></li>
<li>feat(dht): deprecate blocking operations by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/110">pubky/mainline#110</a></li>
<li>chore: v7.0.0 by <a
href="https://github.com/andrei-21"><code>@​andrei-21</code></a> in <a
href="https://redirect.github.com/pubky/mainline/pull/111">pubky/mainline#111</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pubky/mainline/compare/v6.2.0...v7.0.0">https://github.com/pubky/mainline/compare/v6.2.0...v7.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pubky/mainline/blob/main/CHANGELOG.md">mainline's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/pubky/mainline/compare/v6.2.0...v7.0.0">7.0.0</a>
- 2026-06-08</h2>
<h3>Added</h3>
<ul>
<li>Add <code>PutOutcome</code> to report the target and number of DHT
nodes that acknowledged a successful PUT.</li>
<li>Add <code>AsyncDht::get_mutable_detailed()</code> with
<code>GetMutableOutcome</code> diagnostics for queried nodes, valid
values, empty responses, invalid responses, KRPC errors, and
timeouts.</li>
</ul>
<h3>Changed</h3>
<ul>
<li><strong>BREAKING</strong>: <code>AsyncDht::put()</code> now returns
<code>PutOutcome</code> instead of a raw <code>Id</code>.</li>
<li><strong>BREAKING</strong>: <code>AsyncDht::put_mutable()</code> now
returns <code>PutOutcome</code> instead of a raw <code>Id</code>.</li>
<li>Mutable GET queries no longer echo locally pending mutable PUT
values; GET results now only come from DHT node responses.</li>
</ul>
<h3>Deprecated</h3>
<ul>
<li>Deprecate blocking <code>Dht</code> operation methods and
<code>GetIterator</code>; use the async API via
<code>Dht::as_async()</code> instead.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pubky/mainline/commit/e77f8060a947736a9f97d4f3001ad1b871f7bb29"><code>e77f806</code></a>
chore: v7.0.0 (<a
href="https://redirect.github.com/pubky/mainline/issues/111">#111</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/8e777bc18b3d0958f646fe29895f33ff65490cb4"><code>8e777bc</code></a>
feat(dht): deprecate blocking operations (<a
href="https://redirect.github.com/pubky/mainline/issues/110">#110</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/83252185cd1997c9ddee2bc6342d7243d40ded21"><code>8325218</code></a>
feat(async)!: return <code>PutOutcome</code> from mutable puts (<a
href="https://redirect.github.com/pubky/mainline/issues/109">#109</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/1e38626a7d020e68f5df5ecead8245001d5a60ec"><code>1e38626</code></a>
feat(dht): add detailed mutable GET outcome (<a
href="https://redirect.github.com/pubky/mainline/issues/107">#107</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/285c1fcf2f7bd5bba0b8836fb32890321426277e"><code>285c1fc</code></a>
fix(rpc)!: stop GET queries from echoing pending PUTs (<a
href="https://redirect.github.com/pubky/mainline/issues/106">#106</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/96606a9a17d516a096c3494c3b1ef5a4e4cd8b88"><code>96606a9</code></a>
feat(async)!: return PUT outcome from raw put (<a
href="https://redirect.github.com/pubky/mainline/issues/105">#105</a>)</li>
<li><a
href="https://github.com/pubky/mainline/commit/e81c8a1048f1bed4951f9f765a522fc6021bc949"><code>e81c8a1</code></a>
refactor(rpc): simplify put query completion (<a
href="https://redirect.github.com/pubky/mainline/issues/103">#103</a>)</li>
<li>See full diff in <a
href="https://github.com/pubky/mainline/compare/v6.2.0...v7.0.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-06-12 12:18:10 +02:00
Frando c319e1e00a fix(iroh)!: add missing export and mark unstable-custom-transport addr types as non_exhaustive 2026-06-12 11:11:59 +02:00
Franz Heinzmann 710d03a634 docs(iroh): improve readme (#4329)
## Description

The [README of the iroh
crate](https://github.com/n0-computer/iroh/tree/main/iroh) is the first
thing people see on https://crates.io/crates/iroh or
https://lib.rs/iroh, and we should improve it.

Right now it mostly talks about structured events, which is a very minor
thing in the grand scheme of things. And it has no code example.

This PR improves the README. Happy to discuss or iterate.
2026-06-11 16:13:45 +02:00
Philipp Krüger 2f41f406e8 chore(iroh): Update to latest noq main (#4333)
## Description

Updates to the latest noq main, especially due to this bug fix:
https://github.com/n0-computer/noq/pull/695

That fix makes `switch_client_dual_to_v4` non-flaky.

## Breaking Changes

None

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-06-11 15:59:31 +02:00
Franz Heinzmann 01e74bc1ec docs: general cleanup and fixes (#4328)
## Description

This is a cleanup pass over all docs of public items. Fixes typos, odd
grammar, non-adherence to doc guidelines, and other minor things.
2026-06-11 14:31:59 +02:00
400264e319 feat(iroh-relay): Add Bearer token access control without an external service (#4326)
## Description

This PR adds a new `AccessConfig::SharedToken(Vec<String>)` variant to
the `iroh-relay` configuration,
allowing self-hosted relays to require a shared bearer token from
connecting
clients, without using an external auth service.

- Clients authenticate via `Authorization: Bearer <token>` header or
`?token=` query param,
using the existing `RelayConfig::with_auth_token()` /
`RelayMap::with_auth_token()` API;
- Token can be set via config file (`access.shared_token = ["token-a",
"token-b"]`) or the
`IROH_RELAY_ACCESS_TOKEN` environment variable (**the env var takes
precedence**);
- Empty token is rejected at startup;
- A token set to the empty string, will make the server fail to start.

[See related
discussion](https://github.com/n0-computer/iroh/discussions/4316)

## Breaking Changes

None.

## Notes & open questions

- As we stated in the discussion, using an external service should
always be considered the best choice for production. The static token
variant is still useful for simpler deployments.
- Supported the token list in config, as suggested by fokx

## Change checklist
- [x] Self-review
- [x] Documentation updates
- [x] Tests

Co-authored-by: fokx <36614441+fokx@users.noreply.github.com>

---------

Co-authored-by: Franz Heinzmann <frando@unbiskant.org>
2026-06-11 14:13:56 +02:00
Floris BruynoogheandPhilipp Krüger a24e6a7fbc test: Mark a patchbay test as flaky (#4322)
## Description

This test is flaky because QAD fails to establish a connection within
3s due to the packet loss. At that point there's not relay server
until at least the next net-report which only runs after about 30s.

The right fix for this is for net-report to be more streaming instead
of running on a schedule. So iroh can respond to events from changed
network conditions properly.

## Breaking Changes

n/a

## Notes & open questions

See #4321 to track this.

## Change checklist

- [x] Self-review.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-06-11 13:42:11 +02:00
Rüdiger Klaehn 6406e077a9 feat: Allow configuring NetReport (#4020)
## Description

This allows us to disable captive portal checks and https probes on
esp32

## Breaking Changes

None

## Notes & open questions

Should we also allow for disabling QAD probes? I was thinking we leave
it for later. The config object is non-exhaustive.

## 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-06-11 12:56:41 +02:00
Franz Heinzmann 33a92f13cf deps: update ed25519-dalek and curve25519-dalek (#4324)
## Description

Updates `ed25519-dalek` to `=3.0.0-rc.0` and `curve25519-dalek` to
`=5.0.0-rc.0`. Not sure if the final release will be made in time. We
can do a minor release though once the final version comes out. It will
be "semi-breaking" but there's nothing we can do about it then (builds
will break for people who have `=3.0.0-rc.0` in their *own* Cargo.toml).
2026-06-11 11:58:05 +02:00
Franz Heinzmann 95111f0c88 chore: update check-external-types (#4323)
## Description

Updates `check-external-types` to the latest version and adapt nightly
toolchain. Also don't use cargo-make's auto-install feature.
2026-06-11 11:18:44 +02:00
Rüdiger Klaehn ba81a72535 fix(iroh): add global address validation token store (#4317)
## Description

This makes the validation token store global for the endpoint. Before it
was recreated on each connection, which defeats the purpose of the
mechanism.

I had to do this to make the example in my blog post (
https://github.com/n0-computer/iroh.computer/pull/464 ) work at all.

For context: This is the client side store for NEW_TOKEN address
validation tokens that need to be presented on new connections for the
mechanism to work.

The mechanism is currently disabled on the **server side** because we
don't set the "bloom" feature flag on noq-proto ( noq-proto = { version
= "=1.0.0-rc.1", default-features = false } ). So if we connect to iroh
nodes with default features we *never* store any tokens because we never
get any.

## Breaking Changes

None

## Notes & open questions

Note: this whole thing feels weird. Since NEW_TOKEN tokens are of very
little utility for iroh connections (reason see blog post) I would
prefer if we would really disable the mechanism both on the client side
and the server side.

To do that I would like to move from the current approach of `Arc<dyn
TokenStore>` with a noop impl `NoneTokenStore` to an `Option<Arc<dyn
TokenStore>>` which is just `None` if the mechanism is disabled. The
same for the server side where we have `Arc<dyn TokenLog>` and
`NoneTokenLog`.

Note: we *can* change this without breaking the public API, but that
means that we still keep the NoneXXX impls around. See
https://github.com/n0-computer/noq/tree/rklaehn/refactor-token-log-2 .
But then ideally you would want to remove them and also provide an
option via the builder to disable them, which would be a public API
change.

Disabling it by default would mean that we would need a new public API
to enable it on the client side. This would be used rarely, only in
cases where you care about 0-rtt *and* payloads for 0-rtt that are big
enough to exceed the 3x amplification limit. I got some real world use
cases for this that I personally care about, involving a DHT, but most
iroh users would never have to touch this.

Note: when I say we should disable this by default I mean in iroh. In
noq as a generic QUIC impl this makes more sense to enable since normal
client server QUIC connections frequently have long cert chains that
exceed the amplification limit. Again, for context see the blog post
draft.

## 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-06-11 09:00:29 +02:00
Rüdiger Klaehn 190374094f fix(iroh-dns): use portable_atomic::AtomicU64 for 32-bit targets (#4320)
## Description

This was an oversight. In general we should prefer potable_atomic since
it falls back to normal atomics on 64 bit but also works on 32 bit
platforms.

I think this should be uncontroversial since we already use portable
atomics elsewhere.

Needed to get iroh to work on esp32 and other 32 bit platforms.

## Breaking Changes

None

## Notes & open questions

Note: this is not a breaking change and does not need to go in before
1.0

## 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-06-10 17:56:57 +02:00
Franz Heinzmann 0a5ce758a7 fix(iroh): don't kill noq endpoint on first transport recv error (#4314)
## Description

This changes iroh's implementation of `AsyncUdpSocket::poll_recv` to not
forward transport recv errors unconditionally.

When `AsyncUdpSocket::poll_recv` returns an error, noq aborts the
`EndpointDriver` (unless the error is `io::ErrorKind::ConnectionReset`,
in which case the driver continues). Aborting the `EndpointDriver` is
final, there is no recovery path from that in noq. An endpoint with a
dead driver will silently fail on most operations thereafter.

In iroh, we have multiple transports. Before this change, a single error
in any transport would kill the `noq::Endpoint`. We do not want this:
Even if the failure of a transport is real and final, there might still
be other transports. Additionally, our IP transports can recover from
errors, e.g. when a major network change notification triggers a rebind.
Finally, error semantics and whether they are final or transient are
obscure and platform-specific, see e.g. #4297.

Instead, we swallow and warn-log errors by default. If *all* configured
transports produce an error, we increment a counter. If the counter
reaches 8, we give up and return an error from `poll_recv`. We'll have
to see in practice if the number 8 is a good compromise here. The idea
is to not die on transient errors right away, but also not keep polling
a dead system forever.

In any case, with this change the noq Endpoint will survive as long as
*any* transport does not produce errors. Whereas before, we would kill
the endpoint even if there are healthy transports.

## 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-06-10 14:21:59 +02:00
Franz Heinzmann b1e91e3d39 feat(iroh-relay)!: Allow setting a custom ServerCertVerifier and rename CaRootsConfig to CaTlsConfig (#4300)
## Description

This adds a new mode to fully customize the `rustls::ServerCertVerifier`
used for non-iroh TLS requests throughout iroh, and renames
`CaRootsConifg` to `CaTlsConfig` (with a deprecated alias to keep
backwards compat). A new mode `CaTlsConfig::custom_server_cert_verifier`
allows to supply a callback that gets passed a `CryptoProvider` and
returns a `Arc<dyn ServerCertVerifier>`.

It is indended for advanced usecases like those described in #2901.

Fixes #2901
cc @link2xt 

## Breaking Changes

None.

The following items have been deprecated:

- `iroh_relay::tls::CaRootsConfig` (also re-exported as
`iroh::tls::CaRootsConfig`), use `iroh_relay::tls::CaTlsConfig` instead
(also re-exported as `iroh::tls::CaTlsConfig`).
- `iroh_relay::tls::CaRootsConfig::custom`, use
`CaTlsConfig::custom_roots` instead
- `iroh::endpoint::Builder::ca_roots_config`,
use`iroh::endpoint::Builder::ca_tls_config` instead

## 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.
- [x] All breaking changes documented.
2026-06-10 13:34:45 +02:00
Rüdiger Klaehn 94f4b2f68c refactor(iroh): Don't log at warn level if the address lookup isn't configured. (#4318)
## Description

Don't log at warn level if the address lookup isn't configured.

This is a conscious choice that you don't want to be nagged about all
the time.

## Breaking Changes

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

## Notes & open questions

Note: another option would be to remove the
AddressLookupFailed::NoServiceConfigured entirely, but that would be
breaking a public API. So I just log that particular error at less than
warn to get rid of the log spam.

## 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-06-10 10:00:17 +02:00
Rüdiger Klaehn 64b9316bf3 fix: Fix condition for retry warning. (#4307)
## Description

Fix condition for retry warning. We want to warn if
remote_addr_validated is true, but currently we warn if
remote_addr_validated is false.

## 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-06-09 09:50:50 +02:00
Franz Heinzmann 9a79782eec refactor(iroh): improve tracing logs (#4313)
## Description

Did a quick pass over tracing logs when running the transfer example
with `RUST_LOG=iroh=debug`.

* Remove some nearly-duplicate lines by demoting one of the duplicates
to `trace`
* Remove duplicate `iroh::_event` for relay connections
* Remove duplicate span qualifier for pkarr publish


## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-06-08 14:47:23 +02:00
Franz Heinzmann 3cbc1a69cd refactor(iroh): minor cleanups to reqwest setup (#4311)
## Description

Minor cleanups to the reqwest client builder util function:
* use non-deprecated `tls_backend_preconfigured` instead of
`use_preconfigured_tls` (change in reqwest 0.13)
* no need to wrap the DNS resolver in an Arc (change in reqwest 0.13)
* improve docs

## Change checklist

- [x] Self-review.
2026-06-08 11:36:33 +02:00
Franz Heinzmann 07f1d1ae4a refactor(iroh): use n0_future::MaybeFuture instead of own version (#4310)
## Description

We upstreamed `MaybeFuture` to `n0-future`, so let's use it and remove
our own version in iroh's util module.

## Change checklist
- [x] Self-review.
2026-06-08 11:11:13 +02:00
Franz Heinzmann bab6a43a2a fix(iroh-relay): Connect IPv4 and IPv6 concurrently (happy eyeballs) (#4299)
## Description

Currently the relay client resolves a relay's hostname to a single
address and dials
only that one. A `prefer_ipv6` flag decides whether we query for an A or
AAAA record.
If the DNS query returns an unreachable AAAA record for whatever reason,
or we somehow
end in a state where `prefer_ipv6` is true but the machine does not
actually support IPv6,
then dialing the relay fails.

This PR fixes this by resolving both A and AAAA records and racing them
happy-eyeballs style: the addresses are tried in preference order, each
dial starting a short delay after the previous, and the
first connection to succeed wins while the rest are cancelled. The same
race
covers both direct and proxied relay connections.

Fixes #4069

## Notes & open questions

Also fixes a unrelated doc comment that was very weirdly written and
referred to, I think, some configuration from a very long time ago.

## 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-06-08 09:31:14 +02: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