diff --git a/Cargo.lock b/Cargo.lock index c37bcc206f..220f030568 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6166,7 +6166,7 @@ dependencies = [ [[package]] name = "nym-node" -version = "0.1.0" +version = "1.1.0" dependencies = [ "anyhow", "bip39", diff --git a/nym-node/src/cli/commands/migrate.rs b/nym-node/src/cli/commands/migrate.rs index 5b34d6e903..5625130148 100644 --- a/nym-node/src/cli/commands/migrate.rs +++ b/nym-node/src/cli/commands/migrate.rs @@ -223,6 +223,7 @@ async fn migrate_mixnode(mut args: Args) -> Result<(), NymNodeError> { packet_forwarding_maximum_backoff: cfg.debug.packet_forwarding_maximum_backoff, initial_connection_timeout: cfg.debug.initial_connection_timeout, maximum_connection_buffer_size: cfg.debug.maximum_connection_buffer_size, + ..Default::default() }, ..Default::default() })) @@ -385,6 +386,7 @@ async fn migrate_gateway(mut args: Args) -> Result<(), NymNodeError> { packet_forwarding_maximum_backoff: cfg.debug.packet_forwarding_maximum_backoff, initial_connection_timeout: cfg.debug.initial_connection_timeout, maximum_connection_buffer_size: cfg.debug.maximum_connection_buffer_size, + ..Default::default() }, })) .with_mixnode(args.mixnode.override_config_section(config::MixnodeConfig { diff --git a/nym-node/src/cli/helpers.rs b/nym-node/src/cli/helpers.rs index 74469a4fcc..1358b92072 100644 --- a/nym-node/src/cli/helpers.rs +++ b/nym-node/src/cli/helpers.rs @@ -203,6 +203,14 @@ pub(crate) struct MixnetArgs { env = NYMNODE_NYXD_URLS_ARG )] pub(crate) nyxd_urls: Option>, + + /// Specifies whether this node should **NOT** use noise protocol in the connections (currently not implemented) + #[clap( + hide = true, + long, + env = NYMNODE_UNSAFE_DISABLE_NOISE + )] + pub(crate) unsafe_disable_noise: bool, } impl MixnetArgs { @@ -221,6 +229,9 @@ impl MixnetArgs { if let Some(nyxd_urls) = self.nyxd_urls { section.nyxd_urls = nyxd_urls } + if self.unsafe_disable_noise { + section.debug.unsafe_disable_noise = true + } section } } diff --git a/nym-node/src/config/mod.rs b/nym-node/src/config/mod.rs index 4ff8519993..0b8e6f5da6 100644 --- a/nym-node/src/config/mod.rs +++ b/nym-node/src/config/mod.rs @@ -437,6 +437,9 @@ pub struct MixnetDebug { /// Maximum number of packets that can be stored waiting to get sent to a particular connection. pub maximum_connection_buffer_size: usize, + + /// Specifies whether this node should **NOT** use noise protocol in the connections (currently not implemented) + pub unsafe_disable_noise: bool, } impl MixnetDebug { @@ -453,6 +456,8 @@ impl Default for MixnetDebug { packet_forwarding_maximum_backoff: Self::DEFAULT_PACKET_FORWARDING_MAXIMUM_BACKOFF, initial_connection_timeout: Self::DEFAULT_INITIAL_CONNECTION_TIMEOUT, maximum_connection_buffer_size: Self::DEFAULT_MAXIMUM_CONNECTION_BUFFER_SIZE, + // to be changed by @SW once the implementation is there + unsafe_disable_noise: true, } } } diff --git a/nym-node/src/env.rs b/nym-node/src/env.rs index f7594ccbc2..4ceeed736d 100644 --- a/nym-node/src/env.rs +++ b/nym-node/src/env.rs @@ -35,6 +35,7 @@ pub mod vars { pub const NYMNODE_MIXNET_BIND_ADDRESS_ARG: &str = "NYMNODE_MIXNET_BIND_ADDRESS"; pub const NYMNODE_NYM_APIS_ARG: &str = "NYMNODE_NYM_APIS"; pub const NYMNODE_NYXD_URLS_ARG: &str = "NYMNODE_NYXD"; + pub const NYMNODE_UNSAFE_DISABLE_NOISE: &str = "UNSAFE_DISABLE_NOISE"; // wireguard: pub const NYMNODE_WG_ENABLED_ARG: &str = "NYMNODE_WG_ENABLED"; diff --git a/nym-node/src/node/http/mod.rs b/nym-node/src/node/http/mod.rs index ca26a8b292..b90398d6be 100644 --- a/nym-node/src/node/http/mod.rs +++ b/nym-node/src/node/http/mod.rs @@ -16,13 +16,19 @@ pub(crate) fn sign_host_details( x25519_noise: &x25519::PublicKey, ed22519_identity: &ed25519::KeyPair, ) -> Result { + let x25519_noise = if config.mixnet.debug.unsafe_disable_noise { + String::new() + } else { + x25519_noise.to_base58_string() + }; + let host_info = api_requests::v1::node::models::HostInformation { ip_address: config.host.public_ips.clone(), hostname: config.host.hostname.clone(), keys: api_requests::v1::node::models::HostKeys { ed25519_identity: ed22519_identity.public_key().to_base58_string(), x25519_sphinx: x22519_sphinx.to_base58_string(), - x25519_noise: x25519_noise.to_base58_string(), + x25519_noise, }, };