mirror of
https://github.com/n0-computer/iroh.git
synced 2026-12-04 08:01:34 +00:00
f904fc3db506eaf8fdf2c9275b95f945dcdcd2bf
2416
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f904fc3db5 |
refactor(iroh)!: use ArcSwap in DnsResolver for synchronous reset (#4141)
## Description `DnsResolver::reset` was `async` and awaited a write lock on the inner `RwLock<dyn Resolver>`. The socket actor's network-change handler awaited it, blocking the actor for the duration of the reset. This means we would potentially block the main actor loop for network IO because the write lock can only be acquired once all reads are done, and the reads are blocked for the duration of a DNS lookup (limited to `2s` usually). This change stores the resolver in `ArcSwap<Box<dyn Resolver>>` instead of `RwLock`. The `reset` call can now become synchronous - we build a fresh resolver and atomically swap it in via `compare_and_swap`. A `tokio::sync::Notify` wakes any in-flight lookup so it retries against the new resolver. Lookups go through an internal `op` helper that races the lookup future, the reset notification, and a per-attempt timeout in a biased `select!`. The `notified` future is enabled before the resolver is loaded, which together with the swap-then-notify ordering in `reset` ensures that in case of a reset all running futures are aborted and restarted against the new resolver. Under concurrent `reset` calls only the first CAS lands and only the winner notifies. Losers drop their freshly-built resolver. This is fine, and won't happen in practice because `reset` calls are serialized through the socket actor loop. ## Breaking Changes - changed: `iroh_relay::dns::Resolver::reset` signature changed from `fn reset(&mut self)` to `fn reset(&self) -> Box<dyn Resolver>`. Implementations now return a fresh resolver rather than mutating in place. - changed: `iroh_relay::dns::DnsResolver::reset` and `DnsResolver::clear_cache` are no longer `async`. - changed: `DnsError::Timeout` no longer carries a `tokio::time::error::Elapsed` source. The `From<tokio::time::error::Elapsed>` impl is removed. ## Notes & open questions The `op` timeout is per-attempt: a reset-triggered retry starts a fresh `sleep(timeout)`. This is intentional, since a fresh attempt against a just-changed network should not inherit the previous attempt's remaining time, but it does mean the wall-clock total can exceed `timeout`. I think this is fine and preferable. ## Change checklist - [x] Self-review. - [x] Documentation updates. - [ ] Tests if relevant. - [x] All breaking changes documented. --------- Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com> |
||
|
|
c08ccf80af |
chore(ci): introduce alt runners (#4164)
## Description We've signed up with blacksmith for a trial run to test out if the added bandwidth helps our queue times. I've selectively converted some but not all of the jobs. Will do similar on noq. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/n0-computer/codesmith/iroh/pr/4164"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-light.svg"><img alt="View in Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-in-codesmith-dark.svg"></picture></a> <sup>Codesmith can help with this PR — just tag <code>@codesmith</code> or enable autofix.</sup> - [ ] Autofix CI and bot reviews <!-- /codesmith:footer --> |
||
|
|
5dc3a064ca |
refactor: Remove the two optional address lookups (#4167)
## Description Remove the two optional address lookups Starting with the next release, they will live in https://github.com/n0-computer/iroh-address-lookups and be published as separate crates. This allows us to keep them out of the 1.0 API ## Breaking Changes - `iroh::address_lookup::MdnsAddressLookup`: removed (moved to [`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup)) - `iroh::address_lookup::MdnsAddressLookupBuilder`: removed (moved to [`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup)) - `iroh::address_lookup::DiscoveryEvent`: removed (moved to [`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup)) - `iroh::address_lookup::DhtAddressLookup`: removed (moved to [`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup)) - `iroh::address_lookup::pkarr::dht`: removed (moved to [`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup)) - `address-lookup-mdns` cargo feature: removed - `address-lookup-pkarr-dht` cargo feature: removed - `dht_address_lookup` example: removed (moved to [`iroh-mainline-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mainline-address-lookup/examples)) - `mdns_address_lookup` example: removed (moved to [`iroh-mdns-address-lookup`](https://github.com/n0-computer/iroh-address-lookups/tree/main/iroh-mdns-address-lookup/examples)) ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
6e81cab3a5 |
refactor(iroh-dns)!: don't expose simple-dns in errors (#4161)
## Description Don't expose `simple_dns` in the public errors in `iroh-dns` so that we don't depend on it in the public API. ## Breaking Changes * changed: The `source` field of `iroh_dns::SignedPacketBuildError::DnsError` and `SignedPacketVerifyError::DnsError` is now of type `n0_error::AnyError` |
||
|
|
a46d62bcbb |
refactor(iroh-relay)!: Remove http_body_util and tokio_util from public API surface (#4162)
## Description Two small iroh-relay API cleanups that reduce the public API surface: - `Server::task_handle` returned a mutable reference to an `AbortOnDropHandle<Result<(), SupervisorError>>`. It is replaced by `Server::join`, an `async` method that awaits the supervisor task and returns its result. This removes `tokio_util` from the public API of `iroh_relay::server::Server`. - The relay's internal `BytesBody` is now a boxed `hyper::body::Body<Data = Bytes, Error = Infallible>` trait object rather than a concrete `http_body_util::Full<Bytes>`. Through this, the non-1.0 crate `http_body_util` no longer is part of the public API for iroh-relay, at the cost of one additional boxing per HTTP response, which I don't think would be observable perf-wise in any way. ## Breaking Changes * removed: `iroh_relay::server::Server::task_handle(&mut self) -> &mut AbortOnDropHandle<Result<(), SupervisorError>>`. Replaced by `iroh_relay::server::Server::join(&mut self) -> Result<Result<(), SupervisorError>, JoinError>`. Callers that previously did `(&mut *server.task_handle()).await` can use `server.join().await` instead. * changed: `iroh_relay::server::http_server::BytesBody` is now `Box<dyn Send + Unpin + hyper::body::Body<Data = hyper::body::Bytes, Error = Infallible>>` instead of `http_body_util::Full<hyper::body::Bytes>`. `http_body_util` is no longer part of the public API surface. ## Change checklist - [x] Self-review. - [x] Documentation updates following the style guide - [x] All breaking changes documented. |
||
|
|
734f8e0ad4 |
refactor(iroh-relay)!: don't expose strum and num_enum in public API (#4163)
## Description Three foreign types were leaking through iroh-relay's public API via derives: `num_enum::TryFromPrimitive`, `num_enum::TryFromPrimitiveError`, and `strum::VariantArray`. Replaced with equivalents that don't impl a foreign trait: - `FrameType`: `num_enum::TryFromPrimitive` -> `strum::FromRepr` (gives an inherent `from_repr(u32) -> Option<Self>`). `IntoPrimitive` is kept since it only impls `From<Self> for u32`. - `ProtocolVersion`: drops `strum::VariantArray` in favor of a manual `ProtocolVersion::ALL`. A `cfg(test)`-only `strum::EnumCount` derive powers a drift test asserting `ALL.len() == COUNT`. ## Breaking Changes * removed: `impl TryFrom<u32> for iroh_relay::protos::common::FrameType` (and its `num_enum::TryFromPrimitive` impl). Use the inherent `FrameType::from_repr(v: u32) -> Option<FrameType>` instead. * removed: `iroh_relay::http::ProtocolVersion::VARIANTS` and the `strum::VariantArray` impl. Use `ProtocolVersion::ALL` instead, which is ordered newest-first (previously oldest-first, reversed by `all()`). ## Change checklist - [x] Self-review. - [x] All breaking changes documented. |
||
|
|
9f3c4f3304 |
refactor(iroh-relay)!: remove rustls_cert_reloadable_resolver from public API (#4157)
## Description The `rustls_cert_reloadable_resolver::ReloadingResolver` struct and its generic `Loader` type parameter were part of the public API of `iroh_relay::server`. This PR removes it from the API surface and only keeps a single public async factory function `reloading_resolver` that returns an `Arc<dyn rustls::ResolvesServerCert>`. For more configurability, users can use `rustls_cert_reloadable_resolver` themselves. ## Breaking Changes * removed: `iroh_relay::server::ReloadingResolver` (and its `init`, `shutdown`, and `reload` methods) is no longer public. The struct is now a private implementation detail of `iroh-relay`. * added: `iroh_relay::server::reloading_resolver` async factory function returning `Result<Arc<dyn ResolvesServerCert>, n0_error::AnyError>`. It takes a `&CryptoProvider`, `cert_path: PathBuf`, `key_path: PathBuf`, and `interval: std::time::Duration`. Use this in place of constructing a `ReloadingResolver` directly. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] All breaking changes documented. |
||
|
|
0527bd5494 |
refactor!: Move EndpointInfo and friends to iroh-dns (#4094)
## Description As suggested by @Frando: move more dns related stuff from iroh-relay to iroh-dns. Builds on top of https://github.com/n0-computer/iroh/pull/4026 ## Breaking Changes - `iroh_relay::dns`: moved to `iroh_dns::dns` - `iroh_relay::dns::Resolver`: moved to `iroh_dns::dns::Resolver` - `iroh_relay::dns::DnsResolver`: moved to `iroh_dns::dns::DnsResolver` - `iroh_relay::dns::Builder`: moved to `iroh_dns::dns::Builder` - `iroh_relay::dns::DnsError`: moved to `iroh_dns::dns::DnsError` - `iroh_relay::dns::DnsProtocol`: moved to `iroh_dns::dns::DnsProtocol` - `iroh_relay::dns::LookupError`: moved to `iroh_dns::dns::LookupError` - `iroh_relay::dns::StaggeredError`: moved to `iroh_dns::dns::StaggeredError` - `iroh_relay::dns::TxtRecordData`: moved to `iroh_dns::dns::TxtRecordData` - `iroh_relay::dns::N0_DNS_ENDPOINT_ORIGIN_PROD`: moved to `iroh_dns::dns::N0_DNS_ENDPOINT_ORIGIN_PROD` - `iroh_relay::dns::N0_DNS_ENDPOINT_ORIGIN_STAGING`: moved to `iroh_dns::dns::N0_DNS_ENDPOINT_ORIGIN_STAGING` - `iroh_relay::dns::DNS_TIMEOUT`: moved to `iroh_dns::dns::DNS_TIMEOUT` - `iroh_relay::endpoint_info`: moved to `iroh_dns::endpoint_info` - `iroh_relay::endpoint_info::EndpointInfo`: moved to `iroh_dns::endpoint_info::EndpointInfo` - `iroh_relay::endpoint_info::EndpointData`: moved to `iroh_dns::endpoint_info::EndpointData` - `iroh_relay::endpoint_info::AddrFilter`: moved to `iroh_dns::endpoint_info::AddrFilter` - `iroh_relay::endpoint_info::UserData`: moved to `iroh_dns::endpoint_info::UserData` - `iroh_relay::endpoint_info::MaxLengthExceededError`: moved to `iroh_dns::endpoint_info::MaxLengthExceededError` - `iroh_relay::endpoint_info::EncodingError`: moved to `iroh_dns::EncodingError` - `iroh_relay::endpoint_info::ParseError`: moved to `iroh_dns::ParseError` - `iroh_relay::endpoint_info::IROH_TXT_NAME`: moved to `iroh_dns::IROH_TXT_NAME` - `iroh_dns::attrs`: made private - `iroh_dns::attrs::IrohAttr`: made private - `iroh_dns::attrs::TxtAttrs`: made private - `iroh_dns::attrs::endpoint_id_from_txt_name`: made private ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
306c35dc4f |
refactor(iroh-relay)!: use AnyError instead of concrete websocket and postcard errors (#4156)
## Description
This hides `postcard`, `tokio_websocket` and `ws_wasm_stream` from the
public API surface of iroh-relay by replacing their errors with
`AnyError` in the public error enums.
## Breaking Changes
* changed: `iroh_relay::protos::streams::StreamError` is now a type
alias for `n0_error::AnyError` on all platforms (previously
`tokio_websockets::Error` on non-`wasm_browser`, `ws_stream_wasm::WsErr`
on `wasm_browser`). The concrete type is still accessible via
`AnyError::downcast_ref`, but that downcast is not covered by semver.
* changed: `iroh_relay::client::ConnectError::Websocket { source }`: the
`source` field type changed from a cfg-gated `tokio_websockets::Error` /
`ws_stream_wasm::WsErr` to `n0_error::AnyError`.
* changed: `iroh_relay::client::conn::SendError::StreamError { source
}`: the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::client::conn::RecvError::StreamError { source
}`: the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::protos::handshake::Error::Websocket { source }`:
the `source` field type changed from a cfg-gated
`tokio_websockets::Error` / `ws_stream_wasm::WsErr` to
`n0_error::AnyError`.
* changed: `iroh_relay::protos::handshake::Error::DeserializationError {
source, .. }`: the `source` field type changed from `postcard::Error` to
`n0_error::AnyError`.
* removed: `iroh_relay::protos::relay::Error::SerDe { source:
postcard::Error }` variant. `postcard` is no longer exposed from this
error
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
|
||
|
|
54250090e7 |
refactor(iroh)!: Remove ipnet, hickory_net and netmon from public API surface by replacing their errors with variants or AnyError (#4155)
## Description
This removes a few foreign errors from our public API to reduce
semver-relevant API surface.
- Remove `ipnet::PrefixLenError` from public API, just the variant is
enough (doesn't add further details anyway)
- Replace `hickory_net::Error` with `AnyError` to not have a dependency
on `hickory_net` in public API
- Replace `netmon::Error` with `AnyError` to not have a dependency on
`netmon` in public API
## Breaking Changes
* changed: `iroh_relay::dns::DnsError::Timeout`: the `source:
tokio::time::error::Elapsed` field has been removed. The variant is now
an empty struct variant (`Timeout {}`) and no longer exposes `tokio` in
the public API.
* changed: `iroh_relay::dns::DnsError::Resolve { source }`: the `source`
field type changed from `hickory_resolver::net::NetError` to
`n0_error::AnyError`. `hickory_resolver` is no longer part of the public
API surface of this error.
* changed: `iroh::endpoint::BindError::CreateNetmonMonitor { source }`:
the `source` field type changed from `netmon::Error` to
`n0_error::AnyError`. `netmon` is no longer part of the public API
surface of this error.
* removed: `iroh::endpoint::bind::InvalidSocketAddr::InvalidPrefix {
source: ipnet::PrefixLenError }` variant.
* added: `iroh::endpoint::bind::InvalidSocketAddr::InvalidPrefixLength
{}` variant, replacing `InvalidPrefix`. The underlying
`ipnet::PrefixLenError` is no longer exposed.
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
|
||
|
|
fe6148de90 |
refactor(iroh, iroh-relay)!: remove reqwest from public API and enforce our DNS resolver (#4150)
## Description
This changes our interaction with `reqwest` such that we could swap to
another HTTP client library during 1.0.
* Remove the public `impl reqwest::dns::Resolver for DnsResolver`.
Instead we now have a private wrapper struct, thus not exposing this as
public API
* Remove reqwest errors from our errors, replaced with `AnyError`
* Enforce that we always use the `DnsResolver` configured on the
endpoint. In net_report we previously used reqwest's default DNS
resolver. Now we always use the one configured on the endpoint
* Streamline the pkarr address lookup constructors to always take a
`DnsResolver`. When used outside of iroh's address lookup you can just
pass `Default::default` (done in tests or examples).
With this `reqwest` no longer shows up anywhere in the public API.
## Breaking Changes
changed: `iroh::address_lookup::pkarr::PkarrRelayClient::new` now takes
a `DnsResolver` as a third argument (non-`wasm_browser` builds):
`PkarrRelayClient::new(pkarr_relay_url, tls_config, dns_resolver)`. Pass
`DnsResolver::default()` to preserve previous behavior.
* changed: `iroh::address_lookup::pkarr::PkarrRelayClient::new` in
`wasm_browser` builds no longer takes a `tls_config` argument:
`PkarrRelayClient::new(pkarr_relay_url)`.
* removed: `iroh::address_lookup::pkarr::PkarrRelayClient::builder`.
Construct a `PkarrRelayClient` directly via `PkarrRelayClient::new` and
pass the desired `DnsResolver`.
* removed:
`iroh::address_lookup::pkarr::PkarrRelayClientBuilder::set_dns_resolver`.
The DNS resolver is now a required constructor argument on
`PkarrRelayClient::new`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpSend { source
}`: the `source` field type changed from `reqwest::Error` to
`n0_error::AnyError`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpPayload {
source }`: the `source` field type changed from `reqwest::Error` to
`n0_error::AnyError`.
* changed: `iroh::address_lookup::pkarr::PkarrError::HttpRequest {
status }`: the `status` field type changed from `reqwest::StatusCode` to
`http::StatusCode`.
* removed: `impl reqwest::dns::Resolve for
iroh_relay::dns::DnsResolver`. `DnsResolver` is no longer usable
directly as a `reqwest` resolver; wrap it yourself if you need that
integration
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
|
||
|
|
7c853c04d8 |
feat: update to hickory 0.26 (#4151)
- Update iroh-dns-server to use `hickory-server@0.26` and `hickory-resolver@0.26` - Update `swarm-discovery` to `0.6.0` |
||
|
|
c6b1b6e1c4 |
feat(iroh): expose home relay connection status (#4149)
## Description Currently, the only API to check whether an endpoint successfully connected to a home relay is `Endpoint::online`. However, this API neither provides a notification in case the connection is lost, nor does it provide any insight in case the connection fails. This PR adds `Endpoint::home_relay_status`, exposing the connection status of the home relay. It returns a watcher over `Vec<RelayStatus>`. Currently the vec will never have more than one entry, but we're keeping the API aligned to other relay APIs in preparation of a potential multi-home-relays feature during 1.0. The `RelayStatus` is a struct that internally contains a non-public enum with the actual status. For now, it only provides methods `is_connected() -> bool` and `last_error() -> Option<Arc<AnyError>>`, which should provide reasonable introspectability while allowing us to add more information in the future. Fixes #3940 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. |
||
|
|
d8abb11cd1 |
refactor(iroh-relay)!: remove lru_cache from public API (#4152)
## Description We had `lru_cache` in the public API for iroh-relay (with `server` feature). This removes it by hiding the enum behind a struct. ## Breaking Changes * changed: `iroh_relay::KeyCache` now is a struct (was an enum). All methods are unchanged. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] All breaking changes documented. |
||
|
|
4f8e278c1a | ci: fix release build targets (#4146) | ||
|
|
3ea82803bb |
refactor(iroh): don't track paths by address (#4131)
## Description We shouldn't track paths by their address, because noq allows to have multiple paths per remote address. Even though we currently don't ever get into this situation (I think) we shouldn't have a data structure that conflicts with noq's contract here, unless we specifically would want to enforce this here. So this PR removes the `paths_by_addr` map in the RemoteStateActor. Instead, we iterate over the path list. Because the number of paths is small-ish, this should have no perf effect. ## Change checklist - [x] Self-review. |
||
|
|
8e6562d4cc | chore: Release v0.98.1 | ||
|
|
28b4cfea00 |
fix(iroh): reduce await points in socket actor loop (#4143)
## Description We needlessly await the return channel from messages sent to `RemoteStateActor`s within the main socket actor loop. This moves the await point out of the actor loop: - For `remote_info`, we can just use the read-only copy of the remote actor sender map, because this should not start a new actor anyways - for `add_connection` we can await the reply channel outside of the actor loop, as in #4138 ## Change checklist - [x] Self-review. |
||
|
|
aed36e1a24 |
fix: set default crypto provider for iroh-dns-server binary (#4142)
## Description This fixes the panic in 0.98 on the dns server. Same fix as in #4087 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
c7dba4a265 |
fix(iroh): don't block socket actor loop on address lookups (#4138)
## Description When calling `Endpoint::connect`, the first thing happening internally is checking if we have *any* address for the endpoint ID, and if not, wait for address lookup to return at least one address (because attempting to connect without any address is worthless). Due to changes in unrelated refactors, we moved the `await` on the return channel from the `RemoteStateActor` (which handles the address lookup) *into the main socket actor loop*. This is a bug, because it means the socket actor loop may be blocked waiting for address lookup, which can take a long time. This PR fixes this by passing through the return channel and only awaiting it at the call site, i.e. out of the actor loop. Included is a test that fails without the fix and passes now. ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions Ideally, the actor loop should not have any `await` points outside of the main `tokio::select!`. However, this is not feasable in the current architecture, because we need to send into bounded channels. This is fine, too, as those sends should all be fast and only apply necessary backpressure in rare conditions. However, it means we need to review all `await` points in the branches of the select most precisely by hand, to be sure to not have any potentially long-running awaits block the actor loop. ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Tests if relevant. |
||
|
|
867471dd76 |
fix(ci): fix arm builds and some cleanup (#4139)
## Description Should fix https://github.com/n0-computer/iroh/actions/runs/24570219857/job/71841008990 Passes as expected here now: https://github.com/n0-computer/iroh/actions/runs/24657515016/job/72094689852 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
42d698348b | chore: Release v0.98.0 | ||
|
|
08c6454ac6 | chore: fix changelog generation | ||
|
|
1b04d345a3 |
fix(iroh): don't falsely report home relay as connected on change (#4136)
## Description Follow-up to #4115. `RelayActor::on_network_change` was inferring `HomeRelayStatus::Connected` from `active_relays.contains_key()`, but a present entry only means the actor task exists, not that it has finished dialing. If the newly selected home relay already had an `ActiveRelayActor` running as a non-home relay (because we reached a peer via it) and that actor was still dialing or in `Disconnected` backoff, `Endpoint::online` would return immediately, defeating the guarantee added in #4115. ## Change checklist - [x] Self-review. |
||
|
|
481c8703c1 |
refactor(iroh)!: improve address lookup registry (#4130)
## Description While working on #4126 I realized that our `ConcurrentAddressLookup` really is a struct from way back when address lookup configuration on the endpoint worked differently. It now is an integral part of the `Endpoint`, and there's no reason (I think) for users to create one themselves, because they can work on `Endpoint::address_lookup()` directly. This renames it to `AddressLookupServices` and changes it to no longer implement `AddressLookup` by itself. This allows then for a more sensible return type in `Self::resolve`, basically moving what #4126 did into the correct place. Also removes a few methods that were unused. ## Breaking Changes * renamed: `iroh::address_lookup::ConcurrentAddressLookup` -> `iroh::address_lookup::AddressLookupServices`. * `AddressLookupServices` no longer implements the `AddressLookup` trait. It is owned by the `Endpoint` and used directly via its inherent methods. * removed: `ConcurrentAddressLookup::empty()` and `ConcurrentAddressLookup::from_services()`. Construct with `AddressLookupServices::default()` and register services with `AddressLookupServices::add` / `AddressLookupServices::add_boxed`. * removed: `impl<T: IntoIterator<Item = Box<dyn AddressLookup>>> From<T> for ConcurrentAddressLookup`. Construct with `AddressLookupServices::default()` and add services explicitly. * `iroh::Endpoint::address_lookup` now returns `Result<&AddressLookupServices, EndpointError>` (was `Result<&ConcurrentAddressLookup, EndpointError>`). * `AddressLookupServices::resolve` now returns `impl Stream<Item = Result<Item, AddressLookupFailed>>` instead of `Option<BoxStream<Result<Item, Error>>>`. The stream is always returned: if no services are configured it yields a single `AddressLookupFailed::NoServiceConfigured` error and then ends. Callers that previously unwrapped the `Option` (e.g. with `.expect("...")`) should drop the unwrap and use the stream directly. <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. |
||
|
|
2ad657ad22 |
tests(iroh): improve patchbay NAT matrix (#4135)
## Description This expands the NAT testing matrix, and defines the NAT types inline. It tests the full matrix for 4 NAT kinds. See the extensive docs for the different kinds. These are, I think, the most widely deployed ones. There are more possible variations, but these are the ones that matter most IMO. Tests that don't pass are ignored, with a note of which used to pass in iroh 0.35. The ones that we currently regressed ones are where one side is `Hard` and the other is `None` or `Easiest` - those we should get to pass again. `Hard x Hard` and `Hard x Easy` (and reverse) fail on iroh 0.35 as well - they would need port guessing (birthday paradox) which we never did so far. I back-ported these tests to iroh 0.35 for a comparison: https://github.com/n0-computer/iroh/tree/patchbay-0.35 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
321443d01d |
fix(iroh)!: don't stop address lookup when one service errors (#4126)
## Description We currently abort address lookup on the first error from *any* service. This is a bug, we should run each service to completion and only abort once all completed or failed. Fixes #4125 Turns out our current errors were not equipped to handle this well. Refactored into a) The error returned from an individual address lookup service. This is just a struct now, because `NoServicesConfigured` didn't ever make sense here, and `NoResults` is expressed by returning `None` without yielding items. b) The error returned from a lookup across all services now has `NoServicesConfigured` and `NoResults` variants only, where the latter can contain the errors emitted from individual services ## Breaking Changes * changed: `iroh::address_lookup::Error` is now a struct. Existing constructor methods are unchanged. * changed: `iroh::endpoint::ConnectWithOptsError::NoAddress { source }`: The `source` field now has type `AddressLookupFailed`, which is a new error type that can hold errors for *all* failed lookup services ## Notes & open questions It might be more appropriate to move the new format of the stream right into `ConcurrentAddressLookup`. However, with the different error type, it could no longer implement `AddressLookup` - which it arguably doesn't have to. Maybe that would be the cleaner refactor? See #4130 ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. --------- Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com> |
||
|
|
3424c6daf8 |
fix(iroh): Endpoint::online should only return once connected to a relay (#4115)
## Description Currently, `Endpoint::online` returns once *net_report selected the home relay*, not once connected to it. This is unintuitive, and leads to races especially in tests. This fixes it by exposing the connection status of the home relay to the upper Socket layers. It reuses the existing `my_relay` watchable, but adds a `HomeRelayStatus` to its value. ## Breaking Changes Behavior change: `Endpoint::online` now returns once the endpoint is connected to its home relay. Previously, it would return once the home relay is selected but before having connected to it. ## Notes & open questions We have a terminology mix in our code between "my_relay" and "home_relay". We should clean this up, but not in this PR. ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) --------- Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com> |
||
|
|
1c92a395bd |
fix(iroh-relay): treat frames not allowed in a protocol version as error (#4127)
## Description #3955 added a new relay protocol version. This PR fixes the contract: We should only allow frames that are defined for the negotiated protocol version, and abort if we receive a frame not allowed in the negotiated version. ## Breaking Changes None ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. |
||
|
|
382bf3620e |
refactor: Move to_z32/from_z32 into iroh-base and remove EndpointIdExt trait (#4133)
## Description Move to_z32/from_z32 into iroh-base and remove EndpointIdExt trait Ext traits are just not very nice for our users. ## Breaking Changes removed: iroh_relay::endpoint_info::EndpointIdExt trait and its re-export from iroh_dns. The to_z32 / from_z32 methods are now inherent on iroh_base::PublicKey (and therefore EndpointId, which is a type alias). Callers should drop the use iroh_relay::endpoint_info::EndpointIdExt; import — the methods resolve without it. ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) |
||
|
|
3ab6222bc2 |
feat: vendor pkarr implementation (#4026)
## Description
On main we use the pkarr dependency, which comes with an entire tree of
dependencies and is not under our control. But we do not use the reqwest
based client at all in the dns discovery, instead we have our own. So
what we use is just the encoding and decoding of DNS records.
It seems less than optimal to have a big dependency for just that. So
this PR removes the pkarr dependency, inlines the DNS record encoding
with the help of simple-dns, and implements the dht part manually,
directly using the mainline crate.
Note for reviewers: just do cargo doc -p iroh_dns --open to see the API
of the new crate. Almost everything is just copied, with the exception
of using mainline directly to publish to the DHT.
(In a subsequent PR I might also try to get rid of the mainline dep)
## Breaking Changes
- new crate: iroh-dns — published as a separate crate containing
SignedPacket, Timestamp, EndpointIdExt, TxtAttrs, IrohAttr,
IROH_TXT_NAME, ParseError, EncodingError. iroh and iroh-relay no longer
depend on the third-party pkarr crate directly.
- removed: iroh_relay::endpoint_info::DecodingError — no longer exists.
Callers that matched on it should now handle iroh_base::KeyParsingError
instead.
- changed: iroh_relay::endpoint_info::EndpointIdExt::from_z32 — return
type changed from Result<EndpointId, DecodingError> to
Result<EndpointId, iroh_base::KeyParsingError>.
- changed: iroh_relay::endpoint_info::EncodingError — the
InvalidTxtEntry { source: pkarr::dns::SimpleDnsError } variant is
removed. Only FailedBuildingPacket remains, and its source type is now
iroh_dns::pkarr::SignedPacketBuildError (no longer the third-party
pkarr::errors::SignedPacketBuildError).
- changed: iroh_relay::endpoint_info::ParseError::DecodingError — the
source field type changed from DecodingError to
iroh_base::KeyParsingError.
- changed: iroh_relay::endpoint_info::EndpointInfo::from_txt_lookup —
signature relaxed from impl Iterator<Item = crate::dns::TxtRecordData>
to impl Iterator<Item = impl Display>. Also no longer
#[cfg(not(wasm_browser))]-gated.
- changed:
iroh_relay::endpoint_info::EndpointInfo::{from_pkarr_signed_packet,
to_pkarr_signed_packet} — the SignedPacket parameter/return type is now
iroh_dns::pkarr::SignedPacket instead of the third-party
pkarr::SignedPacket.
- changed: iroh::address_lookup::pkarr::PkarrError::PublicKey — source
field type changed from pkarr::errors::PublicKeyError to
iroh_base::KeyParsingError.
- changed: iroh::address_lookup::pkarr::PkarrError::Verify — source
field type is now iroh_dns::pkarr::SignedPacketVerifyError (not
pkarr::errors::SignedPacketVerifyError).
- removed:
iroh::address_lookup::pkarr::dht::Builder::client(pkarr::Client) —
replaced by dht_builder(mainline::DhtBuilder). The DHT is now driven by
mainline directly rather than via pkarr::Client.
- removed: iroh::address_lookup::pkarr::dht::Builder::pkarr_relay(Url) —
the DHT address lookup no longer publishes to pkarr relays; it only uses
the Mainline DHT. Use PkarrPublisher for relay publishing.
- removed:
iroh::address_lookup::pkarr::dht::Builder::n0_dns_pkarr_relay() — same
reason as above.
- removed: iroh::address_lookup::pkarr::dht::Builder::dht(bool) — DHT is
always enabled for DhtAddressLookup; the toggle is gone.
- changed: cargo feature address-lookup-pkarr-dht — now pulls in
mainline instead of pkarr/dht + pkarr/relays.
- removed (internal crate deps): z32 and pkarr are no longer direct
dependencies of iroh, iroh-relay, or iroh-dns-server. Downstream users
who pulled those through iroh's dependency tree must depend on them
explicitly (or use the re-exports from iroh-dns).
## Notes & open questions
Note: I am using simple-dns for en/decoding. We could even inline this,
but it is very lightweight compared to hickory or even hickory-proto. I
was originally planning to use hickory-proto, but it has a lot of deps
even with default features disabled. Simple-dns is not a new dependency
- we used to have it via pkarr.
~~Note: this adds a dep to iroh-relay to iroh-dns-server, just for the
pkarr SignedPacket impl. We could alternatively let iroh-relay-server
depend on pkarr (it's not so critical regarding deps), or have a tiny
iroh-pkarr crate.~~
Note: we are no longer using pkarr client (which has relay and dht built
in) for the dht lookup. So there is a functionality change: the dht
lookup can now **only** look up via the DHT. Before you could configure
it with relays.
But I think that is fine, we already have a way to look up via relays.
Note: I also added a few comments and tests regarding storage on
iroh-dns-server. These are unrelated but should do no harm.
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
- [ ] List all breaking changes in the above "Breaking Changes" section.
- [ ] Open an issue or PR on any number0 repos that are affected by this
breaking change. Give guidance on how the updates should be handled or
do the actual updates themselves. The major ones are:
- [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc)
- [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip)
- [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs)
- [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe)
- [ ] [`sendme`](https://github.com/n0-computer/sendme)
|
||
|
|
f8295934bd |
chore(iroh): Update hickory to 0.26.0-beta.4 and use exact-version deps for prereleased crates (#4117)
## Description Updates hickory to 0.26.0-beta.4. Also fixes a bunch of version bounds that were outdated, and some that were not exact version bounds, even though we were depending on a prerelease version. # Notes Waiting for https://github.com/rkuhn/swarm-discovery/pull/22 to be merged & released. --------- Co-authored-by: dignifiedquire <me@dignifiedquire.com> |
||
|
|
24efedf65e | chore: update to netwatch@0.16 and portmapper@0.16 (#4128) | ||
|
|
72e4538332 |
feat: update to noq@0.18 (#4121)
update to noq@0.18 ...so it is updated --------- Co-authored-by: Ruediger Klaehn <rklaehn@protonmail.com> |
||
|
|
c865251ffd |
examples(iroh): allow to configure the receive window in the transfer example (#4082)
## Description This allows to configure the receive window in the transfer example. It comes with docs that explain the tradeoffs and how to calculate a good value. For a relay-only transfer (with `--relay-only`) and the relay pinned to use1 (~100ms one-way latency from my laptop, so 400ms RTT between two endpoints on my laptop), increasing this from the default to 5MB (i.e. `--receive-window 5M`or `--receive-window-rtt 400`) lets the transfer throughput go from ~600 KB/s to ~1.8 MB/s. ## 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. |
||
|
|
f5ec24a636 |
tests(iroh): add more patchbay tests and improve existing tests (#4118)
## Description Based on #4119 to make reviewing easier. * Add a `left`/`right` API to `Pair`. We often want to run the same test with switched client/server roles, and the existing API was cumbersome for this. With `left` / `right` the sides are set via a variable, so it is straightforward to pass that into a run function called from multiple test functions (matrix style) * Parametrize the existing tests over switched client/server roles * Add NAT matrix tests to test all combinations of `(None, Home, Coporate)` NATs (Home is endpoint-indpendent, so holepunchable for us; Corporate is endpoint-dependant so not holepunchable for us). Tests that don't pass are ignored. * Adds two new tests: * Holepunch with many interfaces. It passes with 8 additional interfaces and fails with 16 (the latter are ignored until we make them pass) * Start on a hard nat (no holepunch), then switch uplink to an easy nat and validate that it holepunchs then mid-connection ## 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. |
||
|
|
b2b1d46159 |
feat(iroh): do not advertise deprecated IPv6 addrs (#4106)
## Description This skips advertising `deprecated` IPv6 addresses in nat traversal, as they are not supposed to be used for new connections. Fixes https://github.com/n0-computer/iroh/discussions/4071 ## Breaking Changes None ## Notes & open questions - There are more flags on IPv6 addresses, should we take them into account in some form as well? |
||
|
|
0a22d76905 |
feat: update relay protocol to iroh-relay-v2, add new Health frame, test protocol update mechanism (#3955)
## Description This commit adds a `iroh-relay-v2` protocol. The only changes to the `iroh-relay-v1` protocol are: * removed `Health` frame (id 11) with string payload * added `Status` frame (id 13) with binary-encoded enum payload that can be extended with further variants or payloads * From now on, unknown frames will be ignored in iroh (instead of erroring out) The actual change is thus quite minor, but serves as a real-world test for our protocol negotiation. The PR also fixes a bug in how the relay server parsed the supported protocols; it is harmless because all existing deployments support a single version anyway, but good to fix now. Everything is fully backwards-compatible on the wire (old clients can talk to new relays, and new clients can talk to old relays). ## Breaking Changes * `iroh_relay::http::RELAY_PROTOCOL_VERSION` has been removed. The relay protocol now supports version negotiation between client and server. Use `iroh_relay::http::ProtocolVersion` instead. For the previous constant value, use `ProtocolVersion::V1.to_str()`. * `iroh_relay::server::client::Config` has a new field `protocol_version: ProtocolVersion`. * `iroh_relay::protos::relay::RelayToClientMsg` has a new `Status(Status)` variant and the existing `Health` variant is deprecated. Clients should handle `RelayToClientMsg::Status` for connection health information. The `Health` variant is still sent by V1 relay servers but should not be relied upon going forward. ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. |
||
|
|
e36378d572 |
chore(deps): bump the github-actions group across 1 directory with 2 updates (#4112)
Bumps the github-actions group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [cargo-bins/cargo-binstall](https://github.com/cargo-bins/cargo-binstall). Updates `actions/checkout` from 4 to 6 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>v6-beta by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2298">actions/checkout#2298</a></li> <li>update readme/changelog for v6 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2311">actions/checkout#2311</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v5.0.0...v6.0.0">https://github.com/actions/checkout/compare/v5.0.0...v6.0.0</a></p> <h2>v6-beta</h2> <h2>What's Changed</h2> <p>Updated persist-credentials to store the credentials under <code>$RUNNER_TEMP</code> instead of directly in the local git config.</p> <p>This requires a minimum Actions Runner version of <a href="https://github.com/actions/runner/releases/tag/v2.329.0">v2.329.0</a> to access the persisted credentials for <a href="https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container-action">Docker container action</a> scenarios.</p> <h2>v5.0.1</h2> <h2>What's Changed</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v5...v5.0.1">https://github.com/actions/checkout/compare/v5...v5.0.1</a></p> <h2>v5.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> <li>Prepare v5.0.0 release by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2238">actions/checkout#2238</a></li> </ul> <h2>⚠️ Minimum Compatible Runner Version</h2> <p><strong>v2.327.1</strong><br /> <a href="https://github.com/actions/runner/releases/tag/v2.327.1">Release Notes</a></p> <p>Make sure your runner is updated to this version or newer to use this release.</p> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v4...v5.0.0">https://github.com/actions/checkout/compare/v4...v5.0.0</a></p> <h2>v4.3.1</h2> <h2>What's Changed</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v4...v4.3.1">https://github.com/actions/checkout/compare/v4...v4.3.1</a></p> <h2>v4.3.0</h2> <h2>What's Changed</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <h2>v4.2.0</h2> <ul> <li>Add Ref and Commit outputs by <a href="https://github.com/lucacome"><code>@lucacome</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li> <li>Dependency updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>- <a href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>, <a href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li> </ul> <h2>v4.1.7</h2> <ul> <li>Bump the minor-npm-dependencies group across 1 directory with 4 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li> <li>Bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li> <li>Check out other refs/* by commit by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li> <li>Pin actions/checkout's own workflows to a known, good, stable version. by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li> </ul> <h2>v4.1.6</h2> <ul> <li>Check platform to set archive extension appropriately by <a href="https://github.com/cory-miller"><code>@cory-miller</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/de0fac2e4500dabe0009e67214ff5f5447ce83dd"><code>de0fac2</code></a> Fix tag handling: preserve annotations and explicit fetch-tags (<a href="https://redirect.github.com/actions/checkout/issues/2356">#2356</a>)</li> <li><a href="https://github.com/actions/checkout/commit/064fe7f3312418007dea2b49a19844a9ee378f49"><code>064fe7f</code></a> Add orchestration_id to git user-agent when ACTIONS_ORCHESTRATION_ID is set (...</li> <li><a href="https://github.com/actions/checkout/commit/8e8c483db84b4bee98b60c0593521ed34d9990e8"><code>8e8c483</code></a> Clarify v6 README (<a href="https://redirect.github.com/actions/checkout/issues/2328">#2328</a>)</li> <li><a href="https://github.com/actions/checkout/commit/033fa0dc0b82693d8986f1016a0ec2c5e7d9cbb1"><code>033fa0d</code></a> Add worktree support for persist-credentials includeIf (<a href="https://redirect.github.com/actions/checkout/issues/2327">#2327</a>)</li> <li><a href="https://github.com/actions/checkout/commit/c2d88d3ecc89a9ef08eebf45d9637801dcee7eb5"><code>c2d88d3</code></a> Update all references from v5 and v4 to v6 (<a href="https://redirect.github.com/actions/checkout/issues/2314">#2314</a>)</li> <li><a href="https://github.com/actions/checkout/commit/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3"><code>1af3b93</code></a> update readme/changelog for v6 (<a href="https://redirect.github.com/actions/checkout/issues/2311">#2311</a>)</li> <li><a href="https://github.com/actions/checkout/commit/71cf2267d89c5cb81562390fa70a37fa40b1305e"><code>71cf226</code></a> v6-beta (<a href="https://redirect.github.com/actions/checkout/issues/2298">#2298</a>)</li> <li><a href="https://github.com/actions/checkout/commit/069c6959146423d11cd0184e6accf28f9d45f06e"><code>069c695</code></a> Persist creds to a separate file (<a href="https://redirect.github.com/actions/checkout/issues/2286">#2286</a>)</li> <li><a href="https://github.com/actions/checkout/commit/ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493"><code>ff7abcd</code></a> Update README to include Node.js 24 support details and requirements (<a href="https://redirect.github.com/actions/checkout/issues/2248">#2248</a>)</li> <li><a href="https://github.com/actions/checkout/commit/08c6903cd8c0fde910a37f88322edcfb5dd907a8"><code>08c6903</code></a> Prepare v5.0.0 release (<a href="https://redirect.github.com/actions/checkout/issues/2238">#2238</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/checkout/compare/v4...v6">compare view</a></li> </ul> </details> <br /> Updates `cargo-bins/cargo-binstall` from 1.17.9 to 1.18.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/cargo-bins/cargo-binstall/releases">cargo-bins/cargo-binstall's releases</a>.</em></p> <blockquote> <h2>v1.18.1</h2> <p><em>Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for <code>cargo install</code> in most cases. Install it today with <code>cargo install cargo-binstall</code>, from the binaries below, or if you already have it, upgrade with <code>cargo binstall cargo-binstall</code>.</em></p> <h4>In this release:</h4> <p>Remove <code>GITHUB_TOKEN</code> and <code>GH_TOKEN</code> when fallback to installing from source using <code>cargo-install</code> (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2533">#2533</a>)</p> <p>This reduces the risk of leaks of tokens for users who pass the <code>GITHUN_TOKEN</code> or <code>GH_TOKEN</code> environment variables to cargo-binstall to avoid GitHub API rate limits.</p> <h2>v1.18.0</h2> <p><em>Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for <code>cargo install</code> in most cases. Install it today with <code>cargo install cargo-binstall</code>, from the binaries below, or if you already have it, upgrade with <code>cargo binstall cargo-binstall</code>.</em></p> <h4>In this release:</h4> <ul> <li>feat: support <code>cargo:token</code> and <code>cargo:token-from-stdout</code> auth for private registries (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2526">#2526</a> <a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2528">#2528</a>)</li> </ul> <h4>Other changes:</h4> <ul> <li>Upgrade dependencies</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/dc19f1e48450eefe5a29b8da6c6b00a87d730b37"><code>dc19f1e</code></a> release: cargo-binstall v1.18.1 (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2535">#2535</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/94bc68e7efa62ceea52ea6a71c9cc5c390151132"><code>94bc68e</code></a> chore(binstalk): release v0.28.73 (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2534">#2534</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/0d65135961eddf19314af64b5cf3f59d4eee25b0"><code>0d65135</code></a> binstalk: Remove GITHUB_TOKEN and GH_TOKEN when installing from source (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2533">#2533</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/f8ce4d55b131f4a1e373b8747ca6b6a54133ae5a"><code>f8ce4d5</code></a> release: cargo-binstall v1.18.0 (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2532">#2532</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/7ef7b56abb96c9d71a0b5f71d3c9e2ced7cb849c"><code>7ef7b56</code></a> chore: release (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2524">#2524</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/4d6e1bd0e7ec407fbcad111abf7bce31ec60d668"><code>4d6e1bd</code></a> dep: Upgrade transitive dependencies (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2529">#2529</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/6ed12bbaae779f3fd3ba1477bc9a61a2535a3bb2"><code>6ed12bb</code></a> feat: support <code>cargo:token-from-stdout</code> in private registries (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2528">#2528</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/c3664f981c04ab538bd76b0ba83680ee5bab631a"><code>c3664f9</code></a> feat: support <code>cargo:token</code> auth for private registries (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2526">#2526</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/b6c541758da069b696c176405f63bd11cc1f21f9"><code>b6c5417</code></a> build(deps): bump the deps group with 2 updates (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2525">#2525</a>)</li> <li><a href="https://github.com/cargo-bins/cargo-binstall/commit/d8822126a23fcb622ca7b46f94ea2b73316bedf4"><code>d882212</code></a> dep: Upgrade transitive dependencies (<a href="https://redirect.github.com/cargo-bins/cargo-binstall/issues/2523">#2523</a>)</li> <li>See full diff in <a href="https://github.com/cargo-bins/cargo-binstall/compare/v1.17.9...v1.18.1">compare view</a></li> </ul> </details> <br /> 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 <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
|
|
d72f1cb87a |
tests(iroh): add patchbay test matrix for switching uplinks (#4095)
## Description Adds a patchbay test matrix for testing uplink switching across IP family transitions (v4/v6/dual-stack) for both client and server side. Each test holepunches a direct path, replugs the switching side to a different router, and verifies that a new direct path is selected and data flows over it. The tests all pass. Initially, the server side tests failed, and this uncovered two issues which are now fixed: * We currently fail to detect the default route when switching to a v6-only interface in netwatch, see https://github.com/n0-computer/net-tools/pull/132. This leads to iroh not forwarding the major network change to quinn, because we only do this if we determine the network to be usable, which fails because the default route check fails. * noq's `handle_network_change` only checks whether a path is recoverable on the client side; the server side always assumed paths were recoverable, so dead direct paths were never proactively abandoned after a server replug. See https://github.com/n0-computer/noq/pull/579 |
||
|
|
ea7a634fad |
feat: Rate limiting in router (#3951)
## Description
Add an optional mechanism for rate limiting and requesting requests in
the iroh router.
The reason to have something like this is if we ever have a single iroh
endpoint exposed to the world that can be overloaded or hit by a DOS
attack. E.g. a public irpc service, n0des, ...
Unfortunately this has quite some API surface: a trait for the
callbacks, and enums for the fn returns.
~~I also added an example that hammers a server with lots of clients and
measures the CPU load. Here is the output of the latest version:~~
Simplified the sample. The hammering tool now lives in a separate repo,
since it got a bit too big for an example.
```
Connection filter benchmark, 100 attempts per filter
Direct connections:
no filter: 0 accepted, 0 rejected, 100 closed (client: 40.63ms | server: 97.30ms cpu, 1028 ops/s, 41.00ms wall)
ignore addr: 0 accepted, 100 rejected, 0 closed (client: 5.01s | server: 3.46ms cpu, 28868 ops/s, 10.53ms wall)
reject addr: 0 accepted, 100 rejected, 0 closed (client: 8.04ms | server: 5.61ms cpu, 17835 ops/s, 10.08ms wall)
retry + reject: 0 accepted, 100 rejected, 0 closed (client: 37.18ms | server: 12.77ms cpu, 7833 ops/s, 39.96ms wall)
reject alpn: 0 accepted, 0 rejected, 100 closed (client: 31.34ms | server: 75.25ms cpu, 1329 ops/s, 33.84ms wall)
Relay connections (https://127.0.0.1:53395/):
no filter: 0 accepted, 0 rejected, 100 closed (client: 4.10s | server: 174.75ms cpu, 572 ops/s, 4.09s wall)
reject endpoint id: 0 accepted, 100 rejected, 0 closed (client: 4.04s | server: 21.50ms cpu, 4652 ops/s, 4.04s wall)
reject alpn: 0 accepted, 0 rejected, 100 closed (client: 4.08s | server: 88.07ms cpu, 1135 ops/s, 4.08s wall)
```
ignore is fastest, reject just a tad slower. reject alpn doesn't buy
much over just closing the connection. It is just a convenient place to
throttle or reject by alpn.
For relay connections, the cheapest is to reject by endpoint id. This is
quite a bit faster than closing the connection since we get the endpoint
id early. Rejecting by alpn in this case helps a bit more.
The example starts a server in a subprocess and then hammers it with n
connections. The subprocess is measuring its own CPU time.
## Breaking Changes
None
## Notes & open questions
## 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)
|
||
|
|
184e378795 |
deps: bump noq and net-tools (#4113)
## Description Bumps noq and netwatch/portmapper to recent main commits. |
||
|
|
811a0627fe |
deps(iroh): update patchbay to 0.5 (#4097)
## Description Updates patchbay from 0.3.0 to 0.5.0. * v0.4 introduced an new `Iface` API. * v0.5 fixed a nasty bug when running patchbay as root (as CI runners do) where `resolv.conf` would leak to the host, and has a new `Lab::builder` API. |
||
|
|
ee844a66b0 |
feat(iroh-relay): expose more metrics on the relay server (#4085)
## Description Adds more metrics to the relay server: - Metrics for HTTP (TCP) connections - Metrics for QUIC (QAD) connections - Metrics for inactive clients Also slightly improves logging for QUIC connections. Co-authored-by: Floris Bruynooghe <flub@n0.computer> |
||
|
|
86d3ac6076 |
refactor(iroh, iroh-relay)!: mark public types as non_exhaustive (#4107)
## Description Add `#[non_exhaustive]` to various public structs and enums that we might want to extend during 1.0: - structs: `relay_map::RelayConfig`, `relay_map::RelayQuicConfig` - enums: `DirectAddrType`, `DiscoveryEvent`: enums - enums in iroh_relay: `RelayToClientMsg`, `ClientToRelayMsg`, `FrameType` There's more items in the server-side of iroh-relay, will do those separately. ## Breaking Changes * `iroh_relay::RelayConfig` is now `#[non_exhaustive]`. Use `RelayConfig::from(relay_url)` for the common case, or `RelayConfig::new(url, quic)` to specify a custom QUIC config. * `iroh_relay::RelayQuicConfig` is now `#[non_exhaustive]`. Use `RelayQuicConfig::new(port)` or `RelayQuicConfig::default()` instead of struct literals. * `iroh_relay::protos::relay::RelayToClientMsg` is now `#[non_exhaustive]`. * `iroh_relay::protos::relay::ClientToRelayMsg` is now `#[non_exhaustive]`. * `iroh_relay::protos::common::FrameType` is now `#[non_exhaustive]`. * `iroh::DirectAddrType` is now `#[non_exhaustive]`. * `iroh::address_lookup::mdns::DiscoveryEvent` is now `#[non_exhaustive]`. * `iroh_relay::server::Metrics` is now `#[non_exhaustive]`. Use `Metrics::default()` instead of struct literals. * `iroh_relay::server::RelayMetrics` is now `#[non_exhaustive]`. Use `RelayMetrics::default()` instead of struct literals. ## 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. |
||
|
|
372aab94e2 |
feat(iroh): add ability to configure external addrs (#4098)
## Description This allows configuring known external addresses using the builder and at runtime, to aid in the help of discovery, when they are already known through other processes. Related to #2552 |
||
|
|
0cc244190b |
tests: minor patchbay test improvements (#4091)
## Description * Collect nextest output in the downloadable dump together with the testdir for easier debugging * Remove stale "currently ignored" comments * Add explicit connection closing to all tests * Increase timeouts for degrade tests * Fix formatting by reducing `info!` line length in async blocks so that `rustfmt` doesn't silently ignore the block |
||
|
|
79bb0e48e9 |
refactor(iroh-relay)!: proper timeouts on relay connections (#4083)
## Description Adds a timeout to relay connections to abort connections that stall while establishing the relay WebSocket connection. A timeout of 30s is started for each new incoming TCP stream. The timeout is cleared once the connection has completed a TLS handshake (if serving via HTTPS), received a WebSocket request and passed that request to the relay protocol handler. If the timeout elapses before the connection is fully established and passed to the relay handler, the connection is aborted. Before this change, clients could open TCP connections to the relay server, and they would sit idle forever if the client neither closes it nor issues the WebSocket request. ## Breaking Changes * `iroh_relay::server::http_server::RelayService` no longer implements `hyper::Service`. Use `iroh_relay::server::http_server::RelayServiceWithNotify` instead, it can be constructed from a `RelayService` with `RelayServiceWithNotify::new` * `iroh_relay::server::http_server::RelayService::handle_connection` now takes a new argument `establish_timeout` <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. |
||
|
|
159a5cf29c |
feat: update noq and net-tools to latest (#4088)
- Update noq to latest `main` branch - Update netwatch to latest `main` branch - Reduce patchbay test concurrency to 1 thread to increase reliability - Pin hickory-resolver beta version - unignore some patchbay tests - Fix `switch_uplink_v6` test to avoid an initial IPv6-based connection failing the test --------- Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com> |
||
|
|
2433645f2a |
fix: set default crypto provider for iroh-relay binary (#4087)
## Description This sets `ring` as the default crypto provider in the iroh-relay binary. Otherwise we get panics in `tokio-rustls-acme` if both the `tls-ring` and `tls-aws-lc-rs` feature are enabled. This works and allows to deploy iroh-relay when built with `--all-features`. A cleaner fix would be to pass through a crypto provider into tokio-rustls-acme. It does allow that in most parts, but not all - see https://github.com/n0-computer/tokio-rustls-acme/pull/42. ## 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) --------- Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com> |