Skip to content

Conversation

@dignifiedquire
Copy link
Contributor

@dignifiedquire dignifiedquire commented Dec 19, 2025

@dignifiedquire dignifiedquire changed the title feat: ping paths and trigger holepunching on networkchange feat(iroh): ping paths and trigger holepunching on networkchange Dec 19, 2025
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3796/docs/iroh/

Last updated: 2026-01-07T20:57:24Z

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: e1a58b6

};
tx.send(info).ok();
}
RemoteStateMessage::NetworkChange { is_major } => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not do this with the local addr watcher? I don't like having two mechanisms for this, and a watcher seemed nice.

Copy link
Contributor Author

@dignifiedquire dignifiedquire Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addr change update happens a lot later, this is why I added this mechanism, and it also happens for potentially other reasons. The addr change will happen eventually when net report finishes, but we don't need to wait for that, to already know we want to recheck our connections in here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. could we more often update our local addrs? i don't think if the interfaces change that we need to wait until we've also run netcheck until we get updates. I'd like to receive them all as quickly as possible, but still only via one API.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one day, but that would require the much bigger refactor of netreport to be more stream based, which will not happen any time soon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to accept this technical debt :)
It's annoyed me for a while though so hopefully this will motivate me to get round to improving this soon.

}

if is_major {
self.trigger_holepunching();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this code-path trigges holepunching less often than the watcher for the local addrs? but otherwise does the same? it seems more like the is_major detection should be added to trigger_holepunching. And that should also send pings if that is helpful. but i don't think this is helpful yet, i think we need to be able to see the number of in-flight tail-loss probes in select path to benefit from this.

@n0bot n0bot bot added this to iroh Dec 19, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Dec 19, 2025
@flub flub self-assigned this Dec 22, 2025
@flub flub added this to the iroh: v0.96 milestone Dec 22, 2025
@dignifiedquire dignifiedquire force-pushed the feat-improve-network-change branch from 8fdf74f to bce59b9 Compare January 7, 2026 10:45
@flub flub assigned dignifiedquire and unassigned flub Jan 7, 2026
@flub flub moved this from 🏗 In progress to 👀 In review in iroh Jan 7, 2026
}

fn handle_network_change(&mut self, is_major: bool) {
for conn in self.connections.values() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like I've forgotten half the things, I'm not really sure why we are sending pings today, because I don't think we can do anything with the resulting behaviour. Each path has it's keep-alive and idle-timeout already set. Sending an explicit ping will not change much: the idle timers are already set and will fire. Sending something now won't change that much I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is to make sure we have new information as early as possible

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the pings do anything, but otherwise I'll accept the technical debt being added here as a reasonable tradeoff for now. I'm just a bit sad it's found its way into the this new actor.

};
tx.send(info).ok();
}
RemoteStateMessage::NetworkChange { is_major } => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to accept this technical debt :)
It's annoyed me for a while though so hopefully this will motivate me to get round to improving this soon.

@dignifiedquire
Copy link
Contributor Author

I'm going to accept this technical debt :)
It's annoyed me for a while though so hopefully this will motivate me to get round to improving this soon.

very fair, I think we can clean this up in some form later

@dignifiedquire dignifiedquire force-pushed the feat-improve-network-change branch from bce59b9 to 630344b Compare January 7, 2026 20:53
@matheus23
Copy link
Member

I think this PR needs at least two lines of PR description, otherwise it doesn't auto-merge IIUC?

@dignifiedquire dignifiedquire force-pushed the feat-improve-network-change branch from 62f964d to 3f8bd35 Compare January 8, 2026 10:36
@dignifiedquire dignifiedquire added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit ff24cfc Jan 8, 2026
26 of 28 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in iroh Jan 8, 2026
@matheus23 matheus23 deleted the feat-improve-network-change branch January 8, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants