Commit Graph

4561 Commits

Author SHA1 Message Date
dignifiedquire 2e0c4f1f26 wip: split out paths struct 2025-12-17 11:34:35 +01:00
dignifiedquire d320c63c06 cleanup 2025-12-17 10:07:04 +01:00
dignifiedquire 0cfc00d393 feat(proto): improve PTO calculations on shutdown 2025-12-17 10:07:04 +01:00
Asmir Avdicevic 9947dfa162 fix(ci): windows test build fix (#273)
## Description

Align the windows CI tests with the rest of the build env so we avoid
sproadic config issues against fips.

## 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.
-->
2025-12-17 08:56:09 +00:00
Asmir Avdicevic c4fb84b8c4 fix(ci): windows test build fix 2025-12-17 08:46:28 +01:00
Diva Martínez 56294fe707 fix(quinn-proto): set the hole punching round 2025-12-16 22:48:22 +01:00
Friedel Ziegelmayer 7a3f33ecc1 fix(proto): do not attempt to initate NAT traversal on a closed connection (#268) 2025-12-16 17:34:59 +00:00
dignifiedquire 2bfe573f90 typing 2025-12-16 18:21:52 +01:00
dignifiedquire 1ac2c3c914 fix(proto): do not attempt to initate NAT traversal on a closed connection 2025-12-16 18:21:52 +01:00
Asmir Avdicevic d1a6b5a3d1 fix(ci): windows deps (#267)
## Description

<!-- A summary of what this pull request achieves and a rough list of
changes. -->

## Breaking Changes

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

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
2025-12-16 17:20:52 +00:00
Asmir Avdicevic eb59f64ae5 fix(ci): windows deps 2025-12-16 18:01:20 +01:00
Diva Martínez caccc6754d fix: include off-path challenges in setting challenge lost timer (#261)
## Description

we need to take into account path challenges for remotes other than
received ones when stopping the challenge lost timer

## Breaking Changes

n/a

## Notes & open questions

n/a
2025-12-16 16:57:31 +00:00
Diva Martínez 5b6efe9944 add set_or_stop to connection timers 2025-12-16 11:52:36 -05:00
Diva Martínez 7ab9cb15c1 Merge branch 'main' into set-off-path-challenge-timers 2025-12-16 10:13:45 -05:00
Diva Martínez 706cb2d232 refactor: move path logic for received path response to path (#259)
## Description

Moves logic about receiving path response to the path state. This helps
simplify the connection logic and have a better separation of concerns

**technically this also fixes a bug where we send multiple path open
events**

## Breaking Changes

n/a

## Notes & open questions

n/a
2025-12-16 15:06:01 +00:00
Diva Martínez 01536ace3d Merge branch 'main' into refactor-handle-path-response 2025-12-16 09:53:57 -05:00
Diva Martínez a74b51c65f Merge branch 'main' into refactor-handle-path-response 2025-12-16 09:51:28 -05:00
Diva Martínez 9cac306da1 fix(proto): Don't assume a path is validated if we had another path on the same remote (#258)
## Description

We can't assume that opening a path to a remote address is going to be
valid if we have another path to the same remote that is valid, because
they might be different four-tuples underneath.

The bug was found by a proptest in CI, that I added as a regression test
with a comment.

This should also be fixed "fully" by tracking the proper four-tuple, but
that's a bigger refactor (that I'm working on in parallel).
I'm opening this to prevent any PRs getting blocked by CI failing due to
this bug (and the proptest finding it again).
2025-12-16 14:47:43 +00:00
Philipp Krüger d5cf02696c Merge remote-tracking branch 'origin/main' into matheus23/fix-path-validation 2025-12-16 15:38:13 +01:00
Philipp Krüger 9b439430a4 Use correct prefix for the regression test 2025-12-16 15:37:53 +01:00
Philipp Krüger 04afc1c313 Change the eprintln! to a tracing::error! 2025-12-16 15:35:26 +01:00
Friedel Ziegelmayer 83b3c73239 docs: cleanup readme and update licensing infos (#266) 2025-12-16 14:30:33 +00:00
Diva Martínez 00f4bebebf Merge branch 'main' into refactor-handle-path-response 2025-12-16 09:18:52 -05:00
dignifiedquire afc6947323 docs: cleanup readme and update licensing infos 2025-12-16 15:05:14 +01:00
Friedel Ziegelmayer 8e056b5bfe ci: update branch name to main (#265) 2025-12-16 13:21:48 +00:00
dignifiedquire 6ed0e458f9 ci: update branch name to main 2025-12-16 13:59:16 +01:00
Rüdiger Klaehn 65c66d5929 deps: switch to criterion for benching (#262)
* Switch from bencher to criterion

* clippy

* MSRV
2025-12-16 10:24:03 +00:00
Asmir Avdicevic 3e1abcae86 chore(ci): cache more deps (#253)
* chore(ci): cache more deps

* pin and cache codespell

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2025-12-16 09:15:42 +00:00
Diva Martínez fe9d950cc3 more little changes 2025-12-15 15:21:53 -05:00
Diva Martínez dffd8a6d9d spelling 2025-12-15 15:16:53 -05:00
Diva Martínez f53d33a4d3 reduce diff 2025-12-15 15:10:45 -05:00
ramfox 18604d36be feat: publically export UnorderedRecvStream (#260)
Co-authored-by: “ramfox” <“kasey@n0.computer”>
2025-12-15 20:08:25 +00:00
Diva Martínez 1e37c366a0 Revert "keep only refactor changes"
This reverts commit a91a51cb63.
2025-12-15 14:55:31 -05:00
Diva Martínez 1c4b5ac3b3 further reduce diff 2025-12-15 14:47:41 -05:00
Diva Martínez a91a51cb63 keep only refactor changes 2025-12-15 14:44:54 -05:00
Diva Martínez c742e038b8 refactor path logic into path 2025-12-15 14:35:01 -05:00
Philipp Krüger 09fafd0a6c Don't assume paths are validated if we've got another validated path with the same remote 2025-12-15 18:18:53 +01:00
Philipp Krüger 69b98af84d Add regression test for incorrect path validation 2025-12-15 18:18:40 +01:00
Philipp Krüger 4f9d519ef4 fix(proto): Ensure errors are returned from proto::Connection::poll, fix PATH_ABANDON logic (#234)
* fix(proto): Never use `self.close` from within quinn-proto, to ensure errors are returned from `poll`

* Use `Connection::poll` instead of accessing `.state().take_error()`

* Don't allow closing the last path, if no other *validated* path exists.

Closes #244

* Add yet another regression test, also fix a typo in random_interaction

* Set the `PathNotAbandoned` timer to at least the idle timeout

Otherwise it's possible to mistake the connection timing out for a transport error of PATH_ABANDON not being sent.

* `cargo make format`

* Only return a transport error for an unanswered PATH_ABANDON if we still receive data on that path

* Remove unused `PathNotAbandoned` timer

* Rename `PathAbandon` to `ForgetPath` and `drop_path_state` to `forget_path`

* Ignore "last path abandoned by peer" errors

* Apply clippy suggestion

* I guess a follow-up clippy fix? Lol

* Rename "forget" to "discard"

* Store `last_allowed_receive` in `PathState`

* Chnage error message for failing PATH_ABANDON response

* Fix timer name in qlog

* Nit: Better warn message

* Comment suggestion

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

* Fix comment grammar

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

* Add reference to `on_packet_authenticated` in comment

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2025-12-15 17:00:00 +00:00
Rüdiger Klaehn 8dfdc04e13 feat: Introduce UnorderedRecvStream newtype (#257)
* Introduce UnorderedRecvStream newtype and remove unordered flag from recv_chunk

The only way to do unordered reads is now via the UnorderedRecvStream.

UnorderedRecvStream duplicates the API of RecvStream related to stream state

* Fix bench

* Update quinn/src/recv_stream.rs

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

* Update quinn/src/recv_stream.rs

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

* Add links to docs.

* Add doc comment to UnorderedRecvStream.

* Remove IllegalOrderedRead in quinn.

We do not remove ReadableError::IllegalOrderedRead in quinn-proto, since
using the current quinn-proto API you can still get it.

So we need to panic in the (single) place where we convert a ReadableError
to a ReadError.

* Move struct definition closer to impl

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2025-12-15 15:52:45 +00:00
Friedel Ziegelmayer 36fe698a36 fix(proto): return error in initiate_nat_traversal_round (#254) 2025-12-15 14:35:40 +00:00
Philipp Krüger 52364f3f3a ci: Run docs preview, as long as it's a run in the n0-computer/quinn repo (#256)
* ci: Run docs preview, as long as it's a run in the `n0-computer/quinn` repo

* improve docs check

---------

Co-authored-by: Asmir Avdicevic <asmir.avdicevic64@gmail.com>
2025-12-15 10:01:06 +00:00
Philipp Krüger b49b43f2cc feat: Implement CidQueue::next_reserved (#180)
* Implement `CidQueue::next_reserved`

* Explanatory comment

* Mark `next_reserved` as test only, temporarily

* add failing test

* Add a TEMP display impl

* Fix `next`

* add another test

* cleanup

* fmt

---------

Co-authored-by: Diva Martínez <git@divma.net>
Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
2025-12-12 21:45:44 +00:00
Philipp Krüger ad4c99f126 feat(test): Set dst_ip for incoming datagrams in TestEndpoint (#248)
* Use actually different IP addrs in proptests

* Introduce `Inbound` type and populate `dst_ip` in `Endpoint::handle` for `TestEndpoint`
2025-12-12 19:13:43 +00:00
Rüdiger Klaehn 38a7d1558f Use array range set everywhere (#212)
* Use ArrayRangeSet in SendBuffer

* Implement replace for ArrayRangeSet

* Remove RangeSet

* WIP

* Remove complex op from ArrayRangeSet that is used nowhere

also remove some stray println! from some tests

* Shut up clippy

* fmt

* Replace replace with an iterator and insert.

iter_range does a linear scan, but so do all other ArrayRangeSet ops.

binary search only becomes worth it when it becomes very large. For typical
sizes linear scan is perfectly fine!

* fmt

* Put back the former println! statements as info!

* Remove common_set_tests macro

we only have one range set now!
2025-12-12 10:38:18 +00:00
Rüdiger Klaehn 5a231e3d91 test(quinn-proto): Add proptests for assembler (#243)
* Add proptests for assembler

Also fix a bug in the assembler when going to unordered state after reading
data, and add a regression test for that case.

* Increase ops before we switch to unordered

Otherwise this test mostly tests unordered mode!

* Update quinn-proto/src/connection/assembler.rs

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

* Add defragment to the prop test ops

only to be used when in ordered mode for some reason 🤷

* fmt

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2025-12-12 09:08:11 +00:00
Diva Martínez a6fdaa34b6 handle responses to off-path PathChallenges (#238)
* store remote to which path challenges are sent

* differentiate response for on-path PathChallenges and off-path ones

* reduce diff
2025-12-11 11:20:08 -05:00
ramfox dd9430a61b refactor: update to draft-ietf-quic-multipath-18 (#241)
* refactor: `PATH_BACKUP` => `PATH_STATUS_BACKUP`

* refactor: `PATH_AVAILABLE` => `PATH_STATUS_AVAILABLE`

---------

Co-authored-by: “ramfox” <“kasey@n0.computer”>
2025-12-11 10:34:41 +00:00
Asmir Avdicevic 2cf15d246c fix: path cid panic (#242) 2025-12-11 08:37:49 +00:00
Diva Martínez a688a24072 refactor: create PathChallenge and PathResponse types (#240)
* create PathChallenge and PathResponse

* Small fixes
2025-12-10 21:32:56 +00:00