Skip to content
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

network-libp2p: Expose a configuration for the desired number of peers #2038

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

jsdanielh
Copy link
Member

@jsdanielh jsdanielh commented Dec 8, 2023

  • Expose a configuration for the desired number of peers for the connection pool to realize when to try to connect to more peers. This configuration is exposed in the network and is set in the client to be consensus.min_peers.
  • Make the ConnectionState aware of the desired number of connections such that when doing housekeeping it resets the connections marked as down after 1s when the number of connections is below the desired number. This changes how eagerly connections are re-tried when the number of connected peers is less than the desired value.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

@jsdanielh jsdanielh added the WIP This pull request is still work in progress label Dec 12, 2023
@jsdanielh jsdanielh force-pushed the jsdanielh/network3 branch 2 times, most recently from 9b75335 to 1af0b21 Compare December 19, 2023 01:30
@jsdanielh jsdanielh force-pushed the jsdanielh/network3 branch 3 times, most recently from 2808b17 to 4bd5759 Compare January 20, 2024 03:30
@jsdanielh jsdanielh marked this pull request as ready for review January 20, 2024 03:30
@jsdanielh jsdanielh requested a review from hrxi January 20, 2024 03:30
@jsdanielh jsdanielh removed the WIP This pull request is still work in progress label Jan 20, 2024
Expose a configuration for the desired number of peers for the
connection pool to realize when to try to connect to more peers.
This configuration is exposed in the network and is set in the client
to be `consensus.min_peers`.
Make the `ConnectionState` aware of the desired number of connections
such that when doing `housekeeping` it resets the connections marked
as down after 1s when the number of connections is below the desired
number. This changes how eagerly connections are re-tried when the
number of connected peers is less than the desired value.
@hrxi hrxi merged commit 1d388bc into albatross Jan 25, 2024
6 checks passed
@hrxi hrxi deleted the jsdanielh/network3 branch January 25, 2024 23:59
@@ -297,6 +297,7 @@ impl ClientInner {
false,
required_services,
tls_config,
config.consensus.min_peers,
Copy link
Member

Choose a reason for hiding this comment

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

Should this not pass in the desired peer count?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants