feat: update relay protocol to iroh-relay-v2, add new Health frame, test protocol update mechanism#3955
feat: update relay protocol to iroh-relay-v2, add new Health frame, test protocol update mechanism#3955
Conversation
This reverts commit a68a89a.
dbda584 to 89da514 Compare b420ff2 to 7cf0ed9 Compare 89da514 to 52a4783 Compare iroh-relay/src/http.rs Outdated
| #[default] | ||
| V2, | ||
| /// Deprecated version 1 (before iroh 0.97.0) | ||
| V1, |
There was a problem hiding this comment.
doesn't declaring them in this order would mean calls to max would return V1 rather than V2 (which we call in handle_relay_ws_upgrade) (since we derive Ord)
There was a problem hiding this comment.
good observation, thanks. changed and added a test for the protocol negotiation.
| only addition I might add here something on the client side that acknowledges we negotiated the protocol. Maybe just a debug line at this point, since it's not used anywhere on the client side yet? |
| I wrote this as feedback in discord, but that's quickly lost to the archives, so just repeating some higher-level feedback here: My thinking was that we should separate our protocol versions by module. So e.g. now, we'd introduce two modules: If we do this, it is much easier to look at one protocol and see how it works rather than mixing multiple versions in the same code. I think that can become quite messy. It's also nice to be able to have a bunch of |
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.
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 payloadsI wrote this mostly as a test case if and how we can update the relay protocol in a backwards-compatible way. Not sure if the new Health frame is worth it. But also, maybe it's a good idea to actually put the version negotiation and upgrade mechanism to test before we release 1.0?
The PR likely needs some more cleanups. But would be interested in a high-level review/discussion if this is roughly how we intend to support backwards-compatible relay protocol changes during 1.0.
Breaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme