feat(networking): dont add bootstrap ndoes as relay candidates #1862
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 should more evenly spread the load of bootstrap peering.
This pull request primarily focuses on updating the logic in the
SwarmDriver
implementation and modifying constants in therelay_manager.rs
file. The key changes include a new condition to prevent bootstrap peers from being used as relay candidates and an adjustment to the maximum concurrent relay connections and potential candidates.Key changes:
sn_networking/src/event/swarm.rs
: A new condition has been added to theSwarmDriver
implementation to check if a peer is a bootstrap peer. Bootstrap peers will no longer be used as potential relay candidates. This change aims to improve the relay selection process by excluding peers that are already serving a critical role in the network.Constants adjustment:
sn_networking/src/relay_manager.rs
: The constantsMAX_CONCURRENT_RELAY_CONNECTIONS
andMAX_POTENTIAL_CANDIDATES
have been modified. The maximum concurrent relay connections have been reduced from 3 to 2, while the maximum potential candidates have been increased from 15 to 1000. This change could potentially enhance the efficiency of the relay selection process by exploring a larger pool of candidates while limiting the number of active connections.