Repository: paritytech/substrate
File: client/cli/src/params/network_params.rs (Rust)

Code before:
	pub kademlia_disjoint_query_paths: bool,

	/// Join the IPFS network and serve transactions over bitswap protocol.
	#[arg(long)]
	pub ipfs_server: bool,

	/// Blockchain syncing mode.
	///
	/// - `full`: Download and validate full blockchain history.
	/// - `fast`: Download blocks and the latest state only.
	/// - `fast-unsafe`: Same as `fast`, but skip downloading state proofs.
	/// - `warp`: Download the latest state and proof.
	#[arg(
		long,
		value_enum,
		value_name = "SYNC_MODE",
		default_value_t = SyncMode::Full,
		ignore_case = true,
		verbatim_doc_comment
	)]
	pub sync: SyncMode,

	/// Maximum number of blocks per request.
	///
	/// Try reducing this number from the default value if you have a slow network connection
	/// and observe block request timing out.
	#[arg(long, value_name = "COUNT", default_value_t = 64)]
	pub max_blocks_per_request: u32,
}

impl NetworkParams {
	/// Fill the given `NetworkConfiguration` by looking at the cli parameters.
	pub fn network_config(
		&self,
		chain_spec: &Box<dyn ChainSpec>,
		is_dev: bool,
		is_validator: bool,
		net_config_path: Option<PathBuf>,
		client_id: &str,
		node_name: &str,
		node_key: NodeKeyConfig,
		default_listen_port: u16,
	) -> NetworkConfiguration {
		let port = self.port.unwrap_or(default_listen_port);

		let listen_addresses = if self.listen_addr.is_empty() {
			if is_validator || is_dev {
				vec![
					Multiaddr::empty()
						.with(Protocol::Ip6([0, 0, 0, 0, 0, 0, 0, 0].into()))
						.with(Protocol::Tcp(port)),

Review comment (suggestion):
```suggestion
	/// and observe block requests timing out.
```

Code after:
	pub kademlia_disjoint_query_paths: bool,

	/// Join the IPFS network and serve transactions over bitswap protocol.
	#[arg(long)]
	pub ipfs_server: bool,

	/// Blockchain syncing mode.
	///
	/// - `full`: Download and validate full blockchain history.
	/// - `fast`: Download blocks and the latest state only.
	/// - `fast-unsafe`: Same as `fast`, but skip downloading state proofs.
	/// - `warp`: Download the latest state and proof.
	#[arg(
		long,
		value_enum,
		value_name = "SYNC_MODE",
		default_value_t = SyncMode::Full,
		ignore_case = true,
		verbatim_doc_comment
	)]
	pub sync: SyncMode,

	/// Maximum number of blocks per request.
	///
	/// Try reducing this number from the default value if you have a slow network connection
	/// and observe block requests timing out.
	#[arg(long, value_name = "COUNT", default_value_t = 64)]
	pub max_blocks_per_request: u32,
}

impl NetworkParams {
	/// Fill the given `NetworkConfiguration` by looking at the cli parameters.
	pub fn network_config(
		&self,
		chain_spec: &Box<dyn ChainSpec>,
		is_dev: bool,
		is_validator: bool,
		net_config_path: Option<PathBuf>,
		client_id: &str,
		node_name: &str,
		node_key: NodeKeyConfig,
		default_listen_port: u16,
	) -> NetworkConfiguration {
		let port = self.port.unwrap_or(default_listen_port);

		let listen_addresses = if self.listen_addr.is_empty() {
			if is_validator || is_dev {
				vec![
					Multiaddr::empty()
						.with(Protocol::Ip6([0, 0, 0, 0, 0, 0, 0, 0].into()))
						.with(Protocol::Tcp(port)),