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

fix(networking): use default Relay config from libp2p #1894

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

joshuef
Copy link
Contributor

@joshuef joshuef commented Jun 17, 2024

Reduce the relay config to default limits.

We were allowing nodes to handle thousands of relays (which they cannot)

let relay_server_cfg = relay::Config {
                max_reservations: 1024,      // the number of home nodes that we can support
                max_circuits: 32_000, // total max number of relayed connections we can support
                max_circuits_per_peer: 1024, // max number of relayed connections per peer
                ..Default::default()
            };

becomes effectively

let relay_server_cfg = relay::Config {
                max_reservations: 128,      // the number of home nodes that we can support
                max_circuits: 16, // total max number of relayed connections we can support
                max_circuits_per_peer: 4, // max number of relayed connections per peer
                ..Default::default()
            };

We could further tweak rate limiting via the config rate limiters if desired.


This pull request includes a change to the NetworkBuilder implementation in the sn_networking/src/driver.rs file. The change simplifies the creation of the relay_server_cfg object by using the default configuration provided by relay::Config::default(), instead of manually setting each configuration option. This change may affect the number of home nodes, total relayed connections, and relayed connections per peer that the relay server can support.

This is much more conservative and should help relay load on machines
@joshuef joshuef enabled auto-merge June 17, 2024 04:50
@joshuef joshuef added this pull request to the merge queue Jun 17, 2024
Merged via the queue into maidsafe:main with commit 13a6d8a Jun 17, 2024
41 checks passed
@joshuef joshuef deleted the DefaultRelayConfig branch June 17, 2024 05:45
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.

2 participants