-
Notifications
You must be signed in to change notification settings - Fork 254
fix(iroh): always ping new paths, add test for reconnecting with changed addrs #3372
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
base: main
Are you sure you want to change the base?
Changes from all commits
14c6d1d
9866f0e
087f003
a00644a
a8ee257
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,11 +121,19 @@ impl BestAddr { | |
} | ||
Some(state) => { | ||
let candidate = AddrLatency { addr, latency }; | ||
// If the current address has exceeded its trust interval, or if the new address has lower latency, | ||
// use the new address. | ||
if !state.is_trusted(confirmed_at) || candidate.is_better_than(&state.addr) { | ||
self.insert(addr, latency, source, confirmed_at); | ||
// If the new address is equal to the current address, mark it as reconfirmed now and expand its trust | ||
// interval. | ||
} else if state.addr.addr == addr { | ||
state.confirmed_at = confirmed_at; | ||
state.trust_until = Some(source.trust_until(confirmed_at)); | ||
// If we receive a pong on a different port but the same IP address as the current best addr, | ||
// we assume that the endpoint has rebound, and thus use the new port. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My main issue with this logic is that I find it fairly arbitrary. It fixes an artificial test case, but it seems like a sub-set of the cases that need to be fixed. We're also not really sure we can send on this path at this point, but I'm not even sure if that's something we're always sure of anyway. |
||
} else if state.addr.addr.ip() == addr.ip() { | ||
self.insert(addr, latency, source, confirmed_at) | ||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.