forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: same geo peering #111
Closed
Closed
Conversation
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
czarcas7ic
force-pushed
the
adam/same-geo-peering
branch
from
June 23, 2024 00:56
1167cc8
to
c1c5beb
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
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.
This PR introduces a new config section of p2p:
If
region_aware
is set to false, all previous logic for peer dialing should be exactly the same (the ONLY diff was a small change I snuck in, where in the current live logic, if toDial is 1, the max dial attempts we make are 3*1. I instead created a floor of 5, as finding that last peer tends to take a while.)If
region_aware
is set to true, the following new logic occurs:percent_peers_in_same_region
is 0.9 and we have inbound and outbound peers set to 10, we will connect to 9 inbound/outbound peers in our own region, and 1 inbound/outbound peer outside of our region.You can test this feature out for yourself, but setting these values in config.toml, starting the node up, waiting a few minutes and running the following one-liner:
You can then manually use this link (http://ip-api.com/json/X.X.X.X) to check that the region for the peers you are connected to follow the constraints.
PR checklist
.changelog
(we use unclog to manage our changelog)docs/
orspec/
) and code comments