Skip to content

feat(iroh,iroh-relay)!: Use stride instead of custom split protocol, send ECN bits #3389

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

Merged
merged 85 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
6aaed21
Separate code path for websocket handshake
matheus23 May 21, 2025
55fd3b2
Implement full handshake protocol for websocket transport only
matheus23 May 21, 2025
3f52da0
WIP
matheus23 May 23, 2025
db787e1
WIP
matheus23 May 23, 2025
20f08c9
Test & fix `ClientInfo` serialization round-trip
matheus23 May 25, 2025
5cb2248
Rename handshake stuff, implement key-export based verification on se…
matheus23 May 30, 2025
04d34e3
Introduce `FrameType` enum
matheus23 Jun 2, 2025
41f5f3f
Fix typo
matheus23 Jun 2, 2025
f6bd7ab
Merge branch 'main' into matheus23/relay-handshake-2
matheus23 Jun 4, 2025
eeebc80
Fix merge
matheus23 Jun 4, 2025
140e967
(WIP) remove legacy relay protocol path
matheus23 Jun 5, 2025
ae67e9c
`cargo make format`
matheus23 Jun 5, 2025
0433a33
WIP
matheus23 Jun 6, 2025
ab193ef
WIP
matheus23 Jun 6, 2025
6ada3d6
Our own rate limiter
matheus23 Jun 6, 2025
cfe4e4d
Remove unused code
matheus23 Jun 9, 2025
bb27d3d
Restructure tests, remove unused code
matheus23 Jun 9, 2025
9a92b0d
Remove unused frames
matheus23 Jun 9, 2025
8a2ebd5
Remove `Frame`, `ReceivedMessage` and `SendMessage` in favor of `Serv…
matheus23 Jun 9, 2025
87c68a3
Remove `Option` from `ServerToClientMsg::Health`
matheus23 Jun 10, 2025
ae844ab
Fix iroh type
matheus23 Jun 10, 2025
521bdfa
Deduplicate `FrameType`
matheus23 Jun 10, 2025
0dda03e
Remove `Protocol` enum
matheus23 Jun 10, 2025
bd8f56b
Fix snapshot tests
matheus23 Jun 10, 2025
35df94d
Move handshake & send/recv common code to relay.rs (rename relay.rs -…
matheus23 Jun 10, 2025
866fed0
Merge branch 'main' into matheus23/relay-handshake-2
matheus23 Jun 30, 2025
7a7c09c
Resolve warnings
matheus23 Jun 30, 2025
fe9641b
`cargo make format`
matheus23 Jun 30, 2025
7a5550a
Send ECN bits and use stride instead of custom split protocol
matheus23 Jun 30, 2025
f254fa4
Fix iroh-relay tests
matheus23 Jun 30, 2025
1464cc9
Handle some TODOs
matheus23 Jun 30, 2025
1589c63
Fix Wasm
matheus23 Jun 30, 2025
6659c90
Fix proptest & docfixes & clippy
matheus23 Jul 1, 2025
a3282f5
Run integraiton test against philipp.iroh.link relay
matheus23 Jul 1, 2025
4f55f72
1-RTT faster handshake by sending client auth with HTTP header
matheus23 Jul 2, 2025
a3f76af
Split up `ClientAuth` frame type
matheus23 Jul 2, 2025
310b9c5
Rename to appease clippy (clippy is right tho)
matheus23 Jul 2, 2025
6f2f50a
Handle terminated streams in relay server actor more gracefully
matheus23 Jul 3, 2025
12230e0
Increase timeout waiting for relay actor termination
matheus23 Jul 3, 2025
05f5e40
Convert `test_active_relay_inactive` into more of a tokio paused time…
matheus23 Jul 3, 2025
ed94a52
Rework error handling and access control
matheus23 Jul 4, 2025
1e7c8c8
Fix Wasm & clippy
matheus23 Jul 4, 2025
4f9627d
Documentation
matheus23 Jul 4, 2025
f4528b3
Rename `Server` to `Relay` in general
matheus23 Jul 4, 2025
9446e5f
Typos
matheus23 Jul 4, 2025
d5b4317
`protos::relay` -> `protos::common` -> `protos::send_recv` -> `protos…
matheus23 Jul 4, 2025
57d8937
Fix docs
matheus23 Jul 4, 2025
58d7026
Cleanup packet iter logic
matheus23 Jul 4, 2025
f2ec678
Small cleanup
matheus23 Jul 4, 2025
48b3fe3
cargo make format
matheus23 Jul 4, 2025
4dc29cd
Merge branch 'main' into matheus23/relay-handshake-2
matheus23 Jul 7, 2025
a337826
Use a perf-improved branch of `tokio-websockets`
matheus23 Jul 8, 2025
e1cf2ba
Vector your writes like noone's watching
matheus23 Jul 9, 2025
3339d90
Cleanup
matheus23 Jul 9, 2025
739e8f9
Use staging relays for the integration test
matheus23 Jul 9, 2025
bd3f43d
Fix wasm import
matheus23 Jul 9, 2025
7c9ba5d
Use debug level
matheus23 Jul 9, 2025
716984a
Update staging URLs
matheus23 Jul 9, 2025
7689368
Implement server-side ws subprotocol versioning
matheus23 Jul 10, 2025
9a731fa
Implement relay protocol versioning client-side
matheus23 Jul 10, 2025
7efad8a
Internal docs & prefer `Vec::from(Bytes)` over `to_vec()`
matheus23 Jul 10, 2025
beef2d6
Make clippy happy
matheus23 Jul 10, 2025
9b85f32
Adjust frame type parsing and numbers and comments
matheus23 Jul 10, 2025
cdea65e
Choose correct buffer size
matheus23 Jul 10, 2025
5b07556
Adjust comment
matheus23 Jul 11, 2025
8ce6ef7
Merge remote-tracking branch 'origin/main' into matheus23/relay-hands…
matheus23 Jul 11, 2025
f66e765
Cleanup
matheus23 Jul 11, 2025
8c0ae16
Diff reduction
matheus23 Jul 11, 2025
f6cffe9
Cleanup / reduce diff
matheus23 Jul 11, 2025
e20915d
Fix docs, don't `cfg_attr` on serde impls
matheus23 Jul 11, 2025
16c89c2
Revert logical changes from "Send ECN bits and use stride instead of …
matheus23 Jul 14, 2025
6ea0b26
Fix tests
matheus23 Jul 14, 2025
e2e5926
`cargo make format`
matheus23 Jul 14, 2025
805d103
Fix docs
matheus23 Jul 14, 2025
a448330
clippy fix
matheus23 Jul 14, 2025
11dfe8e
Fix more documentation
matheus23 Jul 14, 2025
a38e636
Send ECN bits and use stride instead of custom split protocol
matheus23 Jul 14, 2025
a1be02c
feat(iroh-relay)!: Save 2 bytes for non-GSO datagrams
matheus23 Jul 11, 2025
3a6d751
Fix snapshot tests
matheus23 Jul 14, 2025
80ee68e
Merge remote-tracking branch 'origin/main' into matheus23/relay-effic…
matheus23 Jul 18, 2025
edcafb4
Address code review
matheus23 Jul 18, 2025
5990021
Remove `MAX_PAYLOAD_SIZE` (its calculations are wrong)
matheus23 Jul 18, 2025
1a34025
Fix documentation
matheus23 Jul 18, 2025
6f42a31
Ignore clippy in this case
matheus23 Jul 18, 2025
4606f73
Use `FrameType::encoded_len` in `ClientToRelayMsg::encoded_len`
matheus23 Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions iroh-relay/src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ impl Sink<ClientToRelayMsg> for Conn {
}

fn start_send(mut self: Pin<&mut Self>, frame: ClientToRelayMsg) -> Result<(), Self::Error> {
if let ClientToRelayMsg::SendPacket { packet, .. } = &frame {
let size = packet.len();
snafu::ensure!(size <= MAX_PACKET_SIZE, ExceedsMaxPacketSizeSnafu { size });
snafu::ensure!(size != 0, EmptyPacketSnafu);
let size = frame.encoded_len();
snafu::ensure!(size <= MAX_PACKET_SIZE, ExceedsMaxPacketSizeSnafu { size });
if let ClientToRelayMsg::Datagrams { datagrams, .. } = &frame {
snafu::ensure!(!datagrams.contents.is_empty(), EmptyPacketSnafu);
}

Pin::new(&mut self.conn)
Expand Down
12 changes: 8 additions & 4 deletions iroh-relay/src/protos/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ pub enum FrameType {
ServerConfirmsAuth = 2,
/// The server frame type for authentication denial
ServerDeniesAuth = 3,
/// 32B dest pub key + content
SendPacket = 4,
/// 32B src pub key + content
RecvPacket = 6,
/// 32B dest pub key + ECN bytes + one datagram's content
ClientToRelayDatagram = 4,
/// 32B dest pub key + ECN byte + segment size u16 + datagrams contents
ClientToRelayDatagramBatch = 5,
/// 32B src pub key + ECN bytes + one datagram's content
RelayToClientDatagram = 6,
/// 32B src pub key + ECN byte + segment size u16 + datagrams contents
RelayToClientDatagramBatch = 7,
/// Sent from server to client to signal that a previous sender is no longer connected.
///
/// That is, if A sent to B, and then if A disconnects, the server sends `FrameType::PeerGone`
Expand Down
2 changes: 1 addition & 1 deletion iroh-relay/src/protos/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ pub(crate) async fn serverside(
.build()
})?;

if let Ok(()) = client_auth.verify(io) {
if client_auth.verify(io).is_ok() {
trace!(?client_auth.public_key, "authentication succeeded via keying material");
return Ok(SuccessfulAuthentication {
client_key: client_auth.public_key,
Expand Down
Loading
Loading