-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-net)!: Improve initial connection latency (#2234)
## Description When the magic socket changes the underlying path the congestion controller has all the wrong ideas about the latency. This results in widely varying latencies and only slowly settling of them. This change resets the values of the congestion controller whenever the magic socket path changes. The result is a much faster stable connection. Renames the Pong::src field to ping_observed_addr to try and make this field a bit more intuitive to read. This helps especially around logging pongs and the UDP address of the pong sender next to each other. The mesh_stacks function in the tests has the relay server removed. The point of the function is to hook up the magic endpoints using direct addresses, so the relay is redundant. Furthermore the way the server was set up in the tests made it not functional, so it never did anything. So things are simplified without it. ## Breaking Changes - `MagicEndpoint::accept` now returns `magic_endpoint::Accept` rather than Quinn's `Accept` type. - `magic_endpoint::Connecting` replaces `quinn::Connecting`. This is the type returned by `.await`ing the `Accept` future. - `magic_endpoint::accept_conn` and `magic_endpoint::get_alpn` have been removed. You now accept the connection by directly awaiting the futures returned. To retrieve the ALPN use the new `Connecting::alpn` method. ## Notes & open questions To review, start at the new `rtt_actor.rs`, that's the important bit. Then look at `MagicEndpoint` how it adds it to `.connect()` (simple) and `.accept()` (complex). The latter requires copying a bunch of Quinn structs into magic_endpoint. This also simplifies how the interact with the alpn a little. Everything else is how making the rest of iroh adapt to those changes. ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. ## TODO - ~~[ ] Use stream-util instead of futures-concurrency~~
- Loading branch information
Showing
23 changed files
with
652 additions
and
284 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.