Commit Graph

4792 Commits

Author SHA1 Message Date
Ruediger Klaehn c3a005b24f Merge branch 'main' into max-transmit-per-path 2026-02-04 10:36:01 +02:00
Diva Martínez b5e2b8f0e3 update bytes to address advisory RUSTSEC-2026-0007 (#405) 2026-02-03 16:33:31 +00:00
Diva Martínez 8289585713 fix: allow the remote to abandon paths even if no validated paths remain (#401)
* Add failing test

* Handle closes locally and remotely iniated diff

* fix spelling
2026-02-03 13:48:48 +00:00
Ruediger Klaehn eaa99d02bc Also add the local ip addr for the decision for max_segment_size 2026-02-02 14:13:52 +02:00
Ruediger Klaehn 4d9ae530d0 Merge branch 'main' into max-transmit-per-path 2026-02-02 13:00:24 +02:00
“ramfox” 4695fbfe1f chore: Release iroh-quinn-v0.16.1 2026-01-31 13:49:00 -05:00
“ramfox” d1c70a87d0 chore: Release iroh-quinn-proto-v0.15.1 2026-01-31 13:48:45 -05:00
Philipp Krüger cc9682a393 test(proto): Simulate passive migrations in proptests (#359)
* test(proto): Simulate passive migrations in proptests

* Turn proptest failure into regression test

* Use older IP constructors
2026-01-30 16:26:24 +00:00
Friedel Ziegelmayer 3e729dc392 fix(proto): send close immediately (#385)
This checks if the connection has already been terminated when `on_closed()` is called. If so, it sends the error immediately instead of adding the sender to a vec that has already been drained.
2026-01-30 13:12:35 +00:00
Philipp Krüger 5660b3e8af fix(proto): Avoid panicking in Connection::pto_max_path (#366)
* fix(proto): Avoid panicing in `Connection::pto_max_path`

We can't filter out unused branches in `is_closing`, otherwise we might get into a state where the we don't have any paths to consider for PTO, when the only path remaining is one that we didn't send/receive on yet.

Also: Rename `Connection::pto_max_path` to `Connection::max_pto_all_paths`

* Clippy fix
2026-01-30 09:46:07 +00:00
Ruediger Klaehn 01a7654dde fix bench 2026-01-29 14:50:48 +02:00
Ruediger Klaehn 6676762910 fix tests 2026-01-29 14:44:11 +02:00
Ruediger Klaehn 55dca31790 Merge branch 'main' into max-transmit-per-path 2026-01-29 14:37:41 +02:00
Ruediger Klaehn 9e2490b75e fmt 2026-01-29 14:37:26 +02:00
Ruediger Klaehn d4a5681e39 Take SocketAddr by reference in max_gso_segments 2026-01-29 14:18:27 +02:00
Ruediger Klaehn 424fefcc61 Complete per path max_gso_segments 2026-01-29 14:03:42 +02:00
Asmir Avdicevic 25f35c2fe3 chore: disable solaris tests in daily CI as they hang (#377) 2026-01-29 11:14:49 +00:00
Ruediger Klaehn 43ee6fecff Compute max_datagrams per path. 2026-01-29 13:05:54 +02:00
“ramfox” e41672537d chore: Release iroh-quinn-v0.16.0 2026-01-28 11:10:17 -05:00
“ramfox” 349e82913a chore: Release iroh-quinn-proto-v0.15.0 2026-01-28 11:09:42 -05:00
“ramfox” 086cf769b3 chore: Release 2026-01-28 11:01:36 -05:00
Floris Bruynooghe d7e98af8cf fix: do not send CONNECTION_CLOSE to unvalidated remotes (#361)
* docs: Try and document closing states and behaviour a bit more

Hopefully this is somewhat correct and helps me next time I have to
understand something involving this all.

* Apply suggestion from @divagant-martian

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>

* improve comments

* Improve description and fix anti-amplification bug

* format

* upwrap_or_false

---------

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-01-27 11:44:43 +00:00
Floris Bruynooghe aa6c3735ce fix: Do not send off-path data when closing (#358)
* fix: Do not send off-path data when closing

When we are closing we're only supposed to send packets containing
CONNECTION_CLOSE and (PATH_)ACK frames. There is no need to continue
sending any off-path data.

* maybe fix

* revert that. it was wrong

* Apply suggestion from @matheus23

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

---------

Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
2026-01-26 16:09:47 +00:00
Philipp Krüger c38be740eb refactor(proto): Extract address canonicalization and local socket family detection into fns (#346)
* fix(proto): Don't close paths from previous HP round we're still interested in

* Use local/remote instead of src/dst in 4-tuple logs

* Don't clear all path timers in `close_path`.

* Also check for `!self.abandoned_paths.contains(&path_id)`

* refactor(proto): Canonicalize IP addrs early for HP state

* Spellcheck

* Revert canonicalization to the right places again.

We don't want to canonicalize when adding local addresses, since there might be NAT46 between us and the peer.
We also don't want to canonicalize right when we receive ADD_ADDRESS frames, since that has an effect on maximum number of addresses calculations.

* Preserve address mapping invariant in `iroh_hp::NatTraversalRound`

* Update doc comments

* Map ipv6-mapped IPv4 addresses to IPv4 if possible/necessary

* Don't convert `::1` to `127.0.0.1` in `map_to_local_socket_family`

Also: add a test case

* Prefer `Ipv4Addr::to_ipv4_mapped`
2026-01-26 15:40:10 +00:00
Floris Bruynooghe 2cc515adbc refactor: split poll_transmit into per-path and per-space parts (#338)
* split up poll_transmit per path and per space

* refactor: return last_packet_number

* cleanup status enums

* refactor: streamline mtu probe building

* refactor: extract remote cid exhaustion handling into function

* refactor: move remote_cid check per path

* refactor: simplify send space check

* fixup

* docs(proto): describe enums

* wip

* friday was too short. make it work, maybe

* Do coalescing right

* tweak comments, logs

* remove redundant size-setting

* fix path scheduling description, add bug description

* fixup path stats

* wording, wording

* weird off path enum variants are no longer needed!

* fix fmt

* Make TransmitBuf in each loop and collate off-path work

This make the construction of the TransmitBuf a little less weird, but
still a bit weird.

* Consistent naming for now

* missing rename

* fix merge

* Pass around a Vec while no transmit has been started yet

* expand on what is meant here, link to new issue

* pointless return

---------

Co-authored-by: dignifiedquire <me@dignifiedquire.com>
Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Diva Martínez <git@divma.net>
2026-01-26 15:31:59 +00:00
Floris Bruynooghe ab03f16038 fix: Expect missing CIDs when migrating (#362)
With multipath there is no guarantee that CIDs exist. Since this
previous PathData is currently only used to send a single
fire-and-forget PATH_CHALLENGE there is no value to store it as the
previous path, since it would not be able to be sent. And this path
would still have to be path-validated from scratch if it is the valid
one.

Additionally fix a bug that only stored this path if the previous path
was *currently* validating. This was a bug introduced due to
refactors. The intention is to store the path only if it was
path-validated. Not to store it only if it was currently not being
validated.

Fixes #310
2026-01-26 10:46:32 +00:00
Franz Heinzmann cd7a9d8443 fix: emit PathNewConnectionId frame in qlog (#363) 2026-01-26 09:39:25 +00:00
ramfox bf4c64874d chore: add CI to ensure docs-rs publishing will work (#360)
Also, removes "log" from list of features for `iroh-quinn-proto` to run with `docs-rs`, since it is not a feature `iroh-quinn-proto` has

Co-authored-by: “ramfox” <“kasey@n0.computer”>
2026-01-23 09:53:21 +00:00
Floris Bruynooghe e424c7fb78 tests: Skip proptests in the default runs (#356)
We run with --profile ci on CI, so this still runs the proptests on CI
every time. Also includes clear instructions on how to run the
proptests.
2026-01-22 13:16:19 +00:00
Philipp Krüger 1a2bd1186b fix(proto): Stop all path timers when closing it (#350)
* fix(proto): Stop all path timers when closing it

* Mute clippy warning

* Update quinn-proto/src/tests/multipath.rs

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>

* Update quinn-proto/src/tests/multipath.rs

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>

---------

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
2026-01-21 20:47:42 +00:00
Floris Bruynooghe 11b684ded3 refactor: Log which path is lacking CIDs (#355)
Missed review suggestion from #336.
2026-01-21 19:08:35 +00:00
Floris Bruynooghe e6c004e144 refactor: Some much needed renaming of variables mostly (#354)
And collecting some functions together. Split off from #338.

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
2026-01-21 16:24:37 +00:00
Floris Bruynooghe 37524202b6 fix(multipath): handle missing remote CIDs better (#336)
* fix(multipath): handle missing remote CIDs better

QUIC-MULTIPATH § 4.7 says that sending PATH_CIDS_BLOCKED is to be done
when opening the path. For locally opened paths we were already doing
this but for remotely opened paths we did not yet do that.

Instead it was deferred to poll_transmit to send this, but that is
troublesome:

- Primarily it means that when checking paths suddenly more data is
  available to be sent and should have been sent on an earlier
  path. Making the logic of poll_transmit very difficult.

- It meant precaution should be taken against sending this too much,
  which wasn't being done.

So instead we schedule PATH_CIDS_BLOCKED when the paths are actually
being opened. Simplifying things significantly.

* needless map

Though the compiler should have optimised that away

* actually read the review text

* remove path_challenge comment

* explicit false

* Apply suggestions from code review

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>

* Do not log when an abandoned path has retired CIDs

That's the normal situation, it can get fairly verbose, and you should
be able to deduce this from other logs.

* fix broken merge

---------

Co-authored-by: Diva Martínez <26765164+divagant-martian@users.noreply.github.com>
2026-01-21 16:01:15 +00:00
Philipp Krüger 7706e5a4e1 refactor: Rename rem_cid to remote_cid and friends (#351)
* refactor: Rename `rem_cid` to `remote_cid` and friends

* `cargo make format`
2026-01-20 16:37:57 +00:00
Rüdiger Klaehn 9f4c68ed17 tests: Complete encoder proptests (#340)
* Implement encode-decode tests for ack

And some DRY

* Add path_ack as well

* Get rid of TestFrame

* clippy

* fmt

* Remove more explicit strategies

* Use StreamMeta for encoding stream frames instead of duplicating the logic

* Make the arb for RangeSet also create the empty set

Also exchange unwrap to expect in the arbs that use it

* PR feedback

- Derive arbs unless they are really complex
- Test remaining is empty in encode/decode proptest
2026-01-20 13:43:58 +00:00
Diva Martínez 332c8f7d7a return all paths that belong to the round (#345) 2026-01-20 12:48:44 +00:00
Philipp Krüger ce4f347032 fix(proto): Don't close paths from previous HP round we're still interested in (#341)
* fix(proto): Don't close paths from previous HP round we're still interested in

* Use local/remote instead of src/dst in 4-tuple logs

* Don't clear all path timers in `close_path`.

* Also check for `!self.abandoned_paths.contains(&path_id)`
2026-01-20 10:27:11 +00:00
Diva Martínez a772fbe095 fix(quinn-proto): do not reuse buffers across network paths (#339)
* obsolete set_segment_size

* send off path path responses at the same time as validation challenges

* simplify poll transmit code

* clippy
2026-01-19 14:11:20 +00:00
Floris Bruynooghe 7a8aeb9609 fix: Use better terms in logging (#343)
Follow up from #331.
2026-01-19 14:03:54 +00:00
Rüdiger Klaehn 1df76577f7 tests: Add proptest arbitraries for various quinn-proto types and implement encoder roundtrip tests. (#325)
* Add proptests for encode/decode

* Add proptest arbitrary for VarInt and StreamId

Also fix the StreamId arbitrary::Arbitrary generation

* Add proptest arbitraries for various quinn-proto types and make use of them in the random interaction test

* Add more arbitraries.

* Remove unneeded derives

* Use MaybeFrame arb

* fmt

* Use cfg(test) for the arbitraries.

Also move the encode_decode tests into a separate file.

* Add more cases to TestFrame

* Get rid of the last remaining record enum cases.

* More arbitraries. Now almost every frame type is roundrrip tested.

* remove dead code

* clippy

* Add proptest and test-strategy even in wasm

(we don't *run* proptests, but need them to compile)

* Use a feature flag after all...

going in circles...

* Remove claude settings and DRY the proptest attribute.

* Revert "Use a feature flag after all..."

This reverts commit b27add632b.

* Try to get proptest to work in wasm after all

It doesn't need to run tests, just compile.

* Use the right hmac import

* sort dev deps

* Remove some feature flag gated imports

they are not worth it in terms of DRY

* Use test_strategy::Arbitrary by default in frame. It gets used way more often.
2026-01-19 09:35:31 +00:00
Friedel Ziegelmayer 19274cf4d5 fix(proto): properly encode can_coalesce during packet building (#334) 2026-01-16 12:59:34 +00:00
Philipp Krüger be298f39ad feat(proto): Use UdpStats in PathStats and add receive stats (#332) 2026-01-16 10:57:33 +00:00
Friedel Ziegelmayer 22169a5a02 refactor(proto): cleanup Connection::space_can_send (#333)
* refactor(proto): cleanup Connection:::space_can_send

* typing is hard
2026-01-16 10:25:32 +00:00
Floris Bruynooghe 6177c8d05c fix(proto): Some frames were sent on non-validated path (#330)
* refactor: Update to rust edition 2025

* bump to 1.88

That's what I need for let chains.

* i asked for let chain, clippy looooooves the let chains!

* more let chains in the workspace

* fix(proto): Some frames were sent on non-validated path

We were accidentally sending frames on non-validated paths. And also
on PATH_STATUS_BACKUP paths.

With the current way this is controlled when path_exclusive_only is
set we should not be sending frames that can be sent on other
paths. Respecting this for more frame types will make sure they are
not sent on non-validated and backup paths.

Fixes #314.
2026-01-15 16:00:33 +00:00
Floris Bruynooghe 5f19d75275 refactor: Update to rust edition 2024 (#328)
* refactor: Update to rust edition 2025

* bump to 1.88

That's what I need for let chains.

* i asked for let chain, clippy looooooves the let chains!

* more let chains in the workspace
2026-01-15 15:41:35 +00:00
Floris Bruynooghe bd88e2d0dc refactor: some logging consistency (#331)
Random personal stuff I tweak when reading logfiles.
2026-01-15 15:32:06 +00:00
Diva Martínez ddbdf535a8 refactor(quinn-proto): misc code improvements from pr reviews (#327)
* address review

* make docs less weird
2026-01-14 20:51:02 +00:00
Philipp Krüger 4de9876c53 fix(proto): Check abandoned_paths in open_path_ensure (#319)
* fix(proto): Check `abandoned_paths` in `open_path_ensure`.

* code review

* Add tests for `open_path_ensure`

* Apply clippy fixes

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2026-01-14 15:50:49 +00:00
Philipp Krüger ee980072e0 fix(proto): Use path PTOs for PATH_ABANDON calculations (#291)
* fix(proto): Use most relevant PTOs for PATH_ABANDON calculations

Instead of always using max PTO.

* refactor: Use a nice enum

* fix merge

* cw: Use proper `TransportError`s, improve comments

* cw: Clear up confusing comment
2026-01-14 15:40:42 +00:00
Asmir Avdicevic afc9ed49d2 chore: revert sccache removal (#326) 2026-01-14 15:01:06 +00:00