Merge pull request #6439 from nymtech/release/2026.3-parmigiano
Release/2026.3 parmigiano
This commit is contained in:
@@ -4,6 +4,86 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2026.3-parmigiano] (2026-02-10)
|
||||
|
||||
- chore: disable LP on parmigiano branch ([#6422])
|
||||
- revert mixnet-based client fautly changes from LP ([#6420])
|
||||
- [LP fix] Registration client with fallback ([#6419])
|
||||
- Lp/ip pool fixes ([#6412])
|
||||
- [LP-fix] expose wg psk for the vpn-client ([#6411])
|
||||
- LP-fix : configurable LP timeouts ([#6409])
|
||||
- LP-fix : add LP x25519 key to the description ([#6408])
|
||||
- use rng that is Send ([#6404])
|
||||
- use local kem key instead of local x25519 ([#6402])
|
||||
- [LP Gateway Probe] CLI and behavior improvements ([#6400])
|
||||
- lp: attempt to negotiate (and use) protocol version ([#6399])
|
||||
- bugfix: use correct reserved bytes when parsing LpHeader ([#6398])
|
||||
- Lp/bugfix/share ip allocation ([#6395])
|
||||
- feat: use hex-encoding for lp key digests ([#6394])
|
||||
- Add socks5 test to gateway-probe ([#6393])
|
||||
- [LP Gateway probe] Improve file structure ([#6391])
|
||||
- Reduce the size of `HttpClientError` ([#6390])
|
||||
- Lp/two step dvpn reg ([#6386])
|
||||
- Add extra configured nym api url to env ([#6382])
|
||||
- Lp/dvpn psk injection ([#6378])
|
||||
- LP: include signing key digests to LP responses ([#6373])
|
||||
- Lp/use noise x25519 ([#6372])
|
||||
- Topology fallback ([#6363])
|
||||
- NS API socks5 support ([#6361])
|
||||
- LP: modified LPRemotePeer to dynamically choose required KEM key hash ([#6358])
|
||||
- Fix KKT Integration into LP ([#6357])
|
||||
- LP: mixnet reg fixes ([#6356])
|
||||
- LP: announced KEM key hashes ([#6349])
|
||||
- revert faulty drop changes ([#6346])
|
||||
- small qol changes ([#6340])
|
||||
- Apply configured api urls via env ([#6337])
|
||||
- lp chore: make sure to take reserved bytes straight from the header ([#6336])
|
||||
- LP: x25519/ed22519 cleanup round ([#6335])
|
||||
- Lp/encrypted kkt ([#6331])
|
||||
- ensure packets with incompatible versions are rejected ([#6326])
|
||||
- standarise lp serialisation: ([#6324])
|
||||
- Upgrade to def_guard_wireguard v0.8.0 ([#6315])
|
||||
- Max/crates io prep v2 ([#6270])
|
||||
|
||||
[#6422]: https://github.com/nymtech/nym/pull/6422
|
||||
[#6420]: https://github.com/nymtech/nym/pull/6420
|
||||
[#6419]: https://github.com/nymtech/nym/pull/6419
|
||||
[#6412]: https://github.com/nymtech/nym/pull/6412
|
||||
[#6411]: https://github.com/nymtech/nym/pull/6411
|
||||
[#6409]: https://github.com/nymtech/nym/pull/6409
|
||||
[#6408]: https://github.com/nymtech/nym/pull/6408
|
||||
[#6404]: https://github.com/nymtech/nym/pull/6404
|
||||
[#6402]: https://github.com/nymtech/nym/pull/6402
|
||||
[#6400]: https://github.com/nymtech/nym/pull/6400
|
||||
[#6399]: https://github.com/nymtech/nym/pull/6399
|
||||
[#6398]: https://github.com/nymtech/nym/pull/6398
|
||||
[#6395]: https://github.com/nymtech/nym/pull/6395
|
||||
[#6394]: https://github.com/nymtech/nym/pull/6394
|
||||
[#6393]: https://github.com/nymtech/nym/pull/6393
|
||||
[#6391]: https://github.com/nymtech/nym/pull/6391
|
||||
[#6390]: https://github.com/nymtech/nym/pull/6390
|
||||
[#6386]: https://github.com/nymtech/nym/pull/6386
|
||||
[#6382]: https://github.com/nymtech/nym/pull/6382
|
||||
[#6378]: https://github.com/nymtech/nym/pull/6378
|
||||
[#6373]: https://github.com/nymtech/nym/pull/6373
|
||||
[#6372]: https://github.com/nymtech/nym/pull/6372
|
||||
[#6363]: https://github.com/nymtech/nym/pull/6363
|
||||
[#6361]: https://github.com/nymtech/nym/pull/6361
|
||||
[#6358]: https://github.com/nymtech/nym/pull/6358
|
||||
[#6357]: https://github.com/nymtech/nym/pull/6357
|
||||
[#6356]: https://github.com/nymtech/nym/pull/6356
|
||||
[#6349]: https://github.com/nymtech/nym/pull/6349
|
||||
[#6346]: https://github.com/nymtech/nym/pull/6346
|
||||
[#6340]: https://github.com/nymtech/nym/pull/6340
|
||||
[#6337]: https://github.com/nymtech/nym/pull/6337
|
||||
[#6336]: https://github.com/nymtech/nym/pull/6336
|
||||
[#6335]: https://github.com/nymtech/nym/pull/6335
|
||||
[#6331]: https://github.com/nymtech/nym/pull/6331
|
||||
[#6326]: https://github.com/nymtech/nym/pull/6326
|
||||
[#6324]: https://github.com/nymtech/nym/pull/6324
|
||||
[#6315]: https://github.com/nymtech/nym/pull/6315
|
||||
[#6270]: https://github.com/nymtech/nym/pull/6270
|
||||
|
||||
## [2026.2-oscypek] (2026-01-27)
|
||||
|
||||
- bugfix: downgrade gateway protocol to clients proposed version ([#6377])
|
||||
|
||||
@@ -20,7 +20,7 @@ use nym_api_requests::ecash::{
|
||||
};
|
||||
use nym_api_requests::models::{
|
||||
ApiHealthResponse, GatewayCoreStatusResponse, HistoricalPerformanceResponse,
|
||||
MixnodeCoreStatusResponse, NymNodeDescriptionV1, NymNodeDescriptionV2,
|
||||
MixnodeCoreStatusResponse, NymNodeDescriptionV1,
|
||||
};
|
||||
use nym_api_requests::nym_nodes::{
|
||||
NodesByAddressesResponse, SemiSkimmedNodesWithMetadata, SkimmedNode, SkimmedNodesWithMetadata,
|
||||
@@ -273,18 +273,18 @@ impl<C, S> Client<C, S> {
|
||||
Ok(history)
|
||||
}
|
||||
|
||||
#[deprecated(note = "use get_all_cached_described_nodes_v2 instead")]
|
||||
// #[deprecated(note = "use get_all_cached_described_nodes_v2 instead")]
|
||||
pub async fn get_all_cached_described_nodes(
|
||||
&self,
|
||||
) -> Result<Vec<NymNodeDescriptionV1>, ValidatorClientError> {
|
||||
Ok(self.nym_api.get_all_described_nodes().await?)
|
||||
}
|
||||
|
||||
pub async fn get_all_cached_described_nodes_v2(
|
||||
&self,
|
||||
) -> Result<Vec<NymNodeDescriptionV2>, ValidatorClientError> {
|
||||
Ok(self.nym_api.get_all_described_nodes_v2().await?)
|
||||
}
|
||||
// pub async fn get_all_cached_described_nodes_v2(
|
||||
// &self,
|
||||
// ) -> Result<Vec<NymNodeDescriptionV2>, ValidatorClientError> {
|
||||
// Ok(self.nym_api.get_all_described_nodes_v2().await?)
|
||||
// }
|
||||
|
||||
pub async fn get_all_cached_bonded_nym_nodes(
|
||||
&self,
|
||||
@@ -473,7 +473,7 @@ impl NymApiClient {
|
||||
Ok(self.nym_api.health().await?)
|
||||
}
|
||||
|
||||
#[deprecated(note = "use .get_all_described_nodes_v2 instead")]
|
||||
// #[deprecated(note = "use .get_all_described_nodes_v2 instead")]
|
||||
pub async fn get_all_described_nodes(
|
||||
&self,
|
||||
) -> Result<Vec<NymNodeDescriptionV1>, ValidatorClientError> {
|
||||
@@ -495,29 +495,29 @@ impl NymApiClient {
|
||||
Ok(descriptions)
|
||||
}
|
||||
|
||||
pub async fn get_all_described_nodes_v2(
|
||||
&self,
|
||||
) -> Result<Vec<NymNodeDescriptionV2>, ValidatorClientError> {
|
||||
// TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
|
||||
let mut page = 0;
|
||||
let mut descriptions = Vec::new();
|
||||
|
||||
loop {
|
||||
let mut res = self
|
||||
.nym_api
|
||||
.get_nodes_described_v2(Some(page), None)
|
||||
.await?;
|
||||
|
||||
descriptions.append(&mut res.data);
|
||||
if descriptions.len() < res.pagination.total {
|
||||
page += 1
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(descriptions)
|
||||
}
|
||||
// pub async fn get_all_described_nodes_v2(
|
||||
// &self,
|
||||
// ) -> Result<Vec<NymNodeDescriptionV2>, ValidatorClientError> {
|
||||
// // TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
|
||||
// let mut page = 0;
|
||||
// let mut descriptions = Vec::new();
|
||||
//
|
||||
// loop {
|
||||
// let mut res = self
|
||||
// .nym_api
|
||||
// .get_nodes_described_v2(Some(page), None)
|
||||
// .await?;
|
||||
//
|
||||
// descriptions.append(&mut res.data);
|
||||
// if descriptions.len() < res.pagination.total {
|
||||
// page += 1
|
||||
// } else {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Ok(descriptions)
|
||||
// }
|
||||
|
||||
pub async fn get_all_bonded_nym_nodes(
|
||||
&self,
|
||||
|
||||
@@ -17,7 +17,7 @@ use nym_api_requests::ecash::VerificationKeyResponse;
|
||||
use nym_api_requests::models::{
|
||||
AnnotationResponse, ApiHealthResponse, BinaryBuildInformationOwned, ChainBlocksStatusResponse,
|
||||
ChainStatusResponse, KeyRotationInfoResponse, NodePerformanceResponse, NodeRefreshBody,
|
||||
NymNodeDescriptionV1, NymNodeDescriptionV2, PerformanceHistoryResponse, RewardedSetResponse,
|
||||
NymNodeDescriptionV1, PerformanceHistoryResponse, RewardedSetResponse,
|
||||
SignerInformationResponse,
|
||||
};
|
||||
use nym_api_requests::nym_nodes::{
|
||||
@@ -117,7 +117,7 @@ pub trait NymApiClientExt: ApiClient {
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip_all)]
|
||||
#[deprecated(note = "use .get_nodes_described_v2 instead")]
|
||||
// #[deprecated(note = "use .get_nodes_described_v2 instead")]
|
||||
async fn get_nodes_described(
|
||||
&self,
|
||||
page: Option<u32>,
|
||||
@@ -144,32 +144,32 @@ pub trait NymApiClientExt: ApiClient {
|
||||
.await
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip_all)]
|
||||
async fn get_nodes_described_v2(
|
||||
&self,
|
||||
page: Option<u32>,
|
||||
per_page: Option<u32>,
|
||||
) -> Result<PaginatedResponse<NymNodeDescriptionV2>, NymAPIError> {
|
||||
let mut params = Vec::new();
|
||||
|
||||
if let Some(page) = page {
|
||||
params.push(("page", page.to_string()))
|
||||
}
|
||||
|
||||
if let Some(per_page) = per_page {
|
||||
params.push(("per_page", per_page.to_string()))
|
||||
}
|
||||
|
||||
self.get_json(
|
||||
&[
|
||||
routes::V2_API_VERSION,
|
||||
routes::NYM_NODES_ROUTES,
|
||||
routes::NYM_NODES_DESCRIBED,
|
||||
],
|
||||
¶ms,
|
||||
)
|
||||
.await
|
||||
}
|
||||
// #[tracing::instrument(level = "debug", skip_all)]
|
||||
// async fn get_nodes_described_v2(
|
||||
// &self,
|
||||
// page: Option<u32>,
|
||||
// per_page: Option<u32>,
|
||||
// ) -> Result<PaginatedResponse<NymNodeDescriptionV2>, NymAPIError> {
|
||||
// let mut params = Vec::new();
|
||||
//
|
||||
// if let Some(page) = page {
|
||||
// params.push(("page", page.to_string()))
|
||||
// }
|
||||
//
|
||||
// if let Some(per_page) = per_page {
|
||||
// params.push(("per_page", per_page.to_string()))
|
||||
// }
|
||||
//
|
||||
// self.get_json(
|
||||
// &[
|
||||
// routes::V2_API_VERSION,
|
||||
// routes::NYM_NODES_ROUTES,
|
||||
// routes::NYM_NODES_DESCRIBED,
|
||||
// ],
|
||||
// ¶ms,
|
||||
// )
|
||||
// .await
|
||||
// }
|
||||
|
||||
async fn get_current_rewarded_set(&self) -> Result<RewardedSetResponse, NymAPIError> {
|
||||
self.get_rewarded_set().await
|
||||
@@ -302,8 +302,8 @@ pub trait NymApiClientExt: ApiClient {
|
||||
Ok(SkimmedNodesWithMetadata::new(nodes, metadata))
|
||||
}
|
||||
|
||||
#[deprecated(note = "use .get_all_described_nodes_v2 instead")]
|
||||
#[allow(deprecated)]
|
||||
// #[deprecated(note = "use .get_all_described_nodes_v2 instead")]
|
||||
// #[allow(deprecated)]
|
||||
async fn get_all_described_nodes(&self) -> Result<Vec<NymNodeDescriptionV1>, NymAPIError> {
|
||||
// TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
|
||||
let mut page = 0;
|
||||
@@ -323,24 +323,24 @@ pub trait NymApiClientExt: ApiClient {
|
||||
Ok(descriptions)
|
||||
}
|
||||
|
||||
async fn get_all_described_nodes_v2(&self) -> Result<Vec<NymNodeDescriptionV2>, NymAPIError> {
|
||||
// TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
|
||||
let mut page = 0;
|
||||
let mut descriptions = Vec::new();
|
||||
|
||||
loop {
|
||||
let mut res = self.get_nodes_described_v2(Some(page), None).await?;
|
||||
|
||||
descriptions.append(&mut res.data);
|
||||
if descriptions.len() < res.pagination.total {
|
||||
page += 1
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(descriptions)
|
||||
}
|
||||
// async fn (&self) -> Result<Vec<NymNodeDescriptionV2>, NymAPIError> {
|
||||
// // TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
|
||||
// let mut page = 0;
|
||||
// let mut descriptions = Vec::new();
|
||||
//
|
||||
// loop {
|
||||
// let mut res = self.get_nodes_described_v2(Some(page), None).await?;
|
||||
//
|
||||
// descriptions.append(&mut res.data);
|
||||
// if descriptions.len() < res.pagination.total {
|
||||
// page += 1
|
||||
// } else {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Ok(descriptions)
|
||||
// }
|
||||
|
||||
#[tracing::instrument(level = "debug", skip_all)]
|
||||
async fn get_nym_nodes(
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct Args {
|
||||
}
|
||||
|
||||
pub async fn query(args: Args, client: &QueryClientWithNyxd) {
|
||||
match client.get_all_cached_described_nodes_v2().await {
|
||||
match client.get_all_cached_described_nodes().await {
|
||||
Ok(res) => match args.identity_key {
|
||||
Some(identity_key) => {
|
||||
let node = res.iter().find(|node| {
|
||||
|
||||
@@ -14,7 +14,7 @@ pub struct Args {
|
||||
}
|
||||
|
||||
pub async fn query(args: Args, client: &QueryClientWithNyxd) {
|
||||
match client.get_all_cached_described_nodes_v2().await {
|
||||
match client.get_all_cached_described_nodes().await {
|
||||
Ok(res) => match args.identity_key {
|
||||
Some(identity_key) => {
|
||||
let node = res.iter().find(|node| {
|
||||
|
||||
@@ -231,7 +231,7 @@ async fn get_bonded_nodes(
|
||||
),
|
||||
params(PaginationRequest)
|
||||
)]
|
||||
#[deprecated(note = "use '/v2/nym-nodes/described' instead")]
|
||||
// #[deprecated(note = "use '/v2/nym-nodes/described' instead")]
|
||||
async fn get_described_nodes(
|
||||
State(state): State<AppState>,
|
||||
Query(pagination): Query<PaginationRequest>,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::node_status_api::models::AxumResult;
|
||||
use crate::node_status_api::models::{AxumErrorResponse, AxumResult};
|
||||
use crate::support::http::helpers::PaginationRequest;
|
||||
use crate::support::http::state::AppState;
|
||||
use axum::extract::{Query, State};
|
||||
use axum::routing::get;
|
||||
use axum::Router;
|
||||
use nym_api_requests::models::NymNodeDescriptionV2;
|
||||
use nym_api_requests::pagination::{PaginatedResponse, Pagination};
|
||||
use nym_api_requests::pagination::PaginatedResponse;
|
||||
use nym_http_api_common::FormattedResponse;
|
||||
use tower_http::compression::CompressionLayer;
|
||||
|
||||
@@ -36,19 +36,23 @@ async fn get_described_nodes(
|
||||
State(state): State<AppState>,
|
||||
Query(pagination): Query<PaginationRequest>,
|
||||
) -> AxumResult<FormattedResponse<PaginatedResponse<NymNodeDescriptionV2>>> {
|
||||
// TODO: implement it
|
||||
let _ = state;
|
||||
let _ = pagination;
|
||||
let output = pagination.output.unwrap_or_default();
|
||||
Err(AxumErrorResponse::not_implemented())
|
||||
|
||||
let cache = state.described_nodes_cache.get().await?;
|
||||
let descriptions = cache.all_nodes().cloned().collect::<Vec<_>>();
|
||||
|
||||
Ok(output.to_response(PaginatedResponse {
|
||||
pagination: Pagination {
|
||||
total: descriptions.len(),
|
||||
page: 0,
|
||||
size: descriptions.len(),
|
||||
},
|
||||
data: descriptions,
|
||||
}))
|
||||
// // TODO: implement it
|
||||
// let _ = pagination;
|
||||
// let output = pagination.output.unwrap_or_default();
|
||||
//
|
||||
// let cache = state.described_nodes_cache.get().await?;
|
||||
// let descriptions = cache.all_nodes().cloned().collect::<Vec<_>>();
|
||||
//
|
||||
// Ok(output.to_response(PaginatedResponse {
|
||||
// pagination: Pagination {
|
||||
// total: descriptions.len(),
|
||||
// page: 0,
|
||||
// size: descriptions.len(),
|
||||
// },
|
||||
// data: descriptions,
|
||||
// }))
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
use anyhow::{Context, anyhow, bail};
|
||||
use nym_api_requests::models::{
|
||||
AuthenticatorDetailsV2, DeclaredRolesV2, DescribedNodeTypeV2, HostInformationV2,
|
||||
IpPacketRouterDetailsV2, NetworkRequesterDetailsV2, NymNodeDataV2,
|
||||
OffsetDateTimeJsonSchemaWrapper, WebSocketsV2, WireguardDetailsV2,
|
||||
AuthenticatorDetailsV1, DeclaredRolesV1, DescribedNodeTypeV1, HostInformationV1,
|
||||
IpPacketRouterDetailsV1, NetworkRequesterDetailsV1, NymNodeDataV1,
|
||||
OffsetDateTimeJsonSchemaWrapper, WebSocketsV1, WireguardDetailsV1,
|
||||
};
|
||||
use nym_authenticator_requests::AuthenticatorVersion;
|
||||
use nym_bin_common::build_information::BinaryBuildInformationOwned;
|
||||
@@ -13,14 +13,13 @@ use nym_crypto::asymmetric::x25519;
|
||||
use nym_http_api_client::UserAgent;
|
||||
use nym_kkt_ciphersuite::SignatureScheme;
|
||||
use nym_kkt_ciphersuite::{KEM, KEMKeyDigests};
|
||||
use nym_lp::packet::version;
|
||||
use nym_network_defaults::DEFAULT_NYM_NODE_HTTP_PORT;
|
||||
use nym_node_requests::api::client::NymNodeApiClientExt;
|
||||
use nym_node_requests::api::v1::node::models::AuxiliaryDetails as NodeAuxiliaryDetails;
|
||||
use nym_sdk::mixnet::NodeIdentity;
|
||||
use nym_sdk::mixnet::Recipient;
|
||||
use nym_validator_client::client::NymApiClientExt;
|
||||
use nym_validator_client::models::NymNodeDescriptionV2;
|
||||
use nym_validator_client::models::NymNodeDescriptionV1;
|
||||
use rand::prelude::IteratorRandom;
|
||||
use std::collections::HashMap;
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
@@ -91,7 +90,7 @@ use url::Url;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DirectoryNode {
|
||||
described: NymNodeDescriptionV2,
|
||||
described: NymNodeDescriptionV1,
|
||||
}
|
||||
|
||||
impl DirectoryNode {
|
||||
@@ -130,16 +129,16 @@ impl DirectoryNode {
|
||||
.copied()
|
||||
.ok_or_else(|| anyhow!("no ip address known"))?;
|
||||
|
||||
let lp_data = description.lewes_protocol.as_ref().and_then(|lp_data| {
|
||||
Some(TestedNodeLpDetails {
|
||||
address: SocketAddr::new(ip_address, lp_data.control_port),
|
||||
expected_kem_key_hashes: lp_data.kem_keys().ok()?,
|
||||
expected_signing_key_hashes: lp_data.signing_keys().ok()?,
|
||||
x25519: lp_data.x25519,
|
||||
// \/ TODO: proper derivation from build version
|
||||
lp_version: version::CURRENT,
|
||||
})
|
||||
});
|
||||
// let lp_data = description.lewes_protocol.as_ref().and_then(|lp_data| {
|
||||
// Some(TestedNodeLpDetails {
|
||||
// address: SocketAddr::new(ip_address, lp_data.control_port),
|
||||
// expected_kem_key_hashes: lp_data.kem_keys().ok()?,
|
||||
// expected_signing_key_hashes: lp_data.signing_keys().ok()?,
|
||||
// x25519: lp_data.x25519,
|
||||
// // \/ TODO: proper derivation from build version
|
||||
// lp_version: version::CURRENT,
|
||||
// })
|
||||
// });
|
||||
|
||||
Ok(TestedNodeDetails {
|
||||
identity: self.identity(),
|
||||
@@ -148,7 +147,7 @@ impl DirectoryNode {
|
||||
authenticator_address,
|
||||
authenticator_version,
|
||||
ip_address: Some(ip_address),
|
||||
lp_data,
|
||||
lp_data: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -238,11 +237,11 @@ pub async fn query_gateway_by_ip(address: String) -> anyhow::Result<DirectoryNod
|
||||
.await
|
||||
.inspect_err(|e| error!("Failed to get wireguard information : {e}"))
|
||||
.ok();
|
||||
let lp_result = client
|
||||
.get_lewes_protocol()
|
||||
.await
|
||||
.inspect_err(|e| error!("Failed to get LP information : {e}"))
|
||||
.ok();
|
||||
// let lp_result = client
|
||||
// .get_lewes_protocol()
|
||||
// .await
|
||||
// .inspect_err(|e| error!("Failed to get LP information : {e}"))
|
||||
// .ok();
|
||||
|
||||
// Check required fields
|
||||
let host_info = host_info_result.context("Failed to get host information")?;
|
||||
@@ -262,22 +261,22 @@ pub async fn query_gateway_by_ip(address: String) -> anyhow::Result<DirectoryNod
|
||||
}
|
||||
|
||||
// Convert to our internal types
|
||||
let network_requester: Option<NetworkRequesterDetailsV2> =
|
||||
nr_result.map(|nr| NetworkRequesterDetailsV2 {
|
||||
let network_requester: Option<NetworkRequesterDetailsV1> =
|
||||
nr_result.map(|nr| NetworkRequesterDetailsV1 {
|
||||
address: nr.address,
|
||||
uses_exit_policy: false, // Field not availabe, to change if it becomes useful here
|
||||
});
|
||||
let ip_packet_router: Option<IpPacketRouterDetailsV2> =
|
||||
ipr_result.map(|ipr| IpPacketRouterDetailsV2 {
|
||||
let ip_packet_router: Option<IpPacketRouterDetailsV1> =
|
||||
ipr_result.map(|ipr| IpPacketRouterDetailsV1 {
|
||||
address: ipr.address,
|
||||
});
|
||||
let authenticator: Option<AuthenticatorDetailsV2> =
|
||||
authenticator_result.map(|auth| AuthenticatorDetailsV2 {
|
||||
let authenticator: Option<AuthenticatorDetailsV1> =
|
||||
authenticator_result.map(|auth| AuthenticatorDetailsV1 {
|
||||
address: auth.address,
|
||||
});
|
||||
#[allow(deprecated)]
|
||||
let wireguard: Option<WireguardDetailsV2> =
|
||||
wireguard_result.map(|wg| WireguardDetailsV2 {
|
||||
let wireguard: Option<WireguardDetailsV1> =
|
||||
wireguard_result.map(|wg| WireguardDetailsV1 {
|
||||
port: wg.tunnel_port, // Use tunnel_port for deprecated port field
|
||||
tunnel_port: wg.tunnel_port,
|
||||
metadata_port: wg.metadata_port,
|
||||
@@ -285,14 +284,14 @@ pub async fn query_gateway_by_ip(address: String) -> anyhow::Result<DirectoryNod
|
||||
});
|
||||
|
||||
// Construct NymNodeData
|
||||
let node_data = NymNodeDataV2 {
|
||||
let node_data = NymNodeDataV1 {
|
||||
last_polled: OffsetDateTimeJsonSchemaWrapper(OffsetDateTime::now_utc()),
|
||||
host_information: HostInformationV2 {
|
||||
host_information: HostInformationV1 {
|
||||
ip_address: host_info.data.ip_address,
|
||||
hostname: host_info.data.hostname,
|
||||
keys: host_info.data.keys.into(),
|
||||
},
|
||||
declared_role: DeclaredRolesV2 {
|
||||
declared_role: DeclaredRolesV1 {
|
||||
mixnode: roles.mixnode_enabled,
|
||||
entry: roles.gateway_enabled,
|
||||
exit_nr: roles.network_requester_enabled,
|
||||
@@ -315,17 +314,17 @@ pub async fn query_gateway_by_ip(address: String) -> anyhow::Result<DirectoryNod
|
||||
ip_packet_router,
|
||||
authenticator,
|
||||
wireguard,
|
||||
lewes_protocol: lp_result.map(Into::into),
|
||||
mixnet_websockets: WebSocketsV2 {
|
||||
// lewes_protocol: lp_result.map(Into::into),
|
||||
mixnet_websockets: WebSocketsV1 {
|
||||
ws_port: websockets.ws_port,
|
||||
wss_port: websockets.wss_port,
|
||||
},
|
||||
};
|
||||
|
||||
// Create NymNodeDescription
|
||||
let described = NymNodeDescriptionV2 {
|
||||
let described = NymNodeDescriptionV1 {
|
||||
node_id: 0, // We don't have a node_id from direct query
|
||||
contract_node_type: DescribedNodeTypeV2::NymNode, // All new nodes are NymNode type
|
||||
contract_node_type: DescribedNodeTypeV1::NymNode, // All new nodes are NymNode type
|
||||
description: node_data,
|
||||
};
|
||||
|
||||
@@ -362,7 +361,7 @@ impl NymApiDirectory {
|
||||
|
||||
debug!("Fetching all described nodes from nym-api...");
|
||||
let described_nodes = api_client
|
||||
.get_all_described_nodes_v2()
|
||||
.get_all_described_nodes()
|
||||
.await
|
||||
.context("nym api query failure")?;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ use nym_http_api_common::middleware::logging;
|
||||
use nym_node_requests::api::v1::authenticator::models::Authenticator;
|
||||
use nym_node_requests::api::v1::gateway::models::{Bridges, Gateway};
|
||||
use nym_node_requests::api::v1::ip_packet_router::models::IpPacketRouter;
|
||||
use nym_node_requests::api::v1::lewes_protocol::models::LewesProtocol;
|
||||
use nym_node_requests::api::v1::mixnode::models::Mixnode;
|
||||
use nym_node_requests::api::v1::network_requester::exit_policy::models::UsedExitPolicy;
|
||||
use nym_node_requests::api::v1::network_requester::models::NetworkRequester;
|
||||
@@ -133,11 +132,11 @@ impl HttpServerConfig {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_lewes_protocol(mut self, lewes_protocol: LewesProtocol) -> Self {
|
||||
self.api.v1_config.lewes_protocol.details = Some(lewes_protocol);
|
||||
self
|
||||
}
|
||||
// #[must_use]
|
||||
// pub fn with_lewes_protocol(mut self, lewes_protocol: LewesProtocol) -> Self {
|
||||
// self.api.v1_config.lewes_protocol.details = Some(lewes_protocol);
|
||||
// self
|
||||
// }
|
||||
}
|
||||
|
||||
pub struct NymNodeRouter {
|
||||
|
||||
+40
-53
@@ -42,7 +42,6 @@ use nym_bin_common::bin_info;
|
||||
use nym_credential_verification::UpgradeModeState;
|
||||
use nym_crypto::asymmetric::{ed25519, x25519};
|
||||
use nym_gateway::node::{ActiveClientsStore, GatewayTasksBuilder, UpgradeModeCheckRequestSender};
|
||||
use nym_kkt::key_utils::produce_key_digests;
|
||||
use nym_mixnet_client::client::ActiveConnections;
|
||||
use nym_mixnet_client::forwarder::MixForwardingSender;
|
||||
use nym_network_requester::{
|
||||
@@ -51,9 +50,6 @@ use nym_network_requester::{
|
||||
};
|
||||
use nym_node_metrics::NymNodeMetrics;
|
||||
use nym_node_metrics::events::MetricEventsSender;
|
||||
use nym_node_requests::api::v1::lewes_protocol::models::{
|
||||
LPHashFunction, LPKEM, LPSignatureScheme,
|
||||
};
|
||||
use nym_node_requests::api::v1::node::models::{AnnouncePorts, NodeDescription};
|
||||
use nym_noise::config::{NoiseConfig, NoiseNetworkView};
|
||||
use nym_noise_keys::VersionedNoiseKeyV1;
|
||||
@@ -66,7 +62,6 @@ use nym_verloc::{self, measurements::VerlocMeasurer};
|
||||
use nym_wireguard::{WireguardGatewayData, peer_controller::PeerControlRequest};
|
||||
use rand::rngs::OsRng;
|
||||
use rand::{CryptoRng, RngCore};
|
||||
use std::collections::HashMap;
|
||||
use std::net::SocketAddr;
|
||||
use std::ops::Deref;
|
||||
use std::path::Path;
|
||||
@@ -714,11 +709,13 @@ impl NymNode {
|
||||
self.config.gateway_tasks.lp.control_bind_address,
|
||||
self.config.gateway_tasks.lp.data_bind_address,
|
||||
);
|
||||
let mut lp_listener = gateway_tasks_builder
|
||||
let lp_listener = gateway_tasks_builder
|
||||
.build_lp_listener(wg_peer_registrator.clone(), active_clients_store.clone())
|
||||
.await?;
|
||||
self.shutdown_tracker()
|
||||
.try_spawn_named(async move { lp_listener.run().await }, "LpListener");
|
||||
// make sure lp listener can be built, but do not start it
|
||||
let _ = lp_listener;
|
||||
// self.shutdown_tracker()
|
||||
// .try_spawn_named(async move { lp_listener.run().await }, "LpListener");
|
||||
} else {
|
||||
info!("node not running in entry mode: the websocket and LP will remain closed");
|
||||
}
|
||||
@@ -794,40 +791,40 @@ impl NymNode {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn compute_kem_key_hashes(&self) -> HashMap<LPKEM, HashMap<LPHashFunction, String>> {
|
||||
let kem = LPKEM::X25519;
|
||||
|
||||
let kem_key_bytes = self.entry_gateway.psq_kem_key.public_key().as_bytes();
|
||||
|
||||
// convert from `nym_kkt_ciphersuite` types into `nym_nodes_requests`
|
||||
let digests = produce_key_digests(kem_key_bytes.as_ref())
|
||||
.into_iter()
|
||||
.map(|(f, digest)| (f.into(), hex::encode(&digest)))
|
||||
.collect();
|
||||
|
||||
let mut hashes = HashMap::new();
|
||||
hashes.insert(kem, digests);
|
||||
hashes
|
||||
}
|
||||
|
||||
fn compute_signing_key_hashes(
|
||||
&self,
|
||||
) -> HashMap<LPSignatureScheme, HashMap<LPHashFunction, String>> {
|
||||
let scheme = LPSignatureScheme::Ed25519;
|
||||
|
||||
let kem_key_bytes = self.ed25519_identity_keys.public_key().as_bytes();
|
||||
|
||||
// convert from `nym_kkt_ciphersuite` types into `nym_nodes_requests`
|
||||
let digests = produce_key_digests(kem_key_bytes.as_ref())
|
||||
.into_iter()
|
||||
.map(|(f, digest)| (f.into(), hex::encode(&digest)))
|
||||
.collect();
|
||||
|
||||
let mut hashes = HashMap::new();
|
||||
hashes.insert(scheme, digests);
|
||||
hashes
|
||||
}
|
||||
//
|
||||
// fn compute_kem_key_hashes(&self) -> HashMap<LPKEM, HashMap<LPHashFunction, String>> {
|
||||
// let kem = LPKEM::X25519;
|
||||
//
|
||||
// let kem_key_bytes = self.entry_gateway.psq_kem_key.public_key().as_bytes();
|
||||
//
|
||||
// // convert from `nym_kkt_ciphersuite` types into `nym_nodes_requests`
|
||||
// let digests = produce_key_digests(kem_key_bytes.as_ref())
|
||||
// .into_iter()
|
||||
// .map(|(f, digest)| (f.into(), hex::encode(&digest)))
|
||||
// .collect();
|
||||
//
|
||||
// let mut hashes = HashMap::new();
|
||||
// hashes.insert(kem, digests);
|
||||
// hashes
|
||||
// }
|
||||
//
|
||||
// fn compute_signing_key_hashes(
|
||||
// &self,
|
||||
// ) -> HashMap<LPSignatureScheme, HashMap<LPHashFunction, String>> {
|
||||
// let scheme = LPSignatureScheme::Ed25519;
|
||||
//
|
||||
// let kem_key_bytes = self.ed25519_identity_keys.public_key().as_bytes();
|
||||
//
|
||||
// // convert from `nym_kkt_ciphersuite` types into `nym_nodes_requests`
|
||||
// let digests = produce_key_digests(kem_key_bytes.as_ref())
|
||||
// .into_iter()
|
||||
// .map(|(f, digest)| (f.into(), hex::encode(&digest)))
|
||||
// .collect();
|
||||
//
|
||||
// let mut hashes = HashMap::new();
|
||||
// hashes.insert(scheme, digests);
|
||||
// hashes
|
||||
// }
|
||||
|
||||
pub(crate) async fn build_http_server(&self) -> Result<NymNodeHttpServer, NymNodeError> {
|
||||
let auxiliary_details = api_requests::v1::node::models::AuxiliaryDetails {
|
||||
@@ -902,15 +899,6 @@ impl NymNode {
|
||||
policy: None,
|
||||
};
|
||||
|
||||
let lp_details = api_requests::v1::lewes_protocol::models::LewesProtocol::new(
|
||||
self.modes().entry,
|
||||
self.config.gateway_tasks.lp.announced_control_port(),
|
||||
self.config.gateway_tasks.lp.announced_data_port(),
|
||||
*self.x25519_noise_keys.public_key(),
|
||||
self.compute_kem_key_hashes(),
|
||||
self.compute_signing_key_hashes(),
|
||||
);
|
||||
|
||||
let mut config = HttpServerConfig::new()
|
||||
.with_landing_page_assets(self.config.http.landing_page_assets_path.as_ref())
|
||||
.with_mixnode_details(mixnode_details)
|
||||
@@ -921,8 +909,7 @@ impl NymNode {
|
||||
.with_used_exit_policy(exit_policy_details)
|
||||
.with_description(self.description.clone())
|
||||
.with_auxiliary_details(auxiliary_details)
|
||||
.with_prometheus_bearer_token(self.config.http.access_token.clone())
|
||||
.with_lewes_protocol(lp_details);
|
||||
.with_prometheus_bearer_token(self.config.http.access_token.clone());
|
||||
|
||||
if self.config.http.expose_system_info {
|
||||
config = config.with_system_info(get_system_info(
|
||||
|
||||
@@ -14,9 +14,7 @@ use nym_validator_client::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
RegistrationClient,
|
||||
clients::{LpBasedRegistrationClient, MixnetBasedRegistrationClient},
|
||||
config::RegistrationMode,
|
||||
RegistrationClient, clients::MixnetBasedRegistrationClient, config::RegistrationMode,
|
||||
error::RegistrationClientError,
|
||||
};
|
||||
use config::BuilderConfig;
|
||||
@@ -50,7 +48,10 @@ impl RegistrationClientBuilder {
|
||||
pub async fn build(self) -> Result<RegistrationClient, RegistrationClientError> {
|
||||
if self.use_lp() {
|
||||
tracing::debug!("Using LP for registration");
|
||||
Ok(RegistrationClient::Lp(Box::new(self.build_lp().await?)))
|
||||
Err(RegistrationClientError::LpRegistrationNotPossible {
|
||||
node_id: "any".to_string(),
|
||||
})
|
||||
// Ok(RegistrationClient::Lp(Box::new(self.build_lp().await?)))
|
||||
} else {
|
||||
tracing::debug!("Using Mixnet for registration");
|
||||
Ok(RegistrationClient::Mixnet(Box::new(
|
||||
@@ -123,29 +124,29 @@ impl RegistrationClientBuilder {
|
||||
})
|
||||
}
|
||||
|
||||
async fn build_lp(self) -> Result<LpBasedRegistrationClient, RegistrationClientError> {
|
||||
let storage = self.config.setup_credential_storage().await?;
|
||||
let config = self.config.registration_client_config();
|
||||
|
||||
let nyxd_client = get_nyxd_client(&self.config.network_env)?;
|
||||
|
||||
let bandwidth_controller: Box<dyn BandwidthTicketProvider> =
|
||||
if let Some(credential_storage) = storage {
|
||||
Box::new(BandwidthController::new(credential_storage, nyxd_client))
|
||||
} else {
|
||||
Box::new(BandwidthController::new(
|
||||
EphemeralCredentialStorage::default(),
|
||||
nyxd_client,
|
||||
))
|
||||
};
|
||||
|
||||
Ok(LpBasedRegistrationClient {
|
||||
config,
|
||||
bandwidth_controller,
|
||||
cancel_token: self.config.cancel_token.clone(),
|
||||
fallback_client_builder: Some(self),
|
||||
})
|
||||
}
|
||||
// async fn build_lp(self) -> Result<LpBasedRegistrationClient, RegistrationClientError> {
|
||||
// let storage = self.config.setup_credential_storage().await?;
|
||||
// let config = self.config.registration_client_config();
|
||||
//
|
||||
// let nyxd_client = get_nyxd_client(&self.config.network_env)?;
|
||||
//
|
||||
// let bandwidth_controller: Box<dyn BandwidthTicketProvider> =
|
||||
// if let Some(credential_storage) = storage {
|
||||
// Box::new(BandwidthController::new(credential_storage, nyxd_client))
|
||||
// } else {
|
||||
// Box::new(BandwidthController::new(
|
||||
// EphemeralCredentialStorage::default(),
|
||||
// nyxd_client,
|
||||
// ))
|
||||
// };
|
||||
//
|
||||
// Ok(LpBasedRegistrationClient {
|
||||
// config,
|
||||
// bandwidth_controller,
|
||||
// cancel_token: self.config.cancel_token.clone(),
|
||||
// fallback_client_builder: Some(self),
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
||||
// temporary while we use the legacy bandwidth-controller
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::builder::RegistrationClientBuilder;
|
||||
use crate::config::RegistrationClientConfig;
|
||||
use crate::config::RegistrationMode;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pub(crate) mod lp;
|
||||
pub(crate) mod mixnet;
|
||||
#![allow(unused)]
|
||||
|
||||
pub mod lp;
|
||||
pub mod mixnet;
|
||||
|
||||
pub use lp::LpBasedRegistrationClient;
|
||||
pub use mixnet::MixnetBasedRegistrationClient;
|
||||
|
||||
@@ -24,14 +24,14 @@ mod types;
|
||||
|
||||
pub enum RegistrationClient {
|
||||
Mixnet(Box<clients::MixnetBasedRegistrationClient>),
|
||||
Lp(Box<clients::LpBasedRegistrationClient>),
|
||||
// Lp(Box<clients::LpBasedRegistrationClient>),
|
||||
}
|
||||
|
||||
impl RegistrationClient {
|
||||
pub async fn register(self) -> Result<RegistrationResult, RegistrationClientError> {
|
||||
match self {
|
||||
RegistrationClient::Mixnet(client) => client.register().await,
|
||||
RegistrationClient::Lp(client) => client.register().await,
|
||||
// RegistrationClient::Lp(client) => client.register().await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::LpClientError;
|
||||
use nym_crypto::asymmetric::ed25519;
|
||||
use nym_lp::message::ForwardPacketData;
|
||||
|
||||
@@ -25,7 +25,7 @@ pub(crate) async fn get_network_requester(
|
||||
url::Url::parse(&nym_api_url.unwrap_or(NYM_API_URL.to_string()))?,
|
||||
None,
|
||||
);
|
||||
let nodes = client.get_all_described_nodes_v2().await?;
|
||||
let nodes = client.get_all_described_nodes().await?;
|
||||
let providers: Vec<_> = nodes
|
||||
.iter()
|
||||
.filter_map(|node| {
|
||||
|
||||
Reference in New Issue
Block a user