[Feature] Noise XKpsk3 integration (2025 version) (#5692)
* grand Noise squaheroo * fix merge conflicts and adapt code for the key rotation changes (#5824) * remove file that should have been ignored
This commit is contained in:
@@ -50,6 +50,8 @@ use nym_network_requester::{
|
||||
use nym_node_metrics::events::MetricEventsSender;
|
||||
use nym_node_metrics::NymNodeMetrics;
|
||||
use nym_node_requests::api::v1::node::models::{AnnouncePorts, NodeDescription};
|
||||
use nym_noise::config::{NoiseConfig, NoiseNetworkView};
|
||||
use nym_noise_keys::VersionedNoiseKey;
|
||||
use nym_sphinx_acknowledgements::AckKey;
|
||||
use nym_sphinx_addressing::Recipient;
|
||||
use nym_task::{ShutdownManager, ShutdownToken, TaskClient};
|
||||
@@ -800,16 +802,19 @@ impl NymNode {
|
||||
config.api.v1_config.node.roles.ip_packet_router_enabled = true;
|
||||
}
|
||||
|
||||
let x25519_noise_key = if self.config.mixnet.debug.unsafe_disable_noise {
|
||||
let x25519_versioned_noise_key = if self.config.mixnet.debug.unsafe_disable_noise {
|
||||
None
|
||||
} else {
|
||||
Some(*self.x25519_noise_keys.public_key())
|
||||
Some(VersionedNoiseKey {
|
||||
supported_version: nym_noise::LATEST_NOISE_VERSION,
|
||||
x25519_pubkey: *self.x25519_noise_keys.public_key(),
|
||||
})
|
||||
};
|
||||
|
||||
let app_state = AppState::new(
|
||||
StaticNodeInformation {
|
||||
ed25519_identity_keys: self.ed25519_identity_keys.clone(),
|
||||
x25519_noise_key,
|
||||
x25519_versioned_noise_key,
|
||||
ip_addresses: self.config.host.public_ips.clone(),
|
||||
hostname: self.config.host.hostname.clone(),
|
||||
},
|
||||
@@ -1031,6 +1036,7 @@ impl NymNode {
|
||||
active_clients_store: &ActiveClientsStore,
|
||||
replay_protection_bloomfilter: ReplayProtectionBloomfilters,
|
||||
routing_filter: F,
|
||||
noise_config: NoiseConfig,
|
||||
shutdown: ShutdownToken,
|
||||
) -> Result<(MixForwardingSender, ActiveConnections), NymNodeError>
|
||||
where
|
||||
@@ -1054,6 +1060,7 @@ impl NymNode {
|
||||
);
|
||||
let mixnet_client = nym_mixnet_client::Client::new(
|
||||
mixnet_client_config,
|
||||
noise_config.clone(),
|
||||
self.metrics
|
||||
.network
|
||||
.active_egress_mixnet_connections_counter(),
|
||||
@@ -1080,6 +1087,7 @@ impl NymNode {
|
||||
replay_protection_bloomfilter,
|
||||
mix_packet_sender.clone(),
|
||||
final_hop_data,
|
||||
noise_config,
|
||||
self.metrics.clone(),
|
||||
shutdown,
|
||||
);
|
||||
@@ -1089,10 +1097,18 @@ impl NymNode {
|
||||
}
|
||||
|
||||
pub(crate) async fn run_minimal_mixnet_processing(self) -> Result<(), NymNodeError> {
|
||||
let noise_config = nym_noise::config::NoiseConfig::new(
|
||||
self.x25519_noise_keys.clone(),
|
||||
NoiseNetworkView::new_empty(),
|
||||
self.config.mixnet.debug.initial_connection_timeout,
|
||||
)
|
||||
.with_unsafe_disabled(true);
|
||||
|
||||
self.start_mixnet_listener(
|
||||
&ActiveClientsStore::new(),
|
||||
ReplayProtectionBloomfilters::new_disabled(),
|
||||
OpenFilter,
|
||||
noise_config,
|
||||
self.shutdown_manager.clone_token("mixnet-traffic"),
|
||||
)
|
||||
.await?;
|
||||
@@ -1137,11 +1153,19 @@ impl NymNode {
|
||||
|
||||
let bloomfilters_manager = self.setup_replay_detection().await?;
|
||||
|
||||
let noise_config = nym_noise::config::NoiseConfig::new(
|
||||
self.x25519_noise_keys.clone(),
|
||||
network_refresher.noise_view(),
|
||||
self.config.mixnet.debug.initial_connection_timeout,
|
||||
)
|
||||
.with_unsafe_disabled(self.config.mixnet.debug.unsafe_disable_noise);
|
||||
|
||||
let (mix_packet_sender, active_egress_mixnet_connections) = self
|
||||
.start_mixnet_listener(
|
||||
&active_clients_store,
|
||||
bloomfilters_manager.bloomfilters(),
|
||||
network_refresher.routing_filter(),
|
||||
noise_config,
|
||||
self.shutdown_manager.clone_token("mixnet-traffic"),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user