-
Notifications
You must be signed in to change notification settings - Fork 317
feat: prune old, inactive paths #3666
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
Open
ramfox
wants to merge
9
commits into
feat-multipath
Choose a base branch
from
ramfox/prune
base: feat-multipath
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3666/docs/iroh/ Last updated: 2025-11-21T17:17:19Z |
…` method, and called it whenever new paths are added
matheus23
reviewed
Nov 20, 2025
…unched this connection
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Prune paths that are not actively being used, never have been holepunched, are not about to be dialed, or old.
Notes and Questions
The logic of gathering all of the relevant information is in the
fn prune_ip_pathsfunction, not in theself.prune_ip_pathsmethod onEndpointActorState. Separating these out made it easier to test.Used AI to help write tests & reduce allocations when working through the paths.
keep_pathis where we can play around with what exactly we want to keep, based on thePathState, if we want to get more strict or particular as we learn more.I added a
PathState::holepunchedfield that says whether or not that path was ever hole punched.I added an
Instantto thePathState::sent_pingfield, so we can ensure that we don't prune paths that are currently attempting to holepunch, giving a very generous 30 seconds before deciding that the holepunch didn't work.Right now we:
This means:
Also, we only do prune this if there are more that 20 inactive paths open.
I've added
prune_ip_pathsevery time we call insert theEndpointActorState::paths.