From ff0ad976c610d6873c233e240d96e301f243ac3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C5=9Fu?= Date: Wed, 28 Aug 2024 19:47:51 +0200 Subject: [PATCH] Remove unused wireguard flag from SDK (#4823) * Remove unused wireguard flag from SDK * Remove from wasm and socks5 too --- .../20240828120000_remove_wg_address.sql | 17 ++++ .../src/backend/fs_backend/manager.rs | 5 +- .../client-core/gateways-storage/src/types.rs | 19 ----- .../src/cli_helpers/client_add_gateway.rs | 2 - .../src/cli_helpers/client_init.rs | 1 - .../src/cli_helpers/client_list_gateways.rs | 2 - common/client-core/src/cli_helpers/types.rs | 5 -- .../client-core/src/client/base_client/mod.rs | 77 ++++++------------- .../base_client/storage/migration_helpers.rs | 1 - common/client-core/src/init/mod.rs | 26 ++----- common/client-core/src/init/types.rs | 41 ---------- common/wasm/client-core/src/helpers.rs | 1 - common/wasm/client-core/src/storage/types.rs | 1 - sdk/lib/socks5-listener/src/lib.rs | 1 - sdk/rust/nym-sdk/src/mixnet/client.rs | 31 +------- 15 files changed, 51 insertions(+), 179 deletions(-) create mode 100644 common/client-core/gateways-storage/fs_gateways_migrations/20240828120000_remove_wg_address.sql diff --git a/common/client-core/gateways-storage/fs_gateways_migrations/20240828120000_remove_wg_address.sql b/common/client-core/gateways-storage/fs_gateways_migrations/20240828120000_remove_wg_address.sql new file mode 100644 index 0000000000..47f27ce889 --- /dev/null +++ b/common/client-core/gateways-storage/fs_gateways_migrations/20240828120000_remove_wg_address.sql @@ -0,0 +1,17 @@ +/* + * Copyright 2024 - Nym Technologies SA + * SPDX-License-Identifier: Apache-2.0 + */ + +CREATE TABLE remote_gateway_details_temp +( + gateway_id_bs58 TEXT NOT NULL UNIQUE PRIMARY KEY REFERENCES registered_gateway (gateway_id_bs58), + derived_aes128_ctr_blake3_hmac_keys_bs58 TEXT NOT NULL, + gateway_owner_address TEXT, + gateway_listener TEXT NOT NULL +); + +INSERT INTO remote_gateway_details_temp SELECT gateway_id_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, gateway_owner_address, gateway_listener FROM remote_gateway_details; + +DROP TABLE remote_gateway_details; +ALTER TABLE remote_gateway_details_temp RENAME TO remote_gateway_details; \ No newline at end of file diff --git a/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs b/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs index 4c3e3c48b5..daa342fe9b 100644 --- a/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs +++ b/common/client-core/gateways-storage/src/backend/fs_backend/manager.rs @@ -155,14 +155,13 @@ impl StorageManager { ) -> Result<(), sqlx::Error> { sqlx::query!( r#" - INSERT INTO remote_gateway_details(gateway_id_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, gateway_owner_address, gateway_listener, wg_tun_address) - VALUES (?, ?, ?, ?, ?) + INSERT INTO remote_gateway_details(gateway_id_bs58, derived_aes128_ctr_blake3_hmac_keys_bs58, gateway_owner_address, gateway_listener) + VALUES (?, ?, ?, ?) "#, remote.gateway_id_bs58, remote.derived_aes128_ctr_blake3_hmac_keys_bs58, remote.gateway_owner_address, remote.gateway_listener, - remote.wg_tun_address, ) .execute(&self.connection_pool) .await?; diff --git a/common/client-core/gateways-storage/src/types.rs b/common/client-core/gateways-storage/src/types.rs index 58ce8f40a9..8daade3422 100644 --- a/common/client-core/gateways-storage/src/types.rs +++ b/common/client-core/gateways-storage/src/types.rs @@ -67,14 +67,12 @@ impl GatewayDetails { derived_aes128_ctr_blake3_hmac_keys: Arc, gateway_owner_address: Option, gateway_listener: Url, - wg_tun_address: Option, ) -> Self { GatewayDetails::Remote(RemoteGatewayDetails { gateway_id, derived_aes128_ctr_blake3_hmac_keys, gateway_owner_address, gateway_listener, - wg_tun_address, }) } @@ -172,7 +170,6 @@ pub struct RawRemoteGatewayDetails { pub derived_aes128_ctr_blake3_hmac_keys_bs58: String, pub gateway_owner_address: Option, pub gateway_listener: String, - pub wg_tun_address: Option, } impl TryFrom for RemoteGatewayDetails { @@ -217,24 +214,11 @@ impl TryFrom for RemoteGatewayDetails { } })?; - let wg_tun_address = value - .wg_tun_address - .as_ref() - .map(|addr| { - Url::parse(addr).map_err(|source| BadGateway::MalformedListener { - gateway_id: value.gateway_id_bs58.clone(), - raw_listener: addr.clone(), - source, - }) - }) - .transpose()?; - Ok(RemoteGatewayDetails { gateway_id, derived_aes128_ctr_blake3_hmac_keys, gateway_owner_address, gateway_listener, - wg_tun_address, }) } } @@ -248,7 +232,6 @@ impl<'a> From<&'a RemoteGatewayDetails> for RawRemoteGatewayDetails { .to_base58_string(), gateway_owner_address: value.gateway_owner_address.as_ref().map(|o| o.to_string()), gateway_listener: value.gateway_listener.to_string(), - wg_tun_address: value.wg_tun_address.as_ref().map(|addr| addr.to_string()), } } } @@ -264,8 +247,6 @@ pub struct RemoteGatewayDetails { pub gateway_owner_address: Option, pub gateway_listener: Url, - - pub wg_tun_address: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/common/client-core/src/cli_helpers/client_add_gateway.rs b/common/client-core/src/cli_helpers/client_add_gateway.rs index 7b6448062f..022db8b9c3 100644 --- a/common/client-core/src/cli_helpers/client_add_gateway.rs +++ b/common/client-core/src/cli_helpers/client_add_gateway.rs @@ -133,7 +133,6 @@ where let gateway_setup = GatewaySetup::New { specification: selection_spec, available_gateways, - wg_tun_address: None, }; let init_details = @@ -162,6 +161,5 @@ where active: common_args.set_active, typ: gateway_registration.details.typ().to_string(), endpoint: Some(gateway_details.gateway_listener.clone()), - wg_tun_address: gateway_details.wg_tun_address.clone(), }) } diff --git a/common/client-core/src/cli_helpers/client_init.rs b/common/client-core/src/cli_helpers/client_init.rs index 646083ce5b..bac6de5c60 100644 --- a/common/client-core/src/cli_helpers/client_init.rs +++ b/common/client-core/src/cli_helpers/client_init.rs @@ -172,7 +172,6 @@ where let gateway_setup = GatewaySetup::New { specification: selection_spec, available_gateways, - wg_tun_address: None, }; let init_details = diff --git a/common/client-core/src/cli_helpers/client_list_gateways.rs b/common/client-core/src/cli_helpers/client_list_gateways.rs index 1bfcafb027..34259df02d 100644 --- a/common/client-core/src/cli_helpers/client_list_gateways.rs +++ b/common/client-core/src/cli_helpers/client_list_gateways.rs @@ -57,7 +57,6 @@ where active: active_gateway == Some(remote_details.gateway_id), typ: GatewayType::Remote.to_string(), endpoint: Some(remote_details.gateway_listener), - wg_tun_address: remote_details.wg_tun_address, }), GatewayDetails::Custom(_) => info.push(GatewayInfo { registration: gateway.registration_timestamp, @@ -65,7 +64,6 @@ where active: active_gateway == Some(gateway.details.gateway_id()), typ: gateway.details.typ().to_string(), endpoint: None, - wg_tun_address: None, }), }; } diff --git a/common/client-core/src/cli_helpers/types.rs b/common/client-core/src/cli_helpers/types.rs index 4a351f38ef..5cf2ebb012 100644 --- a/common/client-core/src/cli_helpers/types.rs +++ b/common/client-core/src/cli_helpers/types.rs @@ -15,7 +15,6 @@ pub struct GatewayInfo { pub typ: String, pub endpoint: Option, - pub wg_tun_address: Option, } impl Display for GatewayInfo { @@ -31,10 +30,6 @@ impl Display for GatewayInfo { if let Some(endpoint) = &self.endpoint { write!(f, " endpoint: {endpoint}")?; } - - if let Some(wg_tun_address) = &self.wg_tun_address { - write!(f, " wg tun address: {wg_tun_address}")?; - } Ok(()) } } diff --git a/common/client-core/src/client/base_client/mod.rs b/common/client-core/src/client/base_client/mod.rs index c91a7569fc..0579cc12a8 100644 --- a/common/client-core/src/client/base_client/mod.rs +++ b/common/client-core/src/client/base_client/mod.rs @@ -35,7 +35,7 @@ use crate::init::{ }; use crate::{config, spawn_future}; use futures::channel::mpsc; -use log::{debug, error, info, warn}; +use log::*; use nym_bandwidth_controller::BandwidthController; use nym_client_core_gateways_storage::{GatewayDetails, GatewaysDetailsStore}; use nym_credential_storage::storage::Storage as CredentialStorage; @@ -44,7 +44,6 @@ use nym_gateway_client::client::config::GatewayClientConfig; use nym_gateway_client::{ AcknowledgementReceiver, GatewayClient, GatewayConfig, MixnetMessageReceiver, PacketRouter, }; -use nym_network_defaults::{DEFAULT_CLIENT_LISTENING_PORT, WG_TUN_DEVICE_ADDRESS}; use nym_sphinx::acknowledgements::AckKey; use nym_sphinx::addressing::clients::Recipient; use nym_sphinx::addressing::nodes::NodeIdentity; @@ -181,7 +180,6 @@ pub struct BaseClientBuilder<'a, C, S: MixnetClientStorage> { dkg_query_client: Option, wait_for_gateway: bool, - wireguard_connection: bool, custom_topology_provider: Option>, custom_gateway_transceiver: Option>, shutdown: Option, @@ -205,7 +203,6 @@ where client_store, dkg_query_client, wait_for_gateway: false, - wireguard_connection: false, custom_topology_provider: None, custom_gateway_transceiver: None, shutdown: None, @@ -226,12 +223,6 @@ where self } - #[must_use] - pub fn with_wireguard_connection(mut self, wireguard_connection: bool) -> Self { - self.wireguard_connection = wireguard_connection; - self - } - #[must_use] pub fn with_topology_provider( mut self, @@ -361,7 +352,6 @@ where async fn start_gateway_client( config: &Config, - wireguard_connection: bool, initialisation_result: InitialisationResult, bandwidth_controller: Option>, packet_router: PacketRouter, @@ -377,47 +367,33 @@ where return Err(ClientCoreError::UnexpectedPersistedCustomGatewayDetails); }; - let mut gateway_client = if let Some(existing_client) = - initialisation_result.authenticated_ephemeral_client - { - existing_client.upgrade(packet_router, bandwidth_controller, shutdown) - } else { - let gateway_listener = if wireguard_connection { - if let Some(tun_address) = details.wg_tun_address { - tun_address.to_string() - } else { - let default = - format!("ws://{WG_TUN_DEVICE_ADDRESS}:{DEFAULT_CLIENT_LISTENING_PORT}"); - warn!("gateway {} does not have tun device address set. defaulting to '{default}'", details.gateway_id); - default - } + let mut gateway_client = + if let Some(existing_client) = initialisation_result.authenticated_ephemeral_client { + existing_client.upgrade(packet_router, bandwidth_controller, shutdown) } else { - details.gateway_listener.to_string() + let cfg = GatewayConfig::new( + details.gateway_id, + details + .gateway_owner_address + .as_ref() + .map(|o| o.to_string()), + details.gateway_listener.to_string(), + ); + GatewayClient::new( + GatewayClientConfig::new_default() + .with_disabled_credentials_mode(config.client.disabled_credentials_mode) + .with_response_timeout( + config.debug.gateway_connection.gateway_response_timeout, + ), + cfg, + managed_keys.identity_keypair(), + Some(details.derived_aes128_ctr_blake3_hmac_keys), + packet_router, + bandwidth_controller, + shutdown, + ) }; - let cfg = GatewayConfig::new( - details.gateway_id, - details - .gateway_owner_address - .as_ref() - .map(|o| o.to_string()), - gateway_listener, - ); - GatewayClient::new( - GatewayClientConfig::new_default() - .with_disabled_credentials_mode(config.client.disabled_credentials_mode) - .with_response_timeout( - config.debug.gateway_connection.gateway_response_timeout, - ), - cfg, - managed_keys.identity_keypair(), - Some(details.derived_aes128_ctr_blake3_hmac_keys), - packet_router, - bandwidth_controller, - shutdown, - ) - }; - gateway_client .authenticate_and_start() .await @@ -435,7 +411,6 @@ where async fn setup_gateway_transceiver( custom_gateway_transceiver: Option>, config: &Config, - wireguard_connection: bool, initialisation_result: InitialisationResult, bandwidth_controller: Option>, packet_router: PacketRouter, @@ -464,7 +439,6 @@ where // otherwise, setup normal gateway client, etc let gateway_client = Self::start_gateway_client( config, - wireguard_connection, initialisation_result, bandwidth_controller, packet_router, @@ -729,7 +703,6 @@ where let gateway_transceiver = Self::setup_gateway_transceiver( self.custom_gateway_transceiver, self.config, - self.wireguard_connection, init_res, bandwidth_controller, gateway_packet_router, diff --git a/common/client-core/src/client/base_client/storage/migration_helpers.rs b/common/client-core/src/client/base_client/storage/migration_helpers.rs index 81ea931085..b03b6d13c7 100644 --- a/common/client-core/src/client/base_client/storage/migration_helpers.rs +++ b/common/client-core/src/client/base_client/storage/migration_helpers.rs @@ -102,7 +102,6 @@ pub mod v1_1_33 { message: format!("the stored gateway listener address was malformed: {err}"), } })?, - wg_tun_address: None, })) } diff --git a/common/client-core/src/init/mod.rs b/common/client-core/src/init/mod.rs index 63f0a98e0c..479d73be1a 100644 --- a/common/client-core/src/init/mod.rs +++ b/common/client-core/src/init/mod.rs @@ -23,7 +23,6 @@ use nym_topology::gateway; use rand::rngs::OsRng; use rand::{CryptoRng, RngCore}; use serde::Serialize; -use std::net::IpAddr; pub mod helpers; pub mod types; @@ -52,7 +51,6 @@ async fn setup_new_gateway( details_store: &D, selection_specification: GatewaySelectionSpecification, available_gateways: Vec, - wg_tun_ip_address: Option, ) -> Result where K: KeyStore, @@ -70,19 +68,19 @@ where let selected_gateway = match selection_specification { GatewaySelectionSpecification::UniformRemote { must_use_tls } => { let gateway = uniformly_random_gateway(&mut rng, &available_gateways, must_use_tls)?; - SelectedGateway::from_topology_node(gateway, wg_tun_ip_address, must_use_tls)? + SelectedGateway::from_topology_node(gateway, must_use_tls)? } GatewaySelectionSpecification::RemoteByLatency { must_use_tls } => { let gateway = choose_gateway_by_latency(&mut rng, &available_gateways, must_use_tls).await?; - SelectedGateway::from_topology_node(gateway, wg_tun_ip_address, must_use_tls)? + SelectedGateway::from_topology_node(gateway, must_use_tls)? } GatewaySelectionSpecification::Specified { must_use_tls, identity, } => { let gateway = get_specified_gateway(&identity, &available_gateways, must_use_tls)?; - SelectedGateway::from_topology_node(gateway, wg_tun_ip_address, must_use_tls)? + SelectedGateway::from_topology_node(gateway, must_use_tls)? } GatewaySelectionSpecification::Custom { gateway_identity, @@ -104,23 +102,19 @@ where gateway_id, gateway_owner_address, gateway_listener, - wg_tun_address, } => { // if we're using a 'normal' gateway setup, do register let our_identity = client_keys.identity_keypair(); - // if wg address is set, use that one - let url = wg_tun_address.clone().unwrap_or(gateway_listener.clone()); - let registration = - helpers::register_with_gateway(gateway_id, url, our_identity).await?; + helpers::register_with_gateway(gateway_id, gateway_listener.clone(), our_identity) + .await?; ( GatewayDetails::new_remote( gateway_id, registration.shared_keys, gateway_owner_address, gateway_listener, - wg_tun_address, ), Some(registration.authenticated_ephemeral_client), ) @@ -207,17 +201,9 @@ where GatewaySetup::New { specification, available_gateways, - wg_tun_address, } => { log::debug!("GatewaySetup::New with spec: {specification:?}"); - setup_new_gateway( - key_store, - details_store, - specification, - available_gateways, - wg_tun_address, - ) - .await + setup_new_gateway(key_store, details_store, specification, available_gateways).await } GatewaySetup::ReuseConnection { authenticated_ephemeral_client, diff --git a/common/client-core/src/init/types.rs b/common/client-core/src/init/types.rs index c02509cf99..8f1daa84b4 100644 --- a/common/client-core/src/init/types.rs +++ b/common/client-core/src/init/types.rs @@ -6,7 +6,6 @@ use crate::client::key_manager::ClientKeys; use crate::config::Config; use crate::error::ClientCoreError; use crate::init::{setup_gateway, use_loaded_gateway_details}; -use log::info; use nym_client_core_gateways_storage::{ GatewayRegistration, GatewaysDetailsStore, RemoteGatewayDetails, }; @@ -19,7 +18,6 @@ use nym_validator_client::client::IdentityKey; use nym_validator_client::nyxd::AccountId; use serde::Serialize; use std::fmt::Display; -use std::net::IpAddr; use std::str::FromStr; use std::sync::Arc; use time::OffsetDateTime; @@ -32,8 +30,6 @@ pub enum SelectedGateway { gateway_owner_address: Option, gateway_listener: Url, - - wg_tun_address: Option, }, Custom { gateway_id: identity::PublicKey, @@ -41,36 +37,9 @@ pub enum SelectedGateway { }, } -fn wg_tun_address( - tun_ip: Option, - gateway: &gateway::Node, -) -> Result, ClientCoreError> { - let Some(tun_ip) = tun_ip else { - return Ok(None); - }; - - // log this so we'd remember about it if we ever decided to actually use that port - if gateway.clients_wss_port.is_some() { - info!( - "gateway {} exposes wss but for wireguard we're going to use ws", - gateway.identity_key - ); - } - - let raw_url = format!("ws://{tun_ip}:{}", gateway.clients_ws_port); - Ok(Some(raw_url.as_str().parse().map_err(|source| { - ClientCoreError::MalformedListener { - gateway_id: gateway.identity_key.to_base58_string(), - raw_listener: raw_url, - source, - } - })?)) -} - impl SelectedGateway { pub fn from_topology_node( node: gateway::Node, - wg_tun_ip_address: Option, must_use_tls: bool, ) -> Result { let gateway_listener = if must_use_tls { @@ -82,8 +51,6 @@ impl SelectedGateway { node.clients_address() }; - let wg_tun_address = wg_tun_address(wg_tun_ip_address, &node)?; - let gateway_owner_address = node .owner .as_ref() @@ -109,7 +76,6 @@ impl SelectedGateway { gateway_id: node.identity_key, gateway_owner_address, gateway_listener, - wg_tun_address, }) } @@ -250,12 +216,6 @@ pub enum GatewaySetup { // TODO: seems to be a bit inefficient to pass them by value available_gateways: Vec, - - /// Implicitly specify whether the chosen gateway must use wireguard mode by setting the tun address. - /// - /// Currently this is imperfect solution as I'd imagine this address could vary from gateway to gateway - /// so perhaps it should be part of gateway::Node struct - wg_tun_address: Option, }, ReuseConnection { @@ -290,7 +250,6 @@ impl GatewaySetup { additional_data: None, }, available_gateways: vec![], - wg_tun_address: None, } } diff --git a/common/wasm/client-core/src/helpers.rs b/common/wasm/client-core/src/helpers.rs index fb38508162..05caa7d88b 100644 --- a/common/wasm/client-core/src/helpers.rs +++ b/common/wasm/client-core/src/helpers.rs @@ -106,7 +106,6 @@ pub async fn setup_gateway_wasm( GatewaySetup::New { specification: selection_spec, available_gateways: gateways.to_vec(), - wg_tun_address: None, } }; diff --git a/common/wasm/client-core/src/storage/types.rs b/common/wasm/client-core/src/storage/types.rs index 499a0a0354..0973c837e8 100644 --- a/common/wasm/client-core/src/storage/types.rs +++ b/common/wasm/client-core/src/storage/types.rs @@ -32,7 +32,6 @@ impl TryFrom for GatewayRegistration { .derived_aes128_ctr_blake3_hmac_keys_bs58, gateway_owner_address: value.gateway_owner_address, gateway_listener: value.gateway_listener, - wg_tun_address: None, }; let remote: RemoteGatewayDetails = raw_remote.try_into()?; diff --git a/sdk/lib/socks5-listener/src/lib.rs b/sdk/lib/socks5-listener/src/lib.rs index 46afb57678..bc5350718c 100644 --- a/sdk/lib/socks5-listener/src/lib.rs +++ b/sdk/lib/socks5-listener/src/lib.rs @@ -276,7 +276,6 @@ where must_use_tls: false, }, available_gateways: current_gateways(&mut rng, &nym_apis, None).await?, - wg_tun_address: None, }); eprintln!("starting the socks5 client"); diff --git a/sdk/rust/nym-sdk/src/mixnet/client.rs b/sdk/rust/nym-sdk/src/mixnet/client.rs index 22cf485b33..72b14cbebc 100644 --- a/sdk/rust/nym-sdk/src/mixnet/client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/client.rs @@ -29,14 +29,12 @@ use nym_client_core::init::helpers::current_gateways; use nym_client_core::init::setup_gateway; use nym_client_core::init::types::{GatewaySelectionSpecification, GatewaySetup}; use nym_credentials_interface::TicketType; -use nym_network_defaults::WG_TUN_DEVICE_IP_ADDRESS; use nym_socks5_client_core::config::Socks5; use nym_task::manager::TaskStatus; use nym_task::{TaskClient, TaskHandle}; use nym_topology::provider_trait::TopologyProvider; use nym_validator_client::{nyxd, QueryHttpRpcNyxdClient, UserAgent}; use rand::rngs::OsRng; -use std::net::IpAddr; use std::path::Path; use std::path::PathBuf; use url::Url; @@ -50,7 +48,6 @@ pub struct MixnetClientBuilder { storage_paths: Option, socks5_config: Option, - wireguard_mode: bool, wait_for_gateway: bool, custom_topology_provider: Option>, custom_gateway_transceiver: Option>, @@ -86,7 +83,6 @@ impl MixnetClientBuilder { config: Default::default(), storage_paths: None, socks5_config: None, - wireguard_mode: false, wait_for_gateway: false, custom_topology_provider: None, storage: storage_paths @@ -118,7 +114,6 @@ where config: Default::default(), storage_paths: None, socks5_config: None, - wireguard_mode: false, wait_for_gateway: false, custom_topology_provider: None, custom_gateway_transceiver: None, @@ -137,7 +132,6 @@ where config: self.config, storage_paths: self.storage_paths, socks5_config: self.socks5_config, - wireguard_mode: self.wireguard_mode, wait_for_gateway: self.wait_for_gateway, custom_topology_provider: self.custom_topology_provider, custom_gateway_transceiver: self.custom_gateway_transceiver, @@ -224,13 +218,6 @@ where self } - /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. - #[must_use] - pub fn with_wireguard_mode(mut self, wireguard_mode: bool) -> Self { - self.wireguard_mode = wireguard_mode; - self - } - /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. #[must_use] pub fn with_wait_for_gateway(mut self, wait_for_gateway: bool) -> Self { @@ -269,7 +256,6 @@ where client.custom_gateway_transceiver = self.custom_gateway_transceiver; client.custom_topology_provider = self.custom_topology_provider; client.custom_shutdown = self.custom_shutdown; - client.wireguard_mode = self.wireguard_mode; client.wait_for_gateway = self.wait_for_gateway; client.force_tls = self.force_tls; client.user_agent = self.user_agent; @@ -310,9 +296,6 @@ where /// advanced usage of custom gateways custom_gateway_transceiver: Option>, - /// If the client connects via Wireguard tunnel to the gateway. - wireguard_mode: bool, - /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. wait_for_gateway: bool, @@ -368,7 +351,6 @@ where storage, custom_topology_provider: None, custom_gateway_transceiver: None, - wireguard_mode: false, wait_for_gateway: false, force_tls: false, custom_shutdown: None, @@ -396,15 +378,6 @@ where .collect() } - fn wireguard_tun_address(&self) -> Option { - // currently use a hardcoded value here, but perhaps we should change that later - if self.wireguard_mode { - Some(WG_TUN_DEVICE_IP_ADDRESS) - } else { - None - } - } - async fn setup_client_keys(&self) -> Result<()> { let mut rng = OsRng; let key_store = self.storage.key_store(); @@ -481,7 +454,6 @@ where Ok(GatewaySetup::New { specification: selection_spec, available_gateways, - wg_tun_address: self.wireguard_tun_address(), }) } @@ -594,8 +566,7 @@ where let mut base_builder: BaseClientBuilder<_, _> = BaseClientBuilder::new(&base_config, self.storage, self.dkg_query_client) - .with_wait_for_gateway(self.wait_for_gateway) - .with_wireguard_connection(self.wireguard_mode); + .with_wait_for_gateway(self.wait_for_gateway); if let Some(user_agent) = self.user_agent { base_builder = base_builder.with_user_agent(user_agent);