Compare commits

...

4 Commits

Author SHA1 Message Date
benedetta davico a98306d340 Update Cargo.toml 2026-01-26 18:26:43 +01:00
benedettadavico b68e13f0f2 update changelog 2026-01-13 16:47:13 +01:00
Jędrzej Stuczyński 46fe1bc819 bugfix: mozzarella -> niolo config migration (#6259)
* bugfix: mozzarella -> niolo config migration

* clippy
2025-12-02 15:29:30 +00:00
benedettadavico 37ae72d8ec bump versions 2025-11-28 19:18:05 +01:00
14 changed files with 698 additions and 416 deletions
+56
View File
@@ -4,6 +4,62 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
## [Unreleased]
## [2026.1-niolo] (2026-01-13)
- bugfix: mozzarella -> niolo config migration ([#6259])
- chore: remove run DKG migration ([#6253])
- bugfix: reexposed 'derive_extended_private_key' ([#6247])
- Bump js-yaml from 3.14.1 to 3.14.2 in /sdk/typescript/codegen/contract-clients ([#6231])
- Statistics API v2 ([#6227])
- Bump golang.org/x/crypto from 0.39.0 to 0.45.0 in /nym-gateway-probe/netstack_ping ([#6220])
- Update chain registry link ([#6219])
- Bump glob from 10.3.4 to 10.5.0 in /documentation/scripts/post-process ([#6216])
- Bump js-yaml from 4.1.0 to 4.1.1 in /sdk/typescript/tests/integration-tests/mix-fetch ([#6215])
- gateway-probe fixes for run-local ([#6212])
- chore: updated default endpoint for retrieving attestation.json ([#6207])
- chore: remove support for legacy mixnode within the performance contract ([#6205])
- feat: upgrade mode: VPN adjustments ([#6189])
- Bump min-document from 2.19.0 to 2.19.1 ([#6181])
- Bump next from 15.4.1 to 15.4.7 in /nym-node-status-api/nym-node-status-ui ([#6180])
- feat: merge intermediate upgrade mode changes ([#6174])
- Add weighted scoring to NS API ([#6144])
- build(deps): bump mikefarah/yq from 4.47.1 to 4.48.1 ([#6107])
- build(deps): bump SonarSource/sonarqube-scan-action from 5 to 6 in /.github/workflows ([#6068])
- build(deps): bump tar-fs from 3.0.9 to 3.1.1 in /sdk/typescript/tests/integration-tests/mix-fetch ([#6063])
- build(deps): bump ammonia from 4.1.1 to 4.1.2 ([#6057])
- build(deps): bump tower-http from 0.5.2 to 0.6.6 ([#6030])
- build(deps): bump actions/setup-go from 5 to 6 ([#6013])
- build(deps): bump next from 14.2.28 to 14.2.32 ([#5996])
- build(deps): bump tracing-subscriber from 0.3.19 to 0.3.20 ([#5993])
- build(deps): bump actions/upload-pages-artifact from 3 to 4 ([#5992])
[#6259]: https://github.com/nymtech/nym/pull/6259
[#6253]: https://github.com/nymtech/nym/pull/6253
[#6247]: https://github.com/nymtech/nym/pull/6247
[#6231]: https://github.com/nymtech/nym/pull/6231
[#6227]: https://github.com/nymtech/nym/pull/6227
[#6220]: https://github.com/nymtech/nym/pull/6220
[#6219]: https://github.com/nymtech/nym/pull/6219
[#6216]: https://github.com/nymtech/nym/pull/6216
[#6215]: https://github.com/nymtech/nym/pull/6215
[#6212]: https://github.com/nymtech/nym/pull/6212
[#6207]: https://github.com/nymtech/nym/pull/6207
[#6205]: https://github.com/nymtech/nym/pull/6205
[#6189]: https://github.com/nymtech/nym/pull/6189
[#6181]: https://github.com/nymtech/nym/pull/6181
[#6180]: https://github.com/nymtech/nym/pull/6180
[#6174]: https://github.com/nymtech/nym/pull/6174
[#6144]: https://github.com/nymtech/nym/pull/6144
[#6107]: https://github.com/nymtech/nym/pull/6107
[#6068]: https://github.com/nymtech/nym/pull/6068
[#6063]: https://github.com/nymtech/nym/pull/6063
[#6057]: https://github.com/nymtech/nym/pull/6057
[#6030]: https://github.com/nymtech/nym/pull/6030
[#6013]: https://github.com/nymtech/nym/pull/6013
[#5996]: https://github.com/nymtech/nym/pull/5996
[#5993]: https://github.com/nymtech/nym/pull/5993
[#5992]: https://github.com/nymtech/nym/pull/5992
## [2025.21-mozzarella] (2025-11-25)
- [bugfix] Tunnel not waiting on MixnetClient to shut down cleanly ([#6225])
Generated
+7 -7
View File
@@ -4834,7 +4834,7 @@ dependencies = [
[[package]]
name = "nym-api"
version = "1.1.70"
version = "1.1.71"
dependencies = [
"anyhow",
"async-trait",
@@ -5057,7 +5057,7 @@ dependencies = [
[[package]]
name = "nym-cli"
version = "1.1.67"
version = "1.1.68"
dependencies = [
"anyhow",
"base64 0.22.1",
@@ -5140,7 +5140,7 @@ dependencies = [
[[package]]
name = "nym-client"
version = "1.1.67"
version = "1.1.68"
dependencies = [
"bs58",
"clap",
@@ -6367,7 +6367,7 @@ dependencies = [
[[package]]
name = "nym-network-requester"
version = "1.1.68"
version = "1.1.69"
dependencies = [
"addr",
"anyhow",
@@ -6417,7 +6417,7 @@ dependencies = [
[[package]]
name = "nym-node"
version = "1.22.0"
version = "1.23.0"
dependencies = [
"anyhow",
"arc-swap",
@@ -6946,7 +6946,7 @@ dependencies = [
[[package]]
name = "nym-socks5-client"
version = "1.1.67"
version = "1.1.68"
dependencies = [
"bs58",
"clap",
@@ -7680,7 +7680,7 @@ dependencies = [
[[package]]
name = "nymvisor"
version = "0.1.32"
version = "0.1.33"
dependencies = [
"anyhow",
"bytes",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nym-client"
version = "1.1.67"
version = "1.1.68"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
description = "Implementation of the Nym Client"
edition = "2021"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nym-socks5-client"
version = "1.1.67"
version = "1.1.68"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address"
edition = "2021"
+1 -1
View File
@@ -4,7 +4,7 @@
[package]
name = "nym-api"
license = "GPL-3.0"
version = "1.1.70"
version = "1.1.71"
authors.workspace = true
edition = "2021"
rust-version.workspace = true
@@ -3,7 +3,7 @@
[package]
name = "nym-node-status-agent"
version = "1.0.7"
version = "1.0.7-niolo"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-node"
version = "1.22.0"
version = "1.23.0"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
+2
View File
@@ -3,6 +3,7 @@
mod old_config_v1;
mod old_config_v10;
mod old_config_v11;
mod old_config_v2;
mod old_config_v3;
mod old_config_v4;
@@ -22,3 +23,4 @@ pub use old_config_v7::try_upgrade_config_v7;
pub use old_config_v8::try_upgrade_config_v8;
pub use old_config_v9::try_upgrade_config_v9;
pub use old_config_v10::try_upgrade_config_v10;
pub use old_config_v11::try_upgrade_config_v11;
+24 -400
View File
@@ -1,26 +1,11 @@
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
use crate::config::authenticator::{Authenticator, AuthenticatorDebug};
use crate::config::gateway_tasks::{
ClientBandwidthDebug, StaleMessageDebug, UpgradeModeWatcher, ZkNymTicketHandlerDebug,
};
use crate::config::persistence::{
AuthenticatorPaths, GatewayTasksPaths, IpPacketRouterPaths, KeysPaths, NetworkRequesterPaths,
NymNodePaths, ReplayProtectionPaths, ServiceProvidersPaths, WireguardPaths,
};
use crate::config::service_providers::{
IpPacketRouter, IpPacketRouterDebug, NetworkRequester, NetworkRequesterDebug,
};
use crate::config::{
Config, DEFAULT_HTTP_PORT, GatewayTasksConfig, Host, Http, KeyRotation, KeyRotationDebug,
Mixnet, MixnetDebug, NodeModes, ReplayProtection, ReplayProtectionDebug,
ServiceProvidersConfig, Verloc, VerlocDebug, Wireguard, gateway_tasks, service_providers,
};
use crate::config::old_configs::old_config_v11::{ConfigV11, WireguardV11};
use crate::config::{DEFAULT_HTTP_PORT, NodeModes};
use crate::error::NymNodeError;
use celes::Country;
use clap::ValueEnum;
use nym_bin_common::logging::LoggingSettings;
use nym_client_core_config_types::DebugConfig as ClientDebugConfig;
use nym_config::defaults::{DEFAULT_VERLOC_LISTENING_PORT, WG_METADATA_PORT};
use nym_config::helpers::{in6addr_any_init, inaddr_any};
@@ -33,7 +18,7 @@ use serde::{Deserialize, Serialize};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
use std::path::{Path, PathBuf};
use std::time::Duration;
use tracing::{debug, error, instrument};
use tracing::{debug, instrument};
use url::Url;
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
@@ -1169,7 +1154,7 @@ impl ConfigV10 {
pub async fn try_upgrade_config_v10<P: AsRef<Path>>(
path: P,
prev_config: Option<ConfigV10>,
) -> Result<Config, NymNodeError> {
) -> Result<ConfigV11, NymNodeError> {
debug!("attempting to load v10 config...");
let old_cfg = if let Some(prev_config) = prev_config {
@@ -1178,398 +1163,37 @@ pub async fn try_upgrade_config_v10<P: AsRef<Path>>(
ConfigV10::read_from_path(&path)?
};
let cfg = Config {
let cfg = ConfigV11 {
save_path: old_cfg.save_path,
id: old_cfg.id,
modes: NodeModes {
mixnode: old_cfg.modes.mixnode,
entry: old_cfg.modes.entry,
exit: old_cfg.modes.exit,
},
host: Host {
public_ips: old_cfg.host.public_ips,
hostname: old_cfg.host.hostname,
location: old_cfg.host.location,
},
mixnet: Mixnet {
bind_address: old_cfg.mixnet.bind_address,
announce_port: old_cfg.mixnet.announce_port,
nym_api_urls: old_cfg.mixnet.nym_api_urls,
nyxd_urls: old_cfg.mixnet.nyxd_urls,
replay_protection: ReplayProtection {
storage_paths: ReplayProtectionPaths {
current_bloomfilters_directory: old_cfg
.mixnet
.replay_protection
.storage_paths
.current_bloomfilters_directory,
},
debug: ReplayProtectionDebug {
unsafe_disabled: old_cfg.mixnet.replay_protection.debug.unsafe_disabled,
maximum_replay_detection_deferral: old_cfg
.mixnet
.replay_protection
.debug
.maximum_replay_detection_deferral,
maximum_replay_detection_pending_packets: old_cfg
.mixnet
.replay_protection
.debug
.maximum_replay_detection_pending_packets,
false_positive_rate: old_cfg.mixnet.replay_protection.debug.false_positive_rate,
initial_expected_packets_per_second: old_cfg
.mixnet
.replay_protection
.debug
.initial_expected_packets_per_second,
bloomfilter_minimum_packets_per_second_size: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_minimum_packets_per_second_size,
bloomfilter_size_multiplier: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_size_multiplier,
bloomfilter_disk_flushing_rate: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_disk_flushing_rate,
},
},
key_rotation: KeyRotation {
debug: KeyRotationDebug {
rotation_state_poling_interval: old_cfg
.mixnet
.key_rotation
.debug
.rotation_state_poling_interval,
},
},
debug: MixnetDebug {
maximum_forward_packet_delay: old_cfg.mixnet.debug.maximum_forward_packet_delay,
packet_forwarding_initial_backoff: old_cfg
.mixnet
.debug
.packet_forwarding_initial_backoff,
packet_forwarding_maximum_backoff: old_cfg
.mixnet
.debug
.packet_forwarding_maximum_backoff,
initial_connection_timeout: old_cfg.mixnet.debug.initial_connection_timeout,
maximum_connection_buffer_size: old_cfg.mixnet.debug.maximum_connection_buffer_size,
unsafe_disable_noise: old_cfg.mixnet.debug.unsafe_disable_noise,
use_legacy_packet_encoding: old_cfg.mixnet.debug.use_legacy_packet_encoding,
},
},
storage_paths: NymNodePaths {
keys: KeysPaths {
private_ed25519_identity_key_file: old_cfg
.storage_paths
.keys
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.storage_paths
.keys
.public_ed25519_identity_key_file,
primary_x25519_sphinx_key_file: old_cfg
.storage_paths
.keys
.primary_x25519_sphinx_key_file,
private_x25519_noise_key_file: old_cfg
.storage_paths
.keys
.private_x25519_noise_key_file,
public_x25519_noise_key_file: old_cfg
.storage_paths
.keys
.public_x25519_noise_key_file,
secondary_x25519_sphinx_key_file: old_cfg
.storage_paths
.keys
.secondary_x25519_sphinx_key_file,
},
description: old_cfg.storage_paths.description,
},
http: Http {
bind_address: old_cfg.http.bind_address,
landing_page_assets_path: old_cfg.http.landing_page_assets_path,
access_token: old_cfg.http.access_token,
expose_system_info: old_cfg.http.expose_system_info,
expose_system_hardware: old_cfg.http.expose_system_hardware,
expose_crypto_hardware: old_cfg.http.expose_crypto_hardware,
node_load_cache_ttl: old_cfg.http.node_load_cache_ttl,
},
verloc: Verloc {
bind_address: old_cfg.verloc.bind_address,
announce_port: old_cfg.verloc.announce_port,
debug: VerlocDebug {
packets_per_node: old_cfg.verloc.debug.packets_per_node,
connection_timeout: old_cfg.verloc.debug.connection_timeout,
packet_timeout: old_cfg.verloc.debug.packet_timeout,
delay_between_packets: old_cfg.verloc.debug.delay_between_packets,
tested_nodes_batch_size: old_cfg.verloc.debug.tested_nodes_batch_size,
testing_interval: old_cfg.verloc.debug.testing_interval,
retry_timeout: old_cfg.verloc.debug.retry_timeout,
},
},
wireguard: Wireguard {
modes: old_cfg.modes,
host: old_cfg.host,
mixnet: old_cfg.mixnet,
storage_paths: old_cfg.storage_paths,
http: old_cfg.http,
verloc: old_cfg.verloc,
wireguard: WireguardV11 {
enabled: old_cfg.wireguard.enabled,
bind_address: old_cfg.wireguard.bind_address,
private_ipv4: old_cfg.wireguard.private_ipv4,
private_ipv6: old_cfg.wireguard.private_ipv6,
// \/ CHANGED
announced_tunnel_port: old_cfg.wireguard.announced_port,
// /\ CHANGED
// \/ ADDED
announced_metadata_port: WG_METADATA_PORT,
// /\ ADDED
private_network_prefix_v4: old_cfg.wireguard.private_network_prefix_v4,
private_network_prefix_v6: old_cfg.wireguard.private_network_prefix_v6,
storage_paths: WireguardPaths {
private_diffie_hellman_key_file: old_cfg
.wireguard
.storage_paths
.private_diffie_hellman_key_file,
public_diffie_hellman_key_file: old_cfg
.wireguard
.storage_paths
.public_diffie_hellman_key_file,
},
storage_paths: old_cfg.wireguard.storage_paths,
},
gateway_tasks: GatewayTasksConfig {
storage_paths: GatewayTasksPaths {
clients_storage: old_cfg.gateway_tasks.storage_paths.clients_storage,
stats_storage: old_cfg.gateway_tasks.storage_paths.stats_storage,
cosmos_mnemonic: old_cfg.gateway_tasks.storage_paths.cosmos_mnemonic,
bridge_client_params: old_cfg.gateway_tasks.storage_paths.bridge_client_params,
},
enforce_zk_nyms: old_cfg.gateway_tasks.enforce_zk_nyms,
ws_bind_address: old_cfg.gateway_tasks.ws_bind_address,
announce_ws_port: old_cfg.gateway_tasks.announce_ws_port,
announce_wss_port: old_cfg.gateway_tasks.announce_wss_port,
upgrade_mode: UpgradeModeWatcher::new()
.inspect_err(|_| {
error!(
"failed to set custom upgrade mode configuration - falling back to mainnet"
)
})
.unwrap_or(UpgradeModeWatcher::new_mainnet()),
debug: gateway_tasks::Debug {
message_retrieval_limit: old_cfg.gateway_tasks.debug.message_retrieval_limit,
maximum_open_connections: old_cfg.gateway_tasks.debug.maximum_open_connections,
minimum_mix_performance: old_cfg.gateway_tasks.debug.minimum_mix_performance,
max_request_timestamp_skew: old_cfg.gateway_tasks.debug.max_request_timestamp_skew,
stale_messages: StaleMessageDebug {
cleaner_run_interval: old_cfg
.gateway_tasks
.debug
.stale_messages
.cleaner_run_interval,
max_age: old_cfg.gateway_tasks.debug.stale_messages.max_age,
},
client_bandwidth: ClientBandwidthDebug {
max_flushing_rate: old_cfg
.gateway_tasks
.debug
.client_bandwidth
.max_flushing_rate,
max_delta_flushing_amount: old_cfg
.gateway_tasks
.debug
.client_bandwidth
.max_delta_flushing_amount,
},
zk_nym_tickets: ZkNymTicketHandlerDebug {
revocation_bandwidth_penalty: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.revocation_bandwidth_penalty,
pending_poller: old_cfg.gateway_tasks.debug.zk_nym_tickets.pending_poller,
minimum_api_quorum: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.minimum_api_quorum,
minimum_redemption_tickets: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.minimum_redemption_tickets,
maximum_time_between_redemption: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.maximum_time_between_redemption,
},
..Default::default()
},
},
service_providers: ServiceProvidersConfig {
storage_paths: ServiceProvidersPaths {
clients_storage: old_cfg.service_providers.storage_paths.clients_storage,
stats_storage: old_cfg.service_providers.storage_paths.stats_storage,
network_requester: NetworkRequesterPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.network_requester
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.network_requester
.gateway_registrations,
},
ip_packet_router: IpPacketRouterPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.gateway_registrations,
},
authenticator: AuthenticatorPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.authenticator
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.authenticator
.gateway_registrations,
},
},
open_proxy: old_cfg.service_providers.open_proxy,
upstream_exit_policy_url: old_cfg.service_providers.upstream_exit_policy_url,
network_requester: NetworkRequester {
debug: NetworkRequesterDebug {
enabled: old_cfg.service_providers.network_requester.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.network_requester
.debug
.disable_poisson_rate,
client_debug: old_cfg
.service_providers
.network_requester
.debug
.client_debug,
},
},
ip_packet_router: IpPacketRouter {
debug: IpPacketRouterDebug {
enabled: old_cfg.service_providers.ip_packet_router.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.ip_packet_router
.debug
.disable_poisson_rate,
client_debug: old_cfg
.service_providers
.ip_packet_router
.debug
.client_debug,
},
},
authenticator: Authenticator {
debug: AuthenticatorDebug {
enabled: old_cfg.service_providers.authenticator.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.authenticator
.debug
.disable_poisson_rate,
client_debug: old_cfg.service_providers.authenticator.debug.client_debug,
},
},
debug: service_providers::Debug {
message_retrieval_limit: old_cfg.service_providers.debug.message_retrieval_limit,
},
},
metrics: Default::default(),
logging: LoggingSettings {},
debug: Default::default(),
gateway_tasks: old_cfg.gateway_tasks,
service_providers: old_cfg.service_providers,
metrics: old_cfg.metrics,
logging: old_cfg.logging,
debug: old_cfg.debug,
};
Ok(cfg)
}
@@ -0,0 +1,599 @@
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
use crate::config::authenticator::{Authenticator, AuthenticatorDebug};
use crate::config::gateway_tasks::{
ClientBandwidthDebug, StaleMessageDebug, UpgradeModeWatcher, ZkNymTicketHandlerDebug,
};
use crate::config::persistence::{
AuthenticatorPaths, GatewayTasksPaths, IpPacketRouterPaths, KeysPaths, NetworkRequesterPaths,
NymNodePaths, ReplayProtectionPaths, ServiceProvidersPaths, WireguardPaths,
};
use crate::config::service_providers::{
IpPacketRouter, IpPacketRouterDebug, NetworkRequester, NetworkRequesterDebug,
};
use crate::config::{
Config, GatewayTasksConfig, Host, Http, KeyRotation, KeyRotationDebug, Mixnet, MixnetDebug,
NodeModes, ReplayProtection, ReplayProtectionDebug, ServiceProvidersConfig, Verloc,
VerlocDebug, Wireguard, gateway_tasks, service_providers,
};
use crate::error::NymNodeError;
use nym_bin_common::logging::LoggingSettings;
use nym_config::read_config_from_toml_file;
use serde::{Deserialize, Serialize};
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
use std::path::{Path, PathBuf};
use tracing::{debug, error, instrument};
pub use unchanged_v11_types::*;
// (while some of those are technically unused, they might be needed in future migrations,
// thus allow them to exist)
#[allow(dead_code)]
pub mod unchanged_v11_types {
use crate::config::old_configs::old_config_v10::{
AuthenticatorDebugV10, AuthenticatorPathsV10, AuthenticatorV10, ClientBandwidthDebugV10,
DebugV10, GatewayTasksConfigDebugV10, GatewayTasksConfigV10, GatewayTasksPathsV10, HostV10,
HttpV10, IpPacketRouterDebugV10, IpPacketRouterPathsV10, IpPacketRouterV10,
KeyRotationDebugV10, KeyRotationV10, KeysPathsV10, LoggingSettingsV10, MetricsConfigV10,
MetricsDebugV10, MixnetDebugV10, MixnetV10, NetworkRequesterDebugV10,
NetworkRequesterPathsV10, NetworkRequesterV10, NodeModeV10, NodeModesV10, NymNodePathsV10,
ReplayProtectionDebugV10, ReplayProtectionPathsV10, ReplayProtectionV10,
ServiceProvidersConfigDebugV10, ServiceProvidersConfigV10, ServiceProvidersPathsV10,
StaleMessageDebugV10, VerlocDebugV10, VerlocV10, WireguardPathsV10,
ZkNymTicketHandlerDebugV10,
};
pub type WireguardPathsV11 = WireguardPathsV10;
pub type NodeModeV11 = NodeModeV10;
pub type NodeModesV11 = NodeModesV10;
pub type HostV11 = HostV10;
pub type KeyRotationDebugV11 = KeyRotationDebugV10;
pub type KeyRotationV11 = KeyRotationV10;
pub type MixnetDebugV11 = MixnetDebugV10;
pub type MixnetV11 = MixnetV10;
pub type ReplayProtectionV11 = ReplayProtectionV10;
pub type ReplayProtectionPathsV11 = ReplayProtectionPathsV10;
pub type ReplayProtectionDebugV11 = ReplayProtectionDebugV10;
pub type KeysPathsV11 = KeysPathsV10;
pub type NymNodePathsV11 = NymNodePathsV10;
pub type HttpV11 = HttpV10;
pub type VerlocDebugV11 = VerlocDebugV10;
pub type VerlocV11 = VerlocV10;
pub type DebugV11 = DebugV10;
pub type ZkNymTicketHandlerDebugV11 = ZkNymTicketHandlerDebugV10;
pub type NetworkRequesterPathsV11 = NetworkRequesterPathsV10;
pub type IpPacketRouterPathsV11 = IpPacketRouterPathsV10;
pub type AuthenticatorPathsV11 = AuthenticatorPathsV10;
pub type AuthenticatorV11 = AuthenticatorV10;
pub type AuthenticatorDebugV11 = AuthenticatorDebugV10;
pub type IpPacketRouterDebugV11 = IpPacketRouterDebugV10;
pub type IpPacketRouterV11 = IpPacketRouterV10;
pub type NetworkRequesterDebugV11 = NetworkRequesterDebugV10;
pub type NetworkRequesterV11 = NetworkRequesterV10;
pub type GatewayTasksPathsV11 = GatewayTasksPathsV10;
pub type StaleMessageDebugV11 = StaleMessageDebugV10;
pub type ClientBandwidthDebugV11 = ClientBandwidthDebugV10;
pub type GatewayTasksConfigDebugV11 = GatewayTasksConfigDebugV10;
pub type GatewayTasksConfigV11 = GatewayTasksConfigV10;
pub type ServiceProvidersPathsV11 = ServiceProvidersPathsV10;
pub type ServiceProvidersConfigDebugV11 = ServiceProvidersConfigDebugV10;
pub type ServiceProvidersConfigV11 = ServiceProvidersConfigV10;
pub type MetricsConfigV11 = MetricsConfigV10;
pub type MetricsDebugV11 = MetricsDebugV10;
pub type LoggingSettingsV11 = LoggingSettingsV10;
}
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct WireguardV11 {
/// Specifies whether the wireguard service is enabled on this node.
pub enabled: bool,
/// Socket address this node will use for binding its wireguard interface.
/// default: `[::]:51822`
pub bind_address: SocketAddr,
/// Private IPv4 address of the wireguard gateway.
/// default: `10.1.0.1`
pub private_ipv4: Ipv4Addr,
/// Private IPv6 address of the wireguard gateway.
/// default: `fc01::1`
pub private_ipv6: Ipv6Addr,
/// Tunnel port announced to external clients wishing to connect to the wireguard interface.
/// Useful in the instances where the node is behind a proxy.
pub announced_tunnel_port: u16,
/// Metadata port announced to external clients wishing to connect to the metadata endpoint.
/// Useful in the instances where the node is behind a proxy.
pub announced_metadata_port: u16,
/// The prefix denoting the maximum number of the clients that can be connected via Wireguard using IPv4.
/// The maximum value for IPv4 is 32
pub private_network_prefix_v4: u8,
/// The prefix denoting the maximum number of the clients that can be connected via Wireguard using IPv6.
/// The maximum value for IPv6 is 128
pub private_network_prefix_v6: u8,
/// Paths for wireguard keys, client registries, etc.
pub storage_paths: WireguardPathsV11,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ConfigV11 {
// additional metadata holding on-disk location of this config file
#[serde(skip)]
pub(crate) save_path: Option<PathBuf>,
/// Human-readable ID of this particular node.
pub id: String,
/// Current modes of this nym-node.
pub modes: NodeModesV11,
pub host: HostV11,
pub mixnet: MixnetV11,
/// Storage paths to persistent nym-node data, such as its long term keys.
pub storage_paths: NymNodePathsV11,
#[serde(default)]
pub http: HttpV11,
#[serde(default)]
pub verloc: VerlocV11,
pub wireguard: WireguardV11,
#[serde(alias = "entry_gateway")]
pub gateway_tasks: GatewayTasksConfigV11,
#[serde(alias = "exit_gateway")]
pub service_providers: ServiceProvidersConfigV11,
#[serde(default)]
pub metrics: MetricsConfigV11,
#[serde(default)]
pub logging: LoggingSettingsV11,
#[serde(default)]
pub debug: DebugV11,
}
impl ConfigV11 {
// simple wrapper that reads config file and assigns path location
fn read_from_path<P: AsRef<Path>>(path: P) -> Result<Self, NymNodeError> {
let path = path.as_ref();
let mut loaded: ConfigV11 =
read_config_from_toml_file(path).map_err(|source| NymNodeError::ConfigLoadFailure {
path: path.to_path_buf(),
source,
})?;
loaded.save_path = Some(path.to_path_buf());
debug!("loaded config file from {}", path.display());
Ok(loaded)
}
}
#[instrument(skip_all)]
pub async fn try_upgrade_config_v11<P: AsRef<Path>>(
path: P,
prev_config: Option<ConfigV11>,
) -> Result<Config, NymNodeError> {
debug!("attempting to load v11 config...");
let old_cfg = if let Some(prev_config) = prev_config {
prev_config
} else {
ConfigV11::read_from_path(&path)?
};
// for future reference: when creating v12 migration,
// look at how v10 -> v11 is implemented
// you might be able to create a bunch of type aliases again to save you some headache
let cfg = Config {
save_path: old_cfg.save_path,
id: old_cfg.id,
modes: NodeModes {
mixnode: old_cfg.modes.mixnode,
entry: old_cfg.modes.entry,
exit: old_cfg.modes.exit,
},
host: Host {
public_ips: old_cfg.host.public_ips,
hostname: old_cfg.host.hostname,
location: old_cfg.host.location,
},
mixnet: Mixnet {
bind_address: old_cfg.mixnet.bind_address,
announce_port: old_cfg.mixnet.announce_port,
nym_api_urls: old_cfg.mixnet.nym_api_urls,
nyxd_urls: old_cfg.mixnet.nyxd_urls,
replay_protection: ReplayProtection {
storage_paths: ReplayProtectionPaths {
current_bloomfilters_directory: old_cfg
.mixnet
.replay_protection
.storage_paths
.current_bloomfilters_directory,
},
debug: ReplayProtectionDebug {
unsafe_disabled: old_cfg.mixnet.replay_protection.debug.unsafe_disabled,
maximum_replay_detection_deferral: old_cfg
.mixnet
.replay_protection
.debug
.maximum_replay_detection_deferral,
maximum_replay_detection_pending_packets: old_cfg
.mixnet
.replay_protection
.debug
.maximum_replay_detection_pending_packets,
false_positive_rate: old_cfg.mixnet.replay_protection.debug.false_positive_rate,
initial_expected_packets_per_second: old_cfg
.mixnet
.replay_protection
.debug
.initial_expected_packets_per_second,
bloomfilter_minimum_packets_per_second_size: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_minimum_packets_per_second_size,
bloomfilter_size_multiplier: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_size_multiplier,
bloomfilter_disk_flushing_rate: old_cfg
.mixnet
.replay_protection
.debug
.bloomfilter_disk_flushing_rate,
},
},
key_rotation: KeyRotation {
debug: KeyRotationDebug {
rotation_state_poling_interval: old_cfg
.mixnet
.key_rotation
.debug
.rotation_state_poling_interval,
},
},
debug: MixnetDebug {
maximum_forward_packet_delay: old_cfg.mixnet.debug.maximum_forward_packet_delay,
packet_forwarding_initial_backoff: old_cfg
.mixnet
.debug
.packet_forwarding_initial_backoff,
packet_forwarding_maximum_backoff: old_cfg
.mixnet
.debug
.packet_forwarding_maximum_backoff,
initial_connection_timeout: old_cfg.mixnet.debug.initial_connection_timeout,
maximum_connection_buffer_size: old_cfg.mixnet.debug.maximum_connection_buffer_size,
unsafe_disable_noise: old_cfg.mixnet.debug.unsafe_disable_noise,
use_legacy_packet_encoding: old_cfg.mixnet.debug.use_legacy_packet_encoding,
},
},
storage_paths: NymNodePaths {
keys: KeysPaths {
private_ed25519_identity_key_file: old_cfg
.storage_paths
.keys
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.storage_paths
.keys
.public_ed25519_identity_key_file,
primary_x25519_sphinx_key_file: old_cfg
.storage_paths
.keys
.primary_x25519_sphinx_key_file,
private_x25519_noise_key_file: old_cfg
.storage_paths
.keys
.private_x25519_noise_key_file,
public_x25519_noise_key_file: old_cfg
.storage_paths
.keys
.public_x25519_noise_key_file,
secondary_x25519_sphinx_key_file: old_cfg
.storage_paths
.keys
.secondary_x25519_sphinx_key_file,
},
description: old_cfg.storage_paths.description,
},
http: Http {
bind_address: old_cfg.http.bind_address,
landing_page_assets_path: old_cfg.http.landing_page_assets_path,
access_token: old_cfg.http.access_token,
expose_system_info: old_cfg.http.expose_system_info,
expose_system_hardware: old_cfg.http.expose_system_hardware,
expose_crypto_hardware: old_cfg.http.expose_crypto_hardware,
node_load_cache_ttl: old_cfg.http.node_load_cache_ttl,
},
verloc: Verloc {
bind_address: old_cfg.verloc.bind_address,
announce_port: old_cfg.verloc.announce_port,
debug: VerlocDebug {
packets_per_node: old_cfg.verloc.debug.packets_per_node,
connection_timeout: old_cfg.verloc.debug.connection_timeout,
packet_timeout: old_cfg.verloc.debug.packet_timeout,
delay_between_packets: old_cfg.verloc.debug.delay_between_packets,
tested_nodes_batch_size: old_cfg.verloc.debug.tested_nodes_batch_size,
testing_interval: old_cfg.verloc.debug.testing_interval,
retry_timeout: old_cfg.verloc.debug.retry_timeout,
},
},
wireguard: Wireguard {
enabled: old_cfg.wireguard.enabled,
bind_address: old_cfg.wireguard.bind_address,
private_ipv4: old_cfg.wireguard.private_ipv4,
private_ipv6: old_cfg.wireguard.private_ipv6,
announced_tunnel_port: old_cfg.wireguard.announced_tunnel_port,
announced_metadata_port: old_cfg.wireguard.announced_metadata_port,
private_network_prefix_v4: old_cfg.wireguard.private_network_prefix_v4,
private_network_prefix_v6: old_cfg.wireguard.private_network_prefix_v6,
storage_paths: WireguardPaths {
private_diffie_hellman_key_file: old_cfg
.wireguard
.storage_paths
.private_diffie_hellman_key_file,
public_diffie_hellman_key_file: old_cfg
.wireguard
.storage_paths
.public_diffie_hellman_key_file,
},
},
gateway_tasks: GatewayTasksConfig {
storage_paths: GatewayTasksPaths {
clients_storage: old_cfg.gateway_tasks.storage_paths.clients_storage,
stats_storage: old_cfg.gateway_tasks.storage_paths.stats_storage,
cosmos_mnemonic: old_cfg.gateway_tasks.storage_paths.cosmos_mnemonic,
bridge_client_params: old_cfg.gateway_tasks.storage_paths.bridge_client_params,
},
enforce_zk_nyms: old_cfg.gateway_tasks.enforce_zk_nyms,
ws_bind_address: old_cfg.gateway_tasks.ws_bind_address,
announce_ws_port: old_cfg.gateway_tasks.announce_ws_port,
announce_wss_port: old_cfg.gateway_tasks.announce_wss_port,
// \/ ADDED
upgrade_mode: UpgradeModeWatcher::new()
.inspect_err(|_| {
error!(
"failed to set custom upgrade mode configuration - falling back to mainnet"
)
})
.unwrap_or(UpgradeModeWatcher::new_mainnet()),
// /\ ADDED
debug: gateway_tasks::Debug {
message_retrieval_limit: old_cfg.gateway_tasks.debug.message_retrieval_limit,
maximum_open_connections: old_cfg.gateway_tasks.debug.maximum_open_connections,
minimum_mix_performance: old_cfg.gateway_tasks.debug.minimum_mix_performance,
max_request_timestamp_skew: old_cfg.gateway_tasks.debug.max_request_timestamp_skew,
stale_messages: StaleMessageDebug {
cleaner_run_interval: old_cfg
.gateway_tasks
.debug
.stale_messages
.cleaner_run_interval,
max_age: old_cfg.gateway_tasks.debug.stale_messages.max_age,
},
client_bandwidth: ClientBandwidthDebug {
max_flushing_rate: old_cfg
.gateway_tasks
.debug
.client_bandwidth
.max_flushing_rate,
max_delta_flushing_amount: old_cfg
.gateway_tasks
.debug
.client_bandwidth
.max_delta_flushing_amount,
},
zk_nym_tickets: ZkNymTicketHandlerDebug {
revocation_bandwidth_penalty: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.revocation_bandwidth_penalty,
pending_poller: old_cfg.gateway_tasks.debug.zk_nym_tickets.pending_poller,
minimum_api_quorum: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.minimum_api_quorum,
minimum_redemption_tickets: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.minimum_redemption_tickets,
maximum_time_between_redemption: old_cfg
.gateway_tasks
.debug
.zk_nym_tickets
.maximum_time_between_redemption,
},
// \/ ADDED (be explicit about the value rather than using ..Default::default()
upgrade_mode_min_staleness_recheck: gateway_tasks::Debug::default()
.upgrade_mode_min_staleness_recheck,
// /\ ADDED
},
},
service_providers: ServiceProvidersConfig {
storage_paths: ServiceProvidersPaths {
clients_storage: old_cfg.service_providers.storage_paths.clients_storage,
stats_storage: old_cfg.service_providers.storage_paths.stats_storage,
network_requester: NetworkRequesterPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.network_requester
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.network_requester
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.network_requester
.gateway_registrations,
},
ip_packet_router: IpPacketRouterPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.ip_packet_router
.gateway_registrations,
},
authenticator: AuthenticatorPaths {
private_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.private_ed25519_identity_key_file,
public_ed25519_identity_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.public_ed25519_identity_key_file,
private_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.private_x25519_diffie_hellman_key_file,
public_x25519_diffie_hellman_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.public_x25519_diffie_hellman_key_file,
ack_key_file: old_cfg
.service_providers
.storage_paths
.authenticator
.ack_key_file,
reply_surb_database: old_cfg
.service_providers
.storage_paths
.authenticator
.reply_surb_database,
gateway_registrations: old_cfg
.service_providers
.storage_paths
.authenticator
.gateway_registrations,
},
},
open_proxy: old_cfg.service_providers.open_proxy,
upstream_exit_policy_url: old_cfg.service_providers.upstream_exit_policy_url,
network_requester: NetworkRequester {
debug: NetworkRequesterDebug {
enabled: old_cfg.service_providers.network_requester.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.network_requester
.debug
.disable_poisson_rate,
client_debug: old_cfg
.service_providers
.network_requester
.debug
.client_debug,
},
},
ip_packet_router: IpPacketRouter {
debug: IpPacketRouterDebug {
enabled: old_cfg.service_providers.ip_packet_router.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.ip_packet_router
.debug
.disable_poisson_rate,
client_debug: old_cfg
.service_providers
.ip_packet_router
.debug
.client_debug,
},
},
authenticator: Authenticator {
debug: AuthenticatorDebug {
enabled: old_cfg.service_providers.authenticator.debug.enabled,
disable_poisson_rate: old_cfg
.service_providers
.authenticator
.debug
.disable_poisson_rate,
client_debug: old_cfg.service_providers.authenticator.debug.client_debug,
},
},
debug: service_providers::Debug {
message_retrieval_limit: old_cfg.service_providers.debug.message_retrieval_limit,
},
},
metrics: Default::default(),
logging: LoggingSettings {},
debug: Default::default(),
};
Ok(cfg)
}
+2 -1
View File
@@ -17,7 +17,8 @@ async fn try_upgrade_config(path: &Path) -> Result<(), NymNodeError> {
let cfg = try_upgrade_config_v7(path, cfg).await.ok();
let cfg = try_upgrade_config_v8(path, cfg).await.ok();
let cfg = try_upgrade_config_v9(path, cfg).await.ok();
match try_upgrade_config_v10(path, cfg).await {
let cfg = try_upgrade_config_v10(path, cfg).await.ok();
match try_upgrade_config_v11(path, cfg).await {
Ok(cfg) => cfg.save(),
Err(e) => {
tracing::error!("Failed to finish upgrade: {e}");
@@ -4,7 +4,7 @@
[package]
name = "nym-network-requester"
license = "GPL-3.0"
version = "1.1.68"
version = "1.1.69"
authors.workspace = true
edition.workspace = true
rust-version = "1.85"
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nym-cli"
version = "1.1.67"
version = "1.1.68"
authors.workspace = true
edition = "2021"
license.workspace = true
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nymvisor"
version = "0.1.32"
version = "0.1.33"
authors.workspace = true
repository.workspace = true
homepage.workspace = true