Conversation
This reverts commit a68a89a.
dbda584 to
89da514
Compare
b420ff2 to
7cf0ed9
Compare
89da514 to
52a4783
Compare
matheus23
left a comment
There was a problem hiding this comment.
Let's ship this - at the very least for the important bugfix.
Let's discuss changes to code structure later and open another PR for those if need be.
Hmmm. I'm sorry I just reread the PR description again and that's why I'm coming back to this. We should reconsider this (after merging!). We can always change this IMO, that's not a problem, as long as we change this before we do the next breaking change without adding another relay protocol version (and I think we'll always want to use a new protocol version even if we add optional frames). This is contrary to what e.g. QUIC does: If you receive a frame you don't know - that's a protocol violation. We should really think through what this means in various cases again before we do the next protocol change. |
Good point. I think you are right and we should fix that. I'll look into it. |
…ror (#4127) ## Description #3955 added a new relay protocol version. This PR fixes the contract: We should only allow frames that are defined for the negotiated protocol version, and abort if we receive a frame not allowed in the negotiated version. ## Breaking Changes None ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
Description
This branch add a
iroh-relay-v2protocol. The only changes to theiroh-relay-v1protocol are:Healthframe (id 11) with string payloadStatusframe (id 13) with binary-encoded enum payload that can be extended with further variants or payloadsThe actual change is thus quite minor, but serves as a real-world test for our protocol negotiation.
The PR also fixes a bug in how the relay server parsed the supported protocols; it is harmless because all existing deployments support a single version anyway, but good to fix now.
Everything is fully backwards-compatible on the wire (old clients can talk to new relays, and new clients can talk to old relays).
Breaking Changes
iroh_relay::http::RELAY_PROTOCOL_VERSIONhas been removed. The relay protocol now supports version negotiation between client and server. Useiroh_relay::http::ProtocolVersioninstead. For the previous constant value, useProtocolVersion::V1.to_str().iroh_relay::server::client::Confighas a new fieldprotocol_version: ProtocolVersion.iroh_relay::protos::relay::RelayToClientMsghas a newStatus(Status)variant and the existingHealthvariant is deprecated. Clients should handleRelayToClientMsg::Statusfor connection health information. TheHealthvariant is still sent by V1 relay servers but should not be relied upon going forward.Notes & open questions
Change checklist