Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/apollo_network/src/discovery/flow_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl DiscoveryMixedBehaviour {

#[tokio::test]
async fn all_nodes_have_same_bootstrap_peer() {
const NUM_NODES: usize = 2;
const NUM_NODES: usize = 100;

let mut bootstrap_swarm =
Swarm::new_ephemeral_tokio(|keypair| DiscoveryMixedBehaviour::new(keypair, None));
Expand Down
4 changes: 3 additions & 1 deletion crates/apollo_network/src/mixed_behaviour.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO(shahak): Erase main_behaviour and make this a separate module.

use std::convert::Infallible;
use std::num::NonZeroUsize;
use std::time::Duration;

use libp2p::connection_limits::ConnectionLimits;
Expand Down Expand Up @@ -85,7 +86,8 @@ impl MixedBehaviour {
let protocol_name =
StreamProtocol::try_from_owned(format!("/starknet/kad/{chain_id}/1.0.0"))
.expect("Failed to create StreamProtocol from a string that starts with /");
let kademlia_config = kad::Config::new(protocol_name);
let mut kademlia_config = kad::Config::new(protocol_name);
kademlia_config.set_kbucket_size(NonZeroUsize::new(100).unwrap());
let connection_limits = ConnectionLimits::default().with_max_established_per_peer(Some(1));

Self {
Expand Down
Loading