Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aea7821308 | |||
| 0343469179 | |||
| b7d13d6fa6 | |||
| 838dd630ae | |||
| 7f9dba6e99 | |||
| 96e88b6ea9 | |||
| 87882f70cf | |||
| 46a8697a5d | |||
| 0429238b0f |
@@ -36,7 +36,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [arc-linux-latest]
|
||||
platform: [ubuntu-22.04]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
env:
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install cosmwasm-check
|
||||
run: cargo install cosmwasm-check
|
||||
run: cargo install cosmwasm-check --locked
|
||||
|
||||
- name: Install wasm-opt
|
||||
uses: ./.github/actions/install-wasm-opt
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: arc-linux-latest
|
||||
- os: ubuntu-22.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
||||
@@ -4,6 +4,54 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2026.6-stilton] (2026-03-25)
|
||||
|
||||
- lp fixes ([#6601])
|
||||
- bugfix: allow deserialisation of LP data from either snake_case or lowercase ([#6586])
|
||||
- bugfix: make sure to run cargo install cosmwasm-check with --locked flag during CI ([#6568])
|
||||
- Add LP to NS UI ([#6562])
|
||||
- feat: nyxd watcher ([#6561])
|
||||
- Additional ticket for agent ([#6551])
|
||||
- bugfix: make sure to use old values from metrics debug config during v12 migration (#6546) ([#6547])
|
||||
- typo ([#6543])
|
||||
- rng changes for a Send variant ([#6541])
|
||||
- Add LP fields ([#6535])
|
||||
- enable LP registration in registration client ([#6534])
|
||||
- chore: rename LpMessage to LpFrame ([#6530])
|
||||
- chore: LP improvements ([#6526])
|
||||
- Remove dep leak of strum iterator ([#6522])
|
||||
- chore: update ts-rs dep ([#6517])
|
||||
- addressing LP PR comments ([#6513])
|
||||
- remove redundant LP state machine in favour of in place processing ([#6512])
|
||||
- chore: split up lp listener ([#6507])
|
||||
- feat: enable mutual KKT exchange ([#6505])
|
||||
- feat: introduce /v3/unstable/nym-nodes/semi-skimmed to aggregate LP information ([#6499])
|
||||
- Max/asyncread asyncwrite nym client ([#6318])
|
||||
- feat: localnet v2 ([#6277])
|
||||
|
||||
[#6601]: https://github.com/nymtech/nym/pull/6601
|
||||
[#6586]: https://github.com/nymtech/nym/pull/6586
|
||||
[#6568]: https://github.com/nymtech/nym/pull/6568
|
||||
[#6562]: https://github.com/nymtech/nym/pull/6562
|
||||
[#6561]: https://github.com/nymtech/nym/pull/6561
|
||||
[#6551]: https://github.com/nymtech/nym/pull/6551
|
||||
[#6547]: https://github.com/nymtech/nym/pull/6547
|
||||
[#6543]: https://github.com/nymtech/nym/pull/6543
|
||||
[#6541]: https://github.com/nymtech/nym/pull/6541
|
||||
[#6535]: https://github.com/nymtech/nym/pull/6535
|
||||
[#6534]: https://github.com/nymtech/nym/pull/6534
|
||||
[#6530]: https://github.com/nymtech/nym/pull/6530
|
||||
[#6526]: https://github.com/nymtech/nym/pull/6526
|
||||
[#6522]: https://github.com/nymtech/nym/pull/6522
|
||||
[#6517]: https://github.com/nymtech/nym/pull/6517
|
||||
[#6513]: https://github.com/nymtech/nym/pull/6513
|
||||
[#6512]: https://github.com/nymtech/nym/pull/6512
|
||||
[#6507]: https://github.com/nymtech/nym/pull/6507
|
||||
[#6505]: https://github.com/nymtech/nym/pull/6505
|
||||
[#6499]: https://github.com/nymtech/nym/pull/6499
|
||||
[#6318]: https://github.com/nymtech/nym/pull/6318
|
||||
[#6277]: https://github.com/nymtech/nym/pull/6277
|
||||
|
||||
## [2026.5-raclette] (2026-03-10)
|
||||
|
||||
- bugfix: correctly populate gateway probe LP data ([#6533])
|
||||
|
||||
Generated
+9
-8
@@ -5547,7 +5547,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-api"
|
||||
version = "1.1.75"
|
||||
version = "1.1.76"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -5792,7 +5792,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-cli"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.22.1",
|
||||
@@ -5875,7 +5875,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-client"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"clap",
|
||||
@@ -6445,7 +6445,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-data-observatory"
|
||||
version = "1.0.2"
|
||||
version = "1.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -7279,7 +7279,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-requester"
|
||||
version = "1.1.73"
|
||||
version = "1.1.74"
|
||||
dependencies = [
|
||||
"addr",
|
||||
"anyhow",
|
||||
@@ -7329,7 +7329,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-node"
|
||||
version = "1.27.0"
|
||||
version = "1.28.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
@@ -7875,7 +7875,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"clap",
|
||||
@@ -8668,11 +8668,12 @@ dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.12",
|
||||
"x25519-dalek",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nymvisor"
|
||||
version = "0.1.37"
|
||||
version = "0.1.38"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-client"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
description = "Implementation of the Nym Client"
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
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"
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::collections::HashMap;
|
||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
||||
|
||||
pub const NYM_API_DOMAIN: &str = "validator.nymtech.net";
|
||||
pub const NYM_API_IPS: &[IpAddr] = &[IpAddr::V4(Ipv4Addr::new(212, 71, 233, 232))];
|
||||
pub const NYM_API_IPS: &[IpAddr] = &[IpAddr::V4(Ipv4Addr::new(92, 39, 63, 14))];
|
||||
|
||||
pub const NYM_VPN_API_DOMAIN: &str = "nymvpn.com";
|
||||
pub const NYM_VPN_API_IPS: &[IpAddr] = &[IpAddr::V4(Ipv4Addr::new(76, 76, 21, 21))];
|
||||
|
||||
@@ -119,22 +119,6 @@ where
|
||||
Ok(scraper)
|
||||
}
|
||||
|
||||
pub async fn build_unsafe(self) -> Result<NyxdScraper<S>, ScraperError> {
|
||||
self.config.pruning_options.validate()?;
|
||||
let storage =
|
||||
S::initialise(&self.config.database_storage, &self.config.run_migrations).await?;
|
||||
let rpc_client = RpcClient::new(&self.config.rpc_url)?;
|
||||
|
||||
Ok(NyxdScraper {
|
||||
config: self.config,
|
||||
task_tracker: TaskTracker::new(),
|
||||
cancel_token: CancellationToken::new(),
|
||||
startup_sync: Arc::new(Default::default()),
|
||||
storage,
|
||||
rpc_client,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new(config: Config) -> Self {
|
||||
NyxdScraperBuilder {
|
||||
_storage: PhantomData,
|
||||
|
||||
@@ -7,6 +7,7 @@ use nym_crypto::asymmetric::{ed25519, x25519};
|
||||
use nym_ip_packet_requests::IpPair;
|
||||
use nym_kkt_ciphersuite::{Ciphersuite, KEM, KEMKeyDigests};
|
||||
use nym_sphinx::addressing::Recipient;
|
||||
use nym_wireguard_types::PresharedKey;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::BTreeMap;
|
||||
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
|
||||
@@ -44,11 +45,11 @@ pub struct WireguardRegistrationData {
|
||||
pub private_ipv6: Ipv6Addr,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct WireguardConfiguration {
|
||||
#[serde(with = "bs58_x25519_pubkey")]
|
||||
pub public_key: x25519::PublicKey,
|
||||
pub psk: Option<[u8; 32]>,
|
||||
pub psk: Option<PresharedKey>,
|
||||
pub endpoint: SocketAddr,
|
||||
pub private_ipv4: Ipv4Addr,
|
||||
pub private_ipv6: Ipv6Addr,
|
||||
|
||||
@@ -15,6 +15,7 @@ description = "Wireguard public key and config definitions"
|
||||
base64 = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
thiserror = { workspace = true }
|
||||
zeroize.workspace = true
|
||||
|
||||
x25519-dalek = { workspace = true, features = ["static_secrets"] }
|
||||
nym-crypto = { workspace = true, features = ["asymmetric"] }
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
|
||||
pub mod config;
|
||||
pub mod error;
|
||||
pub mod preshared_key;
|
||||
pub mod public_key;
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
pub use config::Config;
|
||||
pub use error::Error;
|
||||
pub use preshared_key::PresharedKey;
|
||||
pub use public_key::PeerPublicKey;
|
||||
|
||||
pub const DEFAULT_PEER_TIMEOUT_CHECK: Duration = Duration::from_secs(5); // 5 seconds
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zeroize::{Zeroize, ZeroizeOnDrop};
|
||||
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize, Zeroize, ZeroizeOnDrop)]
|
||||
pub struct PresharedKey([u8; 32]);
|
||||
|
||||
impl PresharedKey {
|
||||
pub fn as_bytes(&self) -> &[u8; 32] {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl From<[u8; 32]> for PresharedKey {
|
||||
fn from(key: [u8; 32]) -> PresharedKey {
|
||||
PresharedKey(key)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PresharedKey> for [u8; 32] {
|
||||
fn from(key: PresharedKey) -> [u8; 32] {
|
||||
key.0
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
name = "nym-api"
|
||||
license = "GPL-3.0"
|
||||
version = "1.1.75"
|
||||
version = "1.1.76"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
rust-version.workspace = true
|
||||
|
||||
@@ -296,11 +296,14 @@ fn translate_digests(
|
||||
ToSchema,
|
||||
Ord,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[non_exhaustive]
|
||||
pub enum LPKEM {
|
||||
#[serde(alias = "ml_kem768")]
|
||||
MlKem768,
|
||||
|
||||
#[serde(alias = "mc_eliece")]
|
||||
McEliece,
|
||||
}
|
||||
|
||||
@@ -320,7 +323,7 @@ pub enum LPKEM {
|
||||
ToSchema,
|
||||
Ord,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[non_exhaustive]
|
||||
pub enum LPHashFunction {
|
||||
@@ -345,7 +348,7 @@ pub enum LPHashFunction {
|
||||
EnumString,
|
||||
ToSchema,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[non_exhaustive]
|
||||
pub enum LPSignatureScheme {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-data-observatory"
|
||||
version = "1.0.2"
|
||||
version = "1.0.1"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
@@ -6,32 +6,6 @@ Collects data about the Nym network including:
|
||||
- **Price scraper** - to get the NYM/USD token price from CoinGecko
|
||||
- **Webhooks** - trigger on messages or all messages to call with details
|
||||
|
||||
## Processing historical data or reprocessing block ranges
|
||||
|
||||
You can run the scraper to operate on a range of blocks, without listening for new blocks. This is useful for:
|
||||
|
||||
- processing historical data
|
||||
- reprocessing block ranges
|
||||
|
||||
Run this as follows to process blocks starting at 1000 and ending at 2000:
|
||||
|
||||
```bash
|
||||
./nym_data_observatory process --start 1000 --end 2000
|
||||
```
|
||||
|
||||
Or to process a single block:
|
||||
|
||||
```bash
|
||||
./nym_data_observatory process --start 1000
|
||||
```
|
||||
|
||||
Or to process 10 blocks starting at block 1000:
|
||||
|
||||
```bash
|
||||
./nym_data_observatory process --start 1000 --blocks 10
|
||||
```
|
||||
|
||||
|
||||
## Running locally
|
||||
|
||||
### 1. Install Prerequisites
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::cli::commands::run::Args;
|
||||
use crate::db::DbPool;
|
||||
use nyxd_scraper_psql::{PostgresNyxdScraper, PruningOptions};
|
||||
use tracing::info;
|
||||
@@ -5,7 +6,7 @@ use tracing::info;
|
||||
pub(crate) mod webhook;
|
||||
|
||||
pub(crate) async fn run_chain_scraper(
|
||||
args: crate::cli::commands::run::Args,
|
||||
args: Args,
|
||||
config: &crate::config::Config,
|
||||
connection_pool: DbPool,
|
||||
) -> anyhow::Result<PostgresNyxdScraper> {
|
||||
@@ -18,8 +19,8 @@ pub(crate) async fn run_chain_scraper(
|
||||
.expect("no database connection string set in config");
|
||||
|
||||
let scraper = PostgresNyxdScraper::builder(nyxd_scraper_psql::Config {
|
||||
rpc_url: args.rpc_url,
|
||||
websocket_url: args.websocket_url,
|
||||
rpc_url: args.rpc_url,
|
||||
database_storage,
|
||||
pruning_options: PruningOptions::nothing(),
|
||||
store_precommits: false,
|
||||
@@ -39,41 +40,3 @@ pub(crate) async fn run_chain_scraper(
|
||||
|
||||
Ok(instance)
|
||||
}
|
||||
|
||||
pub(crate) async fn process_chain_scraper(
|
||||
args: crate::cli::commands::process::Args,
|
||||
config: &crate::config::Config,
|
||||
connection_pool: DbPool,
|
||||
start_block_height: u32,
|
||||
end_block_height: u32,
|
||||
) -> anyhow::Result<PostgresNyxdScraper> {
|
||||
let database_storage = config
|
||||
.chain_scraper_connection_string
|
||||
.clone()
|
||||
.and(args.db_connection_string)
|
||||
.expect("no database connection string set in config");
|
||||
|
||||
let scraper = PostgresNyxdScraper::builder(nyxd_scraper_psql::Config {
|
||||
rpc_url: args.rpc_url,
|
||||
websocket_url: args.websocket_url,
|
||||
database_storage,
|
||||
pruning_options: PruningOptions::nothing(),
|
||||
store_precommits: false,
|
||||
start_block: nyxd_scraper_psql::StartingBlockOpts {
|
||||
start_block_height: Some(start_block_height),
|
||||
use_best_effort_start_height: false,
|
||||
},
|
||||
run_migrations: false, // ignore the base migrations
|
||||
})
|
||||
.with_msg_module(crate::modules::wasm::WasmModule::new(connection_pool))
|
||||
.with_tx_module(webhook::WebhookModule::new(config.clone())?);
|
||||
|
||||
let instance = scraper.build_unsafe().await?;
|
||||
|
||||
info!("🏃♂️ processing blocks from {start_block_height} to {end_block_height}...");
|
||||
instance
|
||||
.unsafe_process_block_range(Some(start_block_height), Some(end_block_height))
|
||||
.await?;
|
||||
|
||||
Ok(instance)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
pub(crate) mod build_info;
|
||||
pub(crate) mod init;
|
||||
pub(crate) mod process;
|
||||
pub(crate) mod run;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::env::vars::*;
|
||||
use url::Url;
|
||||
|
||||
#[derive(clap::Args, Debug, Clone)]
|
||||
pub(crate) struct Args {
|
||||
#[arg(long, alias = "start")]
|
||||
pub(crate) start_block_height: u32,
|
||||
|
||||
#[arg(long, alias = "end")]
|
||||
pub(crate) end_block_height: Option<u32>,
|
||||
|
||||
#[arg(long, alias = "blocks")]
|
||||
pub(crate) blocks_to_process: Option<u32>,
|
||||
|
||||
#[arg(long, env = NYM_DATA_OBSERVATORY_DB_URL, alias = "db_url")]
|
||||
pub(crate) db_connection_string: Option<String>,
|
||||
|
||||
#[arg(long, env = NYXD_WS, alias = "nyxd_ws", default_value = "wss://rpc.nymtech.net/websocket")]
|
||||
pub(crate) websocket_url: Url,
|
||||
|
||||
#[arg(long, env = NYXD, alias = "nyxd", default_value = "https://rpc.nymtech.net")]
|
||||
pub(crate) rpc_url: Url,
|
||||
|
||||
/// (Override) Watch for chain messages of these types
|
||||
#[clap(
|
||||
long,
|
||||
value_delimiter = ',',
|
||||
env = NYM_DATA_OBSERVATORY_WATCH_CHAIN_MESSAGE_TYPES
|
||||
)]
|
||||
pub watch_for_chain_message_types: Vec<String>,
|
||||
|
||||
/// (Override) The webhook to call when we find something
|
||||
#[clap(
|
||||
long,
|
||||
env = NYM_DATA_OBSERVATORY_WEBHOOK_URL
|
||||
)]
|
||||
pub webhook_url: Option<Url>,
|
||||
|
||||
/// (Override) Optionally, authenticate with the webhook
|
||||
#[clap(
|
||||
long,
|
||||
env = NYM_DATA_OBSERVATORY_WEBHOOK_AUTH
|
||||
)]
|
||||
pub webhook_auth: Option<String>,
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::chain_scraper::process_chain_scraper;
|
||||
pub(crate) use crate::cli::commands::process::args::Args;
|
||||
use crate::cli::commands::run::wait_for_shutdown;
|
||||
use crate::db;
|
||||
use crate::error::NymDataObservatoryError;
|
||||
use nym_task::wait_for_signal;
|
||||
use time::OffsetDateTime;
|
||||
use tokio::task::{JoinHandle, JoinSet};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{error, info};
|
||||
|
||||
mod args;
|
||||
|
||||
pub(crate) async fn execute(args: Args) -> Result<(), NymDataObservatoryError> {
|
||||
let start = OffsetDateTime::now_utc();
|
||||
let scraper_args = args.clone();
|
||||
|
||||
let run_args = crate::cli::commands::run::args::Args {
|
||||
rpc_url: args.rpc_url.clone(),
|
||||
websocket_url: args.websocket_url.clone(),
|
||||
start_block_height: Some(args.start_block_height),
|
||||
db_connection_string: args.db_connection_string,
|
||||
webhook_url: args.webhook_url.clone(),
|
||||
watch_for_chain_message_types: args.watch_for_chain_message_types,
|
||||
webhook_auth: args.webhook_auth.clone(),
|
||||
};
|
||||
|
||||
let config = crate::cli::commands::run::config::get_run_config(run_args.clone())?;
|
||||
|
||||
let db_connection_string = config.chain_scraper_connection_string();
|
||||
|
||||
let start_block_height = args.start_block_height;
|
||||
let end_block_height = args
|
||||
.end_block_height
|
||||
.unwrap_or(args.start_block_height + (args.blocks_to_process.unwrap_or(1u32) - 1u32));
|
||||
|
||||
info!("nyxd rpc: {}", args.rpc_url.to_string());
|
||||
info!("start_block_height: {:#?}", start_block_height);
|
||||
info!("end_block_height: {:#?}", end_block_height);
|
||||
info!("blocks_to_process: {:#?}", args.blocks_to_process);
|
||||
|
||||
let storage = db::Storage::init(db_connection_string).await?;
|
||||
|
||||
let tasks = JoinSet::new();
|
||||
let cancellation_token = CancellationToken::new();
|
||||
|
||||
let scraper_pool = storage.pool_owned();
|
||||
let shutdown_pool = storage.pool_owned();
|
||||
|
||||
// start the blocks processing in the background, that can be cancelled by the user
|
||||
let cancel_after_processing = cancellation_token.clone();
|
||||
let scraper_token_handle: JoinHandle<anyhow::Result<CancellationToken>> = tokio::spawn({
|
||||
let config = config.clone();
|
||||
async move {
|
||||
// this only blocks until startup sync is done; it then runs on its own set of tasks
|
||||
let scraper = process_chain_scraper(
|
||||
scraper_args,
|
||||
&config,
|
||||
scraper_pool,
|
||||
start_block_height,
|
||||
end_block_height,
|
||||
)
|
||||
.await?;
|
||||
|
||||
info!("⏰ shutting down...");
|
||||
cancel_after_processing.cancel();
|
||||
|
||||
Ok(scraper.cancel_token())
|
||||
}
|
||||
});
|
||||
|
||||
// wait for either shutdown or scraper having finished processing the block range
|
||||
tokio::select! {
|
||||
_ = wait_for_signal() => {
|
||||
info!("received shutdown signal while waiting for scraper to finish its startup");
|
||||
return Ok(())
|
||||
}
|
||||
scraper_token = scraper_token_handle => {
|
||||
let scraper_token = match scraper_token {
|
||||
Ok(Ok(token)) => token,
|
||||
Ok(Err(startup_err)) => {
|
||||
error!("failed to startup the chain scraper: {startup_err}");
|
||||
return Err(startup_err.into());
|
||||
}
|
||||
Err(runtime_err) => {
|
||||
error!("failed to finish the scraper startup task: {runtime_err}");
|
||||
return Ok(())
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
wait_for_shutdown(shutdown_pool, start, cancellation_token, scraper_token, tasks).await
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -9,8 +9,8 @@ use tokio::task::{JoinHandle, JoinSet};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{error, info};
|
||||
|
||||
pub(crate) mod args;
|
||||
pub(crate) mod config;
|
||||
mod args;
|
||||
mod config;
|
||||
|
||||
use crate::chain_scraper::run_chain_scraper;
|
||||
use crate::db::DbPool;
|
||||
@@ -40,7 +40,7 @@ async fn try_insert_startup_information(
|
||||
.inspect_err(|err| error!("failed to insert run information: {err}"));
|
||||
}
|
||||
|
||||
pub(crate) async fn wait_for_shutdown(
|
||||
async fn wait_for_shutdown(
|
||||
db_pool: DbPool,
|
||||
start: OffsetDateTime,
|
||||
main_cancellation_token: CancellationToken,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::cli::commands::{build_info, init, process, run};
|
||||
use crate::cli::commands::{build_info, init, run};
|
||||
use crate::env::vars::*;
|
||||
use crate::error::NymDataObservatoryError;
|
||||
use clap::{Parser, Subcommand};
|
||||
@@ -50,7 +50,6 @@ impl Cli {
|
||||
Commands::BuildInfo(args) => build_info::execute(args),
|
||||
Commands::Run(args) => run::execute(*args, self.http_port).await,
|
||||
Commands::Init(args) => init::execute(args).await,
|
||||
Commands::Process(args) => process::execute(*args).await,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,9 +59,6 @@ pub(crate) enum Commands {
|
||||
/// Show build information of this binary
|
||||
BuildInfo(build_info::Args),
|
||||
|
||||
/// Process or re-process a fixed block range
|
||||
Process(Box<process::Args>),
|
||||
|
||||
/// Start this nym-chain-watcher
|
||||
Run(Box<run::Args>),
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ pub async fn lp_registration_probe(
|
||||
" - PSK: {:?}",
|
||||
gateway_data
|
||||
.psk
|
||||
.map(|k| general_purpose::STANDARD.encode(k))
|
||||
.map(|k| general_purpose::STANDARD.encode(k.as_bytes()))
|
||||
);
|
||||
info!(" - Private IPv4: {}", gateway_data.private_ipv4);
|
||||
info!(" - Private IPv6: {}", gateway_data.private_ipv6);
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-node"
|
||||
version = "1.27.0"
|
||||
version = "1.28.0"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
@@ -71,11 +71,14 @@ impl LewesProtocol {
|
||||
EnumString,
|
||||
Ord,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
||||
pub enum LPKEM {
|
||||
#[serde(alias = "ml_kem768")]
|
||||
MlKem768,
|
||||
|
||||
#[serde(alias = "mc_eliece")]
|
||||
McEliece,
|
||||
}
|
||||
|
||||
@@ -113,7 +116,7 @@ impl From<nym_kkt_ciphersuite::KEM> for LPKEM {
|
||||
EnumIter,
|
||||
Ord,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
||||
pub enum LPHashFunction {
|
||||
@@ -160,7 +163,7 @@ impl From<nym_kkt_ciphersuite::HashFunction> for LPHashFunction {
|
||||
EnumString,
|
||||
EnumIter,
|
||||
)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
#[strum(serialize_all = "lowercase")]
|
||||
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
|
||||
pub enum LPSignatureScheme {
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::config::RegistrationMode;
|
||||
use crate::error::RegistrationClientError;
|
||||
use crate::lp_client::helpers::to_lp_remote_peer;
|
||||
use crate::lp_client::{LpRegistrationClient, NestedLpSession};
|
||||
use crate::types::{LpRegistrationResult, RegistrationResult};
|
||||
use crate::types::{RegistrationResult, WireguardRegistrationResult};
|
||||
|
||||
use nym_bandwidth_controller::BandwidthTicketProvider;
|
||||
use nym_credentials_interface::TicketType;
|
||||
@@ -147,13 +147,13 @@ impl LpBasedRegistrationClient {
|
||||
// All data flows through WireGuard after this point.
|
||||
// Each LP packet used its own TCP connection which was closed after the exchange.
|
||||
// Exit registration was completed via forwarding through entry gateway.
|
||||
Ok(RegistrationResult::Lp(Box::new(LpRegistrationResult {
|
||||
Ok(RegistrationResult::wireguard_lp(
|
||||
entry_gateway_data,
|
||||
exit_gateway_data,
|
||||
entry_lp_keypair,
|
||||
exit_lp_keypair,
|
||||
bw_controller: self.bandwidth_controller,
|
||||
})))
|
||||
self.bandwidth_controller,
|
||||
))
|
||||
}
|
||||
|
||||
async fn register_wg(self) -> Result<RegistrationResult, RegistrationClientError> {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use crate::AuthenticatorRegistrationResult;
|
||||
use crate::config::RegistrationClientConfig;
|
||||
use crate::config::RegistrationMode;
|
||||
use crate::error::RegistrationClientError;
|
||||
@@ -84,19 +85,17 @@ impl MixnetBasedRegistrationClient {
|
||||
}
|
||||
};
|
||||
|
||||
Ok(RegistrationResult::Mixnet(Box::new(
|
||||
MixnetRegistrationResult {
|
||||
mixnet_client: ipr_client.into_mixnet_client(),
|
||||
assigned_addresses: AssignedAddresses {
|
||||
interface_addresses,
|
||||
exit_mix_address: ipr_address,
|
||||
mixnet_client_address: self.mixnet_client_address,
|
||||
entry_mixnet_gateway_ip,
|
||||
exit_mixnet_gateway_ip,
|
||||
},
|
||||
event_rx: self.event_rx,
|
||||
Ok(RegistrationResult::mixnet(
|
||||
ipr_client.into_mixnet_client(),
|
||||
AssignedAddresses {
|
||||
interface_addresses,
|
||||
exit_mix_address: ipr_address,
|
||||
mixnet_client_address: self.mixnet_client_address,
|
||||
entry_mixnet_gateway_ip,
|
||||
exit_mixnet_gateway_ip,
|
||||
},
|
||||
)))
|
||||
self.event_rx,
|
||||
))
|
||||
}
|
||||
|
||||
async fn register_wg(self) -> Result<RegistrationResult, RegistrationError> {
|
||||
@@ -199,16 +198,14 @@ impl MixnetBasedRegistrationClient {
|
||||
}
|
||||
};
|
||||
|
||||
Ok(RegistrationResult::Wireguard(Box::new(
|
||||
WireguardRegistrationResult {
|
||||
entry_gateway_client: entry_auth_client,
|
||||
exit_gateway_client: exit_auth_client,
|
||||
entry_gateway_data: entry,
|
||||
exit_gateway_data: exit,
|
||||
authenticator_listener_handle: mixnet_listener,
|
||||
bw_controller: self.bandwidth_controller,
|
||||
},
|
||||
)))
|
||||
Ok(RegistrationResult::wireguard_legacy(
|
||||
entry_auth_client,
|
||||
exit_auth_client,
|
||||
entry,
|
||||
exit,
|
||||
mixnet_listener,
|
||||
self.bandwidth_controller,
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) async fn register(self) -> Result<RegistrationResult, RegistrationClientError> {
|
||||
|
||||
@@ -12,7 +12,8 @@ pub use lp_client::{
|
||||
LpRegistrationClient, LpRegistrationConfig, NestedLpSession, error::LpClientError,
|
||||
};
|
||||
pub use types::{
|
||||
LpRegistrationResult, MixnetRegistrationResult, RegistrationResult, WireguardRegistrationResult,
|
||||
AuthenticatorRegistrationResult, LpRegistrationResult, MixnetRegistrationResult,
|
||||
RegistrationResult, WireguardRegistrationResult,
|
||||
};
|
||||
|
||||
mod builder;
|
||||
|
||||
@@ -597,7 +597,7 @@ where
|
||||
|
||||
Ok(WireguardConfiguration {
|
||||
public_key: final_response.public_key,
|
||||
psk: Some(psk),
|
||||
psk: Some(psk.into()),
|
||||
endpoint: SocketAddr::new(self.gateway_lp_address.ip(), final_response.port),
|
||||
private_ipv4: final_response.private_ipv4,
|
||||
private_ipv6: final_response.private_ipv6,
|
||||
|
||||
@@ -401,10 +401,9 @@ impl NestedLpSession {
|
||||
}
|
||||
};
|
||||
|
||||
// JS/SW TODO Adapt this to new gateway response
|
||||
Ok(WireguardConfiguration {
|
||||
public_key: final_response.public_key,
|
||||
psk: Some(psk),
|
||||
psk: Some(psk.into()),
|
||||
endpoint: SocketAddr::new(self.exit_address.ip(), final_response.port),
|
||||
private_ipv4: final_response.private_ipv4,
|
||||
private_ipv6: final_response.private_ipv6,
|
||||
|
||||
@@ -11,7 +11,58 @@ use std::sync::Arc;
|
||||
pub enum RegistrationResult {
|
||||
Mixnet(Box<MixnetRegistrationResult>),
|
||||
Wireguard(Box<WireguardRegistrationResult>),
|
||||
Lp(Box<LpRegistrationResult>),
|
||||
}
|
||||
|
||||
impl RegistrationResult {
|
||||
pub fn mixnet(
|
||||
mixnet_client: MixnetClient,
|
||||
assigned_addresses: AssignedAddresses,
|
||||
event_rx: EventReceiver,
|
||||
) -> Self {
|
||||
RegistrationResult::Mixnet(Box::new(MixnetRegistrationResult {
|
||||
assigned_addresses,
|
||||
mixnet_client,
|
||||
event_rx,
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn wireguard_legacy(
|
||||
entry_gateway_client: AuthenticatorClient,
|
||||
exit_gateway_client: AuthenticatorClient,
|
||||
entry_gateway_data: WireguardConfiguration,
|
||||
exit_gateway_data: WireguardConfiguration,
|
||||
authenticator_listener_handle: AuthClientMixnetListenerHandle,
|
||||
bw_controller: Box<dyn BandwidthTicketProvider>,
|
||||
) -> Self {
|
||||
RegistrationResult::Wireguard(Box::new(WireguardRegistrationResult::Legacy(Box::new(
|
||||
AuthenticatorRegistrationResult {
|
||||
entry_gateway_client,
|
||||
exit_gateway_client,
|
||||
entry_gateway_data,
|
||||
exit_gateway_data,
|
||||
authenticator_listener_handle,
|
||||
bw_controller,
|
||||
},
|
||||
))))
|
||||
}
|
||||
|
||||
pub fn wireguard_lp(
|
||||
entry_gateway_data: WireguardConfiguration,
|
||||
exit_gateway_data: WireguardConfiguration,
|
||||
entry_lp_keypair: Arc<DHKeyPair>,
|
||||
exit_lp_keypair: Arc<DHKeyPair>,
|
||||
bw_controller: Box<dyn BandwidthTicketProvider>,
|
||||
) -> Self {
|
||||
RegistrationResult::Wireguard(Box::new(WireguardRegistrationResult::LewesProtocol(
|
||||
Box::new(LpRegistrationResult {
|
||||
entry_gateway_data,
|
||||
exit_gateway_data,
|
||||
entry_lp_keypair,
|
||||
exit_lp_keypair,
|
||||
bw_controller,
|
||||
}),
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MixnetRegistrationResult {
|
||||
@@ -20,7 +71,28 @@ pub struct MixnetRegistrationResult {
|
||||
pub event_rx: EventReceiver,
|
||||
}
|
||||
|
||||
pub struct WireguardRegistrationResult {
|
||||
pub enum WireguardRegistrationResult {
|
||||
Legacy(Box<AuthenticatorRegistrationResult>),
|
||||
LewesProtocol(Box<LpRegistrationResult>),
|
||||
}
|
||||
|
||||
impl WireguardRegistrationResult {
|
||||
pub fn entry_gateway_data(&self) -> &WireguardConfiguration {
|
||||
match self {
|
||||
Self::Legacy(res) => &res.entry_gateway_data,
|
||||
Self::LewesProtocol(res) => &res.entry_gateway_data,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exit_gateway_data(&self) -> &WireguardConfiguration {
|
||||
match self {
|
||||
Self::Legacy(res) => &res.exit_gateway_data,
|
||||
Self::LewesProtocol(res) => &res.exit_gateway_data,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthenticatorRegistrationResult {
|
||||
pub entry_gateway_client: AuthenticatorClient,
|
||||
pub exit_gateway_client: AuthenticatorClient,
|
||||
pub entry_gateway_data: WireguardConfiguration,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
name = "nym-network-requester"
|
||||
license = "GPL-3.0"
|
||||
version = "1.1.73"
|
||||
version = "1.1.74"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version = "1.85"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-cli"
|
||||
version = "1.1.72"
|
||||
version = "1.1.73"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
license.workspace = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nymvisor"
|
||||
version = "0.1.37"
|
||||
version = "0.1.38"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
Reference in New Issue
Block a user