WIP: perf(datagrams): expose batch send/recv APIs through iroh Connection#4383
Draft
ifdario wants to merge 2 commits into
Draft
WIP: perf(datagrams): expose batch send/recv APIs through iroh Connection#4383ifdario wants to merge 2 commits into
ifdario wants to merge 2 commits into
Conversation
Add thin passthroughs to the underlying noq batch APIs so downstream crates (e.g. rayfish) can amortize the per-datagram connection-mutex cost, which is the dominant overhead at high pps for a mesh VPN forwarding bursts of TUN packets. - Connection::send_datagrams / read_datagrams delegate to noq::Connection. - Re-export ReadDatagrams and SendMany through endpoint::quic and the public endpoint surface (required by the crate's unreachable_pub lint). - Add [patch.crates-io] pointing noq/noq-proto/noq-udp at the local fork (../noq) so iroh builds against the rayfish noq with the batch APIs. This is a workspace-local dev override; published iroh still resolves to noq 1.0.1 from crates.io.
matheus23
reviewed
Jul 1, 2026
Comment on lines
+45
to
+48
| [patch.crates-io] | ||
| noq = { path = "../noq/noq" } | ||
| noq-proto = { path = "../noq/noq-proto" } | ||
| noq-udp = { path = "../noq/noq-udp" } |
Author
There was a problem hiding this comment.
I'll do it once we merge noq. Then we can upgrade to whatever version that one adds
Author
|
Related: n0-computer/noq#735 |
Contributor
|
Thanks for taking care of this side as well! But let's move this back into draft until n0-computer/noq#735 is merged. Please re-open once that's been merged. |
flub
marked this pull request as draft
July 1, 2026 14:06
Follow the noq rename to read_many_datagrams / send_many_datagrams and the slice-based signatures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Expose the new noq batch datagram APIs through iroh's
Connectionwrapper so downstream crates (e.g. rayfish) can amortize the per-datagram connection-mutex cost, which is the dominant overhead at high pps for a mesh VPN forwarding bursts of TUN packets.Connection::send_datagrams/read_datagramsdelegate tonoq::Connection.ReadDatagramsandSendManythroughendpoint::quicand the public endpoint surface (required by the crate'sunreachable_publint).Depends on the noq PR that adds
Connection::send_datagrams/read_datagramsandDatagramState::recv_many/Datagrams::send_many. This branch should not merge until that noq release is published and the[patch.crates-io]override (see below) is removed.Breaking Changes
None. All additions are additive methods and types. Existing
send_datagram/read_datagram/send_datagram_waitare unchanged.Notes & open questions
[patch.crates-io]override in the workspaceCargo.tomlpointingnoq/noq-proto/noq-udpat a local fork (../noq) so iroh can see the new APIs during development. This MUST be removed before merge, which requires the noq batch-API PR to be merged and a new noq release published to crates.io first. Leaving the patch in would break CI for anyone without the local../noqcheckout.iroh/Cargo.tomlis not yet bumped; a follow-up commit will bumpnoq(andnoq-proto/noq-udp) to the released version that contains the batch APIs, and remove the patch, in the same change.Change checklist