Commit Graph

4964 Commits

Author SHA1 Message Date
Frando 335b7b8921 refactor!: remove open_path_ensure and add OpenPathOpts 2026-05-14 17:35:23 +02:00
Frando b25191205c feat(noq)!: open path by four tuple 2026-05-14 16:27:36 +02:00
Franz Heinzmann e2130abf4e refactor(noq-proto)!: Remove unused PathAbandonReason::NatTraversalRoundEnded (#652)
## Description

This removes `PathAbandonReason::NatTraversalRoundEnded`, it is never
constructed after the recent refactors.

## Breaking Changes

* Removed: `PathAbandonReason::NatTraversalRoundEnded`, no longer needed

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-05-13 18:57:54 +00:00
Franz Heinzmann 684c3e2531 chore: check external types in CI (#643)
## Description

This adds a `cargo make` task and CI job to ensure that no foreign
crates appear in the public API apart from those explicitly
allow-listed.

## Change checklist
- [x] Self-review.
2026-05-11 13:18:44 +00:00
Floris Bruynooghe 6a114f5a7f refactor(multipath)!: Rename PathEvent::Opened to Established (#644)
## Description

The event only is emitted when the path is usable for application
data, having it called Opened is confusing as that does not match
multipath terminology. Maybe in the future there is a need for an
event when the path is really opened, according to multipath, and then
we'd have to come up with a different event name.

Established also matches how we consider the state of the connection:
once the handshake is *completed*, it is considered established. So I
think this is a good match.

## Breaking Changes

- `PathEvent::Opened` -> `PathEvent::Established`

## Notes & open questions

Yes, this is an API breaking change in an RC release.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] All breaking changes documented.
2026-05-11 07:24:02 +00:00
dignifiedquire 6ee7cf2f8c chore: Release noq-proto-v1.0.0-rc.0 noq-udp-v1.0.0-rc.0 noq-v1.0.0-rc.0 2026-05-07 11:28:50 +02:00
dignifiedquire 307adcd786 chore: change deps to be more explicit 2026-05-07 11:28:35 +02:00
Rüdiger Klaehn a0f988a91d refactor: Rename read_chunk to read_bytes and make it return just a Bytes (#535)
## Description

Remove Chunk usage in ordered read API

Make read_chunk return just a Bytes. Also rename read_chunks to
read_chunks_many (it already returns Bytes).

Add a bytes_read fn for the rare case where you do need the offset
despite being in ordered read mode.

Not sure if people agree, but there was an inconsistency before between
read_chunk (returns a Chunk, including offset) and read_chunks (fills a
bunch of Bytes, no offset).

Also it doesn't seem useful to have Chunk at all for ordered streams.
You usually don't care about the offset unless you are reading unordered
streams. So I would like to confine Chunk usage to only the (now
separate) unordered read API.

## Breaking Changes

noq::RecvStream::read_chunk returns a Bytes.
noq::RecvStream::read_chunks renamed to read_many_chunks.

## Notes & open questions

Note: while the [other related
PR](https://github.com/n0-computer/noq/pull/536) is just renaming, this
one is I think actually removing some weirdness.

Why does read_chunk give you an offset but read_chunks does not. And
there is no way to get the offset if you need it if you use read_chunks.

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-05-07 08:52:03 +00:00
Rüdiger Klaehn f4ec7775af refactor: Rename write_chunk to write_bytes and write_chunks to write_bytes_many (#536)
## Description

Remove the Written struct from the public API.

write_many_chunks had a somewhat weird API. On the one hand it was
mutating the passed buffers to zero out fully written buffers and split
the half-written buffer, but then on the other hand it expected the
caller to remove the empty buffers from the buffer array for the next
call.

With the change we only return the total number of written bytes and
remove the buffers from the slice ourselves. That makes the typical use
simpler.

In the rare case where you do need the number of fully written buffers
you can still get it.

## Breaking Changes

noq::SendStream::write_bytes_many: renamed to write_many_chunks, and
returns just the size.
noq::Written: removed

## Notes & open questions

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

---------

Co-authored-by: Floris Bruynooghe <flub@devork.be>
2026-05-07 08:51:55 +00:00
Franz Heinzmann c64cf98400 refactor(noq): atomic path ref counts (#626)
## Description

Mirror the recent `ConnectionRef`/`EndpointRef` refactor (c1d7ed27) for
path reference counts. Cloning a `Path` or `WeakPathHandle` and calling
`Path::weak_handle`/`WeakPathHandle::upgrade` no longer lock the
connection state to bump a counter. Instead they `fetch_add` an atomic.

The state mutex is still taken on initial construction and on the last
drop, since `PathRef` entries are allocated lazily per `PathId` and we
need to clear `path_refs` plus any cached `final_path_stats` when the
count hits zero.
## Breaking Changes

None.

## Change checklist

- [x] Self-review.
2026-05-06 16:57:14 +00:00
Franz Heinzmann 437d0c17b4 refactor(noq-proto)!: get ring and aws_lc_rs out of public API (#640)
## Description

I ran `cargo-check-external-types` on the noq crates. It all looks
reasonable. `noq-proto` has `ring` and `aws-lc-rs` in its public API
though through a `From<ring::error::Unspecified> for CryptoError` impl
(same for aws-lcs-rs, depending on feature flags). This means that from
a strict POV that ring couldn't be updated without a semver breaking
change.

This PR removes the From impl, instead using `map_err` at the few call
sites.

## Breaking Changes

* changed: `noq_proto::crypto::CryptoError` no longer implements
`From<ring::error::Unspecified>` and
`From<aws_lcs_rs::error::Unspecified>`

## Notes & open questions

Remaining foreign types in public API are: `bytes`, `futures_core`,
`rustls`, `rustls_pki_types`, `tokio` - all reasonable. Then we also
have `identity_hash` (marker trait, but don't think there would be any
need to update that crate during 1.0 so fine) and `arbitrary` (gated
behind non-default `arbitrary` feature). I think we're good!

## Change checklist

- [x] Self-review.
- [x] All breaking changes documented.
2026-05-06 16:56:39 +00:00
Rüdiger Klaehn fe19376f80 feat: make negotiated_key_exchange_group always available (#633)
## Description

Make `negotiated_key_exchange_group` always available. This is useful if
you configured post quantum key exchange and want to make sure that you
actually got one, but also in general. It just costs 32 bit in size, and
getting it is very cheap.

## Breaking Changes

`crypto::rustls::HandshakeData`: public struct gets a new field
negotiated_key_exchange_group.

## Notes & open questions

Note: we could choose a shorter name?
Note: I made the struct non_exhaustive in case we want to add more.

Needed for https://github.com/n0-computer/iroh/issues/4195

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

<!--
tip:
Run `cargo make` in the workspace root to check many light-weight CI
steps locally.
-->
2026-05-06 14:56:51 +00:00
Floris Bruynooghe c904e92eeb fix(qlog): emit RTT values in milliseconds (#639)
## Description

draft-ietf-quic-qlog-main-schema-13.txt: All timestamps and
time-related values (e.g. offsets) in qlog are logged as float64 in
the millisecond resolution.

## Breaking Changes

n/a

## Notes & open questions

Port of https://github.com/quinn-rs/quinn/pull/2631

## Change checklist

- [x] Self-review.
2026-05-06 12:57:28 +00:00
Franz Heinzmann 1facdd9a44 refactor!: return previous path status from Path::set_status (#638)
## Description

This makes `noq::Path::set_status` return the previous `PathStatus`, so
that callers can check whether the status changed without having to call
`status` again (which would aquire another lock needlessly).

## Breaking Changes

* changed: `noq::Path::set_status` now returns `Result<PathStatus,
SetPathStatusError>`, where `PathStatus` is the previous path status


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

<!--
tip:
Run `cargo make` in the workspace root to check many light-weight CI
steps locally.
-->
2026-05-06 09:13:58 +00:00
Floris Bruynooghe 262697c65b feat(proto): Better NAT probe retry intervals (#623)
## Description

This improves the NAT probing intervals: it now starts at 33ms by
default and does an exponential backoff capping at 2s intervals. There
are now 7 probe attempts spanning a period 4 seconds.

Fixes #569 

## Breaking Changes

n/a

## Notes & open questions

4s is a bit longer than I initially thought, but I think it's
fine. Maybe we could remove 1 or even 2 further attempts. Removing 1
gets you to 2s though. Alternatively the interval cap could be lowered
a bit and the initial interval a tiny bit higher. But really I'm only
writing this down for nice git history, I think the current tradeoff
is a good start.

## 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-06 09:04:20 +00:00
Floris Bruynooghe 058aaab548 feat(proto): Send NAT probes with off-path PATH_RESPONSE (#619)
## Description

When we are NAT probing and we are sending a PATH_RESPONSE as a
client, we include a PATH_CHALLENGE. This ensures that if the peer got
through the firewall first that the client immediately gets through as
well and can open the path. Speeding up NAT traversal.

## Breaking Changes

n/a

## Notes & open questions

Closes #570.

Also fixes an oversight from before: we were still consuming CIDs for
off-path responses. For now we want to not do that.

## Change checklist

- [x] Self-review.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-05-06 08:04:06 +00:00
Franz Heinzmann 3fc2e28f9e feat(noq)!: Return Closed struct from Connection::on_closed with path stats (#617)
## Description

Replace the (ConnectionError, ConnectionStats) tuple with a named Closed
struct that exposes the close reason, the aggregate connection stats and
per-path stats for every path the connection knew about at close time.
Path stats are sourced from the proto layer for paths still tracked at
close time and from the cached final stats for already-discarded paths.

## Breaking Changes

* changed: the `OnClosed` future returned `noq::Connection::on_closed`
now resolves to a struct `Closed` instead of a tuple `(ConnectionError,
ConnectionStats)`. `Closed` has public fields `reason`, `stats`, and
`path_stats`.

## Notes & open questions

I gave the `Closed` struct public fields plus `#[non_exhaustive]`. Could
also be accessor methods and private fields, but then the path stats and
the connection error would have to be cloned out to get hold of owned
variants, or we'd have to have both getters and `into_` methods. I think
the public fields are fine here, but can also change it.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-05-05 14:14:05 +00:00
Floris Bruynooghe 9e1f1ad779 fix(proto): Use approximate comparison for network paths (#635)
## Description

When the local IP is not yet set on a network path we need to do our
network path comparisons with `is_probably_same_path` so that we accept
this difference. We can not accept the local_ip earlier because for
probing packets it should not be set. This requires a few fixed in
various places where network paths are compared.

Additionally when doing these network path changes we are not allowed to
depend on the PathData existing, it only gets created later for new
paths.

## Breaking Changes

n/a

## Notes & open questions

Testing this is difficult, it relies on the strange way that transports
are setup in iroh. Which is not even a notion that noq has at this time.
I'll think about it but not sure I can come up with a test. I've created
https://github.com/n0-computer/noq/issues/637 to follow up on this.

## Change checklist

- [x] Self-review.
2026-05-05 11:03:53 +00:00
Floris Bruynooghe d5a09efeec refactor(proto): Remove some obsolete warnings (#634)
## Description

With the current off-path nat traversal none of these limits apply, so
do not issue warnings about them.

We'll add appropriate warnings once we need them again, but there's no
point in logging stuff that does not matter.

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
2026-05-04 18:05:35 +00:00
Floris Bruynooghe 7ce929446c refactor(proto): Do not log as error (#632)
## Description

This can happen when we abandon the path for which the peer is just
retiring a CID. That's not really an issue.

## Breaking Changes

n/a

## Notes & open questions

Seen as NODES-BACKEND-31 on sentry

## Change checklist

- [x] Self-review.
2026-05-04 10:26:54 +00:00
Friedel Ziegelmayer 8c353b86e0 fix(noq-proto): do not recreate path state for already abandonend paths (#631)
Closes #630
2026-05-04 10:04:25 +00:00
Philipp Krüger c7119679e6 refactor(proto): Introduce CanonicalIpPort to fix IP canonicalization issues (#629)
## Description

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

## Notes & open questions

This should unblock https://github.com/n0-computer/iroh/pull/4213 and
seems to fix the test problems with ipv4-only hosts.

## 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-04-30 12:59:06 +00:00
Floris Bruynooghe ee806ab69a chore: Fail cargo-make flows for warnings (#624)
## Description

This sets the -Dwarnings flags so that the commands fail when there
are warnings. The output of the full flow easily scrolls off screen so
you don't notice things will fail on CI.

## Breaking Changes

n/a

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
2026-04-29 15:34:55 +00:00
Philipp Krüger a49f0665b6 refactor(proto): Raise limit of path responses kept around per PathData (#622)
## Description

- Raises `MAX_PATH_RESPONSES` from 16 to 32.
16 is not enough with users potentially having 25 interfaces or more
configured. Now that we send off-path PATH_CHALLENGEs all from a single
`PathId`, we need to be able to keep around 32 PATH_RESPONSEs queued for
sending for potentially that many challenges.
I've considered other values for this such as 64 or 128, but the
worst-case memory use caused by malicious attackers is quite bad, so
I've opted for the lowest reasonable value.
- Raises `MAX_QNT_ADDRS` in the proptests from 12 to 32, to match values
that will be set in iroh: https://github.com/n0-computer/iroh/pull/4213

Closes #613 (together with
https://github.com/n0-computer/iroh/pull/4213).


## 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-04-29 15:10:10 +00:00
Philipp Krüger e25d7dd60a feat(proto)!: Rename NAT traversal config and expose multipath default value (#621)
## Description

There was some inconsistency in naming in the transport config between
the multipath enabling config and NAT traversal enabling config:
- `max_concurrent_multipath_paths` vs.
- `set_max_remote_nat_traversal_addresses`

This renames `set_max_remote_nat_traversal_addresses` to
`max_remote_nat_traversal_addresses`, dropping the `set_` prefix.

I'm also removing the whole `#[cfg(doc)] pub const
DEFAULT_MAX_CONCURRENT_MULTIPATHS_PATHS` dance with two `const` values
and `NonZeroUSize`. There is no previous pattern for exposing config
defaults, so I'm keep it consistent.

## Breaking Changes

- Renamed `set_max_remote_nat_traversal_addresses` to
`max_remote_nat_traversal_addresses`.

## Notes & open questions

This is based on https://github.com/n0-computer/noq/pull/620 to avoid
conflicts.

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

<!--
tip:
Run `cargo make` in the workspace root to check many light-weight CI
steps locally.
-->
2026-04-29 13:27:49 +00:00
Philipp Krüger a60749cae7 feat(proto)!: Set default max concurrent multipath paths to 8 (instead of 12) (#620)
## Description

Since we're using off-path PATH_CHALLENGEs for punching firewall holes
(#567), we don't need as many concurrent multipath paths.

## Breaking Changes

None, only behavioral: The default maximum multipath paths is reduced
from 12 to 8.

## Notes & open questions

Partially addresses #613 

But really, we need to change the default in iroh more than the one in
noq.

I also changed the default used in the proptests. Those shouldn't break
older regression tests, none of them hit the concurrent path limit.

We might want to consider changing the whole
`DEFAULT_CONCURRENT_MULTIPATH_PATHS_WHEN_ENABLED_` constant dance, but
I'll do that in another PR.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
2026-04-29 12:08:34 +00:00
Friedel Ziegelmayer fd36bc5bf5 refactor!: cleanup single path based expectations (#616)
## Description

- Removes the two API calls on `Connection` that haven't been migrated
yet
- Adds some more explicit `expect`s for unnamed `unwrap`s

Closes #514

## Breaking Changes

- remove
  - `noq::Connection::local_ip`
  - `noq::Connection::remote_address`
2026-04-29 07:13:03 +00:00
Floris Bruynooghe 98e626f6e0 feat(proto): Client-side off-path nat traversal (#614)
## Description

Implement client-side off-path nat traversal:

- REACH_OUT frames are scheduled on a normal may_send_data path.
- NAT probes are sent off-path without opening a new path.
- On a successful probe a new path is opened.
- Paths to-be-opened are retried if they fail due to temporary errors.

Closes #568.

## Breaking Changes

While not specifically tested, I think this will still interoperate with
a 0.98 peer.

## Notes & open questions

- Paths that fail to be opened due to insufficient CIDs or MAX_PATH_ID
are retried without when those become available again, without
time-limit. This is unlikely to be a big deal right now.

- The NAT state for ClientSide and ServerSide are very similar now. But
I'd like to defer merging them further for a later refactor. This is
already enough logic change. It's a tad annoying since one side needs to
keep track of the sequence ID.

## Change checklist

- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-04-28 13:59:35 +00:00
Rüdiger Klaehn ecd08ae5f5 chore: Reexport all public noq-proto types at noq level (#615)
## Description

Reexport all public noq-proto types at noq level so crates that use noq
don't have to import noq-proto.

Exported types:

ClosePathError
ClosedPath
DecryptedInitial
PathError
PathEvent
PathStatus
SetPathStatusError

Fixes https://github.com/n0-computer/noq/issues/417

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

<!--
tip:
Run `cargo make` in the workspace root to check many light-weight CI
steps locally.
-->
2026-04-24 14:58:40 +00:00
Friedel Ziegelmayer 0ac6b4620b feat(proto): replace BBR with BBRv3 + breaking Controller API changes (#611)
Pulls in upstream quinn PR https://github.com/quinn-rs/quinn/pull/2481

Squashes the upstream commits and adapts them.

Closes #603

Upstream commits
- f8b25b24b - granular packet events for congestion controllers
- 52f04ed9b - Pacer queries Controller for pacing rate / send quantum
- c022e308a - BBRv3 implementation + MaxFilter
- ce60e5b5c - remove old BBR implementation



## Breaking Changes

- `Controller` trait:
  - `on_ack` gains `pn: u64`
  - `on_congestion_event` gains `largest_lost: u64`
- New optional `on_packet_sent`, `on_packet_lost`,
`on_ack_frequency_update`
- New `metrics()` -> `ControllerMetrics { congestion_window, ssthresh,
pacing_rate, send_quantum }`, used by the pacer
- Pacer changes:
- `Pacer::delay()` now also takes `capacity: Option<u64>` and
`pacing_rate: Option<u64>` from the controller; CC-supplied values take
precedence over the window-derived defaults but are still capped by
noq's `max_bytes_per_second`.

---------

Co-authored-by: Tipuch <fiorini751@proton.me>
2026-04-24 09:18:46 +00:00
Floris Bruynooghe 4a310f799c feat(proto): Accept off-path probe packets (#608)
## Description

When sending probing packets we need to accept them and send
responses.

This currently does not try to track all 4-tuples the server should
know, we only need this to work when qnt is enabled for now so I'm
taking a shortcut and not storing that state (yet).

This also fixes updating the 4-tuple too early: it would be update
even when a packet could still be rejected. We now only update the
4-tuple once the packet is fully authenticated. It is made clear that
earlier discards are only an optimisation.

This now fully respects the various probing packet requirements of
RFC9000, Multipath and QNT in all it's confusing combinations.

Fixes #599.

## Breaking Changes

n/a

## Notes & open questions

n/a

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

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-04-23 11:32:57 +00:00
Floris Bruynooghe 0c0e0205bb refactor(proto): Improve state of off-path nat probes (#600)
## Description

This moves the state of the server-side off-path NAT traversal probes
to not be mixed in with path challenges. This is helpful because this
is now mostly the same state as the client needs to be.

Importantly this no longer pads these nat traversal probes, they are
now only 35 bytes.

It addresses one of the fields in #591.

It also cleans up some logging for timers.

## Breaking Changes

n/a

## Notes & open questions

Note that since the server probes are not accepted by the client they
never get acknowledged. And the server keeps sending those probes until
the maximum count is reached. #599 will fix this.

Test coverage is test_simple_nat_traveral_opens_path which was added in
the
previous PR just for this purpose.

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

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-04-23 09:21:53 +00:00
Floris Bruynooghe c13d711efb chore(docs): Improve docs of PacketNumberSpace vs PathData a little (#598)
## Description

It was not made clear that the PathData stays the same for the
Initial, Handshake and Data(PathId::ZERO) spaces.

## Breaking Changes

n/a

## Notes & open questions

n/a

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

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-04-22 15:03:19 +00:00
Friedel Ziegelmayer 877dcca064 chore: sync with quinn@main (#606)
Synced up to
https://github.com/quinn-rs/quinn/commit/07ce61cc2f0ca1cf31eee24d366311c23197fe85

Closes #602 

### Commits applied in this PR

| upstream SHA | PR | subject | noq commit |
|---|---|---|---|
| 06f7f7df1 | [#2611](https://github.com/quinn-rs/quinn/pull/2611) |
Take boxed connection ID generator factories | `167c709c7` |
| 404db1bc9 | [#2495](https://github.com/quinn-rs/quinn/pull/2495) |
Move the ref counts out | `e6772ea9f` (bundled) |
| 4b7a03949 | [#2495](https://github.com/quinn-rs/quinn/pull/2495) | Fix
the (pre-existing) rightward drift by inverting conditions | `e6772ea9f`
(bundled) |
| 475b55bad | [#2495](https://github.com/quinn-rs/quinn/pull/2495) |
Early return in `RecvStream::drop()` | `e6772ea9f` (bundled) |
| 803c81479 | [#2541](https://github.com/quinn-rs/quinn/pull/2541) |
Remove `RecvStream`s from `blocked_readers` on `stop` | `e6772ea9f`
(bundled) |
| 37625fe2d | [#2609](https://github.com/quinn-rs/quinn/pull/2609) |
quinn: fix ref count logic for ConnectionRef and EndpointRef |
`e6772ea9f` (bundled) |
| 07ce61cc2 | [#2612](https://github.com/quinn-rs/quinn/pull/2612) |
Test cleanup of connections/endpoints when all references are dropped |
`e6772ea9f` (bundled) |
| 42de9dd2b | [#2469](https://github.com/quinn-rs/quinn/pull/2469) |
refactor(quinn-udp): extract `decode_socket_addr` helper | `2e4effbe4` |
| 4742a70e3 | [#2469](https://github.com/quinn-rs/quinn/pull/2469) |
refactor(quinn-udp): extract `ControlMetadata` helper | `6f5904350` |
| 2964782b4 | [#2472](https://github.com/quinn-rs/quinn/pull/2472) |
refactor(quinn-udp): split fast&slow send/recv paths | `a17058e80` |
| 459c34714 | [#2549](https://github.com/quinn-rs/quinn/pull/2549) | add
metric for spurious congestion events | `0c78d6435` |
| f853e5e08 | [#2550](https://github.com/quinn-rs/quinn/pull/2550) |
fix(perf): suppress table output in JSON mode | `0155ee3f6` |
| a0ec97a50 | [#2463](https://github.com/quinn-rs/quinn/pull/2463) |
feat(quinn-udp): make Apple fast datapath opt-in | `412dc6684` |
| bb005309e | [#2560](https://github.com/quinn-rs/quinn/pull/2560) |
docs: fix book build with mdbook 0.5.2 | `98cb0ad67` |
| ee8f9469b | [#2565](https://github.com/quinn-rs/quinn/pull/2565) |
fix: reuse existing socket for probing GRO/GSO support | `012530527` |
| 56bba7c0f | [#2565](https://github.com/quinn-rs/quinn/pull/2565) |
refactor: remove `gro` module | `1174207fa` |
| 04ba57c64 | [#2565](https://github.com/quinn-rs/quinn/pull/2565) |
fix: remove opportunistic GRO syscall | `35400c04e` |
| f0905db64 | [#2570](https://github.com/quinn-rs/quinn/pull/2570) |
docs(quinn): improve `Connection::close_reason()` documentation |
`287fd2b63` |
| 0adcd2053 | [#2573](https://github.com/quinn-rs/quinn/pull/2573) |
docs: clarify that `Event::ConnectionLost` is not emitted on local close
| `7f34b4517` |
| b8e4d3b9a | [#2572](https://github.com/quinn-rs/quinn/pull/2572) |
quinn: Make Endpoint::server dual-stack V6 by default | `461fe7f28` |
| 52c7ad189 | [#2583](https://github.com/quinn-rs/quinn/pull/2583) |
refactor(quinn-udp): add `retry_if_interrupted` helper | `348b91383` |
| 8acb578f1 | [#2584](https://github.com/quinn-rs/quinn/pull/2584) |
fix(unix): disable GSO after probing | `85c022d75` |
| e01f99e26 | [#2571](https://github.com/quinn-rs/quinn/pull/2571) |
fix: Resolve `sendmsg_x`/`recvmsg_x` via `dlsym` | `881d6f151` |
| eff557289 | [#2579](https://github.com/quinn-rs/quinn/pull/2579) |
proto: send STREAMS_BLOCKED when stream limit is hit | `e64abef10` |
| dc8640052 | [#2556](https://github.com/quinn-rs/quinn/pull/2556) |
Introduce `max_outgoing_bytes_per_second` option | `ffe5a5474` |
| bda24fdae | [#2602](https://github.com/quinn-rs/quinn/pull/2602) |
Upgrade rustls-platform-verifier to 0.7 | `e4570ea71` |

### Already present in noq 

| upstream SHA | PR | subject |
|---|---|---|
| 16e1aaad5 | [#2511](https://github.com/quinn-rs/quinn/pull/2511) | Fix
unused_mut warning from Rust 1.93 |
| e96c27943 | [#2533](https://github.com/quinn-rs/quinn/pull/2533) |
quinn-proto: make cids_exhausted overflow-safe on 32-bit |
| 5db36fe4e | [#2534](https://github.com/quinn-rs/quinn/pull/2534) |
docs: fix typo in EndpointStats |
| d305440ef | [#2540](https://github.com/quinn-rs/quinn/pull/2540) |
Upgrade fastbloom to 0.17 |
| 57b9d0abf | [#2558](https://github.com/quinn-rs/quinn/pull/2558) |
fuzz: add fuzzing target for parsing transport parameters |
| 655a8ad09 | [#2558](https://github.com/quinn-rs/quinn/pull/2558) |
proto: avoid unwrapping varint decoding during parameters parsing |
| 7f7d9ea90 | [#2610](https://github.com/quinn-rs/quinn/pull/2610) | Fix
clippy warnings from 1.95

### Skipped 

| upstream SHA | PR | subject | reason |
|---|---|---|---|
| e5b30f513 | [#2532](https://github.com/quinn-rs/quinn/pull/2532) |
quinn-udp: make ECN best-effort on Windows (Wine/Proton) | noq already
has its own Wine/Proton ECN handling using `AtomicBool`
runtime-detection (noq PR
[#414](https://github.com/n0-computer/noq/pull/414)); upstream's
static-bool approach would be redundant. |
| 70d083be9 | [#2540](https://github.com/quinn-rs/quinn/pull/2540) |
Upgrade to qlog 0.16 | noq uses its own `n0-qlog` fork with a different
API. |
| d8db7a047 | [#2599](https://github.com/quinn-rs/quinn/pull/2599) |
Upgrade to qlog 0.17 | Same reason as above. |
| 41bf1db60 | [#2564](https://github.com/quinn-rs/quinn/pull/2564) |
fix: evaluate `max_gso_segments` for every socket on Windows | noq
already tracks `max_gso_segments` per-socket on an `AtomicUsize`. |
| 905e1090f | [#2599](https://github.com/quinn-rs/quinn/pull/2599) |
Bump MSRV to 1.82 (for qlog -> serde_with) | noq is already at MSRV
1.88. |
| 95863afb5 | [#2602](https://github.com/quinn-rs/quinn/pull/2602) |
Bump MSRV to 1.85 (for rustls-platform-verifier) | Same reason as above.
|

---------

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>
Co-authored-by: Lars Eggert <lars@eggert.org>
Co-authored-by: Fabien SAVY <fabien.savy@stormshield.eu>
Co-authored-by: Zotyamester <szatmary.zoltan1222@gmail.com>
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: zphrs <z@zephiris.dev>
Co-authored-by: alexchenai <alexchenai@users.noreply.github.com>
Co-authored-by: Romain Roffé <r2@kyber.media>
Co-authored-by: cong-or <conchubhar.gannon@gmail.com>
Co-authored-by: Adolfo Ochagavía <github@adolfo.ochagavia.nl>
2026-04-22 16:06:32 +02:00
dignifiedquire 79b20f4453 fix: gate perf Path import on json-output + restore deny.toml entries 2026-04-22 15:15:19 +02:00
dignifiedquire 8a8119b4d9 chore: clean up stale deny.toml entries (unused license/skips) 2026-04-22 15:15:19 +02:00
dignifiedquire 93a2710e74 chore: bump rustls-webpki to 0.103.13 (RUSTSEC-2026-0104) 2026-04-22 15:15:19 +02:00
Dirkjan Ochtman d4f61c1088 Upgrade rustls-platform-verifier to 0.7
(cherry picked from commit bda24fdae5)
2026-04-22 15:15:19 +02:00
Adolfo Ochagavía 8b2023ace2 Introduce max_outgoing_bytes_per_second option
(cherry picked from commit dc8640052a)
2026-04-22 15:15:19 +02:00
cong-or cd3c8c7f2a proto: send STREAMS_BLOCKED when stream limit is hit (#2579)
(cherry picked from commit eff5572893)
2026-04-22 15:15:19 +02:00
Lars Eggert c435c086e5 fix: Resolve sendmsg_x/recvmsg_x via dlsym
The fast-apple-datapath feature previously declared `sendmsg_x` and
`recvmsg_x` as hard extern "C" symbols. On Apple OS versions where these
private APIs don't exist, the dynamic linker would reject the binary at
load time.

Replace the `extern "C"` block with lazy `OnceLock`-based resolvers
using `dlsym`. Both functions now return `Option<Fn>`, and the call
sites in `send_via_sendmsg_x` and `recv_via_recvmsg_x` propagate an
`Unsupported` error if the symbol is absent. This allows callers to
probe availability at runtime before enabling the fast path.

(cherry picked from commit e01f99e265)
2026-04-22 15:15:19 +02:00
Thomas Eizinger bee7381342 fix(unix): disable GSO after probing
After probing the given socket for GSO support, we need to disable this option
again to ensure we can selectively enable it via our cmsg codepaths.

(cherry picked from commit 8acb578f10)
2026-04-22 15:15:19 +02:00
Lars Eggert 609ddba73c refactor(quinn-udp): add retry_if_interrupted helper
Replaces the repeated EINTR-retry loop pattern in `send_single`,
`send_via_sendmsg_x`, `recv_via_recvmmsg`, and `recv_via_recvmsg_x`.

(cherry picked from commit 52c7ad1898)
2026-04-22 15:15:19 +02:00
Romain Roffé ef2be0709d quinn: Make Endpoint::server dual-stack V6 by default
(cherry picked from commit b8e4d3b9ac)
2026-04-22 15:15:19 +02:00
alexchenai 476c7bc61a docs: clarify that Event::ConnectionLost is not emitted on local close
Clarify in the documentation for `Event::ConnectionLost`, `is_closed()`,
and `is_handshaking()` that the `ConnectionLost` event is only emitted
when the connection is closed by the peer or due to an error/timeout.
When the local application calls `Connection::close()`, no
`ConnectionLost` event is emitted; instead, pending operations fail with
`ConnectionError::LocallyClosed`.

Fixes #1495

(cherry picked from commit 0adcd20531)
2026-04-22 15:15:19 +02:00
zphrs 1fdd690447 docs(quinn): improve Connection::close_reason() documentation
(cherry picked from commit f0905db641)
2026-04-22 15:15:19 +02:00
Thomas Eizinger dfa247c605 fix: remove opportunistic GRO syscall
(cherry picked from commit 04ba57c643)
2026-04-22 15:15:19 +02:00
Thomas Eizinger 5ec5e649c3 refactor: remove gro module
(cherry picked from commit 56bba7c0fa)
2026-04-22 15:15:19 +02:00
Thomas Eizinger db87183627 fix: reuse existing socket for probing GRO/GSO support
Instead of creating two throw-away sockets for probing GRO & GSO,
use the existing socket that gets passed into `UdpSocketState::new`.

Related: #2564
(cherry picked from commit ee8f9469b8)
2026-04-22 15:15:19 +02:00
Dirkjan Ochtman bd83f7e42f docs: fix book build with mdbook 0.5.2
(cherry picked from commit bb005309e6)
2026-04-22 15:15:19 +02:00