Commit Graph

4857 Commits

Author SHA1 Message Date
Frando 4bdbf365a1 enable trace logging for patchbay tests 2026-03-23 09:01:49 +01:00
Frando ddf4a4d194 deps: bump patchbay 2026-03-20 15:12:55 +01:00
Frando 32e05c027b tests: add patchbay tests 2026-03-20 12:54:39 +01:00
Floris Bruynooghe f3a73c7bdd refactor(proto): ordering of REACH_OUT and OBSERVED_ADDR building (#508)
* it's the weekend, this is useful in my head

so let's check in totally broken code.

* more

* wip

* wip

* wip

* try more stuff

* moar

* more wip

* can't send anything when there's nothing to send

This stopped us from going to the next space to coalesce the Initial
with the Handshake packet on the server-side. And probably lots of
other stuff

* wip

* and check for loss probes that need to be sent

* some doc updates

* remove SendableFrames::validation, it was redundant

Turns out this was exactly the same case as
SendableFrames::space_id_only.

* Add a test that checks we send on an available path

* simplify the packet scheduling logic a little

* Simplify, immediate close during handshake is broken though

* wip

* Guess we do need a new field for this

Slightly sad to have to make an explicit exception for this, at least
currently.

* clippy

* may_send_data has been made smarter, don't need this

* wip

* tweak logging

* proptests should maybe log errors?

* drive to idle for a 1000 iterations, 100 is a bit small

* turns out we don't need this and i find it a bit confusing

* remove stuff split off into #494

* Remove changes split off into 495

* typo

* style

* ww

* remove this old thing

* tweak

* needs_loss_probe is a variable above, it's not that bad

* collapse these two cases. it's a hard call though

* well doh, the doc comment says why

* wordsmithing, because 90% of packet scheduling is about that

* put this back, split off into another pr

* fix doc comment

* Typos from code review

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* Do not allocate and move scheduling info to separate function

Two bits of PR review:

- Move the scheduling to a separate function.
- Avoid an allocation, but this has some tradeoffs.

- I now have two loops that look for the PathId by doing `next_path_id
  = self.path.keys().find(|i| **i > path_id).copied();`. It might be
  possible to fold the MTU discovery in the main poll loop, MTU packets
  would get a slightly higher priority but probably not really harmful
  overall.

- I now need to do the computation for
  `have_validated_status_available_space many more times.

I'm not sure how much the compiler manages to remove all of that. Is
it smart enough to figure out that
`have_validate_status_available_space` won't change between the calls
and does it move it out? Does it make the iteration as fast as the
previous version?

On the other hand, we now have some situations where we don't have to
compute the scheduling information, and no longer need to compute it
for all paths if we don't send on the last path.

What do you think, which version is better (though I also adopted
@matheus23's feedback about splitting it off to a function, but that
doesn't affect this really. It does make the diff a little bit more
though)?

As an aside, in working out of how scheduling should work it was
really helpful to have to extremely explicit as a bunch of data that's
computed up-front. But it's fair that now we know this is how it
should work that we can implement it in the most optimal way.

* Small attempt at making this clearer

* fix docs

* refactor(proto): ordering of REACH_OUT and OBSERVED_ADDR building

The ordering of these frames was a bit too eager.

REACH_OUT is important timing-wise. But it is not more important than
HANDSHAKE_DONE, PING, IMMEDIATE_ACK, ACK, ACK_FREQUENCY and should
anyway not be sent on a path that also needs
PATH_CHALLENGE. PATH_RESPONSE could be the one exception but it is
also small.

If one of those frames do end up in the same packet as REACH_OUT there
will still be place for the REACH_OUT frame. The CRYPTO frame is left
after it, because after the handshake that is only carrying auxiliarry
non-time-sensitive information, and REACH_OUT is also only possible in
the data space kind.

OBSERVED_ADDRESS is definitely not that high priority, it might need
to move back even further.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-03-19 11:31:13 +00:00
Floris Bruynooghe 4bf3dc9bf2 fix: improve packet scheduling for not-validated paths (#444)
* it's the weekend, this is useful in my head

so let's check in totally broken code.

* more

* wip

* wip

* wip

* try more stuff

* moar

* more wip

* can't send anything when there's nothing to send

This stopped us from going to the next space to coalesce the Initial
with the Handshake packet on the server-side. And probably lots of
other stuff

* wip

* and check for loss probes that need to be sent

* some doc updates

* remove SendableFrames::validation, it was redundant

Turns out this was exactly the same case as
SendableFrames::space_id_only.

* Add a test that checks we send on an available path

* simplify the packet scheduling logic a little

* Simplify, immediate close during handshake is broken though

* wip

* Guess we do need a new field for this

Slightly sad to have to make an explicit exception for this, at least
currently.

* clippy

* may_send_data has been made smarter, don't need this

* wip

* tweak logging

* proptests should maybe log errors?

* drive to idle for a 1000 iterations, 100 is a bit small

* turns out we don't need this and i find it a bit confusing

* remove stuff split off into #494

* Remove changes split off into 495

* typo

* style

* ww

* remove this old thing

* tweak

* needs_loss_probe is a variable above, it's not that bad

* collapse these two cases. it's a hard call though

* well doh, the doc comment says why

* wordsmithing, because 90% of packet scheduling is about that

* put this back, split off into another pr

* fix doc comment

* Typos from code review

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* Do not allocate and move scheduling info to separate function

Two bits of PR review:

- Move the scheduling to a separate function.
- Avoid an allocation, but this has some tradeoffs.

- I now have two loops that look for the PathId by doing `next_path_id
  = self.path.keys().find(|i| **i > path_id).copied();`. It might be
  possible to fold the MTU discovery in the main poll loop, MTU packets
  would get a slightly higher priority but probably not really harmful
  overall.

- I now need to do the computation for
  `have_validated_status_available_space many more times.

I'm not sure how much the compiler manages to remove all of that. Is
it smart enough to figure out that
`have_validate_status_available_space` won't change between the calls
and does it move it out? Does it make the iteration as fast as the
previous version?

On the other hand, we now have some situations where we don't have to
compute the scheduling information, and no longer need to compute it
for all paths if we don't send on the last path.

What do you think, which version is better (though I also adopted
@matheus23's feedback about splitting it off to a function, but that
doesn't affect this really. It does make the diff a little bit more
though)?

As an aside, in working out of how scheduling should work it was
really helpful to have to extremely explicit as a bunch of data that's
computed up-front. But it's fair that now we know this is how it
should work that we can implement it in the most optimal way.

* Small attempt at making this clearer

* fix docs

* Rename field based on more feedback

* fix docs

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-03-19 10:47:41 +00:00
Rüdiger Klaehn 2156ac1c30 bench: Allow configuring the runtime type in the bulk bench (#280)
* Allow configuring the runtime type in the bulk bench

Also switch the default to the multithreaded runtime. I think that is more
representative of actual use.

* fmt

* clippy

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-03-19 08:24:04 +00:00
Dinesh Bhattarai 6345b88c87 Fix typo in RFC 9001 link in README.md (#510) 2026-03-17 11:02:59 +00:00
Philipp Krüger 2a591fa0f4 refactor(proto): Switch from Rng trait to CryptoRng where appropriate (#497) 2026-03-16 11:09:28 +00:00
Floris Bruynooghe 9e78aad8c8 feat(proto): issue CIDs in order of ascending path ID (#504)
* feat(proto): issue CIDs in order of ascending path ID

We used to issue CIDs in sequence order, but not in reverse order of
path ID. This is not the order in which you need to have CIDs. This
fixes this to always issue them in order of ascending path ID and then
ascending order of sequence ID.

By introducing the newtype to do this, we also ensure that this order
is respected even when retransmits come into play. The newtype keeps
its sorting invariance when retransmits are merged back in.

Another benefit of the newtype is that this order is now enforced in a
specific place. Before it was implicit on the reliance between how the
endpoint ID generated the CIDs, how it then sent them to the
connection and how the connection stored and consumed them. It was
very implicit.

WRT to the cost of doing all the ordered inserts: CIDs are issued
relatively infrequently and usually not in huge numbers. Even
considering we want to increase those numbers in the future I think
using a simple Vec as storage is a decent choice for numbers of a few
100 CIDs that can be expected at most.

Fixes #137.

* fix aws-lc-rs tests, hopefully

* lol

* fix test

* Use cmp::Reverse instead of manual cmp

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* Sort less for the sorting gods

This optimises how we sort:

- Sort is still not manually implemented, as tempting it is to
  implement insertion sort. I'm a believer of not manually
  implementing algorithms.

- The major downside is that all functions need to be aware of the
  invariants. Everyone needs to manipulate the fields.

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-03-16 11:04:11 +00:00
Floris Bruynooghe 7e9f628c47 chore(ci): add standard text to beta ci notifications (#506)
We have this everywhere else, it make the notifications consistent and
easy to read.
2026-03-16 09:15:49 +00:00
Philipp Krüger 8adda44486 deps(proto): Don't require ring in wasm builds (#503) 2026-03-13 09:58:39 +00:00
Philipp Krüger c21decd159 feat(proto): Add QuicServerConfig::set_alpn_protocols in rustls feature (#496)
* Implement `ServerConfig::set_alpn_protocols`

* Revert "Implement `ServerConfig::set_alpn_protocols`"

This reverts commit 1708b1afa4a791086aa6cd351edd35ec3f012cfe.

* Implement `set_alpn_protocols` only on `rustls::QuicServerConfig`

* Also allow `QuicClientConfig::set_alpn_protocols`

* Fix documentation

Co-authored-by: Floris Bruynooghe <flub@n0.computer>

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-03-13 09:23:14 +00:00
Floris Bruynooghe caf22ae6f8 refactor(clippy): enable manual_let_else lint and fix code (#500)
* refactor(clippy): enable manual_let_else lint and fix code

I'd like to slowly turn on more and more linting.

* cargo format
2026-03-13 08:26:07 +00:00
Floris Bruynooghe a92084ba7a ci(docs): Check internal docs as well (#499)
* ci(docs): Check internal docs as well

We also want to check that the internal docs are all correct, so we do
not get broken links etc. We have a lot of internal docs, internal
docs are great!

* turns out that syntax is not supported

* fixup all the doc errors

* fix format

* naming nitpicking, fewer changes
2026-03-12 11:44:55 +00:00
Floris Bruynooghe 89a9e7f927 fix(ci): Switch to sccache-action entirely (#501)
This was the only remaining use of rust-cache.

Fixes #481.
2026-03-12 11:26:55 +00:00
Floris Bruynooghe 9725dfb270 refactor: remove redundant log message (#498)
The packet builder now logs this already.
2026-03-12 07:57:05 +00:00
Floris Bruynooghe d93c159954 refactor(proptests): improvements to runs and logging (#495)
* drive to idle for longer

* log more things in proptests

* use .inspect_err() instead of .map_err()
2026-03-11 14:15:14 +00:00
Floris Bruynooghe 2b04ddf5c8 chore(tests): rename proptests modules to all be consistent (#493)
We also have a `connection::send_buffer:proptests` module, which did
not match the nextest naming for the proptest profile. So those tests
were being run in a normal test run.

Because switching that module name to be "proptest" is problematic
since the crate is also called "proptest" and that creates naming
conflicts with the `user super::*` I opted to change the
tests/proptest module to become proptests instead.
2026-03-11 12:51:57 +00:00
Floris Bruynooghe eab0948804 refactor(proto): a few logging and comment tweaks (#494)
Mostly just to split off irrelevant changes from #444.
2026-03-11 12:49:16 +00:00
Rüdiger Klaehn 9234776e64 ci: Build on RISC-V espidf to check that we properly use portable_atomic and don't use advanced posix features. (#492)
* ci: Add ESP32-C3 build check for noq, noq-proto, and noq-udp

Cross-compile check using riscv32imc-esp-espidf target with
nightly + build-std. No ESP-IDF SDK needed for cargo check.

* test: Deliberately break ESP32 build to verify CI catches it

Use unix.rs instead of posix_minimal.rs on espidf to confirm the
esp32_check CI job fails as expected. Revert after verifying.

* Revert "test: Deliberately break ESP32 build to verify CI catches it"

This reverts commit 45f096edc8.

* Correct ci step name

* Use sccache for new ci checks.
2026-03-11 10:33:10 +00:00
Floris Bruynooghe 39510cd443 proto(tests): Document the routing table for proptests a bit (#490)
* proto(tests): Document the routing table for proptests a bit

Adding documentation for how the routing of proptests works.

* improve wording
2026-03-10 11:14:19 +00:00
Philipp Krüger 98507bd045 refactor(proto)!: Remove excessive Arc-wrapping (#489) 2026-03-10 10:51:21 +00:00
dignifiedquire 6b1767964d chore: fix release config 2026-03-09 14:45:33 +01:00
dignifiedquire 87bc101847 docs: create CHANGELOG.md 2026-03-09 14:42:54 +01:00
dignifiedquire faeddf58ee chore: Release noq-proto-v0.16.0 noq-udp-v0.9.0 noq-v0.17.0 2026-03-09 14:41:38 +01:00
dignifiedquire 13695a47ab chore: release prep 2026-03-09 14:40:18 +01:00
Philipp Krüger 752588b980 fix(proto): Avoid unwrapping VarInt decoding during TransportParameter parsing (#485)
* fuzz: add fuzzing target for parsing transport parameters

* proto: avoid unwrapping varint decoding during parameters parsing

---------

Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2026-03-09 10:57:09 +00:00
Diva Martínez c5c0d2f856 reduce log level (#482) 2026-03-06 14:49:36 +00:00
Philipp Krüger bb46490ea7 feat(proto)!: Don't require a HKDF construction in HandshakeTokenKey (#480)
* Implement HandshakeTokenKeys directly using AES-GCM

* Revert to old HDKF-based construction, but with changed trait

* Cleanup

* Clippy fix
2026-03-06 12:27:27 +00:00
Rüdiger Klaehn 018517663d feat: Add minimal socket2 based impl (previously fallback.rs) (#478)
* Rename fallback.rs to posix_minimal.rs

Use it for platforms that are unix, but don't support advanced stuff like
CMSG, GRO, GSO.

Also fix some compile errors in the former fallback.rs

* Test noq-udp with the new posix_minimal configuration

* Eliminate warnings for posix_minimal config.

* shut up clippy
2026-03-05 11:18:14 +00:00
Philipp Krüger 6f48f3ab4a chore(proto): Fix unused import warning with only rustls + platform-verifier (#473) 2026-03-04 09:52:14 +00:00
Asmir Avdicevic caf81fd2e2 chore(ci): adjust runner usage and storage policies (#471)
* chore(ci): adjust runner usage and storage policies

* fix android

* fix android again
2026-03-03 12:58:06 +00:00
Floris Bruynooghe e71b78b88a chore: Attempt at drafting a readme (#467)
* chore: Attempt at drafting a readme

* spelling

* Fix crypto wording

* typo

* remove support for version 2

seems that needs a little more work

* add modern stuff folks demand

* qlog typo

* Try and be slightly less confusing
2026-03-03 12:39:50 +00:00
Rüdiger Klaehn b342c4683f Parse ALPNs at incoming level (#454)
* WIP

* Prettify parsing code

* Fix error in docs

* clippy

* Some optimizations:

- use a lazy iterator over the ALPNs
- fast path for when the ALPNs are in the first crypto frame

Also some tests for the rarely used assembly stuff.

* Fix doc comments regarding allocations

* Add a newtype wrapper for the decrypted initial packet.

We can then add all the various convenience methods to it, not to the main Incoming.
So even if we have a lot of stuff on it we don't pollute the incoming API.

Also we cache the decryption.

* Extend comments about decrypt
2026-03-03 11:52:50 +00:00
Philipp Krüger ee63d4bc48 fix(proto): Don't generate endpoint events in drained connection state (#470)
* fix(proto): Don't generate endpoint events in drained connection state

* Change a `!self.state.is_drained` check into `debug_assert!`
2026-03-03 10:36:03 +00:00
Philipp Krüger 13a1c456f5 feat!: Allow compiling with rustls, but without any crypto providers compiled into rustls (#462)
* Switch to `aes-gcm` crate for retry token logic when using rustls

* Split `rustls-ring` and `rustls-aws-lc-rs` features into `rustls`, `ring` and `aws-lc-rs` features.

* Better document the features.

* `cargo make format`

* Fix outdated feature references

* Avoid double-defining `configured_provider`

* File an issue about suddenly working PQC handshakes now breaking a test

* Fix rebase

* Only enable `aes-gcm` dependency when needed

* Add features for backwards compatibility

* Add some links to the spec's retry packet integrity section
2026-03-02 11:56:51 +00:00
Ben Hagen 6c4de8557e fix: avoid lock re-entry in open_path_ensure and add regression test (#464)
Drop the connection state lock before cloning ConnectionRef in the existing-path branch of open_path_ensure, and add a multipath regression test that verifies ensuring an existing path resolves quickly and returns consistent path details.
2026-03-02 09:04:12 +00:00
Friedel Ziegelmayer 294e3ea603 refactor!: rename to noq (#461)
* refactor!: rename to noq

* fixup python scripts

* fixup

* fixup

* fixup: cr
2026-02-27 14:57:21 +00:00
Floris Bruynooghe 6f06f1f3bd refactor: switch back to pending name for this (#460)
We decided to stick with the pending naming scheme after all.
2026-02-27 10:42:18 +00:00
Diva Martínez 8a9a7021fd fix(proto): set open path timer when first packet is sent (#458)
* set the open path timer only when the path challenge frame has been sent

* test

simplify test comments

* clarify
2026-02-26 19:18:48 +00:00
Philipp Krüger 6ec9ffec6a fix(proto): Remove race condition between take_error & overwriting in move_to_draining (#452)
* Write regression test

* fix(proto): Remove race condition between taking error & overwriting it in `move_to_draining`

* `cargo make format`
2026-02-24 13:43:55 +00:00
Floris Bruynooghe 588efa507c refactor: remove needless variable (#453)
At some point in the past this probably worked around some borrowing
issues. Now it is distracting (just kidding, it was always
distracting but sadly necessary).
2026-02-24 11:58:52 +00:00
Philipp Krüger b966872d35 fix(proto): Properly separate on-path and off-path challenge logic (#449)
* refactor: Some renames

* fix(proto): Only clear and resend on-path challenges

* cr: Renames discussed in discord

* cr: log response
2026-02-23 15:49:42 +00:00
Floris Bruynooghe 0696c830d8 refactor: defensive styel & move code around (#450)
Some refactors:

- Move code around so that helpers structs come after the Connection,
  kind of more the style and keeps connection code more together.
- Use some defensive coding in the spaces impls. Fix a few bugs
  detected by it
2026-02-23 14:18:11 +00:00
Philipp Krüger 5e6ee88d79 regression test: infinite path challenge resending (#442)
* Write regression test

* Add comments to regression test

* Add comment on how we fixed the test
2026-02-23 09:42:16 +00:00
Diva Martínez 565ebec2c0 chore: unify nat traversal naming (#445)
* remove iroh from code, in favor of n0; remove hole punching in favor of nat traversal

* updates

* url fmt
2026-02-23 08:52:44 +00:00
Diva Martínez 8fc9cdd77a fix(proto): fix checks to understand if a path response is valid (#443)
* fix path challenge issues

* the tests

* keep two set of challenges

* fmt

* remove proptest, there's no need

* tone down descriptions

* passive migration sets ip

* adjust test

* spelling

* take into account MSRV

* add more info to the ignored variant

* allow the case when the challenge was sent without knowing our src ip
2026-02-23 08:44:01 +00:00
Diva Martínez c69a939edb fix(quinn-proto): path abandon does not clear all timers, in particular, not loss detection (#438)
* do not clear _all_ timers

* Apply suggestions from code review

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* fmt

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-02-20 21:51:07 +00:00
Franz Heinzmann 88cf95fcd0 refactor!: improve path events around path closing (#427)
* refactor: improve path events around path closing

* chore: clippy, codespell

* improve docs

* address PR review
2026-02-20 17:12:23 +00:00
Philipp Krüger 041777b9d2 ci: Fix daily proptest runs (#441) 2026-02-20 14:43:57 +00:00