don't announce noise keys

This commit is contained in:
Jędrzej Stuczyński
2024-04-18 11:25:29 +01:00
parent 73ae09cb76
commit 8e2c64a867
6 changed files with 27 additions and 2 deletions
Generated
+1 -1
View File
@@ -6166,7 +6166,7 @@ dependencies = [
[[package]]
name = "nym-node"
version = "0.1.0"
version = "1.1.0"
dependencies = [
"anyhow",
"bip39",
+2
View File
@@ -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 {
+11
View File
@@ -203,6 +203,14 @@ pub(crate) struct MixnetArgs {
env = NYMNODE_NYXD_URLS_ARG
)]
pub(crate) nyxd_urls: Option<Vec<Url>>,
/// 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
}
}
+5
View File
@@ -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,
}
}
}
+1
View File
@@ -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";
+7 -1
View File
@@ -16,13 +16,19 @@ pub(crate) fn sign_host_details(
x25519_noise: &x25519::PublicKey,
ed22519_identity: &ed25519::KeyPair,
) -> Result<api_requests::v1::node::models::SignedHostInformation, NymNodeError> {
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,
},
};