diff --git a/CHANGELOG.md b/CHANGELOG.md index c04cce1b0a..e728e00506 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,20 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// ## [Unreleased] -- Add Ephemera functionality in nym-api ([#3731]) +## [1.1.28] (2023-08-22) + +- [final step3]: add [rust] support to nyxd client in wasm ([#3743]) +- Feature/ephemera upgrade ([#3791]) +- [rust-sdk] feat: make it more convenient to send and receive messages in different tasks ([#3756]) +- feat: validator client refactoring + wasm compatible nyxd client ([#3726]) +- feat: retain connection between client init and run ([#3767]) + +[#3743]: https://github.com/nymtech/nym/issues/3743 +[#3791]: https://github.com/nymtech/nym/pull/3791 +[#3756]: https://github.com/nymtech/nym/pull/3756 +[#3726]: https://github.com/nymtech/nym/pull/3726 +[#3767]: https://github.com/nymtech/nym/pull/3767 -[#3731]: https://github.com/nymtech/nym/pull/3731 ## [1.1.27] (2023-08-16) diff --git a/Cargo.lock b/Cargo.lock index f14848f51b..cc54eee9dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2761,7 +2761,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "explorer-api" -version = "1.1.25" +version = "1.1.26" dependencies = [ "chrono", "clap 4.3.21", @@ -5226,7 +5226,7 @@ dependencies = [ [[package]] name = "nym-api" -version = "1.1.26" +version = "1.1.27" dependencies = [ "actix-web", "anyhow", @@ -5373,7 +5373,7 @@ dependencies = [ [[package]] name = "nym-cli" -version = "1.1.25" +version = "1.1.26" dependencies = [ "anyhow", "base64 0.13.1", @@ -5439,7 +5439,7 @@ dependencies = [ [[package]] name = "nym-client" -version = "1.1.25" +version = "1.1.26" dependencies = [ "clap 4.3.21", "dirs 4.0.0", @@ -5737,7 +5737,7 @@ dependencies = [ [[package]] name = "nym-gateway" -version = "1.1.25" +version = "1.1.26" dependencies = [ "anyhow", "async-trait", @@ -5892,7 +5892,7 @@ dependencies = [ [[package]] name = "nym-mixnode" -version = "1.1.26" +version = "1.1.27" dependencies = [ "anyhow", "bs58 0.4.0", @@ -6010,7 +6010,7 @@ dependencies = [ [[package]] name = "nym-network-requester" -version = "1.1.25" +version = "1.1.26" dependencies = [ "anyhow", "async-file-watcher", @@ -6057,7 +6057,7 @@ dependencies = [ [[package]] name = "nym-network-statistics" -version = "1.1.25" +version = "1.1.26" dependencies = [ "dirs 4.0.0", "log", @@ -6215,7 +6215,7 @@ dependencies = [ [[package]] name = "nym-socks5-client" -version = "1.1.25" +version = "1.1.26" dependencies = [ "clap 4.3.21", "lazy_static", diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index 9bf16e89ad..b94b1e7b76 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-client" -version = "1.1.25" +version = "1.1.26" authors = ["Dave Hrycyszyn ", "Jędrzej Stuczyński "] description = "Implementation of the Nym Client" edition = "2021" diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index a574f28985..8532f9d2b7 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-socks5-client" -version = "1.1.25" +version = "1.1.26" authors = ["Dave Hrycyszyn "] description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address" edition = "2021" diff --git a/explorer-api/Cargo.toml b/explorer-api/Cargo.toml index 72724ce6eb..a39e3cb52b 100644 --- a/explorer-api/Cargo.toml +++ b/explorer-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "explorer-api" -version = "1.1.25" +version = "1.1.26" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 25e2b62375..2b71aa1542 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-gateway" -version = "1.1.25" +version = "1.1.26" authors = [ "Dave Hrycyszyn ", "Jędrzej Stuczyński ", diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 101ac4d513..ec0b3f5f94 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-mixnode" -version = "1.1.26" +version = "1.1.27" authors = [ "Dave Hrycyszyn ", "Jędrzej Stuczyński ", diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index cc55f92afc..c9a0b8e8e4 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-api" -version = "1.1.26" +version = "1.1.27" authors = [ "Dave Hrycyszyn ", "Jędrzej Stuczyński ", diff --git a/nym-api/src/support/config/helpers.rs b/nym-api/src/support/config/helpers.rs index 4c20088ad0..1c84a5e837 100644 --- a/nym-api/src/support/config/helpers.rs +++ b/nym-api/src/support/config/helpers.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::support::config::old_config_v1_1_21::ConfigV1_1_21; +use crate::support::config::old_config_v1_1_27::ConfigV1_1_27; use crate::support::config::{default_config_directory, default_data_directory, Config}; use anyhow::Result; use std::{fs, io}; @@ -22,6 +23,22 @@ fn try_upgrade_v1_1_21_config(id: &str) -> Result<()> { Ok(updated.save_to_default_location()?) } +fn try_upgrade_v1_1_27_config(id: &str) -> Result<()> { + use nym_config::legacy_helpers::nym_config::MigrationNymConfig; + + // explicitly load it as v1.1.27 (which is incompatible with the current, i.e. 1.1.28+) + let Ok(old_config) = ConfigV1_1_27::load_from_file(id) else { + // if we failed to load it, there might have been nothing to upgrade + // or maybe it was an even older file. in either way. just ignore it and carry on with our day + return Ok(()); + }; + info!("It seems the nym-api is using <= v1.1.27 config template."); + info!("It is going to get updated to the current specification."); + + let updated: Config = old_config.into(); + Ok(updated.save_to_default_location()?) +} + fn init_paths(id: &str) -> io::Result<()> { fs::create_dir_all(default_data_directory(id))?; fs::create_dir_all(default_config_directory(id)) @@ -36,6 +53,7 @@ pub(crate) fn initialise_new(id: &str) -> Result { pub(crate) fn try_load_current_config(id: &str) -> Result { try_upgrade_v1_1_21_config(id)?; + try_upgrade_v1_1_27_config(id)?; Ok(Config::read_from_default_path(id)?) } diff --git a/nym-api/src/support/config/mod.rs b/nym-api/src/support/config/mod.rs index bc4bdd7b54..a66c5ce8a7 100644 --- a/nym-api/src/support/config/mod.rs +++ b/nym-api/src/support/config/mod.rs @@ -20,6 +20,7 @@ use zeroize::{Zeroize, ZeroizeOnDrop}; pub(crate) mod helpers; pub(crate) mod old_config_v1_1_21; +pub(crate) mod old_config_v1_1_27; mod persistence; mod template; diff --git a/nym-api/src/support/config/old_config_v1_1_27.rs b/nym-api/src/support/config/old_config_v1_1_27.rs new file mode 100644 index 0000000000..3bfb4b8581 --- /dev/null +++ b/nym-api/src/support/config/old_config_v1_1_27.rs @@ -0,0 +1,268 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: Apache-2.0 + +use crate::support::config::persistence::{ + CoconutSignerPaths, NetworkMonitorPaths, NodeStatusAPIPaths, +}; +use crate::support::config::{ + Base, CirculatingSupplyCacher, CoconutSigner, CoconutSignerDebug, Config, Ephemera, + NetworkMonitor, NetworkMonitorDebug, NodeStatusAPI, NodeStatusAPIDebug, Rewarding, + TopologyCacher, +}; +use nym_config::legacy_helpers::nym_config::MigrationNymConfig; +use nym_validator_client::nyxd; +use serde::{Deserialize, Serialize}; +use std::path::PathBuf; +use url::Url; + +const DEFAULT_NYM_API_PORT: u16 = 8080; +const MIXNET_CONTRACT_ADDRESS: &str = + "n17srjznxl9dvzdkpwpw24gg668wc73val88a6m5ajg6ankwvz9wtst0cznr"; +const VESTING_CONTRACT_ADDRESS: &str = + "n1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq73f2nw"; + +const DEFAULT_LOCAL_VALIDATOR: &str = "http://localhost:26657"; + +#[derive(Debug, Default, Deserialize, PartialEq, Eq, Serialize)] +#[serde(deny_unknown_fields)] +pub struct ConfigV1_1_27 { + #[serde(default)] + base: BaseV1_1_27, + + #[serde(default)] + network_monitor: NetworkMonitorV1_1_27, + + #[serde(default)] + node_status_api: NodeStatusAPIV1_1_27, + + #[serde(default)] + topology_cacher: TopologyCacher, + + #[serde(default)] + circulating_supply_cacher: CirculatingSupplyCacher, + + #[serde(default)] + rewarding: Rewarding, + + #[serde(default)] + coconut_signer: CoconutSignerV1_1_27, +} + +impl From for Config { + fn from(value: ConfigV1_1_27) -> Self { + // this value was never properly saved (probably a bug) + // so explicitly set it to the default + + Config { + base: Base { + id: value.base.id.clone(), + local_validator: value.base.local_validator, + mixnet_contract_address: value.base.mixnet_contract_address, + vesting_contract_address: value.base.vesting_contract_address, + mnemonic: value.base.mnemonic, + }, + network_monitor: NetworkMonitor { + enabled: value.network_monitor.enabled, + storage_paths: NetworkMonitorPaths { + credentials_database_path: value + .network_monitor + .storage_paths + .credentials_database_path, + }, + debug: NetworkMonitorDebug { + min_mixnode_reliability: value.network_monitor.debug.min_mixnode_reliability, + min_gateway_reliability: value.network_monitor.debug.min_gateway_reliability, + disabled_credentials_mode: value + .network_monitor + .debug + .disabled_credentials_mode, + run_interval: value.network_monitor.debug.run_interval, + gateway_ping_interval: value.network_monitor.debug.gateway_ping_interval, + gateway_sending_rate: value.network_monitor.debug.gateway_sending_rate, + max_concurrent_gateway_clients: value + .network_monitor + .debug + .max_concurrent_gateway_clients, + gateway_response_timeout: value.network_monitor.debug.gateway_response_timeout, + gateway_connection_timeout: value + .network_monitor + .debug + .gateway_connection_timeout, + packet_delivery_timeout: value.network_monitor.debug.packet_delivery_timeout, + test_routes: value.network_monitor.debug.test_routes, + minimum_test_routes: value.network_monitor.debug.minimum_test_routes, + route_test_packets: value.network_monitor.debug.route_test_packets, + per_node_test_packets: value.network_monitor.debug.per_node_test_packets, + }, + }, + node_status_api: NodeStatusAPI { + storage_paths: NodeStatusAPIPaths { + database_path: value.node_status_api.storage_paths.database_path, + }, + debug: NodeStatusAPIDebug { + caching_interval: value.node_status_api.debug.caching_interval, + }, + }, + topology_cacher: value.topology_cacher, + circulating_supply_cacher: value.circulating_supply_cacher, + rewarding: value.rewarding, + coconut_signer: CoconutSigner { + enabled: value.coconut_signer.enabled, + announce_address: value.base.announce_address, + storage_paths: CoconutSignerPaths { + dkg_persistent_state_path: value + .coconut_signer + .storage_paths + .dkg_persistent_state_path, + verification_key_path: value.coconut_signer.storage_paths.verification_key_path, + secret_key_path: value.coconut_signer.storage_paths.secret_key_path, + decryption_key_path: value.coconut_signer.storage_paths.decryption_key_path, + public_key_with_proof_path: value + .coconut_signer + .storage_paths + .public_key_with_proof_path, + }, + debug: CoconutSignerDebug { + dkg_contract_polling_rate: value.coconut_signer.debug.dkg_contract_polling_rate, + }, + }, + ephemera: Ephemera::new_default(&value.base.id), + } + } +} + +impl MigrationNymConfig for ConfigV1_1_27 { + fn default_root_directory() -> PathBuf { + dirs::home_dir() + .expect("Failed to evaluate $HOME value") + .join(".nym") + .join("nym-api") + } +} + +#[derive(Debug, Deserialize, PartialEq, Eq, Serialize)] +#[serde(default)] +#[serde(deny_unknown_fields)] +pub struct BaseV1_1_27 { + /// ID specifies the human readable ID of this particular nym-api. + id: String, + + local_validator: Url, + + /// Address announced to the directory server for the clients to connect to. + // It is useful, say, in NAT scenarios or wanting to more easily update actual IP address + // later on by using name resolvable with a DNS query, such as `nymtech.net`. + announce_address: Url, + + /// Address of the validator contract managing the network + mixnet_contract_address: nyxd::AccountId, + + /// Address of the vesting contract holding locked tokens + vesting_contract_address: nyxd::AccountId, + + /// Mnemonic used for rewarding and/or multisig operations + mnemonic: bip39::Mnemonic, +} + +impl Default for BaseV1_1_27 { + fn default() -> Self { + let default_validator: Url = DEFAULT_LOCAL_VALIDATOR + .parse() + .expect("default local validator is malformed!"); + let mut default_announce_address = default_validator.clone(); + default_announce_address + .set_port(Some(DEFAULT_NYM_API_PORT)) + .expect("default local validator is malformed!"); + + BaseV1_1_27 { + id: String::default(), + local_validator: default_validator, + announce_address: default_announce_address, + mixnet_contract_address: MIXNET_CONTRACT_ADDRESS.parse().unwrap(), + vesting_contract_address: VESTING_CONTRACT_ADDRESS.parse().unwrap(), + mnemonic: bip39::Mnemonic::generate(24).unwrap(), + } + } +} + +#[derive(Debug, Deserialize, PartialEq, Eq, Serialize)] +#[serde(default)] +#[serde(deny_unknown_fields)] +pub struct NetworkMonitorV1_1_27 { + /// Specifies whether network monitoring service is enabled in this process. + pub enabled: bool, + + pub storage_paths: NetworkMonitorPaths, + + #[serde(default)] + pub debug: NetworkMonitorDebug, +} + +impl Default for NetworkMonitorV1_1_27 { + fn default() -> Self { + NetworkMonitorV1_1_27 { + enabled: false, + storage_paths: NetworkMonitorPaths { + credentials_database_path: Default::default(), + }, + debug: Default::default(), + } + } +} + +#[derive(Debug, Deserialize, PartialEq, Eq, Serialize)] +#[serde(default)] +#[serde(deny_unknown_fields)] +pub struct NodeStatusAPIV1_1_27 { + // pub enabled: bool, + pub storage_paths: NodeStatusAPIPaths, + + #[serde(default)] + pub debug: NodeStatusAPIDebug, +} + +impl Default for NodeStatusAPIV1_1_27 { + fn default() -> Self { + NodeStatusAPIV1_1_27 { + storage_paths: NodeStatusAPIPaths { + database_path: Default::default(), + }, + debug: Default::default(), + } + } +} + +#[derive(Debug, Deserialize, PartialEq, Eq, Serialize)] +#[serde(default)] +#[serde(deny_unknown_fields)] +pub struct CoconutSignerV1_1_27 { + /// Specifies whether rewarding service is enabled in this process. + pub enabled: bool, + + pub announce_address: Url, + + pub storage_paths: CoconutSignerPaths, + + #[serde(default)] + pub debug: CoconutSignerDebug, +} + +impl Default for CoconutSignerV1_1_27 { + fn default() -> Self { + let announce_address: Url = DEFAULT_LOCAL_VALIDATOR + .parse() + .expect("default local validator is malformed!"); + CoconutSignerV1_1_27 { + enabled: Default::default(), + announce_address, + storage_paths: CoconutSignerPaths { + dkg_persistent_state_path: Default::default(), + verification_key_path: Default::default(), + secret_key_path: Default::default(), + decryption_key_path: Default::default(), + public_key_with_proof_path: Default::default(), + }, + debug: Default::default(), + } + } +} diff --git a/nym-connect/desktop/CHANGELOG.md b/nym-connect/desktop/CHANGELOG.md index 13f449269e..20534c13ef 100644 --- a/nym-connect/desktop/CHANGELOG.md +++ b/nym-connect/desktop/CHANGELOG.md @@ -2,7 +2,13 @@ ## [Unreleased] -## [1.1.27] (2023-08-16) +## [1.1.18] (2023-08-22) + +- refactor(nc-desktop): use userdata storage to save user gateway&sp ([#3723]) + +[#3723]: https://github.com/nymtech/nym/pull/3723 + +## [1.1.17] (2023-08-16) - Add a "Send us your feedback" section in NC (on the main screen) to collect user feedback using Sentry ([#3619]) - NC native android - deploy on FDroid ([#3483]) diff --git a/nym-connect/desktop/package.json b/nym-connect/desktop/package.json index ede5727153..a3a74ab218 100644 --- a/nym-connect/desktop/package.json +++ b/nym-connect/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@nym/nym-connect", - "version": "1.1.17", + "version": "1.1.18", "main": "index.js", "license": "MIT", "scripts": { @@ -115,4 +115,4 @@ "webpack-merge": "^5.8.0", "yaml-loader": "^0.8.0" } -} +} \ No newline at end of file diff --git a/nym-connect/desktop/src-tauri/Cargo.toml b/nym-connect/desktop/src-tauri/Cargo.toml index 192b1bb391..1844688af9 100644 --- a/nym-connect/desktop/src-tauri/Cargo.toml +++ b/nym-connect/desktop/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-connect" -version = "1.1.17" +version = "1.1.18" description = "nym-connect" authors = ["Nym Technologies SA"] license = "" diff --git a/nym-connect/desktop/src-tauri/tauri.conf.json b/nym-connect/desktop/src-tauri/tauri.conf.json index 49311b295d..bfbceb21be 100644 --- a/nym-connect/desktop/src-tauri/tauri.conf.json +++ b/nym-connect/desktop/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "nym-connect", - "version": "1.1.17" + "version": "1.1.18" }, "build": { "distDir": "../dist", diff --git a/nym-wallet/CHANGELOG.md b/nym-wallet/CHANGELOG.md index 87928a2574..d0b6d0aa6f 100644 --- a/nym-wallet/CHANGELOG.md +++ b/nym-wallet/CHANGELOG.md @@ -2,10 +2,9 @@ ## [Unreleased] -## [1.1.27] (2023-08-17) +## [1.2.7] (2023-08-17) - release due to schema changes in the contract - ## [v1.2.6] (2023-07-18) - [wallet] bugfix: don't send funds for pledge decrease simulation ([#3676]) diff --git a/package.json b/package.json index a18fc8c35a..a967dafdee 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "ts-packages/*", "nym-wallet", "nym-connect/**", - "nym-browser-extension", "explorer", "types", "clients/validator" @@ -29,9 +28,8 @@ "tsc": "lerna run tsc --stream", "types:lint:fix": "lerna run lint:fix --scope @nymproject/types --scope @nymproject/nym-wallet-app", "audit:fix": "npm_config_yes=true npx yarn-audit-fix -- --dry-run", - "preinstall": "yarn install:copy-placeholders && yarn install:copy-storage-placeholders", - "install:copy-placeholders": "cp scripts/build/yarn/wasm-placeholder/package.json sdk/typescript/packages/nym-client-wasm", - "install:copy-storage-placeholders": "mkdir -p nym-browser-extension/storage/pkg && cp scripts/build/yarn/storage-placeholder/package.json nym-browser-extension/storage/pkg" + "preinstall": "yarn install:copy-placeholders", + "install:copy-placeholders": "cp scripts/build/yarn/wasm-placeholder/package.json sdk/typescript/packages/nym-client-wasm" }, "devDependencies": { "lerna": "^6.6.2", diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index 713552f812..9f1fc07c97 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-network-requester" -version = "1.1.25" +version = "1.1.26" authors.workspace = true edition.workspace = true rust-version = "1.65" diff --git a/service-providers/network-statistics/Cargo.toml b/service-providers/network-statistics/Cargo.toml index 8c5d7784f0..7ff628cdc6 100644 --- a/service-providers/network-statistics/Cargo.toml +++ b/service-providers/network-statistics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-network-statistics" -version = "1.1.25" +version = "1.1.26" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/tools/nym-cli/Cargo.toml b/tools/nym-cli/Cargo.toml index a693b9aa12..e63dcc8225 100644 --- a/tools/nym-cli/Cargo.toml +++ b/tools/nym-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-cli" -version = "1.1.25" +version = "1.1.26" authors.workspace = true edition = "2021"