diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs index bea50958d7..10dce1be99 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs @@ -314,9 +314,6 @@ struct DsnArgs { /// Known external addresses #[arg(long, alias = "external-address")] external_addresses: Vec, - /// Defines whether we should run blocking Kademlia bootstrap() operation before other requests. - #[arg(long, default_value_t = false)] - disable_bootstrap_on_start: bool, } #[derive(Debug, Clone)] @@ -426,7 +423,6 @@ where // Override flags with `--dev` dsn.allow_private_ips = dsn.allow_private_ips || dev; - dsn.disable_bootstrap_on_start = dsn.disable_bootstrap_on_start || dev; let _tmp_directory = if let Some(plot_size) = tmp { let tmp_directory = tempfile::Builder::new() diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm/dsn.rs b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm/dsn.rs index e0037a665f..1a59ab9941 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm/dsn.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm/dsn.rs @@ -41,7 +41,6 @@ pub(super) fn configure_dsn( pending_in_connections, pending_out_connections, external_addresses, - disable_bootstrap_on_start, }: DsnArgs, weak_plotted_pieces: Weak>>, node_client: NodeRpcClient, @@ -180,7 +179,6 @@ pub(super) fn configure_dsn( bootstrap_addresses: bootstrap_nodes, kademlia_mode: KademliaMode::Dynamic, external_addresses, - disable_bootstrap_on_start, ..default_config }; diff --git a/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs b/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs index 1d18236718..35921ce3a3 100644 --- a/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs +++ b/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs @@ -195,7 +195,6 @@ fn main() -> Result<(), Error> { max_pending_in_connections: 100, max_pending_out_connections: 150, external_addresses: vec![], - disable_bootstrap_on_start: false, } }; diff --git a/crates/subspace-networking/src/behavior.rs b/crates/subspace-networking/src/behavior.rs index c11c63fe96..83571c3027 100644 --- a/crates/subspace-networking/src/behavior.rs +++ b/crates/subspace-networking/src/behavior.rs @@ -50,11 +50,6 @@ pub(crate) struct BehaviorConfig { pub(crate) autonat: AutonatWrapperConfig, } -// #[derive(Debug, Clone, Copy)] -// pub(crate) struct GeneralConnectedPeersInstance; -// #[derive(Debug, Clone, Copy)] -// pub(crate) struct SpecialConnectedPeersInstance; - #[derive(NetworkBehaviour)] #[behaviour(to_swarm = "Event")] #[behaviour(event_process = false)] @@ -69,12 +64,6 @@ pub(crate) struct Behavior { pub(crate) request_response: RequestResponseFactoryBehaviour, pub(crate) block_list: BlockListBehaviour, pub(crate) reserved_peers: ReservedPeersBehaviour, - // TODO: Restore or remove connected peer later - // pub(crate) peer_info: Toggle, - // pub(crate) general_connected_peers: - // Toggle>, - // pub(crate) special_connected_peers: - // Toggle>, pub(crate) autonat: AutonatWrapper, } @@ -101,11 +90,6 @@ where }) .into(); - // TODO: Restore or remove connected peer later - // let peer_info = config - // .peer_info_provider - // .map(|provider| PeerInfoBehaviour::new(config.peer_info_config, provider)); - Self { connection_limits: ConnectionLimitsBehaviour::new(config.connection_limits), identify: Identify::new(config.identify), diff --git a/crates/subspace-networking/src/constructor.rs b/crates/subspace-networking/src/constructor.rs index bbb7d04a16..8b4f3b1ab5 100644 --- a/crates/subspace-networking/src/constructor.rs +++ b/crates/subspace-networking/src/constructor.rs @@ -242,8 +242,6 @@ pub struct Config { /// Known external addresses to the local peer. The addresses will be added on the swarm start /// and enable peer to notify others about its reachable address. pub external_addresses: Vec, - /// Defines whether we should run blocking Kademlia bootstrap() operation before other requests. - pub disable_bootstrap_on_start: bool, } impl fmt::Debug for Config { @@ -366,7 +364,6 @@ where bootstrap_addresses: Vec::new(), kademlia_mode: KademliaMode::Static(Mode::Client), external_addresses: Vec::new(), - disable_bootstrap_on_start: false, } } } @@ -430,7 +427,6 @@ where bootstrap_addresses, kademlia_mode, external_addresses, - disable_bootstrap_on_start, } = config; let local_peer_id = peer_id(&keypair); @@ -577,7 +573,6 @@ where metrics, protocol_version, bootstrap_addresses, - disable_bootstrap_on_start, }); Ok((node, node_runner)) diff --git a/crates/subspace-networking/src/node_runner.rs b/crates/subspace-networking/src/node_runner.rs index 8d9a8ce34c..270c2f04fe 100644 --- a/crates/subspace-networking/src/node_runner.rs +++ b/crates/subspace-networking/src/node_runner.rs @@ -127,8 +127,6 @@ where /// Optional storage for the [`HandlerId`] of the address removal task. /// We keep to stop the task along with the rest of the networking. _address_removal_task_handler_id: Option, - /// Defines whether we should run blocking Kademlia bootstrap() operation before other requests. - disable_bootstrap_on_start: bool, } impl fmt::Debug for NodeRunner @@ -160,7 +158,6 @@ where pub(crate) metrics: Option, pub(crate) protocol_version: String, pub(crate) bootstrap_addresses: Vec, - pub(crate) disable_bootstrap_on_start: bool, } impl NodeRunner @@ -182,7 +179,6 @@ where metrics, protocol_version, bootstrap_addresses, - disable_bootstrap_on_start, }: NodeRunnerConfig, ) -> Self { // Setup the address removal events exchange between persistent params storage and Kademlia. @@ -223,7 +219,6 @@ where bootstrap_command_state: Arc::new(AsyncMutex::new(BootstrapCommandState::default())), removed_addresses_rx, _address_removal_task_handler_id: address_removal_task_handler_id, - disable_bootstrap_on_start, } } @@ -246,11 +241,7 @@ where } } - if !self.disable_bootstrap_on_start { - self.bootstrap().await; - } else { - debug!("Kademlia bootstrapping was skipped."); - } + self.bootstrap().await; loop { futures::select! { diff --git a/crates/subspace-node/src/commands/run/consensus.rs b/crates/subspace-node/src/commands/run/consensus.rs index 2159be132f..4ca7b358d9 100644 --- a/crates/subspace-node/src/commands/run/consensus.rs +++ b/crates/subspace-node/src/commands/run/consensus.rs @@ -149,10 +149,6 @@ struct DsnOptions { #[arg(long, default_value_t = 150)] dsn_pending_out_connections: u32, - /// Defines whether we should run blocking Kademlia bootstrap() operation before other requests. - #[arg(long, default_value_t = false)] - dsn_disable_bootstrap_on_start: bool, - /// Known external addresses #[arg(long, alias = "dsn-external-address")] dsn_external_addresses: Vec, @@ -440,7 +436,7 @@ pub(super) fn create_consensus_chain_configuration( mut force_synced, mut force_authoring, pot_external_entropy, - mut dsn_options, + dsn_options, sync_from_dsn, storage_monitor, mut timekeeper_options, @@ -459,7 +455,6 @@ pub(super) fn create_consensus_chain_configuration( force_synced = true; force_authoring = true; network_options.allow_private_ips = true; - dsn_options.dsn_disable_bootstrap_on_start = true; timekeeper_options.timekeeper = true; } @@ -643,7 +638,6 @@ pub(super) fn create_consensus_chain_configuration( max_pending_in_connections: dsn_options.dsn_pending_in_connections, max_pending_out_connections: dsn_options.dsn_pending_out_connections, external_addresses: dsn_options.dsn_external_addresses, - disable_bootstrap_on_start: dsn_options.dsn_disable_bootstrap_on_start, } }; diff --git a/crates/subspace-service/src/dsn.rs b/crates/subspace-service/src/dsn.rs index b69ccdbf37..ab97c3b791 100644 --- a/crates/subspace-service/src/dsn.rs +++ b/crates/subspace-service/src/dsn.rs @@ -63,9 +63,6 @@ pub struct DsnConfig { /// Known external addresses pub external_addresses: Vec, - - /// Defines whether we should run blocking Kademlia bootstrap() operation before other requests. - pub disable_bootstrap_on_start: bool, } pub(crate) fn create_dsn_instance( @@ -118,7 +115,6 @@ pub(crate) fn create_dsn_instance( bootstrap_addresses: dsn_config.bootstrap_nodes, external_addresses: dsn_config.external_addresses, kademlia_mode: KademliaMode::Static(Mode::Client), - disable_bootstrap_on_start: dsn_config.disable_bootstrap_on_start, ..default_networking_config };