Skip to content

Commit a471844

Browse files
authored
Align VPN with Monorepo develop (#3375)
1 parent d657375 commit a471844

File tree

36 files changed

+995
-808
lines changed

36 files changed

+995
-808
lines changed

nym-vpn-core/Cargo.lock

Lines changed: 571 additions & 491 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nym-vpn-core/Cargo.toml

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,35 @@ default-members = [
4747
]
4848

4949
# For local development
50-
#[patch."https://github.com/nymtech/nym"]
51-
#nym-authenticator-requests = { path = "../../nym/common/authenticator-requests" }
52-
#nym-api-requests = { path = "../../nym/nym-api/nym-api-requests" }
53-
#nym-bandwidth-controller = { path = "../../nym/common/bandwidth-controller" }
54-
#nym-bin-common = { path = "../../nym/common/bin-common" }
55-
#nym-client-core = { path = "../../nym/common/client-core" }
56-
#nym-compact-ecash = { path = "../../nym/common/nym_offline_compact_ecash" }
57-
#nym-config = { path = "../../nym/common/config" }
58-
#nym-contracts-common = { path = "../../nym/common/cosmwasm-smart-contracts/contracts-common" }
59-
#nym-credential-proxy-requests = { path = "../../nym/nym-credential-proxy/nym-credential-proxy-requests", default-features = false }
60-
#nym-credential-storage = { path = "../../nym/common/credential-storage" }
61-
#nym-credentials = { path = "../../nym/common/credentials" }
62-
#nym-credentials-interface = { path = "../../nym/common/credentials-interface" }
63-
#nym-crypto = { path = "../../nym/common/crypto" }
64-
#nym-ecash-time = { path = "../../nym/common/ecash-time" }
65-
#nym-http-api-client = { path = "../../nym/common/http-api-client" }
66-
#nym-ip-packet-requests = { path = "../../nym/common/ip-packet-requests" }
67-
#nym-network-defaults = { path = "../../nym/common/network-defaults" }
68-
#nym-node-requests = { path = "../../nym/nym-node/nym-node-requests" }
69-
#nym-pemstore = { path = "../../nym/common/pemstore" }
70-
#nym-service-provider-requests-common = { path = "../../nym/common/service-provider-requests-common" }
71-
#nym-sdk = { path = "../../nym/sdk/rust/nym-sdk" }
72-
#nym-statistics-common = { path = "../../nym/common/statistics" }
73-
#nym-task = { path = "../../nym/common/task" }
74-
#nym-topology = { path = "../../nym/common/topology" }
75-
#nym-validator-client = { path = "../../nym/common/client-libs/validator-client" }
76-
#nym-wireguard-types = { path = "../../nym/common/wireguard-types" }
77-
#nym-credential-utils = { path = "../../nym/common/credential-utils" }
50+
# [patch."https://github.com/nymtech/nym"]
51+
# nym-authenticator-requests = { path = "../../nym/common/authenticator-requests" }
52+
# nym-api-requests = { path = "../../nym/nym-api/nym-api-requests" }
53+
# nym-bandwidth-controller = { path = "../../nym/common/bandwidth-controller" }
54+
# nym-bin-common = { path = "../../nym/common/bin-common" }
55+
# nym-client-core = { path = "../../nym/common/client-core" }
56+
# nym-compact-ecash = { path = "../../nym/common/nym_offline_compact_ecash" }
57+
# nym-config = { path = "../../nym/common/config" }
58+
# nym-contracts-common = { path = "../../nym/common/cosmwasm-smart-contracts/contracts-common" }
59+
# nym-credential-proxy-requests = { path = "../../nym/nym-credential-proxy/nym-credential-proxy-requests", default-features = false }
60+
# nym-credential-storage = { path = "../../nym/common/credential-storage" }
61+
# nym-credentials = { path = "../../nym/common/credentials" }
62+
# nym-credentials-interface = { path = "../../nym/common/credentials-interface" }
63+
# nym-crypto = { path = "../../nym/common/crypto" }
64+
# nym-ecash-time = { path = "../../nym/common/ecash-time" }
65+
# nym-http-api-client = { path = "../../nym/common/http-api-client" }
66+
# nym-http-api-client-macro = { path = "../../nym/common/http-api-client-macro" }
67+
# nym-ip-packet-requests = { path = "../../nym/common/ip-packet-requests" }
68+
# nym-network-defaults = { path = "../../nym/common/network-defaults" }
69+
# nym-node-requests = { path = "../../nym/nym-node/nym-node-requests" }
70+
# nym-pemstore = { path = "../../nym/common/pemstore" }
71+
# nym-service-provider-requests-common = { path = "../../nym/common/service-provider-requests-common" }
72+
# nym-sdk = { path = "../../nym/sdk/rust/nym-sdk" }
73+
# nym-statistics-common = { path = "../../nym/common/statistics" }
74+
# nym-task = { path = "../../nym/common/task" }
75+
# nym-topology = { path = "../../nym/common/topology" }
76+
# nym-validator-client = { path = "../../nym/common/client-libs/validator-client" }
77+
# nym-wireguard-types = { path = "../../nym/common/wireguard-types" }
78+
# nym-credential-utils = { path = "../../nym/common/credential-utils" }
7879

7980
[workspace.package]
8081
version = "1.17.0-beta"
@@ -191,7 +192,7 @@ wiremock = "0.6.4"
191192
wmi = "0.17.2"
192193
x25519-dalek = "2.0"
193194
zeroize = "1.8.1"
194-
sentry = { version = "0.42.0", default-features = false }
195+
sentry = { version = "0.42.0", default-features = false}
195196

196197
nym-apple-network = { path = "crates/nym-apple-network" }
197198
nym-authenticator-client = { path = "crates/nym-authenticator-client" }
@@ -224,33 +225,34 @@ nym-platform-metadata = { path = "crates/nym-platform-metadata" }
224225
nym-vpn-lib-types-uniffi = { path = "crates/nym-vpn-lib-types-uniffi" }
225226
nym-vpnd-types-uniffi = { path = "crates/nym-vpnd-types-uniffi" }
226227

227-
nym-authenticator-requests = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
228-
nym-api-requests = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
229-
nym-bandwidth-controller = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
230-
nym-bin-common = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
231-
nym-client-core = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
232-
nym-compact-ecash = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
233-
nym-config = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
234-
nym-contracts-common = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
235-
nym-credential-proxy-requests = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork", default-features = false }
236-
nym-credential-storage = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
237-
nym-credentials = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
238-
nym-credentials-interface = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
239-
nym-crypto = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
240-
nym-ecash-time = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
241-
nym-http-api-client = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
242-
nym-network-defaults = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
243-
nym-ip-packet-requests = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
244-
nym-node-requests = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
245-
nym-pemstore = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
246-
nym-service-provider-requests-common = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
247-
nym-sdk = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
248-
nym-statistics-common = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
249-
nym-task = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
250-
nym-topology = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
251-
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
252-
nym-wireguard-private-metadata-client = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
253-
nym-wireguard-private-metadata-shared = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
254-
nym-wireguard-types = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
255-
sqlx-pool-guard = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
256-
nym-credential-utils = { git = "https://github.com/nymtech/nym", branch = "domain-fronting-integration-fork" }
228+
nym-authenticator-requests = { git = "https://github.com/nymtech/nym", branch = "develop" }
229+
nym-api-requests = { git = "https://github.com/nymtech/nym", branch = "develop" }
230+
nym-bandwidth-controller = { git = "https://github.com/nymtech/nym", branch = "develop" }
231+
nym-bin-common = { git = "https://github.com/nymtech/nym", branch = "develop" }
232+
nym-client-core = { git = "https://github.com/nymtech/nym", branch = "develop" }
233+
nym-compact-ecash = { git = "https://github.com/nymtech/nym", branch = "develop" }
234+
nym-config = { git = "https://github.com/nymtech/nym", branch = "develop" }
235+
nym-contracts-common = { git = "https://github.com/nymtech/nym", branch = "develop" }
236+
nym-credential-proxy-requests = { git = "https://github.com/nymtech/nym", branch = "develop", default-features = false }
237+
nym-credential-storage = { git = "https://github.com/nymtech/nym", branch = "develop" }
238+
nym-credentials = { git = "https://github.com/nymtech/nym", branch = "develop" }
239+
nym-credentials-interface = { git = "https://github.com/nymtech/nym", branch = "develop" }
240+
nym-crypto = { git = "https://github.com/nymtech/nym", branch = "develop" }
241+
nym-ecash-time = { git = "https://github.com/nymtech/nym", branch = "develop" }
242+
nym-http-api-client = { git = "https://github.com/nymtech/nym", branch = "develop" }
243+
nym-http-api-client-macro = { git = "https://github.com/nymtech/nym", branch = "develop" }
244+
nym-network-defaults = { git = "https://github.com/nymtech/nym", branch = "develop" }
245+
nym-ip-packet-requests = { git = "https://github.com/nymtech/nym", branch = "develop" }
246+
nym-node-requests = { git = "https://github.com/nymtech/nym", branch = "develop" }
247+
nym-pemstore = { git = "https://github.com/nymtech/nym", branch = "develop" }
248+
nym-service-provider-requests-common = { git = "https://github.com/nymtech/nym", branch = "develop" }
249+
nym-sdk = { git = "https://github.com/nymtech/nym", branch = "develop" }
250+
nym-statistics-common = { git = "https://github.com/nymtech/nym", branch = "develop" }
251+
nym-task = { git = "https://github.com/nymtech/nym", branch = "develop" }
252+
nym-topology = { git = "https://github.com/nymtech/nym", branch = "develop" }
253+
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "develop" }
254+
nym-wireguard-private-metadata-client = { git = "https://github.com/nymtech/nym", branch = "develop" }
255+
nym-wireguard-private-metadata-shared = { git = "https://github.com/nymtech/nym", branch = "develop" }
256+
nym-wireguard-types = { git = "https://github.com/nymtech/nym", branch = "develop" }
257+
sqlx-pool-guard = { git = "https://github.com/nymtech/nym", branch = "develop" }
258+
nym-credential-utils = { git = "https://github.com/nymtech/nym", branch = "develop" }

nym-vpn-core/crates/nym-connection-monitor/src/icmp_beacon.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ use bytes::Bytes;
1010
use nym_common::trace_err_chain;
1111
use nym_config::defaults::mixnet_vpn::{NYM_TUN_DEVICE_ADDRESS_V4, NYM_TUN_DEVICE_ADDRESS_V6};
1212
use nym_ip_packet_requests::{IpPair, codec::MultiIpPacketCodec};
13-
use nym_sdk::{
14-
TaskClient,
15-
mixnet::{InputMessage, MixnetClientSender, MixnetMessageSender, Recipient},
16-
};
17-
use nym_task::connections::TransmissionLane;
13+
use nym_sdk::mixnet::{InputMessage, MixnetClientSender, MixnetMessageSender, Recipient};
14+
#[allow(deprecated)]
15+
// We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
16+
use nym_task::{TaskClient, connections::TransmissionLane};
1817
use pnet_packet::Packet;
1918
use tokio::task::JoinHandle;
2019
use tracing::{debug, trace};
@@ -132,6 +131,7 @@ impl IcmpConnectionBeacon {
132131
self.send_icmp_v6_ping(ICMP_IPR_TUN_EXTERNAL_PING_V6).await
133132
}
134133

134+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
135135
pub async fn run(mut self, mut shutdown: TaskClient) -> Result<()> {
136136
debug!("Icmp connection beacon is running");
137137
let mut ping_interval = tokio::time::interval(ICMP_BEACON_PING_INTERVAL);
@@ -234,6 +234,7 @@ pub fn is_icmp_v6_beacon_reply(
234234
None
235235
}
236236

237+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
237238
pub fn start_icmp_connection_beacon(
238239
mixnet_client_sender: MixnetClientSender,
239240
our_ips: IpPair,

nym-vpn-core/crates/nym-connection-monitor/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use futures::channel::mpsc;
55
use nym_ip_packet_requests::IpPair;
66
use nym_sdk::mixnet::{MixnetClientSender, Recipient};
7+
#[allow(deprecated)]
8+
// We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
79
use nym_task::TaskManager;
810
use tracing::info;
911

@@ -57,6 +59,7 @@ impl ConnectionMonitorTask {
5759
self.icmp_beacon_identifier
5860
}
5961

62+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
6063
pub fn start(
6164
self,
6265
mixnet_client_sender: MixnetClientSender,

nym-vpn-core/crates/nym-connection-monitor/src/mixnet_beacon.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
use std::time::Duration;
55

66
use nym_common::trace_err_chain;
7-
use nym_sdk::{
8-
TaskClient,
9-
mixnet::{InputMessage, MixnetClientSender, MixnetMessageSender, Recipient},
10-
};
11-
use nym_task::connections::TransmissionLane;
7+
use nym_sdk::mixnet::{InputMessage, MixnetClientSender, MixnetMessageSender, Recipient};
8+
#[allow(deprecated)]
9+
// We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
10+
use nym_task::{TaskClient, connections::TransmissionLane};
1211
use tokio::task::JoinHandle;
1312
use tracing::{debug, trace};
1413

@@ -39,6 +38,7 @@ impl MixnetConnectionBeacon {
3938
Ok(request_id)
4039
}
4140

41+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
4242
pub async fn run(self, mut shutdown: TaskClient) -> Result<()> {
4343
debug!("Mixnet connection beacon is running");
4444
let mut ping_interval = tokio::time::interval(MIXNET_SELF_PING_INTERVAL);
@@ -89,6 +89,7 @@ pub fn create_self_ping(our_address: Recipient) -> (InputMessage, u64) {
8989
)
9090
}
9191

92+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
9293
pub fn start_mixnet_connection_beacon(
9394
mixnet_client_sender: MixnetClientSender,
9495
our_address: Recipient,

nym-vpn-core/crates/nym-connection-monitor/src/monitor.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use std::{
88

99
use futures::{StreamExt, channel::mpsc};
1010
use nym_common::trace_err_chain;
11-
use nym_sdk::TaskClient;
11+
#[allow(deprecated)]
12+
// We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
13+
use nym_task::TaskClient;
1214
use tokio::task::JoinHandle;
1315

1416
use crate::error::Result;
@@ -160,6 +162,7 @@ impl ConnectionMonitor {
160162
}
161163
}
162164

165+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
163166
async fn run(mut self, mut task_client: TaskClient) -> Result<()> {
164167
tracing::debug!("Connection monitor is running");
165168
let mut report_interval = tokio::time::interval(CONNECTION_MONITOR_REPORT_INTERVAL);
@@ -188,6 +191,7 @@ impl ConnectionMonitor {
188191
}
189192
}
190193

194+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
191195
fn report_connectivity(connectivity: &ConnectivityState, task_client: &mut TaskClient) {
192196
if connectivity.entry == ConnectivityStatus::Fail {
193197
tracing::error!("Entry gateway not routing our mixnet traffic");
@@ -291,6 +295,7 @@ impl nym_task::TaskStatusEvent for ConnectionMonitorStatus {
291295
}
292296
}
293297

298+
#[allow(deprecated)] // We should not migrate this to use an SDK task management of any sort, VPN should handle this how they want, this is a leaky abstraction
294299
pub fn start_connection_monitor(
295300
connection_event_rx: futures::channel::mpsc::UnboundedReceiver<ConnectionStatusEvent>,
296301
shutdown_listener: TaskClient,

nym-vpn-core/crates/nym-gateway-directory/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ pub enum Error {
9595
Offline,
9696

9797
#[error("HTTP client error: {0}")]
98-
HttpClient(#[from] HttpClientError),
98+
HttpClient(#[from] Box<HttpClientError>),
9999

100100
#[error("Nym API error: {source}")]
101-
NymApi { source: NymAPIError },
101+
NymApi { source: Box<NymAPIError> },
102102

103103
#[error("operation cancelled")]
104104
Cancelled,

nym-vpn-core/crates/nym-gateway-directory/src/gateway_client.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ impl GatewayClient {
162162
static_nym_api_ip_addresses: Option<&[SocketAddr]>,
163163
) -> Result<Self> {
164164
// Use the new unified HTTP client with domain fronting for the main API client
165-
let api_client = nym_http_api_client::ClientBuilder::from_network(network_details)?
165+
let api_client = nym_http_api_client::ClientBuilder::from_network(network_details)
166+
.map_err(Box::new)?
166167
.with_user_agent(user_agent.clone())
167-
.build()?;
168+
.build()
169+
.map_err(Box::new)?;
168170

169171
// Use domain fronting with resolver overrides for VPN API client
170172
let nym_vpn_api_client = if config.nym_vpn_api_url.is_some() {
@@ -221,23 +223,29 @@ impl GatewayClient {
221223
self.api_client
222224
.get_all_described_nodes()
223225
.await
224-
.map_err(|e| Error::NymApi { source: e })
226+
.map_err(|e| Error::NymApi {
227+
source: Box::new(e),
228+
})
225229
}
226230

227231
async fn lookup_skimmed_gateways(&self) -> Result<SkimmedNodesWithMetadata> {
228232
debug!("Fetching skimmed entry assigned nodes from nym-api...");
229233
self.api_client
230234
.get_all_basic_entry_assigned_nodes_with_metadata()
231235
.await
232-
.map_err(|e| Error::NymApi { source: e })
236+
.map_err(|e| Error::NymApi {
237+
source: Box::new(e),
238+
})
233239
}
234240

235241
async fn lookup_skimmed_nodes(&self) -> Result<SkimmedNodesWithMetadata> {
236242
debug!("Fetching skimmed entry assigned nodes from nym-api...");
237243
self.api_client
238244
.get_all_basic_nodes_with_metadata()
239245
.await
240-
.map_err(|e| Error::NymApi { source: e })
246+
.map_err(|e| Error::NymApi {
247+
source: Box::new(e),
248+
})
241249
}
242250

243251
pub async fn lookup_gateway_ip_from_nym_api(&self, gateway_identity: &str) -> Result<IpAddr> {
@@ -246,7 +254,9 @@ impl GatewayClient {
246254
.api_client
247255
.get_all_described_nodes()
248256
.await
249-
.map_err(|e| Error::NymApi { source: e })?
257+
.map_err(|e| Error::NymApi {
258+
source: Box::new(e),
259+
})?
250260
.iter()
251261
.find_map(|node| {
252262
if node

nym-vpn-core/crates/nym-gateway-probe/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ nym-sdk.workspace = true
5656
nym-task.workspace = true
5757
nym-validator-client.workspace = true
5858
nym-credential-utils.workspace = true
59+
nym-http-api-client.workspace = true
60+
nym-http-api-client-macro = { workspace = true, features = ["debug-inventory"] }
5961

6062
[build-dependencies]
6163
vergen-gitcl = { workspace = true, default-features = false, features = [

nym-vpn-core/crates/nym-gateway-probe/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,13 @@ impl Probe {
202202
const MAX_RETRIES: usize = 50;
203203
for i in 0..MAX_RETRIES {
204204
let attempt = i + 1; // since humans usually don't count from 0 in this instance
205-
debug!(
205+
info!(
206206
"attempt {attempt}/{MAX_RETRIES} for attempting to acquire {ticketbook_type} bandwidth"
207207
);
208208
let bw_client = disconnected_mixnet_client
209209
.create_bandwidth_client(self.credentials_args.mnemonic.clone(), ticketbook_type)
210210
.await?;
211+
info!("Calling bandwidth controller acquire() for {ticketbook_type}");
211212
match bw_client.acquire().await {
212213
Ok(_) => {
213214
if i > 0 {

0 commit comments

Comments
 (0)