-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(iroh): Newtype the packet sent over relay servers #3030
Conversation
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3030/docs/iroh/ Last updated: 2024-12-12T14:39:17Z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a good change, but I need someone to explain to me why this is a RelaySend
Packet
, not a RelaySend
Datagram
and why the Recv
one is the other way around.
The explanation is in the Whether that is a good idea I'm going to leave alone. I... don't think it is?? It basically only happens when Quinn manages to send a GSO datagram (and I'm not sure if that is really hooked up properly currently so that it would, I think it is though). But the point of GSO datagrams is to have less work but we now do another copy of every packet because we need to prefix it with 2 bytes. So we really are hurting because of this instead of improving. The relay protocol should probably have a separate frame/packet type for GSO datagrams with the stride length encoded in it. Actually... let me write this as an issue... (I'll also improve the docs in this PR a little) |
e29b41b
to
2ec4263
Compare
c5a2f86
to
90f09f7
Compare
There is a difference between the datagrams that the MagicSock sends and the packets that contain datagrams that gets sent to relay servers. But this was all just Bytes. This newtypes the packets explicitly and makes it a sibling of the existing RelayRecvDatagram. Now the PacketizeIter at least does not both consume and produce the same type, because they're not the same things.
90f09f7
to
7399e75
Compare
Description
There is a difference between the datagrams that the MagicSock sends and the packets that contain datagrams that gets sent to relay servers. But this was all just Bytes.
This newtypes the packets explicitly and makes it a sibling of the existing RelayRecvDatagram. Now the PacketizeIter at least does not both consume and produce the same type, because they're not the same things.
Breaking Changes
Notes & open questions
This clones the RelayUrl (usually) twice per packet sent now, instead of (usually) once. That's the only thing I don't like about this really.
I still wonder whether RelayUrl should not be some sort of interned and cloned thing.
Watch out, the base of this PR is
flub/active-relay-again
.Change checklist