diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5d422ecd..258b36964f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// ## [Unreleased] +## [2023.nyxd-upgrade] (2023-11-22) + +- Chore/nyxd 043 upgrade ([#3968]) + +[#3968]: https://github.com/nymtech/nym/pull/3968 + ## [2023.4-galaxy] (2023-11-07) - DRY up client cli ([#4077]) diff --git a/Cargo.lock b/Cargo.lock index 2f406bb985..0ecbfad25c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1554,8 +1554,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" dependencies = [ - "prost", - "prost-types", + "prost 0.11.9", + "prost-types 0.11.9", "tonic", "tracing-core", ] @@ -1572,7 +1572,7 @@ dependencies = [ "futures", "hdrhistogram", "humantime 2.1.0", - "prost-types", + "prost-types 0.11.9", "serde", "serde_json", "thread_local", @@ -1661,30 +1661,30 @@ dependencies = [ [[package]] name = "cosmos-sdk-proto" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c" +checksum = "32560304ab4c365791fd307282f76637213d8083c1a98490c35159cd67852237" dependencies = [ - "prost", - "prost-types", + "prost 0.12.1", + "prost-types 0.12.1", "tendermint-proto", ] [[package]] name = "cosmrs" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6" +checksum = "47126f5364df9387b9d8559dcef62e99010e1d4098f39eb3f7ee4b5c254e40ea" dependencies = [ "bip32", "cosmos-sdk-proto", "ecdsa 0.16.8", "eyre", - "getrandom 0.2.10", "k256", "rand_core 0.6.4", "serde", "serde_json", + "signature 2.1.0", "subtle-encoding", "tendermint", "tendermint-rpc", @@ -2009,15 +2009,6 @@ dependencies = [ "subtle 2.4.1", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct 0.6.1", -] - [[package]] name = "ctor" version = "0.1.26" @@ -3696,30 +3687,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "headers" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" -dependencies = [ - "base64 0.21.4", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.3" @@ -3958,40 +3925,17 @@ dependencies = [ ] [[package]] -name = "hyper-proxy" -version = "0.9.1" +name = "hyper-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ - "bytes", - "futures", - "headers", + "futures-util", "http", "hyper", - "hyper-rustls", - "rustls-native-certs", + "rustls 0.21.7", "tokio", - "tokio-rustls 0.22.0", - "tower-service", - "webpki 0.21.4", -] - -[[package]] -name = "hyper-rustls" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" -dependencies = [ - "ct-logs", - "futures-util", - "hyper", - "log", - "rustls 0.19.1", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.22.0", - "webpki 0.21.4", - "webpki-roots 0.21.1", + "tokio-rustls 0.24.1", ] [[package]] @@ -4658,7 +4602,7 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "pin-project", - "prost", + "prost 0.11.9", "prost-build", "rand 0.8.5", "rw-stream-sink 0.3.0 (git+https://github.com/ChainSafe/rust-libp2p.git?rev=e3440d25681df380c9f0f8cfdcfd5ecc0a4f2fb6)", @@ -4744,7 +4688,7 @@ dependencies = [ "libp2p-swarm 0.42.0", "log", "prometheus-client", - "prost", + "prost 0.11.9", "prost-build", "prost-codec", "rand 0.8.5", @@ -4802,7 +4746,7 @@ dependencies = [ "libp2p-swarm 0.42.0", "log", "lru 0.9.0", - "prost", + "prost 0.11.9", "prost-build", "prost-codec", "smallvec", @@ -4952,7 +4896,7 @@ dependencies = [ "libp2p-core 0.39.0", "log", "once_cell", - "prost", + "prost 0.11.9", "prost-build", "rand 0.8.5", "sha2 0.10.8", @@ -5204,7 +5148,7 @@ dependencies = [ "libp2p-noise 0.42.0", "log", "multihash", - "prost", + "prost 0.11.9", "prost-build", "prost-codec", "rand 0.8.5", @@ -5961,7 +5905,7 @@ dependencies = [ [[package]] name = "nym-api" -version = "1.1.32" +version = "1.1.33" dependencies = [ "actix-web", "anyhow", @@ -6111,7 +6055,7 @@ dependencies = [ [[package]] name = "nym-cli" -version = "1.1.31" +version = "1.1.32" dependencies = [ "anyhow", "base64 0.13.1", @@ -6664,6 +6608,7 @@ dependencies = [ "bincode", "bytes", "nym-sphinx", + "rand 0.8.5", "serde", ] @@ -7525,6 +7470,7 @@ version = "0.1.0" dependencies = [ "async-trait", "base64 0.13.1", + "bip32", "bip39", "colored", "cosmrs", @@ -7555,7 +7501,7 @@ dependencies = [ "nym-service-provider-directory-common", "nym-vesting-contract-common", "openssl", - "prost", + "prost 0.12.1", "reqwest", "serde", "serde_json", @@ -7617,6 +7563,7 @@ dependencies = [ "ip_network", "ip_network_table", "log", + "nym-network-defaults", "nym-sphinx", "nym-task", "nym-tun", @@ -8431,7 +8378,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +dependencies = [ + "bytes", + "prost-derive 0.12.1", ] [[package]] @@ -8448,8 +8405,8 @@ dependencies = [ "multimap", "petgraph", "prettyplease", - "prost", - "prost-types", + "prost 0.11.9", + "prost-types 0.11.9", "regex", "syn 1.0.109", "tempfile", @@ -8463,7 +8420,7 @@ source = "git+https://github.com/ChainSafe/rust-libp2p.git?rev=e3440d25681df380c dependencies = [ "asynchronous-codec", "bytes", - "prost", + "prost 0.11.9", "thiserror", "unsigned-varint", ] @@ -8481,13 +8438,35 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", +] + +[[package]] +name = "prost-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +dependencies = [ + "prost 0.12.1", ] [[package]] @@ -8999,6 +8978,7 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -9008,12 +8988,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.13", + "rustls 0.21.7", + "rustls-native-certs", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", "tokio-native-tls", + "tokio-rustls 0.24.1", "tokio-socks", "tower-service", "url", @@ -9413,12 +9397,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.5.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls 0.19.1", + "rustls-pemfile", "schannel", "security-framework", ] @@ -10619,9 +10603,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0" +checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" dependencies = [ "bytes", "digest 0.10.7", @@ -10632,8 +10616,8 @@ dependencies = [ "k256", "num-traits", "once_cell", - "prost", - "prost-types", + "prost 0.12.1", + "prost-types 0.12.1", "ripemd", "serde", "serde_bytes", @@ -10650,9 +10634,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372" +checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" dependencies = [ "flex-error", "serde", @@ -10664,16 +10648,16 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d" +checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" dependencies = [ "bytes", "flex-error", "num-derive", "num-traits", - "prost", - "prost-types", + "prost 0.12.1", + "prost-types 0.12.1", "serde", "serde_bytes", "subtle-encoding", @@ -10682,21 +10666,18 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129" +checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" dependencies = [ "async-trait", "bytes", "flex-error", "futures", "getrandom 0.2.10", - "http", - "hyper", - "hyper-proxy", - "hyper-rustls", "peg", "pin-project", + "reqwest", "semver 1.0.20", "serde", "serde_bytes", @@ -10920,6 +10901,16 @@ dependencies = [ "webpki 0.22.4", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -11111,7 +11102,7 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", "tokio", "tokio-stream", "tower", diff --git a/Cargo.toml b/Cargo.toml index a7f5365711..4cb7f7b6d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -142,21 +142,6 @@ bip39 = { version = "2.0.0", features = ["zeroize"] } boringtun = { git = "https://github.com/cloudflare/boringtun", rev = "e1d6360d6ab4529fc942a078e4c54df107abe2ba" } clap = "4.4.7" cfg-if = "1.0.0" -cosmwasm-derive = "=1.3.0" -cosmwasm-schema = "=1.3.0" -cosmwasm-std = "=1.3.0" -# use 0.5.0 as that's the version used by cosmwasm-std 1.3.0 -# (and ideally we don't want to pull the same dependency twice) -serde-json-wasm = "=0.5.0" -cosmwasm-storage = "=1.3.0" -cosmrs = "=0.14.0" -# same version as used by cosmrs -cw-utils = "=1.0.1" -cw-storage-plus = "=1.1.0" -cw2 = { version = "=1.1.0" } -cw3 = { version = "=1.1.0" } -cw4 = { version = "=1.1.0" } -cw-controllers = { version = "=1.1.0" } dashmap = "5.5.3" dotenvy = "0.15.6" futures = "0.3.28" @@ -174,7 +159,6 @@ schemars = "0.8.1" serde = "1.0.152" serde_json = "1.0.91" tap = "1.0.1" -tendermint-rpc = "0.32" # same version as used by cosmrs thiserror = "1.0.48" tokio = "1.24.1" tokio-tungstenite = "0.20.1" @@ -186,6 +170,28 @@ utoipa-swagger-ui = "3.1.5" url = "2.4" zeroize = "1.6.0" +# cosmwasm-related +cosmwasm-derive = "=1.3.0" +cosmwasm-schema = "=1.3.0" +cosmwasm-std = "=1.3.0" +# use 0.5.0 as that's the version used by cosmwasm-std 1.3.0 +# (and ideally we don't want to pull the same dependency twice) +serde-json-wasm = "=0.5.0" +cosmwasm-storage = "=1.3.0" +# same version as used by cosmwasm +cw-utils = "=1.0.1" +cw-storage-plus = "=1.1.0" +cw2 = { version = "=1.1.0" } +cw3 = { version = "=1.1.0" } +cw4 = { version = "=1.1.0" } +cw-controllers = { version = "=1.1.0" } + +# cosmrs-related +bip32 = "0.5.1" +cosmrs = "=0.15.0" +tendermint-rpc = "0.34" # same version as used by cosmrs +prost = "0.12" + # wasm-related dependencies gloo-utils = "0.1.7" js-sys = "0.3.63" diff --git a/README.md b/README.md index e46c02478d..c75bcc7c3e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ The platform is composed of multiple Rust crates. Top-level executable binary cr * nym-explorer - a (projected) block explorer and (existing) mixnet viewer. * nym-wallet - a desktop wallet implemented using the [Tauri](https://tauri.studio/en/docs/about/intro) framework. -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](https://opensource.org/licenses/Apache-2.0) [![Build Status](https://img.shields.io/github/actions/workflow/status/nymtech/nym/build.yml?branch=develop&style=for-the-badge&logo=github-actions)](https://github.com/nymtech/nym/actions?query=branch%3Adevelop) @@ -83,4 +82,11 @@ where `s'` is stake `s` scaled over total token circulating supply. ### Licensing and copyright information -This program is available as open source under the terms of the Apache 2.0 license. However, some elements are being licensed under CC0-1.0 and MIT. For accurate information, please check individual files. +This is a monorepo and components that make up Nym as a system are licensed individually, so for accurate information, please check individual files. + +As a general approach, licensing is as follows this pattern: +- applications and binaries are GPLv3 +- libraries and components are Apache 2.0 or MIT +- documentation is Apache 2.0 or CC0-1.0 + +Again, for accurate information, please check individual files. diff --git a/common/client-core/src/client/base_client/storage/gateway_details.rs b/common/client-core/src/client/base_client/storage/gateway_details.rs index fe04aee5c3..d9eaddfa87 100644 --- a/common/client-core/src/client/base_client/storage/gateway_details.rs +++ b/common/client-core/src/client/base_client/storage/gateway_details.rs @@ -77,7 +77,7 @@ pub struct PersistedGatewayConfig { key_hash: Vec, /// Actual gateway details being persisted. - pub(crate) details: GatewayEndpointConfig, + pub details: GatewayEndpointConfig, } #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index e16345f446..808bacaad6 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -45,13 +45,17 @@ cosmrs = { workspace = true, features = ["bip32", "cosmwasm"] } # import it just for the `Client` trait tendermint-rpc = { workspace = true } +# this is an extremely nasty import. we're explicitly bringing in bip32 so that via the magic (or curse, pick your poison) +# of cargo's feature unification we'd get `bip32/std` meaning we'd get `std::error::Error` for the re-exported (via cosmrs) bip32::Error type +bip32 = { workspace = true, default-features = false, features = ["std"] } + eyre = { version = "0.6" } cw-utils = { workspace = true } cw2 = { workspace = true } cw3 = { workspace = true } cw4 = { workspace = true } cw-controllers = { workspace = true } -prost = { version = "0.11", default-features = false } +prost = { workspace = true, default-features = false } flate2 = { version = "1.0.20" } sha2 = { version = "0.9.5" } itertools = { version = "0.10" } diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs index b639b223e3..1718ab2f02 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs @@ -20,12 +20,12 @@ impl CheckResponse for broadcast::tx_commit::Response { }); } - if self.deliver_tx.code.is_err() { + if self.tx_result.code.is_err() { return Err(NyxdError::BroadcastTxErrorDeliverTx { hash: self.hash, height: Some(self.height), - code: self.deliver_tx.code.value(), - raw_log: self.deliver_tx.log, + code: self.tx_result.code.value(), + raw_log: self.tx_result.log, }); } diff --git a/common/client-libs/validator-client/src/nyxd/fee/mod.rs b/common/client-libs/validator-client/src/nyxd/fee/mod.rs index ee30d1ffe5..f062dfdb49 100644 --- a/common/client-libs/validator-client/src/nyxd/fee/mod.rs +++ b/common/client-libs/validator-client/src/nyxd/fee/mod.rs @@ -11,7 +11,7 @@ pub mod gas_price; pub type GasAdjustment = f32; -pub const DEFAULT_SIMULATED_GAS_MULTIPLIER: GasAdjustment = 1.3; +pub const DEFAULT_SIMULATED_GAS_MULTIPLIER: GasAdjustment = 1.5; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AutoFeeGrant { diff --git a/common/client-libs/validator-client/src/nyxd/mod.rs b/common/client-libs/validator-client/src/nyxd/mod.rs index e7d6650052..c9c27370e2 100644 --- a/common/client-libs/validator-client/src/nyxd/mod.rs +++ b/common/client-libs/validator-client/src/nyxd/mod.rs @@ -34,7 +34,9 @@ pub use crate::nyxd::fee::Fee; pub use crate::rpc::TendermintRpcClient; pub use coin::Coin; pub use cosmrs::bank::MsgSend; -pub use cosmrs::tendermint::abci::{response::DeliverTx, Event, EventAttribute}; +pub use cosmrs::tendermint::abci::{ + response::DeliverTx, types::ExecTxResult, Event, EventAttribute, +}; pub use cosmrs::tendermint::block::Height; pub use cosmrs::tendermint::hash::{self, Algorithm, Hash}; pub use cosmrs::tendermint::validator::Info as TendermintValidatorInfo; diff --git a/common/client-libs/validator-client/src/rpc/mod.rs b/common/client-libs/validator-client/src/rpc/mod.rs index fd3f7991ba..78f5476b48 100644 --- a/common/client-libs/validator-client/src/rpc/mod.rs +++ b/common/client-libs/validator-client/src/rpc/mod.rs @@ -28,7 +28,7 @@ where U: TryInto, { HttpRpcClient::builder(url.try_into()?) - .compat_mode(CompatMode::V0_34) + .compat_mode(CompatMode::V0_37) .build() } diff --git a/common/client-libs/validator-client/src/rpc/reqwest.rs b/common/client-libs/validator-client/src/rpc/reqwest.rs index ffad7dd815..973fb63376 100644 --- a/common/client-libs/validator-client/src/rpc/reqwest.rs +++ b/common/client-libs/validator-client/src/rpc/reqwest.rs @@ -36,7 +36,8 @@ pub struct ReqwestRpcClient { impl ReqwestRpcClient { pub fn new(url: Url) -> Self { ReqwestRpcClient { - compat: CompatMode::V0_34, + // after updating to nyxd 0.42 and thus updating to cometbft, the compat mode changed + compat: CompatMode::V0_37, inner: reqwest::Client::new(), url, } diff --git a/common/cosmwasm-smart-contracts/contracts-common/src/types.rs b/common/cosmwasm-smart-contracts/contracts-common/src/types.rs index 4dca6b173b..218bd6ca50 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/src/types.rs +++ b/common/cosmwasm-smart-contracts/contracts-common/src/types.rs @@ -3,6 +3,7 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::Decimal; +use cosmwasm_std::OverflowError; use cosmwasm_std::Uint128; use serde::de::Error; use serde::{Deserialize, Deserializer}; @@ -71,6 +72,10 @@ impl Percent { // we know the cast from u128 to u8 is a safe one since the internal value must be within 0 - 1 range truncate_decimal(hundred * self.0).u128() as u8 } + + pub fn checked_pow(&self, exp: u32) -> Result { + self.0.checked_pow(exp).map(Percent) + } } impl Display for Percent { diff --git a/common/dkg/benches/benchmarks.rs b/common/dkg/benches/benchmarks.rs index 483c6d20e9..2951a57a7c 100644 --- a/common/dkg/benches/benchmarks.rs +++ b/common/dkg/benches/benchmarks.rs @@ -366,11 +366,7 @@ pub fn creating_proof_of_chunking_for_100_parties(c: &mut Criterion) { .map(|&node_index| polynomial.evaluate_at(&Scalar::from(node_index)).into()) .collect::>(); - let remote_share_key_pairs = shares - .iter() - .zip(receivers.values()) - .map(|(share, key)| (share, key)) - .collect::>(); + let remote_share_key_pairs = shares.iter().zip(receivers.values()).collect::>(); let ordered_public_keys = receivers.values().copied().collect::>(); let (ciphertexts, hazmat) = encrypt_shares(&remote_share_key_pairs, ¶ms, &mut rng); @@ -400,11 +396,7 @@ pub fn verifying_proof_of_chunking_for_100_parties(c: &mut Criterion) { .map(|&node_index| polynomial.evaluate_at(&Scalar::from(node_index)).into()) .collect::>(); - let remote_share_key_pairs = shares - .iter() - .zip(receivers.values()) - .map(|(share, key)| (share, key)) - .collect::>(); + let remote_share_key_pairs = shares.iter().zip(receivers.values()).collect::>(); let ordered_public_keys = receivers.values().copied().collect::>(); let (ciphertexts, hazmat) = encrypt_shares(&remote_share_key_pairs, ¶ms, &mut rng); @@ -436,11 +428,7 @@ pub fn creating_proof_of_secret_sharing_for_100_parties(c: &mut Criterion) { .map(|&node_index| polynomial.evaluate_at(&Scalar::from(node_index)).into()) .collect::>(); - let remote_share_key_pairs = shares - .iter() - .zip(receivers.values()) - .map(|(share, key)| (share, key)) - .collect::>(); + let remote_share_key_pairs = shares.iter().zip(receivers.values()).collect::>(); let (ciphertexts, hazmat) = encrypt_shares(&remote_share_key_pairs, ¶ms, &mut rng); @@ -478,11 +466,7 @@ pub fn verifying_proof_of_secret_sharing_for_100_parties(c: &mut Criterion) { .map(|&node_index| polynomial.evaluate_at(&Scalar::from(node_index)).into()) .collect::>(); - let remote_share_key_pairs = shares - .iter() - .zip(receivers.values()) - .map(|(share, key)| (share, key)) - .collect::>(); + let remote_share_key_pairs = shares.iter().zip(receivers.values()).collect::>(); let (ciphertexts, hazmat) = encrypt_shares(&remote_share_key_pairs, ¶ms, &mut rng); @@ -545,11 +529,7 @@ pub fn share_encryption_100(c: &mut Criterion) { .map(|&node_index| polynomial.evaluate_at(&Scalar::from(node_index)).into()) .collect::>(); - let remote_share_key_pairs = shares - .iter() - .zip(receivers.values()) - .map(|(share, key)| (share, key)) - .collect::>(); + let remote_share_key_pairs = shares.iter().zip(receivers.values()).collect::>(); c.bench_function("100 shares encryption", |b| { b.iter(|| black_box(encrypt_shares(&remote_share_key_pairs, ¶ms, &mut rng))) diff --git a/common/ip-packet-requests/Cargo.toml b/common/ip-packet-requests/Cargo.toml index d77f0f9396..969152baf7 100644 --- a/common/ip-packet-requests/Cargo.toml +++ b/common/ip-packet-requests/Cargo.toml @@ -14,4 +14,5 @@ license.workspace = true bincode = "1.3.3" bytes = "1.5.0" nym-sphinx = { path = "../nymsphinx" } +rand = "0.8.5" serde = { workspace = true, features = ["derive"] } diff --git a/common/ip-packet-requests/src/lib.rs b/common/ip-packet-requests/src/lib.rs index ef7672bf17..95dc67076d 100644 --- a/common/ip-packet-requests/src/lib.rs +++ b/common/ip-packet-requests/src/lib.rs @@ -1,35 +1,270 @@ -#[derive(serde::Serialize, serde::Deserialize)] -pub struct TaggedIpPacket { - pub packet: bytes::Bytes, - pub return_address: nym_sphinx::addressing::clients::Recipient, - pub return_mix_hops: Option, - // pub return_mix_delays: Option, +use std::net::IpAddr; + +use nym_sphinx::addressing::clients::Recipient; +use serde::{Deserialize, Serialize}; + +pub const CURRENT_VERSION: u8 = 1; + +fn generate_random() -> u64 { + use rand::RngCore; + let mut rng = rand::rngs::OsRng; + rng.next_u64() } -impl TaggedIpPacket { - pub fn new( - packet: bytes::Bytes, - return_address: nym_sphinx::addressing::clients::Recipient, - return_mix_hops: Option, - ) -> Self { - TaggedIpPacket { - packet, - return_address, - return_mix_hops, +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct IpPacketRequest { + pub version: u8, + pub data: IpPacketRequestData, +} + +impl IpPacketRequest { + pub fn new_static_connect_request( + ip: IpAddr, + reply_to: Recipient, + reply_to_hops: Option, + reply_to_avg_mix_delays: Option, + ) -> (Self, u64) { + let request_id = generate_random(); + ( + Self { + version: CURRENT_VERSION, + data: IpPacketRequestData::StaticConnect(StaticConnectRequest { + request_id, + ip, + reply_to, + reply_to_hops, + reply_to_avg_mix_delays, + }), + }, + request_id, + ) + } + + pub fn new_dynamic_connect_request( + reply_to: Recipient, + reply_to_hops: Option, + reply_to_avg_mix_delays: Option, + ) -> (Self, u64) { + let request_id = generate_random(); + ( + Self { + version: CURRENT_VERSION, + data: IpPacketRequestData::DynamicConnect(DynamicConnectRequest { + request_id, + reply_to, + reply_to_hops, + reply_to_avg_mix_delays, + }), + }, + request_id, + ) + } + + pub fn new_ip_packet(ip_packet: bytes::Bytes) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketRequestData::Data(DataRequest { ip_packet }), } } + pub fn id(&self) -> Option { + match &self.data { + IpPacketRequestData::StaticConnect(request) => Some(request.request_id), + IpPacketRequestData::DynamicConnect(request) => Some(request.request_id), + IpPacketRequestData::Data(_) => None, + } + } + + pub fn recipient(&self) -> Option<&Recipient> { + match &self.data { + IpPacketRequestData::StaticConnect(request) => Some(&request.reply_to), + IpPacketRequestData::DynamicConnect(request) => Some(&request.reply_to), + IpPacketRequestData::Data(_) => None, + } + } + + pub fn to_bytes(&self) -> Result, bincode::Error> { + use bincode::Options; + make_bincode_serializer().serialize(self) + } + pub fn from_reconstructed_message( message: &nym_sphinx::receiver::ReconstructedMessage, ) -> Result { use bincode::Options; make_bincode_serializer().deserialize(&message.message) } +} + +#[allow(clippy::large_enum_variant)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub enum IpPacketRequestData { + StaticConnect(StaticConnectRequest), + DynamicConnect(DynamicConnectRequest), + Data(DataRequest), +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct StaticConnectRequest { + pub request_id: u64, + pub ip: IpAddr, + pub reply_to: Recipient, + pub reply_to_hops: Option, + pub reply_to_avg_mix_delays: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct DynamicConnectRequest { + pub request_id: u64, + pub reply_to: Recipient, + pub reply_to_hops: Option, + pub reply_to_avg_mix_delays: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct DataRequest { + pub ip_packet: bytes::Bytes, +} + +// --- + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct IpPacketResponse { + pub version: u8, + pub data: IpPacketResponseData, +} + +impl IpPacketResponse { + pub fn new_static_connect_success(request_id: u64, reply_to: Recipient) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketResponseData::StaticConnect(StaticConnectResponse { + request_id, + reply_to, + reply: StaticConnectResponseReply::Success, + }), + } + } + + pub fn new_static_connect_failure(request_id: u64, reply_to: Recipient) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketResponseData::StaticConnect(StaticConnectResponse { + request_id, + reply_to, + reply: StaticConnectResponseReply::Failure, + }), + } + } + + pub fn new_dynamic_connect_success(request_id: u64, reply_to: Recipient, ip: IpAddr) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketResponseData::DynamicConnect(DynamicConnectResponse { + request_id, + reply_to, + reply: DynamicConnectResponseReply::Success(DynamicConnectSuccess { ip }), + }), + } + } + + pub fn new_dynamic_connect_failure(request_id: u64, reply_to: Recipient) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketResponseData::DynamicConnect(DynamicConnectResponse { + request_id, + reply_to, + reply: DynamicConnectResponseReply::Failure, + }), + } + } + + pub fn new_ip_packet(ip_packet: bytes::Bytes) -> Self { + Self { + version: CURRENT_VERSION, + data: IpPacketResponseData::Data(DataResponse { ip_packet }), + } + } + + pub fn id(&self) -> Option { + match &self.data { + IpPacketResponseData::StaticConnect(response) => Some(response.request_id), + IpPacketResponseData::DynamicConnect(response) => Some(response.request_id), + IpPacketResponseData::Data(_) => None, + } + } + + pub fn recipient(&self) -> Option<&Recipient> { + match &self.data { + IpPacketResponseData::StaticConnect(response) => Some(&response.reply_to), + IpPacketResponseData::DynamicConnect(response) => Some(&response.reply_to), + IpPacketResponseData::Data(_) => None, + } + } pub fn to_bytes(&self) -> Result, bincode::Error> { use bincode::Options; make_bincode_serializer().serialize(self) } + + pub fn from_reconstructed_message( + message: &nym_sphinx::receiver::ReconstructedMessage, + ) -> Result { + use bincode::Options; + make_bincode_serializer().deserialize(&message.message) + } +} + +#[allow(clippy::large_enum_variant)] +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum IpPacketResponseData { + StaticConnect(StaticConnectResponse), + DynamicConnect(DynamicConnectResponse), + Data(DataResponse), +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct StaticConnectResponse { + pub request_id: u64, + pub reply_to: Recipient, + pub reply: StaticConnectResponseReply, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum StaticConnectResponseReply { + Success, + Failure, +} +impl StaticConnectResponseReply { + pub fn is_success(&self) -> bool { + match self { + StaticConnectResponseReply::Success => true, + StaticConnectResponseReply::Failure => false, + } + } +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct DynamicConnectResponse { + pub request_id: u64, + pub reply_to: Recipient, + pub reply: DynamicConnectResponseReply, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum DynamicConnectResponseReply { + Success(DynamicConnectSuccess), + Failure, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct DynamicConnectSuccess { + pub ip: IpAddr, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct DataResponse { + pub ip_packet: bytes::Bytes, } fn make_bincode_serializer() -> impl bincode::Options { @@ -38,3 +273,63 @@ fn make_bincode_serializer() -> impl bincode::Options { .with_big_endian() .with_varint_encoding() } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn check_size_of_request() { + let connect = IpPacketRequest { + version: 4, + data: IpPacketRequestData::StaticConnect( + StaticConnectRequest { + request_id: 123, + ip: IpAddr::from([10, 0, 0, 1]), + reply_to: Recipient::try_from_base58_string("D1rrpsysCGCYXy9saP8y3kmNpGtJZUXN9SvFoUcqAsM9.9Ssso1ea5NfkbMASdiseDSjTN1fSWda5SgEVjdSN4CvV@GJqd3ZxpXWSNxTfx7B1pPtswpetH4LnJdFeLeuY5KUuN").unwrap(), + reply_to_hops: None, + reply_to_avg_mix_delays: None, + }, + ) + }; + assert_eq!(connect.to_bytes().unwrap().len(), 107); + } + + #[test] + fn check_size_of_data() { + let data = IpPacketRequest { + version: 4, + data: IpPacketRequestData::Data(DataRequest { + ip_packet: bytes::Bytes::from(vec![1u8; 32]), + }), + }; + assert_eq!(data.to_bytes().unwrap().len(), 35); + } + + #[test] + fn serialize_and_deserialize_data_request() { + let data = IpPacketRequest { + version: 4, + data: IpPacketRequestData::Data(DataRequest { + ip_packet: bytes::Bytes::from(vec![1, 2, 4, 2, 5]), + }), + }; + + let serialized = data.to_bytes().unwrap(); + let deserialized = IpPacketRequest::from_reconstructed_message( + &nym_sphinx::receiver::ReconstructedMessage { + message: serialized, + sender_tag: None, + }, + ) + .unwrap(); + + assert_eq!(deserialized.version, 4); + assert_eq!( + deserialized.data, + IpPacketRequestData::Data(DataRequest { + ip_packet: bytes::Bytes::from(vec![1, 2, 4, 2, 5]), + }) + ); + } +} diff --git a/common/network-defaults/src/lib.rs b/common/network-defaults/src/lib.rs index b45b5483e9..bcf02d1f02 100644 --- a/common/network-defaults/src/lib.rs +++ b/common/network-defaults/src/lib.rs @@ -476,3 +476,11 @@ pub const DEFAULT_NYM_NODE_HTTP_PORT: u16 = 8080; pub const TOTAL_SUPPLY: u128 = 1_000_000_000_000_000; pub const DEFAULT_PROFIT_MARGIN: u8 = 10; + +// WIREGUARD +pub const WG_PORT: u16 = 51822; + +// The interface used to route traffic +pub const WG_TUN_BASE_NAME: &str = "nymwg"; +pub const WG_TUN_DEVICE_ADDRESS: &str = "10.1.0.1"; +pub const WG_TUN_DEVICE_NETMASK: &str = "255.255.255.0"; diff --git a/common/nymcoconut/benches/benchmarks.rs b/common/nymcoconut/benches/benchmarks.rs index 74149c15c9..6627b437e1 100644 --- a/common/nymcoconut/benches/benchmarks.rs +++ b/common/nymcoconut/benches/benchmarks.rs @@ -6,9 +6,10 @@ use criterion::{criterion_group, criterion_main, Criterion}; use ff::Field; use group::{Curve, Group}; use nym_coconut::{ - aggregate_signature_shares, aggregate_verification_keys, blind_sign, elgamal_keygen, - prepare_blind_sign, prove_bandwidth_credential, setup, ttp_keygen, verify_credential, - Attribute, BlindedSignature, Parameters, Signature, SignatureShare, VerificationKey, + aggregate_signature_shares, aggregate_verification_keys, blind_sign, prepare_blind_sign, + prove_bandwidth_credential, setup, ttp_keygen, verify_credential, + verify_partial_blind_signature, Attribute, BlindedSignature, Parameters, Signature, + SignatureShare, VerificationKey, }; use rand::seq::SliceRandom; use std::ops::Neg; @@ -175,8 +176,6 @@ fn bench_coconut(c: &mut Criterion) { let binding_number = params.random_scalar(); let private_attributes = vec![serial_number, binding_number]; - let _elgamal_keypair = elgamal_keygen(¶ms); - // The prepare blind sign is performed by the user let (pedersen_commitments_openings, blind_sign_request) = prepare_blind_sign(¶ms, &private_attributes, &public_attributes).unwrap(); @@ -242,6 +241,29 @@ fn bench_coconut(c: &mut Criterion) { .map(|keypair| keypair.verification_key()) .collect(); + // verify a random partial blind signature + let rand_idx = 1; + let random_blind_signature = blinded_signatures.get(rand_idx).unwrap(); + let partial_verification_key = verification_keys.get(rand_idx).unwrap(); + + group.bench_function( + &format!( + "verify_partial_blind_signature_{}_private_attributes_{}_public_attributes", + case.num_private_attrs, case.num_public_attrs + ), + |b| { + b.iter(|| { + verify_partial_blind_signature( + ¶ms, + &blind_sign_request, + &public_attributes, + random_blind_signature, + partial_verification_key, + ) + }) + }, + ); + // Lets bench worse case, ie aggregating all let indices: Vec = (1..=case.num_authorities).collect(); // aggregate verification keys diff --git a/common/nymcoconut/src/lib.rs b/common/nymcoconut/src/lib.rs index a98b546fc1..821b1b3b29 100644 --- a/common/nymcoconut/src/lib.rs +++ b/common/nymcoconut/src/lib.rs @@ -14,6 +14,7 @@ pub use scheme::aggregation::aggregate_signature_shares; pub use scheme::aggregation::aggregate_verification_keys; pub use scheme::issuance::blind_sign; pub use scheme::issuance::prepare_blind_sign; +pub use scheme::issuance::verify_partial_blind_signature; pub use scheme::issuance::BlindSignRequest; pub use scheme::keygen::ttp_keygen; pub use scheme::keygen::KeyPair; diff --git a/common/nymcoconut/src/scheme/issuance.rs b/common/nymcoconut/src/scheme/issuance.rs index 710fc41df9..98a63f4511 100644 --- a/common/nymcoconut/src/scheme/issuance.rs +++ b/common/nymcoconut/src/scheme/issuance.rs @@ -3,12 +3,14 @@ use std::convert::TryFrom; use std::convert::TryInto; +use std::ops::Neg; -use bls12_381::{G1Affine, G1Projective, Scalar}; -use group::{Curve, GroupEncoding}; +use bls12_381::{multi_miller_loop, G1Affine, G1Projective, G2Prepared, Scalar}; +use group::{Curve, Group, GroupEncoding}; use crate::error::{CoconutError, Result}; use crate::proofs::ProofCmCs; +use crate::scheme::keygen::VerificationKey; use crate::scheme::setup::Parameters; use crate::scheme::BlindedSignature; use crate::scheme::SecretKey; @@ -318,6 +320,96 @@ pub fn blind_sign( Ok(BlindedSignature(h, sig)) } +/// Verifies a partial blind signature using the provided parameters and validator's verification key. +/// +/// # Arguments +/// +/// * `params` - A reference to the cryptographic parameters. +/// * `blind_sign_request` - A reference to the blind signature request signed by the client. +/// * `public_attributes` - A reference to the public attributes included in the client's request. +/// * `blind_sig` - A reference to the issued partial blinded signature to be verified. +/// * `partial_verification_key` - A reference to the validator's partial verification key. +/// +/// # Returns +/// +/// A boolean indicating whether the partial blind signature is valid (`true`) or not (`false`). +/// +/// # Remarks +/// +/// This function verifies the correctness and validity of a partial blind signature using +/// the provided cryptographic parameters, blind signature request, blinded signature, +/// and partial verification key. +/// It calculates pairings based on the provided values and checks whether the partial blind signature +/// is consistent with the verification key and commitments in the blind signature request. +/// The function returns `true` if the partial blind signature is valid, and `false` otherwise. +pub fn verify_partial_blind_signature( + params: &Parameters, + blind_sign_request: &BlindSignRequest, + public_attributes: &[Attribute], + blind_sig: &BlindedSignature, + partial_verification_key: &VerificationKey, +) -> bool { + let num_private_attributes = blind_sign_request.private_attributes_commitments.len(); + if num_private_attributes + public_attributes.len() > partial_verification_key.beta_g2.len() { + return false; + } + + // TODO: we're losing some memory here due to extra allocation, + // but worst-case scenario (given SANE amount of attributes), it's just few kb at most + let c_neg = blind_sig.1.to_affine().neg(); + let g2_prep = params.prepared_miller_g2(); + + let mut terms = vec![ + // (c^{-1}, g2) + (c_neg, g2_prep.clone()), + // (s, alpha) + ( + blind_sig.0.to_affine(), + G2Prepared::from(partial_verification_key.alpha.to_affine()), + ), + ]; + + // for each private attribute, add (cm_i, beta_i) to the miller terms + for (private_attr_commit, beta_g2) in blind_sign_request + .private_attributes_commitments + .iter() + .zip(&partial_verification_key.beta_g2) + { + // (cm_i, beta_i) + terms.push(( + private_attr_commit.to_affine(), + G2Prepared::from(beta_g2.to_affine()), + )) + } + + // for each public attribute, add (s^pub_j, beta_{priv + j}) to the miller terms + for (pub_attr, beta_g2) in public_attributes.iter().zip( + partial_verification_key + .beta_g2 + .iter() + .skip(num_private_attributes), + ) { + // (s^pub_j, beta_j) + terms.push(( + (blind_sig.0 * pub_attr).to_affine(), + G2Prepared::from(beta_g2.to_affine()), + )) + } + + // get the references to all the terms to get the arguments the miller loop expects + let terms_refs = terms.iter().map(|(g1, g2)| (g1, g2)).collect::>(); + + // since checking whether e(a, b) == e(c, d) + // is equivalent to checking e(a, b) • e(c, d)^{-1} == id + // and thus to e(a, b) • e(c^{-1}, d) == id + // + // compute e(c^1, g2) • e(s, alpha) • e(cm_0, beta_0) • e(cm_i, beta_i) • (s^pub_0, beta_{i+1}) (s^pub_j, beta_{i + j}) + multi_miller_loop(&terms_refs) + .final_exponentiation() + .is_identity() + .into() +} + #[cfg(test)] pub fn sign( params: &mut Parameters, @@ -354,6 +446,7 @@ pub fn sign( #[cfg(test)] mod tests { use super::*; + use crate::scheme::keygen::keygen; #[test] fn blind_sign_request_bytes_roundtrip() { @@ -385,4 +478,81 @@ mod tests { lambda ); } + + #[test] + fn successful_verify_partial_blind_signature() { + let params = Parameters::new(4).unwrap(); + let private_attributes = params.n_random_scalars(2); + let public_attributes = params.n_random_scalars(2); + + let (_commitments_openings, request) = + prepare_blind_sign(¶ms, &private_attributes, &public_attributes).unwrap(); + + let validator_keypair = keygen(¶ms); + let blind_sig = blind_sign( + ¶ms, + &validator_keypair.secret_key(), + &request, + &public_attributes, + ) + .unwrap(); + + assert!(verify_partial_blind_signature( + ¶ms, + &request, + &public_attributes, + &blind_sig, + &validator_keypair.verification_key() + )); + } + + #[test] + fn successful_verify_partial_blind_signature_no_public_attributes() { + let params = Parameters::new(4).unwrap(); + let private_attributes = params.n_random_scalars(2); + + let (_commitments_openings, request) = + prepare_blind_sign(¶ms, &private_attributes, &[]).unwrap(); + + let validator_keypair = keygen(¶ms); + let blind_sig = + blind_sign(¶ms, &validator_keypair.secret_key(), &request, &[]).unwrap(); + + assert!(verify_partial_blind_signature( + ¶ms, + &request, + &[], + &blind_sig, + &validator_keypair.verification_key() + )); + } + + #[test] + fn fail_verify_partial_blind_signature_with_wrong_key() { + let params = Parameters::new(4).unwrap(); + let private_attributes = params.n_random_scalars(2); + let public_attributes = params.n_random_scalars(2); + + let (_commitments_openings, request) = + prepare_blind_sign(¶ms, &private_attributes, &public_attributes).unwrap(); + + let validator_keypair = keygen(¶ms); + let validator2_keypair = keygen(¶ms); + let blind_sig = blind_sign( + ¶ms, + &validator_keypair.secret_key(), + &request, + &public_attributes, + ) + .unwrap(); + + // this assertion should fail, as we try to verify with a wrong validator key + assert!(!verify_partial_blind_signature( + ¶ms, + &request, + &public_attributes, + &blind_sig, + &validator2_keypair.verification_key() + ),); + } } diff --git a/common/tun/src/linux/tun_device.rs b/common/tun/src/linux/tun_device.rs index 84a62a1220..709f5fec3b 100644 --- a/common/tun/src/linux/tun_device.rs +++ b/common/tun/src/linux/tun_device.rs @@ -198,7 +198,7 @@ impl TunDevice { async fn handle_tun_read(&self, packet: &[u8]) -> Result<(), TunDeviceError> { let ParsedAddresses { src_addr, dst_addr } = parse_src_dst_address(packet)?; log::debug!( - "iface: read Packet({src_addr} -> {dst_addr}, {} bytes)", + "iface: read Packet({dst_addr} <- {src_addr}, {} bytes)", packet.len(), ); diff --git a/common/wireguard-types/src/lib.rs b/common/wireguard-types/src/lib.rs index 605b30ba82..8c10985cbc 100644 --- a/common/wireguard-types/src/lib.rs +++ b/common/wireguard-types/src/lib.rs @@ -15,5 +15,3 @@ pub use registration::{ #[cfg(feature = "verify")] pub use registration::HmacSha256; - -pub const WG_PORT: u16 = 51822; diff --git a/common/wireguard/Cargo.toml b/common/wireguard/Cargo.toml index f2ac47abdc..461282833d 100644 --- a/common/wireguard/Cargo.toml +++ b/common/wireguard/Cargo.toml @@ -26,6 +26,7 @@ futures = "0.3.28" ip_network = "0.4.1" ip_network_table = "0.2.0" log.workspace = true +nym-network-defaults = { path = "../network-defaults" } nym-task = { path = "../task" } nym-wireguard-types = { path = "../wireguard-types" } nym-sphinx = { path = "../nymsphinx" } diff --git a/common/wireguard/src/lib.rs b/common/wireguard/src/lib.rs index b987dbd31c..fe51636a05 100644 --- a/common/wireguard/src/lib.rs +++ b/common/wireguard/src/lib.rs @@ -44,9 +44,9 @@ pub async fn start_wireguard( // Start the tun device that is used to relay traffic outbound let config = tun_device::TunDeviceConfig { - base_name: setup::TUN_BASE_NAME.to_string(), - ip: setup::TUN_DEVICE_ADDRESS.parse().unwrap(), - netmask: setup::TUN_DEVICE_NETMASK.parse().unwrap(), + base_name: nym_network_defaults::WG_TUN_BASE_NAME.to_string(), + ip: nym_network_defaults::WG_TUN_DEVICE_ADDRESS.parse().unwrap(), + netmask: nym_network_defaults::WG_TUN_DEVICE_NETMASK.parse().unwrap(), }; let (tun, tun_task_tx, tun_task_response_rx) = tun_device::TunDevice::new(routing_mode, config); tun.start(); diff --git a/common/wireguard/src/setup.rs b/common/wireguard/src/setup.rs index a4ee4e582d..779554a6eb 100644 --- a/common/wireguard/src/setup.rs +++ b/common/wireguard/src/setup.rs @@ -7,11 +7,6 @@ use log::info; // The wireguard UDP listener pub const WG_ADDRESS: &str = "0.0.0.0"; -// The interface used to route traffic -pub const TUN_BASE_NAME: &str = "nymwg"; -pub const TUN_DEVICE_ADDRESS: &str = "10.1.0.1"; -pub const TUN_DEVICE_NETMASK: &str = "255.255.255.0"; - // The private key of the listener // Corresponding public key: "WM8s8bYegwMa0TJ+xIwhk+dImk2IpDUKslDBCZPizlE=" const PRIVATE_KEY: &str = "AEqXrLFT4qjYq3wmX0456iv94uM6nDj5ugp6Jedcflg="; diff --git a/common/wireguard/src/udp_listener.rs b/common/wireguard/src/udp_listener.rs index 88bab9c162..aada5b98f4 100644 --- a/common/wireguard/src/udp_listener.rs +++ b/common/wireguard/src/udp_listener.rs @@ -6,6 +6,7 @@ use boringtun::{ }; use futures::StreamExt; use log::error; +use nym_network_defaults::WG_PORT; use nym_task::TaskClient; use nym_wireguard_types::{ registration::GatewayClientRegistry, @@ -13,7 +14,7 @@ use nym_wireguard_types::{ active_peers::{ActivePeers, PeersByIp}, event::Event, }, - PeerPublicKey, WG_PORT, + PeerPublicKey, }; use tap::TapFallible; use tokio::{net::UdpSocket, sync::Mutex}; diff --git a/documentation/README.md b/documentation/README.md index 3fe8501eb8..7ec717dd2f 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -10,8 +10,19 @@ Each directory contains a readme with more information about running and contrib ## Scripts * `bump_versions.sh` allows you to update the ~~`platform_release_version` and~~ `wallet_release_version` variable~~s~~ in the `book.toml` of each mdbook project at once. You can also optionally update the `minimum_rust_version` as well. Helpful for lazy-updating when cutting a new version of the docs. + * The following scripts are used by the `ci-dev.yml` and `cd-dev.yml` scripts: * `build_all_to_dist.sh` is used for building all mdbook projects and moving the rendered html to `../dist/` to be rsynced with various servers. * `post_process.sh` is used to post process CSS/image/href links for serving several mdbooks from a subdirectory. -[//]: # ( * `removed_existing_config.sh` is used to remove existing nym client/node config files on the CI/CD server so avoid `mdbook-cmdrun` command errors. ) \ No newline at end of file +[//]: # ( * `removed_existing_config.sh` is used to remove existing nym client/node config files on the CI/CD server so avoid `mdbook-cmdrun` command errors. ) + +### Licensing and copyright information +This is a monorepo and components that make up Nym as a system are licensed individually, so for accurate information, please check individual files. + +As a general approach, licensing is as follows this pattern: +- applications and binaries are GPLv3 +- libraries and components are Apache 2.0 or MIT +- documentation is Apache 2.0 or CC0-1.0 + +For accurate information, please check individual files. diff --git a/documentation/dev-portal/src/licensing.md b/documentation/dev-portal/src/licensing.md index 73567d9f75..6663c2fb56 100644 --- a/documentation/dev-portal/src/licensing.md +++ b/documentation/dev-portal/src/licensing.md @@ -1,5 +1,10 @@ # Licensing -Nym is Free Software released under the Apache License V2. +Components that make up Nym as a system are licensed individually, so for accurate information, please check individual files. -All of the contributions of the Nym core developers are © Nym Technologies SA. If you are interested in talking to us about other licenses, please get in touch. \ No newline at end of file +As a general approach, licensing is as follows this pattern: +- applications and binaries are GPLv3 +- libraries and components are Apache 2.0 or MIT +- documentation is Apache 2.0 or CC0-1.0 + +Again, for accurate information, please check individual files. diff --git a/documentation/dev-portal/src/tutorials/cosmos-service/preparing-env.md b/documentation/dev-portal/src/tutorials/cosmos-service/preparing-env.md index 9192903001..e970821148 100644 --- a/documentation/dev-portal/src/tutorials/cosmos-service/preparing-env.md +++ b/documentation/dev-portal/src/tutorials/cosmos-service/preparing-env.md @@ -29,7 +29,7 @@ cargo new nym-cosmos-service ``` [dependencies] clap = { version = "4.0", features = ["derive"] } -cosmrs = "=0.14.0" +cosmrs = "=0.15.0" tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] } serde = "1.0.152" serde_json = "1.0.91" diff --git a/documentation/docs/LICENSE b/documentation/docs/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/documentation/docs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/documentation/docs/src/licensing.md b/documentation/docs/src/licensing.md index 2e8612d4d4..f0f5fb7d0c 100644 --- a/documentation/docs/src/licensing.md +++ b/documentation/docs/src/licensing.md @@ -1,5 +1,8 @@ # Licensing -Nym is Free Software released under the Apache License V2. +As a general approach, licensing is as follows this pattern: +- applications and binaries are GPLv3 +- libraries and components are Apache 2.0 or MIT +- documentation is Apache 2.0 or CC0-1.0 -All of the contributions of the Nym core developers are © Nym Technologies SA. If you are interested in talking to us about other licenses, please get in touch. +Again, for accurate information, please check individual files. diff --git a/documentation/operators/LICENSE b/documentation/operators/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/documentation/operators/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/documentation/operators/src/licensing.md b/documentation/operators/src/licensing.md index 2e8612d4d4..f0f5fb7d0c 100644 --- a/documentation/operators/src/licensing.md +++ b/documentation/operators/src/licensing.md @@ -1,5 +1,8 @@ # Licensing -Nym is Free Software released under the Apache License V2. +As a general approach, licensing is as follows this pattern: +- applications and binaries are GPLv3 +- libraries and components are Apache 2.0 or MIT +- documentation is Apache 2.0 or CC0-1.0 -All of the contributions of the Nym core developers are © Nym Technologies SA. If you are interested in talking to us about other licenses, please get in touch. +Again, for accurate information, please check individual files. diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 3ee6a13643..ffaf439c7f 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -1,8 +1,9 @@ # Copyright 2020 - Nym Technologies SA -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: GPL-3.0-only [package] name = "nym-gateway" +license = "GPL-3" version = "1.1.31" authors = [ "Dave Hrycyszyn ", diff --git a/gateway/README.md b/gateway/README.md new file mode 100644 index 0000000000..bc4645252e --- /dev/null +++ b/gateway/README.md @@ -0,0 +1,25 @@ + + +# Nym Gateway + +A Rust gateway implementation. + +## License + +Copyright (C) 2023 Nym Technologies SA + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . \ No newline at end of file diff --git a/gateway/build.rs b/gateway/build.rs index 98ad043036..27d55fccd2 100644 --- a/gateway/build.rs +++ b/gateway/build.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use sqlx::{Connection, SqliteConnection}; use std::env; diff --git a/gateway/src/commands/build_info.rs b/gateway/src/commands/build_info.rs index e3385bb933..3b763adf3f 100644 --- a/gateway/src/commands/build_info.rs +++ b/gateway/src/commands/build_info.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use clap::Args; use nym_bin_common::bin_info_owned; diff --git a/gateway/src/commands/helpers.rs b/gateway/src/commands/helpers.rs index edaca0edb8..3b97212ae6 100644 --- a/gateway/src/commands/helpers.rs +++ b/gateway/src/commands/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::upgrade_helpers; use crate::config::default_config_filepath; diff --git a/gateway/src/commands/init.rs b/gateway/src/commands/init.rs index 8bcfca93b7..bfa12bd66d 100644 --- a/gateway/src/commands/init.rs +++ b/gateway/src/commands/init.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{ initialise_local_ip_packet_router, initialise_local_network_requester, diff --git a/gateway/src/commands/mod.rs b/gateway/src/commands/mod.rs index 99c10869a5..34ecc95b47 100644 --- a/gateway/src/commands/mod.rs +++ b/gateway/src/commands/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::Cli; use clap::CommandFactory; diff --git a/gateway/src/commands/node_details.rs b/gateway/src/commands/node_details.rs index 2d37617338..02c0ca9875 100644 --- a/gateway/src/commands/node_details.rs +++ b/gateway/src/commands/node_details.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::try_load_current_config; use crate::node::helpers::node_details; diff --git a/gateway/src/commands/run.rs b/gateway/src/commands/run.rs index 8e57b7b998..76f7629de5 100644 --- a/gateway/src/commands/run.rs +++ b/gateway/src/commands/run.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{ ensure_config_version_compatibility, OverrideConfig, OverrideNetworkRequesterConfig, diff --git a/gateway/src/commands/setup_ip_packet_router.rs b/gateway/src/commands/setup_ip_packet_router.rs index 633c2a4bab..a08f94dea3 100644 --- a/gateway/src/commands/setup_ip_packet_router.rs +++ b/gateway/src/commands/setup_ip_packet_router.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{ initialise_local_ip_packet_router, try_load_current_config, OverrideIpPacketRouterConfig, diff --git a/gateway/src/commands/setup_network_requester.rs b/gateway/src/commands/setup_network_requester.rs index 6c45c05d19..c9de302200 100644 --- a/gateway/src/commands/setup_network_requester.rs +++ b/gateway/src/commands/setup_network_requester.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{ initialise_local_network_requester, try_load_current_config, OverrideNetworkRequesterConfig, diff --git a/gateway/src/commands/sign.rs b/gateway/src/commands/sign.rs index ad8061e597..552315614c 100644 --- a/gateway/src/commands/sign.rs +++ b/gateway/src/commands/sign.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{ ensure_config_version_compatibility, ensure_correct_bech32_prefix, OverrideConfig, diff --git a/gateway/src/commands/upgrade_helpers.rs b/gateway/src/commands/upgrade_helpers.rs index e09e6f827d..f93350caaa 100644 --- a/gateway/src/commands/upgrade_helpers.rs +++ b/gateway/src/commands/upgrade_helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_20::ConfigV1_1_20; use crate::config::old_config_v1_1_28::ConfigV1_1_28; diff --git a/gateway/src/config/mod.rs b/gateway/src/config/mod.rs index 4737f38c58..b872a1dffd 100644 --- a/gateway/src/config/mod.rs +++ b/gateway/src/config/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::persistence::paths::GatewayPaths; use crate::config::template::CONFIG_TEMPLATE; diff --git a/gateway/src/config/old_config_v1_1_20.rs b/gateway/src/config/old_config_v1_1_20.rs index f7a83fc2c0..2ab7431a31 100644 --- a/gateway/src/config/old_config_v1_1_20.rs +++ b/gateway/src/config/old_config_v1_1_20.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_28::{ ConfigV1_1_28, DebugV1_1_28, GatewayPathsV1_1_28, GatewayV1_1_28, KeysPathsV1_1_28, diff --git a/gateway/src/config/old_config_v1_1_28.rs b/gateway/src/config/old_config_v1_1_28.rs index dff9cc896c..42311d36de 100644 --- a/gateway/src/config/old_config_v1_1_28.rs +++ b/gateway/src/config/old_config_v1_1_28.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_29::{ ConfigV1_1_29, DebugV1_1_29, GatewayPathsV1_1_29, GatewayV1_1_29, KeysPathsV1_1_29, diff --git a/gateway/src/config/old_config_v1_1_29.rs b/gateway/src/config/old_config_v1_1_29.rs index bbd939b16a..48ca3d14fb 100644 --- a/gateway/src/config/old_config_v1_1_29.rs +++ b/gateway/src/config/old_config_v1_1_29.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_config::{ must_get_home, read_config_from_toml_file, DEFAULT_CONFIG_DIR, DEFAULT_CONFIG_FILENAME, NYM_DIR, diff --git a/gateway/src/config/old_config_v1_1_31.rs b/gateway/src/config/old_config_v1_1_31.rs index 04d76e6290..18841a4993 100644 --- a/gateway/src/config/old_config_v1_1_31.rs +++ b/gateway/src/config/old_config_v1_1_31.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::persistence::paths::GatewayPaths; use nym_bin_common::logging::LoggingSettings; diff --git a/gateway/src/config/persistence/mod.rs b/gateway/src/config/persistence/mod.rs index cbaa92be3d..d2b55c30f5 100644 --- a/gateway/src/config/persistence/mod.rs +++ b/gateway/src/config/persistence/mod.rs @@ -1,4 +1,4 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub mod paths; diff --git a/gateway/src/config/persistence/paths.rs b/gateway/src/config/persistence/paths.rs index 340b4a6495..b4b79241c6 100644 --- a/gateway/src/config/persistence/paths.rs +++ b/gateway/src/config/persistence/paths.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::{default_config_directory, default_data_directory}; use serde::{Deserialize, Deserializer, Serialize}; diff --git a/gateway/src/config/template.rs b/gateway/src/config/template.rs index 040a92bddd..1b6ac71262 100644 --- a/gateway/src/config/template.rs +++ b/gateway/src/config/template.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of diff --git a/gateway/src/error.rs b/gateway/src/error.rs index 4ae56f813c..61f75981ef 100644 --- a/gateway/src/error.rs +++ b/gateway/src/error.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::error::StorageError; use nym_ip_packet_router::error::IpPacketRouterError; diff --git a/gateway/src/http/mod.rs b/gateway/src/http/mod.rs index badf58dffe..8a8457f1c6 100644 --- a/gateway/src/http/mod.rs +++ b/gateway/src/http/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::Config; use crate::error::GatewayError; diff --git a/gateway/src/main.rs b/gateway/src/main.rs index 16ef053776..0ec4b7865a 100644 --- a/gateway/src/main.rs +++ b/gateway/src/main.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only #![warn(clippy::expect_used)] #![warn(clippy::unwrap_used)] diff --git a/gateway/src/node/client_handling/active_clients.rs b/gateway/src/node/client_handling/active_clients.rs index a44de399ba..ef9b995a88 100644 --- a/gateway/src/node/client_handling/active_clients.rs +++ b/gateway/src/node/client_handling/active_clients.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::websocket::message_receiver::{IsActiveRequestSender, MixMessageSender}; use crate::node::client_handling::embedded_network_requester::LocalNetworkRequesterHandle; diff --git a/gateway/src/node/client_handling/bandwidth.rs b/gateway/src/node/client_handling/bandwidth.rs index 99f1cf095b..e1b4d831e0 100644 --- a/gateway/src/node/client_handling/bandwidth.rs +++ b/gateway/src/node/client_handling/bandwidth.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_coconut_interface::Credential; diff --git a/gateway/src/node/client_handling/embedded_network_requester/mod.rs b/gateway/src/node/client_handling/embedded_network_requester/mod.rs index 8ed7e2f978..8070145cf0 100644 --- a/gateway/src/node/client_handling/embedded_network_requester/mod.rs +++ b/gateway/src/node/client_handling/embedded_network_requester/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::client_handling::websocket::message_receiver::{ MixMessageReceiver, MixMessageSender, diff --git a/gateway/src/node/client_handling/mod.rs b/gateway/src/node/client_handling/mod.rs index bc63605d58..ff4691e256 100644 --- a/gateway/src/node/client_handling/mod.rs +++ b/gateway/src/node/client_handling/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod active_clients; mod bandwidth; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs index ff779cad36..103c1ad102 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/authenticated.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use futures::{ future::{FusedFuture, OptionFuture}, diff --git a/gateway/src/node/client_handling/websocket/connection_handler/coconut.rs b/gateway/src/node/client_handling/websocket/connection_handler/coconut.rs index 32806da385..a2c000875f 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/coconut.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/coconut.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::authenticated::RequestHandlingError; use log::*; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs index d6a8d284d3..aa20f312d0 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/eth_events.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::client_handling::websocket::connection_handler::authenticated::RequestHandlingError; use nym_bandwidth_claim_contract::msg::ExecuteMsg; @@ -7,9 +7,9 @@ use nym_bandwidth_claim_contract::payment::LinkPaymentData; use nym_credentials::token::bandwidth::TokenCredential; use nym_crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH}; use nym_network_defaults::{ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH}; -use std::str::FromStr; use nym_validator_client::nxmd::traits::MixnetQueryClient; use nym_validator_client::nyxd::{AccountId, NyxdClient, SigningNyxdClient}; +use std::str::FromStr; use web3::contract::tokens::Detokenize; use web3::contract::{Contract, Error}; use web3::transports::Http; diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index f4389fb433..2d08c85709 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use futures::{ channel::{mpsc, oneshot}, diff --git a/gateway/src/node/client_handling/websocket/connection_handler/mod.rs b/gateway/src/node/client_handling/websocket/connection_handler/mod.rs index dc5fc1f89c..1bc27a6e2f 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/mod.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::Storage; use log::{trace, warn}; diff --git a/gateway/src/node/client_handling/websocket/listener.rs b/gateway/src/node/client_handling/websocket/listener.rs index 01463e12c6..27a03aacfc 100644 --- a/gateway/src/node/client_handling/websocket/listener.rs +++ b/gateway/src/node/client_handling/websocket/listener.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::client_handling::active_clients::ActiveClientsStore; use crate::node::client_handling::websocket::connection_handler::coconut::CoconutVerifier; diff --git a/gateway/src/node/client_handling/websocket/message_receiver.rs b/gateway/src/node/client_handling/websocket/message_receiver.rs index fb41083803..d1f8ffff38 100644 --- a/gateway/src/node/client_handling/websocket/message_receiver.rs +++ b/gateway/src/node/client_handling/websocket/message_receiver.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use futures::channel::{mpsc, oneshot}; diff --git a/gateway/src/node/client_handling/websocket/mod.rs b/gateway/src/node/client_handling/websocket/mod.rs index df45a32a69..673f14b8a8 100644 --- a/gateway/src/node/client_handling/websocket/mod.rs +++ b/gateway/src/node/client_handling/websocket/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) use listener::Listener; diff --git a/gateway/src/node/helpers.rs b/gateway/src/node/helpers.rs index d3cf2fdae4..abeb50d009 100644 --- a/gateway/src/node/helpers.rs +++ b/gateway/src/node/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::Config; use crate::error::GatewayError; diff --git a/gateway/src/node/mixnet_handling/mod.rs b/gateway/src/node/mixnet_handling/mod.rs index 8940615643..d6f05c6d1f 100644 --- a/gateway/src/node/mixnet_handling/mod.rs +++ b/gateway/src/node/mixnet_handling/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod receiver; diff --git a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs index 00fd98033b..d07dc6489e 100644 --- a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs +++ b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::client_handling::active_clients::ActiveClientsStore; use crate::node::client_handling::websocket::message_receiver::MixMessageSender; diff --git a/gateway/src/node/mixnet_handling/receiver/listener.rs b/gateway/src/node/mixnet_handling/receiver/listener.rs index 6714906ed7..9ca22c77af 100644 --- a/gateway/src/node/mixnet_handling/receiver/listener.rs +++ b/gateway/src/node/mixnet_handling/receiver/listener.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::mixnet_handling::receiver::connection_handler::ConnectionHandler; use crate::node::storage::Storage; diff --git a/gateway/src/node/mixnet_handling/receiver/mod.rs b/gateway/src/node/mixnet_handling/receiver/mod.rs index b733ce4e21..2304ed90f0 100644 --- a/gateway/src/node/mixnet_handling/receiver/mod.rs +++ b/gateway/src/node/mixnet_handling/receiver/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod connection_handler; pub(crate) mod listener; diff --git a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs index e7416c415c..7ac90bb174 100644 --- a/gateway/src/node/mixnet_handling/receiver/packet_processing.rs +++ b/gateway/src/node/mixnet_handling/receiver/packet_processing.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_crypto::asymmetric::encryption; use nym_mixnode_common::packet_processor::error::MixProcessingError; diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index d3764c635a..2c2940fc19 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use self::helpers::load_ip_packet_router_config; use self::storage::PersistentStorage; @@ -476,6 +476,13 @@ impl Gateway { }); } + self.start_client_websocket_listener( + mix_forwarding_channel.clone(), + active_clients_store.clone(), + shutdown.subscribe().named("websocket::Listener"), + Arc::new(coconut_verifier), + ); + let nr_request_filter = if self.config.network_requester.enabled { let embedded_nr = self .start_network_requester( @@ -496,7 +503,7 @@ impl Gateway { if self.config.ip_packet_router.enabled { let embedded_ip_sp = self .start_ip_packet_router( - mix_forwarding_channel.clone(), + mix_forwarding_channel, shutdown.subscribe().named("ip_service_provider"), ) .await?; @@ -513,13 +520,6 @@ impl Gateway { .with_maybe_network_request_filter(nr_request_filter) .start(shutdown.subscribe().named("http-api"))?; - self.start_client_websocket_listener( - mix_forwarding_channel, - active_clients_store, - shutdown.subscribe().named("websocket::Listener"), - Arc::new(coconut_verifier), - ); - // Once this is a bit more mature, make this a commandline flag instead of a compile time // flag #[cfg(feature = "wireguard")] diff --git a/gateway/src/node/statistics/collector.rs b/gateway/src/node/statistics/collector.rs index 4f1035d979..d82847509f 100644 --- a/gateway/src/node/statistics/collector.rs +++ b/gateway/src/node/statistics/collector.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use async_trait::async_trait; use sqlx::types::chrono::{DateTime, Utc}; diff --git a/gateway/src/node/statistics/mod.rs b/gateway/src/node/statistics/mod.rs index 3248ece682..eea54a1a85 100644 --- a/gateway/src/node/statistics/mod.rs +++ b/gateway/src/node/statistics/mod.rs @@ -1,4 +1,4 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub mod collector; diff --git a/gateway/src/node/storage/bandwidth.rs b/gateway/src/node/storage/bandwidth.rs index e2367b2ee1..536f9b69f0 100644 --- a/gateway/src/node/storage/bandwidth.rs +++ b/gateway/src/node/storage/bandwidth.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::models::PersistedBandwidth; diff --git a/gateway/src/node/storage/error.rs b/gateway/src/node/storage/error.rs index 306dafa557..b2feb1becf 100644 --- a/gateway/src/node/storage/error.rs +++ b/gateway/src/node/storage/error.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use thiserror::Error; diff --git a/gateway/src/node/storage/inboxes.rs b/gateway/src/node/storage/inboxes.rs index f67fac94b4..a24f962864 100644 --- a/gateway/src/node/storage/inboxes.rs +++ b/gateway/src/node/storage/inboxes.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::models::StoredMessage; diff --git a/gateway/src/node/storage/mod.rs b/gateway/src/node/storage/mod.rs index e4ae31ca19..77f87437ea 100644 --- a/gateway/src/node/storage/mod.rs +++ b/gateway/src/node/storage/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::bandwidth::BandwidthManager; use crate::node::storage::error::StorageError; diff --git a/gateway/src/node/storage/models.rs b/gateway/src/node/storage/models.rs index 58ea7e3306..c98fb4c26b 100644 --- a/gateway/src/node/storage/models.rs +++ b/gateway/src/node/storage/models.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) struct PersistedSharedKeys { pub(crate) client_address_bs58: String, diff --git a/gateway/src/node/storage/shared_keys.rs b/gateway/src/node/storage/shared_keys.rs index d40823fe96..d04ab12492 100644 --- a/gateway/src/node/storage/shared_keys.rs +++ b/gateway/src/node/storage/shared_keys.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::storage::models::PersistedSharedKeys; diff --git a/gateway/src/support/config.rs b/gateway/src/support/config.rs index ff6cc91789..deae3240de 100644 --- a/gateway/src/support/config.rs +++ b/gateway/src/support/config.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::helpers::{try_load_current_config, OverrideConfig}; use crate::config::Config; diff --git a/gateway/src/support/mod.rs b/gateway/src/support/mod.rs index 6c7248da0b..42dab6772b 100644 --- a/gateway/src/support/mod.rs +++ b/gateway/src/support/mod.rs @@ -1,4 +1,4 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod config; diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index 847e7a5cab..86973cb99d 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -1,8 +1,9 @@ # Copyright 2020 - Nym Technologies SA -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: GPL-3.0-only [package] name = "nym-mixnode" +license = "GPL-3" version = "1.1.33" authors = [ "Dave Hrycyszyn ", diff --git a/mixnode/README.md b/mixnode/README.md index 68fec99c6c..1e910946d6 100644 --- a/mixnode/README.md +++ b/mixnode/README.md @@ -1,12 +1,29 @@ # Nym Mixnode A Rust mixnode implementation. +## License + +Copyright (C) 2020 Nym Technologies SA + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + ## Usage * `nym-mixnode` prints a help message showing usage options diff --git a/mixnode/src/commands/build_info.rs b/mixnode/src/commands/build_info.rs index e3385bb933..3b763adf3f 100644 --- a/mixnode/src/commands/build_info.rs +++ b/mixnode/src/commands/build_info.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use clap::Args; use nym_bin_common::bin_info_owned; diff --git a/mixnode/src/commands/describe.rs b/mixnode/src/commands/describe.rs index 164ef9d740..5576296bcd 100644 --- a/mixnode/src/commands/describe.rs +++ b/mixnode/src/commands/describe.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::try_load_current_config; use crate::node::node_description::NodeDescription; diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index 31a45dfe96..3e678d3d4a 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::OverrideConfig; use crate::commands::override_config; diff --git a/mixnode/src/commands/mod.rs b/mixnode/src/commands/mod.rs index 068089f9d9..dfa1fcbd42 100644 --- a/mixnode/src/commands/mod.rs +++ b/mixnode/src/commands/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::default_config_filepath; use crate::error::MixnodeError; diff --git a/mixnode/src/commands/node_details.rs b/mixnode/src/commands/node_details.rs index c4b17c645f..24dc71cb2f 100644 --- a/mixnode/src/commands/node_details.rs +++ b/mixnode/src/commands/node_details.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::try_load_current_config; use crate::node::MixNode; diff --git a/mixnode/src/commands/run.rs b/mixnode/src/commands/run.rs index 0ca0550679..c4ab5125fb 100644 --- a/mixnode/src/commands/run.rs +++ b/mixnode/src/commands/run.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::OverrideConfig; use crate::commands::{override_config, try_load_current_config, version_check}; diff --git a/mixnode/src/commands/sign.rs b/mixnode/src/commands/sign.rs index 7864ef5504..2604a72d1c 100644 --- a/mixnode/src/commands/sign.rs +++ b/mixnode/src/commands/sign.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::commands::{try_load_current_config, validate_bech32_address_or_exit}; use crate::node::helpers::load_identity_keys; diff --git a/mixnode/src/commands/upgrade_helpers.rs b/mixnode/src/commands/upgrade_helpers.rs index cf64c27158..66b4a6ef4d 100644 --- a/mixnode/src/commands/upgrade_helpers.rs +++ b/mixnode/src/commands/upgrade_helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_21::ConfigV1_1_21; use crate::config::old_config_v1_1_32::ConfigV1_1_32; diff --git a/mixnode/src/config/mod.rs b/mixnode/src/config/mod.rs index 1046641feb..a1ab25a752 100644 --- a/mixnode/src/config/mod.rs +++ b/mixnode/src/config/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::persistence::paths::MixNodePaths; use crate::config::template::CONFIG_TEMPLATE; diff --git a/mixnode/src/config/old_config_v1_1_21.rs b/mixnode/src/config/old_config_v1_1_21.rs index fc4ae148a0..b8f5252893 100644 --- a/mixnode/src/config/old_config_v1_1_21.rs +++ b/mixnode/src/config/old_config_v1_1_21.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_32::{ ConfigV1_1_32, DebugV1_1_32, MixNodeV1_1_32, VerlocV1_1_32, diff --git a/mixnode/src/config/old_config_v1_1_32.rs b/mixnode/src/config/old_config_v1_1_32.rs index 92947a3234..a17cdeadcd 100644 --- a/mixnode/src/config/old_config_v1_1_32.rs +++ b/mixnode/src/config/old_config_v1_1_32.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::persistence::paths::MixNodePaths; use crate::config::{Config, Debug, MixNode, Verloc}; diff --git a/mixnode/src/config/persistence/mod.rs b/mixnode/src/config/persistence/mod.rs index cbaa92be3d..d2b55c30f5 100644 --- a/mixnode/src/config/persistence/mod.rs +++ b/mixnode/src/config/persistence/mod.rs @@ -1,4 +1,4 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub mod paths; diff --git a/mixnode/src/config/persistence/paths.rs b/mixnode/src/config/persistence/paths.rs index 95193e4212..ca5a571b35 100644 --- a/mixnode/src/config/persistence/paths.rs +++ b/mixnode/src/config/persistence/paths.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::{default_config_directory, default_data_directory}; use serde::{Deserialize, Serialize}; diff --git a/mixnode/src/config/template.rs b/mixnode/src/config/template.rs index b7f9433ae5..79a4dd72a8 100644 --- a/mixnode/src/config/template.rs +++ b/mixnode/src/config/template.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only // While using normal toml marshalling would have been way simpler with less overhead, // I think it's useful to have comments attached to the saved config file to explain behaviour of diff --git a/mixnode/src/error.rs b/mixnode/src/error.rs index a5f80b10d4..57c4594747 100644 --- a/mixnode/src/error.rs +++ b/mixnode/src/error.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use std::io; use std::path::PathBuf; diff --git a/mixnode/src/main.rs b/mixnode/src/main.rs index 34ca2d613f..d6383477cc 100644 --- a/mixnode/src/main.rs +++ b/mixnode/src/main.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use ::nym_config::defaults::setup_env; use clap::{crate_name, crate_version, Parser}; diff --git a/mixnode/src/node/helpers.rs b/mixnode/src/node/helpers.rs index 955f4f98fe..54515c053b 100644 --- a/mixnode/src/node/helpers.rs +++ b/mixnode/src/node/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::Config; use crate::error::MixnodeError; diff --git a/mixnode/src/node/http/legacy/description.rs b/mixnode/src/node/http/legacy/description.rs index 7c6ec2b580..29a648c0f2 100644 --- a/mixnode/src/node/http/legacy/description.rs +++ b/mixnode/src/node/http/legacy/description.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::node::node_description::NodeDescription; use axum::extract::Query; use nym_node::http::api::{FormattedResponse, OutputParams}; diff --git a/mixnode/src/node/http/legacy/hardware.rs b/mixnode/src/node/http/legacy/hardware.rs index c4e24b4911..496d034b0b 100644 --- a/mixnode/src/node/http/legacy/hardware.rs +++ b/mixnode/src/node/http/legacy/hardware.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use axum::extract::Query; use cupid::TopologyType; use nym_node::http::api::{FormattedResponse, OutputParams}; diff --git a/mixnode/src/node/http/legacy/mod.rs b/mixnode/src/node/http/legacy/mod.rs index 49230ebbec..94ed29fc6c 100644 --- a/mixnode/src/node/http/legacy/mod.rs +++ b/mixnode/src/node/http/legacy/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::http::legacy::description::description; use crate::node::http::legacy::hardware::hardware; diff --git a/mixnode/src/node/http/legacy/state.rs b/mixnode/src/node/http/legacy/state.rs index 2b3016185c..80cdaa01c0 100644 --- a/mixnode/src/node/http/legacy/state.rs +++ b/mixnode/src/node/http/legacy/state.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::http::legacy::verloc::VerlocState; use crate::node::node_statistics::SharedNodeStats; diff --git a/mixnode/src/node/http/legacy/stats.rs b/mixnode/src/node/http/legacy/stats.rs index 093932288a..b48358799b 100644 --- a/mixnode/src/node/http/legacy/stats.rs +++ b/mixnode/src/node/http/legacy/stats.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::node::node_statistics::{NodeStats, NodeStatsSimple, SharedNodeStats}; use axum::extract::{Query, State}; use nym_node::http::api::{FormattedResponse, Output}; diff --git a/mixnode/src/node/http/legacy/verloc.rs b/mixnode/src/node/http/legacy/verloc.rs index 18a263e713..eb5800bccc 100644 --- a/mixnode/src/node/http/legacy/verloc.rs +++ b/mixnode/src/node/http/legacy/verloc.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use axum::extract::{Query, State}; use nym_mixnode_common::verloc::{AtomicVerlocResult, VerlocResult}; use nym_node::http::api::{FormattedResponse, OutputParams}; diff --git a/mixnode/src/node/http/mod.rs b/mixnode/src/node/http/mod.rs index a3a0d49ce2..5147664c70 100644 --- a/mixnode/src/node/http/mod.rs +++ b/mixnode/src/node/http/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::config::Config; use crate::error::MixnodeError; use crate::node::http::legacy::verloc::VerlocState; diff --git a/mixnode/src/node/listener/connection_handler/mod.rs b/mixnode/src/node/listener/connection_handler/mod.rs index 8d0895cbea..c16a700bfd 100644 --- a/mixnode/src/node/listener/connection_handler/mod.rs +++ b/mixnode/src/node/listener/connection_handler/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::listener::connection_handler::packet_processing::{ MixProcessingResult, PacketProcessor, diff --git a/mixnode/src/node/listener/connection_handler/packet_processing.rs b/mixnode/src/node/listener/connection_handler/packet_processing.rs index 1d52602b1d..f849632f0f 100644 --- a/mixnode/src/node/listener/connection_handler/packet_processing.rs +++ b/mixnode/src/node/listener/connection_handler/packet_processing.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::node_statistics; use nym_crypto::asymmetric::encryption; diff --git a/mixnode/src/node/listener/mod.rs b/mixnode/src/node/listener/mod.rs index fc553b41ed..995a6e7c73 100644 --- a/mixnode/src/node/listener/mod.rs +++ b/mixnode/src/node/listener/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::listener::connection_handler::ConnectionHandler; use log::{error, info, warn}; diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index f1b330e69a..5dca2113dc 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::Config; use crate::error::MixnodeError; diff --git a/mixnode/src/node/node_description.rs b/mixnode/src/node/node_description.rs index 0c31a3e004..6c41b28f24 100644 --- a/mixnode/src/node/node_description.rs +++ b/mixnode/src/node/node_description.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use serde::Deserialize; use serde::Serialize; use std::path::Path; diff --git a/mixnode/src/node/node_statistics.rs b/mixnode/src/node/node_statistics.rs index 78895b85ce..be367dea96 100644 --- a/mixnode/src/node/node_statistics.rs +++ b/mixnode/src/node/node_statistics.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use super::TaskClient; use futures::channel::mpsc; use futures::lock::Mutex; diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index 0e7abfa793..2aa85d714c 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node::node_statistics::UpdateSender; use futures::channel::mpsc; diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index 3df641edcd..ad781f28e2 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -1,9 +1,10 @@ # Copyright 2020 - Nym Technologies SA -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: GPL-3.0-only [package] name = "nym-api" -version = "1.1.32" +license = "GPL-3" +version = "1.1.33" authors = [ "Dave Hrycyszyn ", "Jędrzej Stuczyński ", diff --git a/nym-api/README.md b/nym-api/README.md index 7d3d6c3b49..98c0be85ac 100644 --- a/nym-api/README.md +++ b/nym-api/README.md @@ -3,6 +3,23 @@ Nym API The Nym API provides multiple services to the Nym network, and is designed to be run alongside Nyxd validators. From a logical perspective, there are multiple applications, but they are bundled together for ease of deployment. +License +------- + +Copyright (C) 2023 Nym Technologies SA + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . Nym Directory Caching ---------------------- diff --git a/nym-api/src/circulating_supply_api/cache/data.rs b/nym-api/src/circulating_supply_api/cache/data.rs index 0ca5b7a23a..77ddbaaee2 100644 --- a/nym-api/src/circulating_supply_api/cache/data.rs +++ b/nym-api/src/circulating_supply_api/cache/data.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::caching::Cache; use nym_api_requests::models::CirculatingSupplyResponse; diff --git a/nym-api/src/circulating_supply_api/cache/mod.rs b/nym-api/src/circulating_supply_api/cache/mod.rs index a9f6279e8c..af5568b158 100644 --- a/nym-api/src/circulating_supply_api/cache/mod.rs +++ b/nym-api/src/circulating_supply_api/cache/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use self::data::CirculatingSupplyCacheData; use cosmwasm_std::Addr; diff --git a/nym-api/src/circulating_supply_api/cache/refresher.rs b/nym-api/src/circulating_supply_api/cache/refresher.rs index a5a301b0a6..f983390356 100644 --- a/nym-api/src/circulating_supply_api/cache/refresher.rs +++ b/nym-api/src/circulating_supply_api/cache/refresher.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::CirculatingSupplyCache; use crate::circulating_supply_api::cache::CirculatingSupplyCacheError; diff --git a/nym-api/src/circulating_supply_api/mod.rs b/nym-api/src/circulating_supply_api/mod.rs index ea8d4caea7..0449e9f09f 100644 --- a/nym-api/src/circulating_supply_api/mod.rs +++ b/nym-api/src/circulating_supply_api/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_task::TaskManager; use okapi::openapi3::OpenApi; diff --git a/nym-api/src/circulating_supply_api/routes.rs b/nym-api/src/circulating_supply_api/routes.rs index 2e590e4c8d..5bc76ab8bb 100644 --- a/nym-api/src/circulating_supply_api/routes.rs +++ b/nym-api/src/circulating_supply_api/routes.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::circulating_supply_api::cache::CirculatingSupplyCache; use crate::node_status_api::models::ErrorResponse; diff --git a/nym-api/src/coconut/client.rs b/nym-api/src/coconut/client.rs index 5849556c7b..adb132e1b1 100644 --- a/nym-api/src/coconut/client.rs +++ b/nym-api/src/coconut/client.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::error::Result; use cw3::ProposalResponse; diff --git a/nym-api/src/coconut/comm.rs b/nym-api/src/coconut/comm.rs index cf671defa1..9358af95be 100644 --- a/nym-api/src/coconut/comm.rs +++ b/nym-api/src/coconut/comm.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::error::Result; use crate::nyxd; diff --git a/nym-api/src/coconut/deposit.rs b/nym-api/src/coconut/deposit.rs index d92e5f1d5f..d7db423d60 100644 --- a/nym-api/src/coconut/deposit.rs +++ b/nym-api/src/coconut/deposit.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_api_requests::coconut::BlindSignRequestBody; use nym_coconut_bandwidth_contract_common::events::{ diff --git a/nym-api/src/coconut/dkg/client.rs b/nym-api/src/coconut/dkg/client.rs index cc0c98e4c8..0c62b6e8a4 100644 --- a/nym-api/src/coconut/dkg/client.rs +++ b/nym-api/src/coconut/dkg/client.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::client::Client; use crate::coconut::error::CoconutError; diff --git a/nym-api/src/coconut/dkg/complaints.rs b/nym-api/src/coconut/dkg/complaints.rs index 4ef0d32ce0..8b397f2564 100644 --- a/nym-api/src/coconut/dkg/complaints.rs +++ b/nym-api/src/coconut/dkg/complaints.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use serde::{Deserialize, Serialize}; diff --git a/nym-api/src/coconut/dkg/controller.rs b/nym-api/src/coconut/dkg/controller.rs index 027b8d2800..b85597a51a 100644 --- a/nym-api/src/coconut/dkg/controller.rs +++ b/nym-api/src/coconut/dkg/controller.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::dkg::client::DkgClient; use crate::coconut::dkg::state::{ConsistentState, PersistentState, State}; diff --git a/nym-api/src/coconut/dkg/dealing.rs b/nym-api/src/coconut/dkg/dealing.rs index 5ea676033c..5a05915b0a 100644 --- a/nym-api/src/coconut/dkg/dealing.rs +++ b/nym-api/src/coconut/dkg/dealing.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::dkg::client::DkgClient; use crate::coconut::dkg::state::{ConsistentState, State}; diff --git a/nym-api/src/coconut/dkg/mod.rs b/nym-api/src/coconut/dkg/mod.rs index 4149a3e236..ac82cf97c3 100644 --- a/nym-api/src/coconut/dkg/mod.rs +++ b/nym-api/src/coconut/dkg/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod client; pub(crate) mod complaints; diff --git a/nym-api/src/coconut/dkg/public_key.rs b/nym-api/src/coconut/dkg/public_key.rs index 802b8a5e43..74f3d5c9f3 100644 --- a/nym-api/src/coconut/dkg/public_key.rs +++ b/nym-api/src/coconut/dkg/public_key.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::dkg::client::DkgClient; use crate::coconut::dkg::state::State; diff --git a/nym-api/src/coconut/dkg/state.rs b/nym-api/src/coconut/dkg/state.rs index b50d6fa3d9..59aaec6416 100644 --- a/nym-api/src/coconut/dkg/state.rs +++ b/nym-api/src/coconut/dkg/state.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::dkg::complaints::ComplaintReason; use crate::coconut::error::CoconutError; diff --git a/nym-api/src/coconut/dkg/verification_key.rs b/nym-api/src/coconut/dkg/verification_key.rs index 1e5751eed3..4a59b5fa65 100644 --- a/nym-api/src/coconut/dkg/verification_key.rs +++ b/nym-api/src/coconut/dkg/verification_key.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::dkg::client::DkgClient; use crate::coconut::dkg::complaints::ComplaintReason; diff --git a/nym-api/src/coconut/error.rs b/nym-api/src/coconut/error.rs index e038e74723..14f7b2f933 100644 --- a/nym-api/src/coconut/error.rs +++ b/nym-api/src/coconut/error.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use rocket::http::{ContentType, Status}; use rocket::response::Responder; diff --git a/nym-api/src/coconut/helpers.rs b/nym-api/src/coconut/helpers.rs index 775e761fea..50afa84420 100644 --- a/nym-api/src/coconut/helpers.rs +++ b/nym-api/src/coconut/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::error::CoconutError; use nym_validator_client::nyxd::error::NyxdError::AbciError; diff --git a/nym-api/src/coconut/keypair.rs b/nym-api/src/coconut/keypair.rs index c1fa548fb4..ef27856c83 100644 --- a/nym-api/src/coconut/keypair.rs +++ b/nym-api/src/coconut/keypair.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use std::sync::Arc; use tokio::sync::{RwLock, RwLockReadGuard}; diff --git a/nym-api/src/coconut/mod.rs b/nym-api/src/coconut/mod.rs index 2f783d2a3a..7059e95160 100644 --- a/nym-api/src/coconut/mod.rs +++ b/nym-api/src/coconut/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use self::comm::APICommunicationChannel; use crate::coconut::client::Client as LocalClient; diff --git a/nym-api/src/coconut/tests.rs b/nym-api/src/coconut/tests.rs index 37153f1370..54af19dcae 100644 --- a/nym-api/src/coconut/tests.rs +++ b/nym-api/src/coconut/tests.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::InternalSignRequest; use crate::coconut::error::{CoconutError, Result}; @@ -29,7 +29,7 @@ use nym_validator_client::nym_api::routes::{ }; use nym_validator_client::nyxd::Coin; use nym_validator_client::nyxd::{ - AccountId, Algorithm, DeliverTx, Event, EventAttribute, Fee, Hash, TxResponse, + AccountId, Algorithm, Event, EventAttribute, ExecTxResult, Fee, Hash, TxResponse, }; use crate::coconut::State; @@ -490,7 +490,7 @@ pub fn tx_entry_fixture(tx_hash: &str) -> TxResponse { hash: Hash::from_str(tx_hash).unwrap(), height: Default::default(), index: 0, - tx_result: DeliverTx { + tx_result: ExecTxResult { code: Default::default(), data: Default::default(), log: Default::default(), diff --git a/nym-api/src/ephemera/application.rs b/nym-api/src/ephemera/application.rs index 06c1c016d8..d0256710b1 100644 --- a/nym-api/src/ephemera/application.rs +++ b/nym-api/src/ephemera/application.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use ephemera::{ configuration::Configuration, ephemera_api::{ diff --git a/nym-api/src/ephemera/client.rs b/nym-api/src/ephemera/client.rs index 146153759a..907f88000b 100644 --- a/nym-api/src/ephemera/client.rs +++ b/nym-api/src/ephemera/client.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::ephemera::error::Result; use nym_ephemera_common::types::JsonPeerInfo; diff --git a/nym-api/src/ephemera/epoch.rs b/nym-api/src/ephemera/epoch.rs index a588a478c2..2aa0337321 100644 --- a/nym-api/src/ephemera/epoch.rs +++ b/nym-api/src/ephemera/epoch.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::support::nyxd; use chrono::{DateTime, NaiveDateTime, Timelike, Utc}; use log::info; diff --git a/nym-api/src/ephemera/error.rs b/nym-api/src/ephemera/error.rs index e8dd0b6ace..ba2dfc2ce4 100644 --- a/nym-api/src/ephemera/error.rs +++ b/nym-api/src/ephemera/error.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use thiserror::Error; diff --git a/nym-api/src/ephemera/metrics/mod.rs b/nym-api/src/ephemera/metrics/mod.rs index cd408564ea..3f8575b2c1 100644 --- a/nym-api/src/ephemera/metrics/mod.rs +++ b/nym-api/src/ephemera/metrics/mod.rs @@ -1 +1,4 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + pub mod types; diff --git a/nym-api/src/ephemera/metrics/types.rs b/nym-api/src/ephemera/metrics/types.rs index eb549a2360..74e818cd0f 100644 --- a/nym-api/src/ephemera/metrics/types.rs +++ b/nym-api/src/ephemera/metrics/types.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + #[derive(Debug)] pub struct MixnodeResult { pub mix_id: u32, diff --git a/nym-api/src/ephemera/mod.rs b/nym-api/src/ephemera/mod.rs index d6960fcba5..f9134e7e46 100644 --- a/nym-api/src/ephemera/mod.rs +++ b/nym-api/src/ephemera/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only extern crate core; diff --git a/nym-api/src/ephemera/peers/members.rs b/nym-api/src/ephemera/peers/members.rs index c0ff8e286e..22cfccd68c 100644 --- a/nym-api/src/ephemera/peers/members.rs +++ b/nym-api/src/ephemera/peers/members.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::ephemera::client::Client; use crate::ephemera::peers::NymPeer; diff --git a/nym-api/src/ephemera/peers/mod.rs b/nym-api/src/ephemera/peers/mod.rs index 0706c51fde..29613e0060 100644 --- a/nym-api/src/ephemera/peers/mod.rs +++ b/nym-api/src/ephemera/peers/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use std::collections::HashMap; use std::str::FromStr; diff --git a/nym-api/src/ephemera/reward/aggregator.rs b/nym-api/src/ephemera/reward/aggregator.rs index e83119c4f3..9c94e2c518 100644 --- a/nym-api/src/ephemera/reward/aggregator.rs +++ b/nym-api/src/ephemera/reward/aggregator.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use cosmwasm_std::Decimal; use log::{info, trace}; use nym_mixnet_contract_common::reward_params::Performance; diff --git a/nym-api/src/ephemera/reward/mod.rs b/nym-api/src/ephemera/reward/mod.rs index e4e815a9e4..3e4385fc7e 100644 --- a/nym-api/src/ephemera/reward/mod.rs +++ b/nym-api/src/ephemera/reward/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use async_trait::async_trait; use log::{debug, info, trace}; use std::time::Duration; diff --git a/nym-api/src/epoch_operations/error.rs b/nym-api/src/epoch_operations/error.rs index e92d28700f..a9f0c8ad99 100644 --- a/nym-api/src/epoch_operations/error.rs +++ b/nym-api/src/epoch_operations/error.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_status_api::models::NymApiStorageError; use nym_mixnet_contract_common::{EpochState, MixId}; diff --git a/nym-api/src/epoch_operations/event_reconciliation.rs b/nym-api/src/epoch_operations/event_reconciliation.rs index 0279f96b21..47230463c9 100644 --- a/nym-api/src/epoch_operations/event_reconciliation.rs +++ b/nym-api/src/epoch_operations/event_reconciliation.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::epoch_operations::error::RewardingError; use crate::RewardedSetUpdater; diff --git a/nym-api/src/epoch_operations/helpers.rs b/nym-api/src/epoch_operations/helpers.rs index 929cbac770..4724f14361 100644 --- a/nym-api/src/epoch_operations/helpers.rs +++ b/nym-api/src/epoch_operations/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::epoch_operations::RewardedSetUpdater; use cosmwasm_std::{Decimal, Fraction}; diff --git a/nym-api/src/epoch_operations/mod.rs b/nym-api/src/epoch_operations/mod.rs index aa88d0aa66..7f5afbfc9e 100644 --- a/nym-api/src/epoch_operations/mod.rs +++ b/nym-api/src/epoch_operations/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only // there is couple of reasons for putting this in a separate module: // 1. I didn't feel it fit well in nym contract "cache". It seems like purpose of cache is to just keep updating local data diff --git a/nym-api/src/epoch_operations/rewarded_set_assignment.rs b/nym-api/src/epoch_operations/rewarded_set_assignment.rs index 12bc33eaae..08a794768c 100644 --- a/nym-api/src/epoch_operations/rewarded_set_assignment.rs +++ b/nym-api/src/epoch_operations/rewarded_set_assignment.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::epoch_operations::error::RewardingError; use crate::epoch_operations::helpers::stake_to_f64; @@ -24,7 +24,15 @@ struct MixnodeWithStakeAndPerformance { impl MixnodeWithStakeAndPerformance { fn to_selection_weight(&self) -> f64 { - let scaled_stake = self.total_stake * self.performance; + let scaled_performance = match self.performance.checked_pow(20) { + Ok(perf) => perf, + Err(overflow) => { + warn!("the node's performance ({}) has overflow while scaling it by the factor of 20: {overflow}. Setting it to 0 instead.", self.performance); + return 0.; + } + }; + + let scaled_stake = self.total_stake * scaled_performance; stake_to_f64(scaled_stake) } } diff --git a/nym-api/src/epoch_operations/rewarding.rs b/nym-api/src/epoch_operations/rewarding.rs index 56084a3dfd..2f8ae6160b 100644 --- a/nym-api/src/epoch_operations/rewarding.rs +++ b/nym-api/src/epoch_operations/rewarding.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::epoch_operations::error::RewardingError; use crate::epoch_operations::helpers::MixnodeWithPerformance; diff --git a/nym-api/src/epoch_operations/transition_beginning.rs b/nym-api/src/epoch_operations/transition_beginning.rs index 4df4ed7dfe..f6e8f87b6a 100644 --- a/nym-api/src/epoch_operations/transition_beginning.rs +++ b/nym-api/src/epoch_operations/transition_beginning.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::epoch_operations::error::RewardingError; use crate::epoch_operations::RewardedSetUpdater; diff --git a/nym-api/src/main.rs b/nym-api/src/main.rs index bdba273138..20982ef087 100644 --- a/nym-api/src/main.rs +++ b/nym-api/src/main.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only #[macro_use] extern crate rocket; diff --git a/nym-api/src/network/mod.rs b/nym-api/src/network/mod.rs index b0264f092c..ed60de4a39 100644 --- a/nym-api/src/network/mod.rs +++ b/nym-api/src/network/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use okapi::openapi3::OpenApi; use rocket::Route; diff --git a/nym-api/src/network/models.rs b/nym-api/src/network/models.rs index 518b4352f1..5a86ea6401 100644 --- a/nym-api/src/network/models.rs +++ b/nym-api/src/network/models.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_config::defaults::NymNetworkDetails; use schemars::JsonSchema; diff --git a/nym-api/src/network/routes.rs b/nym-api/src/network/routes.rs index 05dd0b8524..73625f8b88 100644 --- a/nym-api/src/network/routes.rs +++ b/nym-api/src/network/routes.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network::models::{ContractInformation, NetworkDetails}; use crate::nym_contract_cache::cache::NymContractCache; diff --git a/nym-api/src/network_monitor/chunker.rs b/nym-api/src/network_monitor/chunker.rs index 1e1f4d0d4d..ec91577866 100644 --- a/nym-api/src/network_monitor/chunker.rs +++ b/nym-api/src/network_monitor/chunker.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_sphinx::forwarding::packet::MixPacket; use nym_sphinx::message::NymMessage; diff --git a/nym-api/src/network_monitor/gateways_reader.rs b/nym-api/src/network_monitor/gateways_reader.rs index 37a6fba194..01bec7c52a 100644 --- a/nym-api/src/network_monitor/gateways_reader.rs +++ b/nym-api/src/network_monitor/gateways_reader.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use futures::Stream; use nym_crypto::asymmetric::identity; diff --git a/nym-api/src/network_monitor/mod.rs b/nym-api/src/network_monitor/mod.rs index ae49caf020..29298be436 100644 --- a/nym-api/src/network_monitor/mod.rs +++ b/nym-api/src/network_monitor/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::preparer::PacketPreparer; use crate::network_monitor::monitor::processor::{ diff --git a/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs b/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs index 9895f18a5a..4a321d57cd 100644 --- a/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs +++ b/nym-api/src/network_monitor/monitor/gateway_clients_cache.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::nyxd; use nym_credential_storage::persistent_storage::PersistentStorage; diff --git a/nym-api/src/network_monitor/monitor/gateways_pinger.rs b/nym-api/src/network_monitor/monitor/gateways_pinger.rs index 4d0a0e7f0e..a114088024 100644 --- a/nym-api/src/network_monitor/monitor/gateways_pinger.rs +++ b/nym-api/src/network_monitor/monitor/gateways_pinger.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::gateway_clients_cache::ActiveGatewayClients; use crate::network_monitor::monitor::receiver::{GatewayClientUpdate, GatewayClientUpdateSender}; diff --git a/nym-api/src/network_monitor/monitor/mod.rs b/nym-api/src/network_monitor/monitor/mod.rs index 126a2f1a5f..e4c35d8f4f 100644 --- a/nym-api/src/network_monitor/monitor/mod.rs +++ b/nym-api/src/network_monitor/monitor/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::preparer::PacketPreparer; use crate::network_monitor::monitor::processor::ReceivedProcessor; diff --git a/nym-api/src/network_monitor/monitor/preparer.rs b/nym-api/src/network_monitor/monitor/preparer.rs index 8b49055476..7ebfe825e0 100644 --- a/nym-api/src/network_monitor/monitor/preparer.rs +++ b/nym-api/src/network_monitor/monitor/preparer.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::sender::GatewayPackets; use crate::network_monitor::test_route::TestRoute; diff --git a/nym-api/src/network_monitor/monitor/processor.rs b/nym-api/src/network_monitor/monitor/processor.rs index 0e38eebd0b..84ac4b3aeb 100644 --- a/nym-api/src/network_monitor/monitor/processor.rs +++ b/nym-api/src/network_monitor/monitor/processor.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::gateways_reader::GatewayMessages; use crate::network_monitor::test_packet::{NodeTestMessage, NymApiTestMessageExt}; diff --git a/nym-api/src/network_monitor/monitor/receiver.rs b/nym-api/src/network_monitor/monitor/receiver.rs index 344f8193b7..be835fcc41 100644 --- a/nym-api/src/network_monitor/monitor/receiver.rs +++ b/nym-api/src/network_monitor/monitor/receiver.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::gateways_reader::{GatewayMessages, GatewaysReader}; use crate::network_monitor::monitor::processor::ReceivedProcessorSender; diff --git a/nym-api/src/network_monitor/monitor/sender.rs b/nym-api/src/network_monitor/monitor/sender.rs index ef3bda31af..d2d99e7462 100644 --- a/nym-api/src/network_monitor/monitor/sender.rs +++ b/nym-api/src/network_monitor/monitor/sender.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::gateway_clients_cache::{ ActiveGatewayClients, GatewayClientHandle, diff --git a/nym-api/src/network_monitor/monitor/summary_producer.rs b/nym-api/src/network_monitor/monitor/summary_producer.rs index 2a68004e7b..1faca33238 100644 --- a/nym-api/src/network_monitor/monitor/summary_producer.rs +++ b/nym-api/src/network_monitor/monitor/summary_producer.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::preparer::InvalidNode; use crate::network_monitor::test_packet::NodeTestMessage; diff --git a/nym-api/src/network_monitor/test_packet.rs b/nym-api/src/network_monitor/test_packet.rs index 289172d89b..6e5c433ff8 100644 --- a/nym-api/src/network_monitor/test_packet.rs +++ b/nym-api/src/network_monitor/test_packet.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_node_tester_utils::error::NetworkTestingError; use nym_node_tester_utils::TestMessage; diff --git a/nym-api/src/network_monitor/test_route/mod.rs b/nym-api/src/network_monitor/test_route/mod.rs index 48eede18b5..477251f80d 100644 --- a/nym-api/src/network_monitor/test_route/mod.rs +++ b/nym-api/src/network_monitor/test_route/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::test_packet::NymApiTestMessageExt; use crate::network_monitor::ROUTE_TESTING_TEST_NONCE; diff --git a/nym-api/src/node_describe_cache/mod.rs b/nym-api/src/node_describe_cache/mod.rs index e0acd12bf4..0a11a5224a 100644 --- a/nym-api/src/node_describe_cache/mod.rs +++ b/nym-api/src/node_describe_cache/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::nym_contract_cache::cache::NymContractCache; use crate::support::caching::cache::{SharedCache, UninitialisedCache}; diff --git a/nym-api/src/node_status_api/cache/data.rs b/nym-api/src/node_status_api/cache/data.rs index b1fb52ea6e..2b828420f6 100644 --- a/nym-api/src/node_status_api/cache/data.rs +++ b/nym-api/src/node_status_api/cache/data.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use nym_api_requests::models::{GatewayBondAnnotated, MixNodeBondAnnotated}; use crate::support::caching::Cache; diff --git a/nym-api/src/node_status_api/cache/inclusion_probabilities.rs b/nym-api/src/node_status_api/cache/inclusion_probabilities.rs index 7a59de4145..4d53793d36 100644 --- a/nym-api/src/node_status_api/cache/inclusion_probabilities.rs +++ b/nym-api/src/node_status_api/cache/inclusion_probabilities.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use nym_api_requests::models::InclusionProbability; use nym_contracts_common::truncate_decimal; use nym_mixnet_contract_common::{MixId, MixNodeDetails, RewardingParams}; diff --git a/nym-api/src/node_status_api/cache/mod.rs b/nym-api/src/node_status_api/cache/mod.rs index c1f2d93c61..b563afb6a0 100644 --- a/nym-api/src/node_status_api/cache/mod.rs +++ b/nym-api/src/node_status_api/cache/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::caching::Cache; diff --git a/nym-api/src/node_status_api/cache/node_sets.rs b/nym-api/src/node_status_api/cache/node_sets.rs index f871505016..ed20298887 100644 --- a/nym-api/src/node_status_api/cache/node_sets.rs +++ b/nym-api/src/node_status_api/cache/node_sets.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::node_status_api::reward_estimate::{compute_apy_from_reward, compute_reward_estimate}; use crate::support::storage::NymApiStorage; use nym_api_requests::models::{GatewayBondAnnotated, MixNodeBondAnnotated, NodePerformance}; diff --git a/nym-api/src/node_status_api/cache/refresher.rs b/nym-api/src/node_status_api/cache/refresher.rs index 7e84ea2ee8..e1dd3896f0 100644 --- a/nym-api/src/node_status_api/cache/refresher.rs +++ b/nym-api/src/node_status_api/cache/refresher.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use super::NodeStatusCache; use crate::{ node_status_api::cache::{ diff --git a/nym-api/src/node_status_api/helpers.rs b/nym-api/src/node_status_api/helpers.rs index 8fd24679de..894391253d 100644 --- a/nym-api/src/node_status_api/helpers.rs +++ b/nym-api/src/node_status_api/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_status_api::models::ErrorResponse; use crate::storage::NymApiStorage; diff --git a/nym-api/src/node_status_api/local_guard.rs b/nym-api/src/node_status_api/local_guard.rs index e9256a5d9c..fbbe8e27ec 100644 --- a/nym-api/src/node_status_api/local_guard.rs +++ b/nym-api/src/node_status_api/local_guard.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use rocket::http::Status; use rocket::request::{FromRequest, Outcome}; diff --git a/nym-api/src/node_status_api/mod.rs b/nym-api/src/node_status_api/mod.rs index c87b7e5b1c..dc6e34b779 100644 --- a/nym-api/src/node_status_api/mod.rs +++ b/nym-api/src/node_status_api/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use self::cache::refresher::NodeStatusCacheRefresher; use crate::support::config; diff --git a/nym-api/src/node_status_api/models.rs b/nym-api/src/node_status_api/models.rs index b1cb8cd79b..ca5e4fd6d1 100644 --- a/nym-api/src/node_status_api/models.rs +++ b/nym-api/src/node_status_api/models.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_status_api::utils::NodeUptimes; use crate::storage::models::NodeStatus; diff --git a/nym-api/src/node_status_api/reward_estimate.rs b/nym-api/src/node_status_api/reward_estimate.rs index e6166dae8c..e9bd60ba09 100644 --- a/nym-api/src/node_status_api/reward_estimate.rs +++ b/nym-api/src/node_status_api/reward_estimate.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use cosmwasm_std::Decimal; use nym_mixnet_contract_common::mixnode::MixNodeDetails; diff --git a/nym-api/src/node_status_api/routes.rs b/nym-api/src/node_status_api/routes.rs index 18ea70701e..466b10f883 100644 --- a/nym-api/src/node_status_api/routes.rs +++ b/nym-api/src/node_status_api/routes.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::helpers::_get_gateways_detailed; use super::NodeStatusCache; diff --git a/nym-api/src/node_status_api/uptime_updater.rs b/nym-api/src/node_status_api/uptime_updater.rs index 78d4116e11..fc09185b53 100644 --- a/nym-api/src/node_status_api/uptime_updater.rs +++ b/nym-api/src/node_status_api/uptime_updater.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_status_api::models::{ GatewayStatusReport, MixnodeStatusReport, NymApiStorageError, diff --git a/nym-api/src/node_status_api/utils.rs b/nym-api/src/node_status_api/utils.rs index da824188b9..54d5b50d9a 100644 --- a/nym-api/src/node_status_api/utils.rs +++ b/nym-api/src/node_status_api/utils.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_status_api::models::Uptime; use crate::node_status_api::{FIFTEEN_MINUTES, ONE_HOUR}; diff --git a/nym-api/src/nym_contract_cache/cache/data.rs b/nym-api/src/nym_contract_cache/cache/data.rs index ede4bc6838..91852658ba 100644 --- a/nym-api/src/nym_contract_cache/cache/data.rs +++ b/nym-api/src/nym_contract_cache/cache/data.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::caching::Cache; use nym_contracts_common::ContractBuildInformation; diff --git a/nym-api/src/nym_contract_cache/cache/mod.rs b/nym-api/src/nym_contract_cache/cache/mod.rs index 250ba423ac..f5ed467d37 100644 --- a/nym-api/src/nym_contract_cache/cache/mod.rs +++ b/nym-api/src/nym_contract_cache/cache/mod.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use crate::nym_contract_cache::cache::data::CachedContractsInfo; use crate::support::caching::Cache; use data::ValidatorCacheData; diff --git a/nym-api/src/nym_contract_cache/cache/refresher.rs b/nym-api/src/nym_contract_cache/cache/refresher.rs index e1fa5cf18f..bc99ba299f 100644 --- a/nym-api/src/nym_contract_cache/cache/refresher.rs +++ b/nym-api/src/nym_contract_cache/cache/refresher.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use super::NymContractCache; use crate::nym_contract_cache::cache::data::{CachedContractInfo, CachedContractsInfo}; use crate::nyxd::Client; diff --git a/nym-api/src/nym_contract_cache/mod.rs b/nym-api/src/nym_contract_cache/mod.rs index a88b88165c..280bdb5534 100644 --- a/nym-api/src/nym_contract_cache/mod.rs +++ b/nym-api/src/nym_contract_cache/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::nym_contract_cache::cache::NymContractCache; use crate::support::{self, config, nyxd}; diff --git a/nym-api/src/nym_contract_cache/routes.rs b/nym-api/src/nym_contract_cache/routes.rs index 9840e51e97..01fbab47ac 100644 --- a/nym-api/src/nym_contract_cache/routes.rs +++ b/nym-api/src/nym_contract_cache/routes.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::{ node_status_api::{ diff --git a/nym-api/src/nym_nodes/mod.rs b/nym-api/src/nym_nodes/mod.rs index 4e2a10c5b0..54e28db421 100644 --- a/nym-api/src/nym_nodes/mod.rs +++ b/nym-api/src/nym_nodes/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use okapi::openapi3::OpenApi; use rocket::Route; diff --git a/nym-api/src/nym_nodes/routes.rs b/nym-api/src/nym_nodes/routes.rs index cad4549b45..1df0250844 100644 --- a/nym-api/src/nym_nodes/routes.rs +++ b/nym-api/src/nym_nodes/routes.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::node_describe_cache::DescribedNodes; use crate::nym_contract_cache::cache::NymContractCache; diff --git a/nym-api/src/support/caching/cache.rs b/nym-api/src/support/caching/cache.rs index d330d2f667..fc33124f12 100644 --- a/nym-api/src/support/caching/cache.rs +++ b/nym-api/src/support/caching/cache.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use std::ops::Deref; use std::sync::Arc; diff --git a/nym-api/src/support/caching/mod.rs b/nym-api/src/support/caching/mod.rs index 7d647c6666..babc6375d1 100644 --- a/nym-api/src/support/caching/mod.rs +++ b/nym-api/src/support/caching/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod cache; pub(crate) mod refresher; diff --git a/nym-api/src/support/caching/refresher.rs b/nym-api/src/support/caching/refresher.rs index bb0435a6cf..6d32bb4f5a 100644 --- a/nym-api/src/support/caching/refresher.rs +++ b/nym-api/src/support/caching/refresher.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::caching::cache::SharedCache; use nym_task::TaskClient; diff --git a/nym-api/src/support/cli/build_info.rs b/nym-api/src/support/cli/build_info.rs index a40e0fe07e..566d59aa15 100644 --- a/nym-api/src/support/cli/build_info.rs +++ b/nym-api/src/support/cli/build_info.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_bin_common::bin_info_owned; use nym_bin_common::output_format::OutputFormat; diff --git a/nym-api/src/support/cli/mod.rs b/nym-api/src/support/cli/mod.rs index 899b3e9939..c339d52668 100644 --- a/nym-api/src/support/cli/mod.rs +++ b/nym-api/src/support/cli/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::config::Config; use crate::support::config::default_config_filepath; diff --git a/nym-api/src/support/cli/run.rs b/nym-api/src/support/cli/run.rs index e953471296..cb98eab5c4 100644 --- a/nym-api/src/support/cli/run.rs +++ b/nym-api/src/support/cli/run.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::start_nym_api_tasks; use crate::support::cli::build_config; diff --git a/nym-api/src/support/config/helpers.rs b/nym-api/src/support/config/helpers.rs index 1c84a5e837..e04c152c20 100644 --- a/nym-api/src/support/config/helpers.rs +++ b/nym-api/src/support/config/helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::config::old_config_v1_1_21::ConfigV1_1_21; use crate::support::config::old_config_v1_1_27::ConfigV1_1_27; diff --git a/nym-api/src/support/config/mod.rs b/nym-api/src/support/config/mod.rs index 43eb0ddf8a..6431ef611b 100644 --- a/nym-api/src/support/config/mod.rs +++ b/nym-api/src/support/config/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::config::persistence::{ CoconutSignerPaths, NetworkMonitorPaths, NodeStatusAPIPaths, diff --git a/nym-api/src/support/config/old_config_v1_1_21.rs b/nym-api/src/support/config/old_config_v1_1_21.rs index be8c06d7c8..3eee079a53 100644 --- a/nym-api/src/support/config/old_config_v1_1_21.rs +++ b/nym-api/src/support/config/old_config_v1_1_21.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::config::persistence::{ CoconutSignerPaths, NetworkMonitorPaths, NodeStatusAPIPaths, 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 index 3bfb4b8581..3243147bc4 100644 --- a/nym-api/src/support/config/old_config_v1_1_27.rs +++ b/nym-api/src/support/config/old_config_v1_1_27.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::config::persistence::{ CoconutSignerPaths, NetworkMonitorPaths, NodeStatusAPIPaths, diff --git a/nym-api/src/support/config/persistence.rs b/nym-api/src/support/config/persistence.rs index 9914705ae6..7d4e58190a 100644 --- a/nym-api/src/support/config/persistence.rs +++ b/nym-api/src/support/config/persistence.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::support::config::default_data_directory; use serde::{Deserialize, Serialize}; diff --git a/nym-api/src/support/config/template.rs b/nym-api/src/support/config/template.rs index 32d4f5e087..88b0fb85d7 100644 --- a/nym-api/src/support/config/template.rs +++ b/nym-api/src/support/config/template.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) const CONFIG_TEMPLATE: &str = r#" # This is a TOML config file. diff --git a/nym-api/src/support/http/mod.rs b/nym-api/src/support/http/mod.rs index 5d0b646107..be46cb73d6 100644 --- a/nym-api/src/support/http/mod.rs +++ b/nym-api/src/support/http/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::circulating_supply_api::cache::CirculatingSupplyCache; use crate::coconut::{self, comm::QueryCommunicationChannel, InternalSignRequest}; diff --git a/nym-api/src/support/http/openapi.rs b/nym-api/src/support/http/openapi.rs index bda05b0c7a..858d201dc7 100644 --- a/nym-api/src/support/http/openapi.rs +++ b/nym-api/src/support/http/openapi.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use okapi::openapi3::OpenApi; use rocket_okapi::swagger_ui::SwaggerUIConfig; diff --git a/nym-api/src/support/mod.rs b/nym-api/src/support/mod.rs index 322c3625b3..28abaf3b94 100644 --- a/nym-api/src/support/mod.rs +++ b/nym-api/src/support/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) mod caching; pub(crate) mod cli; diff --git a/nym-api/src/support/nyxd/mod.rs b/nym-api/src/support/nyxd/mod.rs index 790be3ca31..6a062352ee 100644 --- a/nym-api/src/support/nyxd/mod.rs +++ b/nym-api/src/support/nyxd/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::coconut::error::CoconutError; use crate::epoch_operations::MixnodeWithPerformance; diff --git a/nym-api/src/support/storage/manager.rs b/nym-api/src/support/storage/manager.rs index 737cb1cfab..2bb3fa5c99 100644 --- a/nym-api/src/support/storage/manager.rs +++ b/nym-api/src/support/storage/manager.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::summary_producer::{GatewayResult, MixnodeResult}; use crate::node_status_api::models::{HistoricalUptime, Uptime}; use crate::node_status_api::utils::{ActiveGatewayStatuses, ActiveMixnodeStatuses}; diff --git a/nym-api/src/support/storage/mod.rs b/nym-api/src/support/storage/mod.rs index c4f6d8e294..4ae899aac1 100644 --- a/nym-api/src/support/storage/mod.rs +++ b/nym-api/src/support/storage/mod.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::network_monitor::monitor::summary_producer::{GatewayResult, MixnodeResult}; use crate::network_monitor::test_route::TestRoute; diff --git a/nym-api/src/support/storage/models.rs b/nym-api/src/support/storage/models.rs index 69d3554ca1..a07a11176c 100644 --- a/nym-api/src/support/storage/models.rs +++ b/nym-api/src/support/storage/models.rs @@ -1,5 +1,5 @@ // Copyright 2021 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_mixnet_contract_common::MixId; diff --git a/nym-connect/desktop/Cargo.lock b/nym-connect/desktop/Cargo.lock index e3a9fce4c2..9a9e99dc92 100644 --- a/nym-connect/desktop/Cargo.lock +++ b/nym-connect/desktop/Cargo.lock @@ -705,9 +705,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -1068,9 +1068,9 @@ dependencies = [ [[package]] name = "cosmos-sdk-proto" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c" +checksum = "32560304ab4c365791fd307282f76637213d8083c1a98490c35159cd67852237" dependencies = [ "prost", "prost-types", @@ -1079,19 +1079,19 @@ dependencies = [ [[package]] name = "cosmrs" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6" +checksum = "47126f5364df9387b9d8559dcef62e99010e1d4098f39eb3f7ee4b5c254e40ea" dependencies = [ "bip32", "cosmos-sdk-proto", "ecdsa 0.16.8", "eyre", - "getrandom 0.2.10", "k256 0.13.1", "rand_core 0.6.4", "serde", "serde_json", + "signature 2.1.0", "subtle-encoding", "tendermint", "tendermint-rpc", @@ -1347,15 +1347,6 @@ dependencies = [ "syn 2.0.28", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct 0.6.1", -] - [[package]] name = "ctor" version = "0.1.26" @@ -2883,31 +2874,6 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "headers" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.3" @@ -3120,40 +3086,17 @@ dependencies = [ ] [[package]] -name = "hyper-proxy" -version = "0.9.1" +name = "hyper-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ - "bytes", - "futures", - "headers", + "futures-util", "http", "hyper", - "hyper-rustls", - "rustls-native-certs", + "rustls 0.21.7", "tokio", - "tokio-rustls 0.22.0", - "tower-service", - "webpki 0.21.4", -] - -[[package]] -name = "hyper-rustls" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" -dependencies = [ - "ct-logs", - "futures-util", - "hyper", - "log", - "rustls 0.19.1", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.22.0", - "webpki 0.21.4", - "webpki-roots 0.21.1", + "tokio-rustls 0.24.1", ] [[package]] @@ -3468,9 +3411,7 @@ dependencies = [ "cfg-if", "ecdsa 0.16.8", "elliptic-curve 0.13.5", - "once_cell", "sha2 0.10.8", - "signature 2.1.0", ] [[package]] @@ -4761,6 +4702,7 @@ version = "0.1.0" dependencies = [ "async-trait", "base64 0.13.1", + "bip32", "bip39", "colored 2.0.4", "cosmrs", @@ -4822,10 +4764,15 @@ version = "0.1.0" dependencies = [ "base64 0.21.4", "boringtun", + "bytes", "dashmap", + "ip_network", + "ip_network_table", + "log", "nym-crypto", "serde", "thiserror", + "tokio", "x25519-dalek 2.0.0", ] @@ -5488,9 +5435,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" dependencies = [ "bytes", "prost-derive", @@ -5498,22 +5445,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ "prost", ] @@ -5770,6 +5717,7 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -5779,12 +5727,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.21.7", + "rustls-native-certs", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", "tokio-native-tls", + "tokio-rustls 0.24.1", "tokio-socks", "tokio-util", "tower-service", @@ -5968,13 +5920,25 @@ dependencies = [ ] [[package]] -name = "rustls-native-certs" -version = "0.5.0" +name = "rustls" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls 0.19.1", + "rustls-pemfile", "schannel", "security-framework", ] @@ -5988,6 +5952,16 @@ dependencies = [ "base64 0.21.4", ] +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted 0.7.1", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -7340,9 +7314,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0" +checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" dependencies = [ "bytes", "digest 0.10.7", @@ -7371,9 +7345,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372" +checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" dependencies = [ "flex-error", "serde", @@ -7385,9 +7359,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d" +checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" dependencies = [ "bytes", "flex-error", @@ -7403,21 +7377,18 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129" +checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" dependencies = [ "async-trait", "bytes", "flex-error", "futures", "getrandom 0.2.10", - "http", - "hyper", - "hyper-proxy", - "hyper-rustls", "peg", "pin-project", + "reqwest", "semver 1.0.18", "serde", "serde_bytes", @@ -7599,6 +7570,16 @@ dependencies = [ "webpki 0.22.2", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -7922,9 +7903,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", diff --git a/nym-node/Cargo.toml b/nym-node/Cargo.toml index a539c211ad..07d976e94a 100644 --- a/nym-node/Cargo.toml +++ b/nym-node/Cargo.toml @@ -1,3 +1,6 @@ +# Copyright 2023 - Nym Technologies SA +# SPDX-License-Identifier: GPL-3.0-only + [package] name = "nym-node" version = "0.1.0" @@ -6,7 +9,7 @@ repository.workspace = true homepage.workspace = true documentation.workspace = true edition.workspace = true -license.workspace = true +license = "GPL-3" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/nym-node/src/config/mod.rs b/nym-node/src/config/mod.rs index c6a6610d4b..3b712f2e63 100644 --- a/nym-node/src/config/mod.rs +++ b/nym-node/src/config/mod.rs @@ -1,8 +1,7 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only -use nym_config::defaults::DEFAULT_NYM_NODE_HTTP_PORT; -use nym_wireguard_types::WG_PORT; +use nym_config::defaults::{DEFAULT_NYM_NODE_HTTP_PORT, WG_PORT}; use serde::{Deserialize, Serialize}; use serde_helpers::*; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; diff --git a/nym-node/src/config/persistence.rs b/nym-node/src/config/persistence.rs index 2ceed4b3cc..c1cf1824ab 100644 --- a/nym-node/src/config/persistence.rs +++ b/nym-node/src/config/persistence.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use serde::{Deserialize, Serialize}; diff --git a/nym-node/src/config/serde_helpers.rs b/nym-node/src/config/serde_helpers.rs index df0f42bb44..75bfef8bb9 100644 --- a/nym-node/src/config/serde_helpers.rs +++ b/nym-node/src/config/serde_helpers.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use serde::{Deserialize, Deserializer}; use std::path::PathBuf; diff --git a/nym-node/src/error.rs b/nym-node/src/error.rs index f1a1407817..e5a14cf018 100644 --- a/nym-node/src/error.rs +++ b/nym-node/src/error.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::wireguard::error::WireguardError; use std::net::{IpAddr, SocketAddr}; diff --git a/nym-node/src/http/middleware/logging.rs b/nym-node/src/http/middleware/logging.rs index 68b12b4155..d191c6f161 100644 --- a/nym-node/src/http/middleware/logging.rs +++ b/nym-node/src/http/middleware/logging.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::{ extract::ConnectInfo, diff --git a/nym-node/src/http/middleware/mod.rs b/nym-node/src/http/middleware/mod.rs index 872a6d3520..54a67e0147 100644 --- a/nym-node/src/http/middleware/mod.rs +++ b/nym-node/src/http/middleware/mod.rs @@ -1,4 +1,4 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub mod logging; diff --git a/nym-node/src/http/mod.rs b/nym-node/src/http/mod.rs index a7a4fa0d4b..77cb66ba14 100644 --- a/nym-node/src/http/mod.rs +++ b/nym-node/src/http/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::extract::connect_info::IntoMakeServiceWithConnectInfo; use axum::Router; diff --git a/nym-node/src/http/router/api/mod.rs b/nym-node/src/http/router/api/mod.rs index 757ec48e97..5e8a4160ca 100644 --- a/nym-node/src/http/router/api/mod.rs +++ b/nym-node/src/http/router/api/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::http::{header, HeaderValue, StatusCode}; use axum::response::{IntoResponse, Response}; diff --git a/nym-node/src/http/router/api/v1/gateway/client_interfaces/mod.rs b/nym-node/src/http/router/api/v1/gateway/client_interfaces/mod.rs index a9b4f6beb7..3bd789a248 100644 --- a/nym-node/src/http/router/api/v1/gateway/client_interfaces/mod.rs +++ b/nym-node/src/http/router/api/v1/gateway/client_interfaces/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::gateway::client_interfaces::wireguard::WireguardAppState; use crate::http::api::{FormattedResponse, OutputParams}; diff --git a/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/client_registry.rs b/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/client_registry.rs index 7fd5682857..d214d6304f 100644 --- a/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/client_registry.rs +++ b/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/client_registry.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::gateway::client_interfaces::wireguard::{ WireguardAppState, WireguardAppStateInner, diff --git a/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/mod.rs b/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/mod.rs index 4008c312b6..eec31b244c 100644 --- a/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/mod.rs +++ b/nym-node/src/http/router/api/v1/gateway/client_interfaces/wireguard/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::gateway::client_interfaces::wireguard::client_registry::{ get_all_clients, get_client, register_client, diff --git a/nym-node/src/http/router/api/v1/gateway/mod.rs b/nym-node/src/http/router/api/v1/gateway/mod.rs index d2bba50118..6b9ee71d14 100644 --- a/nym-node/src/http/router/api/v1/gateway/mod.rs +++ b/nym-node/src/http/router/api/v1/gateway/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::gateway::client_interfaces::wireguard::WireguardAppState; use axum::routing::get; diff --git a/nym-node/src/http/router/api/v1/gateway/root.rs b/nym-node/src/http/router/api/v1/gateway/root.rs index 526d1825dd..04edf2681a 100644 --- a/nym-node/src/http/router/api/v1/gateway/root.rs +++ b/nym-node/src/http/router/api/v1/gateway/root.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/health.rs b/nym-node/src/http/router/api/v1/health.rs index 08e9ff28d5..7b26a61c35 100644 --- a/nym-node/src/http/router/api/v1/health.rs +++ b/nym-node/src/http/router/api/v1/health.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::{FormattedResponse, OutputParams}; use crate::http::state::AppState; diff --git a/nym-node/src/http/router/api/v1/mixnode/mod.rs b/nym-node/src/http/router/api/v1/mixnode/mod.rs index 998a0edd3e..8072b5a822 100644 --- a/nym-node/src/http/router/api/v1/mixnode/mod.rs +++ b/nym-node/src/http/router/api/v1/mixnode/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::routing::get; use axum::Router; diff --git a/nym-node/src/http/router/api/v1/mixnode/root.rs b/nym-node/src/http/router/api/v1/mixnode/root.rs index 2b71fea15c..1ca216b55d 100644 --- a/nym-node/src/http/router/api/v1/mixnode/root.rs +++ b/nym-node/src/http/router/api/v1/mixnode/root.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/mod.rs b/nym-node/src/http/router/api/v1/mod.rs index cc81f9948f..f9415d5309 100644 --- a/nym-node/src/http/router/api/v1/mod.rs +++ b/nym-node/src/http/router/api/v1/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::gateway::client_interfaces::wireguard::WireguardAppState; use crate::http::state::AppState; diff --git a/nym-node/src/http/router/api/v1/network_requester/exit_policy.rs b/nym-node/src/http/router/api/v1/network_requester/exit_policy.rs index a743f20514..ab649711f4 100644 --- a/nym-node/src/http/router/api/v1/network_requester/exit_policy.rs +++ b/nym-node/src/http/router/api/v1/network_requester/exit_policy.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/network_requester/mod.rs b/nym-node/src/http/router/api/v1/network_requester/mod.rs index 7b2ebabf34..19f08cb368 100644 --- a/nym-node/src/http/router/api/v1/network_requester/mod.rs +++ b/nym-node/src/http/router/api/v1/network_requester/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::network_requester::exit_policy::node_exit_policy; use axum::routing::get; diff --git a/nym-node/src/http/router/api/v1/network_requester/root.rs b/nym-node/src/http/router/api/v1/network_requester/root.rs index a1849e2560..4294a4d348 100644 --- a/nym-node/src/http/router/api/v1/network_requester/root.rs +++ b/nym-node/src/http/router/api/v1/network_requester/root.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/node/build_information.rs b/nym-node/src/http/router/api/v1/node/build_information.rs index 1288d94dda..98bd47e691 100644 --- a/nym-node/src/http/router/api/v1/node/build_information.rs +++ b/nym-node/src/http/router/api/v1/node/build_information.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/node/host_information.rs b/nym-node/src/http/router/api/v1/node/host_information.rs index 3581de10bc..c52f00a58b 100644 --- a/nym-node/src/http/router/api/v1/node/host_information.rs +++ b/nym-node/src/http/router/api/v1/node/host_information.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/node/mod.rs b/nym-node/src/http/router/api/v1/node/mod.rs index 6644e75572..620a446090 100644 --- a/nym-node/src/http/router/api/v1/node/mod.rs +++ b/nym-node/src/http/router/api/v1/node/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::api::v1::node::build_information::build_information; use crate::http::api::v1::node::host_information::host_information; diff --git a/nym-node/src/http/router/api/v1/node/roles.rs b/nym-node/src/http/router/api/v1/node/roles.rs index 811954ed52..43648e77c0 100644 --- a/nym-node/src/http/router/api/v1/node/roles.rs +++ b/nym-node/src/http/router/api/v1/node/roles.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api::{FormattedResponse, OutputParams}; use axum::extract::Query; diff --git a/nym-node/src/http/router/api/v1/openapi.rs b/nym-node/src/http/router/api/v1/openapi.rs index 6302429f73..d016de72fb 100644 --- a/nym-node/src/http/router/api/v1/openapi.rs +++ b/nym-node/src/http/router/api/v1/openapi.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::http::router::api; use crate::http::router::types::{ErrorResponse, RequestError}; diff --git a/nym-node/src/http/router/landing_page.rs b/nym-node/src/http/router/landing_page.rs index 425d59c4de..8a0f28b017 100644 --- a/nym-node/src/http/router/landing_page.rs +++ b/nym-node/src/http/router/landing_page.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::response::Html; use axum::routing::get; diff --git a/nym-node/src/http/router/mod.rs b/nym-node/src/http/router/mod.rs index d24033f1bc..e1d9e03b35 100644 --- a/nym-node/src/http/router/mod.rs +++ b/nym-node/src/http/router/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::error::NymNodeError; pub use crate::http::api::v1::gateway::client_interfaces::wireguard::WireguardAppState; diff --git a/nym-node/src/http/router/types.rs b/nym-node/src/http/router/types.rs index 6533a00a25..6eec804c12 100644 --- a/nym-node/src/http/router/types.rs +++ b/nym-node/src/http/router/types.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; diff --git a/nym-node/src/http/state.rs b/nym-node/src/http/state.rs index ee7cd3aad2..e6141fd238 100644 --- a/nym-node/src/http/state.rs +++ b/nym-node/src/http/state.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use tokio::time::Instant; diff --git a/nym-node/src/lib.rs b/nym-node/src/lib.rs index e32c757b15..70e48aeec1 100644 --- a/nym-node/src/lib.rs +++ b/nym-node/src/lib.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only #![warn(clippy::expect_used)] #![warn(clippy::unwrap_used)] diff --git a/nym-node/src/wireguard/error.rs b/nym-node/src/wireguard/error.rs index 47b24af92c..3682017e37 100644 --- a/nym-node/src/wireguard/error.rs +++ b/nym-node/src/wireguard/error.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use thiserror::Error; diff --git a/nym-node/src/wireguard/mod.rs b/nym-node/src/wireguard/mod.rs index ad3a0d85cd..8c2b1fd10f 100644 --- a/nym-node/src/wireguard/mod.rs +++ b/nym-node/src/wireguard/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only // obviously most of the features currently reside in the gateway, // but let's start putting everything in here diff --git a/nym-node/src/wireguard/types.rs b/nym-node/src/wireguard/types.rs index 0243133005..e5eb607115 100644 --- a/nym-node/src/wireguard/types.rs +++ b/nym-node/src/wireguard/types.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub use nym_node_requests::api::v1::gateway::client_interfaces::wireguard::models::*; pub use nym_wireguard_types::registration::{GatewayClientRegistry, PendingRegistrations}; diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 77fbfe47eb..49cff33e2e 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ "nix", "parking_lot", "rand_core 0.6.4", - "ring", + "ring 0.16.20", "tracing", "untrusted 0.9.0", "x25519-dalek 2.0.0", @@ -847,9 +847,9 @@ dependencies = [ [[package]] name = "cosmos-sdk-proto" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c" +checksum = "32560304ab4c365791fd307282f76637213d8083c1a98490c35159cd67852237" dependencies = [ "prost", "prost-types", @@ -858,19 +858,19 @@ dependencies = [ [[package]] name = "cosmrs" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6" +checksum = "47126f5364df9387b9d8559dcef62e99010e1d4098f39eb3f7ee4b5c254e40ea" dependencies = [ "bip32", "cosmos-sdk-proto", "ecdsa 0.16.8", "eyre", - "getrandom 0.2.10", "k256 0.13.1", "rand_core 0.6.4", "serde", "serde_json", + "signature 2.1.0", "subtle-encoding", "tendermint", "tendermint-rpc", @@ -1062,15 +1062,6 @@ dependencies = [ "syn 2.0.28", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct", -] - [[package]] name = "ctor" version = "0.1.26" @@ -2361,31 +2352,6 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" -[[package]] -name = "headers" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.3.3" @@ -2575,40 +2541,17 @@ dependencies = [ ] [[package]] -name = "hyper-proxy" -version = "0.9.1" +name = "hyper-rustls" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ - "bytes", - "futures", - "headers", + "futures-util", "http", "hyper", - "hyper-rustls", - "rustls-native-certs", - "tokio", - "tokio-rustls", - "tower-service", - "webpki", -] - -[[package]] -name = "hyper-rustls" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" -dependencies = [ - "ct-logs", - "futures-util", - "hyper", - "log", "rustls", - "rustls-native-certs", "tokio", "tokio-rustls", - "webpki", - "webpki-roots", ] [[package]] @@ -3602,6 +3545,7 @@ version = "0.1.0" dependencies = [ "async-trait", "base64 0.13.1", + "bip32", "bip39", "colored 2.0.4", "cosmrs", @@ -3706,7 +3650,7 @@ dependencies = [ [[package]] name = "nym_wallet" -version = "1.2.10" +version = "1.2.11" dependencies = [ "async-trait", "base64 0.13.1", @@ -4360,9 +4304,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -4370,22 +4314,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.11.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] @@ -4611,6 +4555,7 @@ dependencies = [ "http", "http-body", "hyper", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -4620,12 +4565,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls", + "rustls-native-certs", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", @@ -4688,12 +4637,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -4733,29 +4696,47 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ - "base64 0.13.1", "log", - "ring", + "ring 0.17.3", + "rustls-webpki", "sct", - "webpki", ] [[package]] name = "rustls-native-certs" -version = "0.5.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls", + "rustls-pemfile", "schannel", "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.3", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -4831,12 +4812,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted 0.7.1", + "ring 0.17.3", + "untrusted 0.9.0", ] [[package]] @@ -5083,17 +5064,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.9.9" @@ -5261,6 +5231,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.6.0" @@ -5729,9 +5705,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f0a7d05cf78524782337f8edd55cbc578d159a16ad4affe2135c92f7dbac7f0" +checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" dependencies = [ "bytes", "digest 0.10.7", @@ -5760,9 +5736,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a72dbbea6dde12045d261f2c70c0de039125675e8a026c8d5ad34522756372" +checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" dependencies = [ "flex-error", "serde", @@ -5774,9 +5750,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d" +checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" dependencies = [ "bytes", "flex-error", @@ -5792,21 +5768,18 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.32.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d83a130537fc4a98c3c9eb6899ebe857fea4860400a61675bfb5f0b35129" +checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" dependencies = [ "async-trait", "bytes", "flex-error", "futures", "getrandom 0.2.10", - "http", - "hyper", - "hyper-proxy", - "hyper-rustls", "peg", "pin-project", + "reqwest", "semver 1.0.18", "serde", "serde_bytes", @@ -5968,13 +5941,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls", "tokio", - "webpki", ] [[package]] @@ -6203,9 +6175,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -6455,25 +6427,6 @@ dependencies = [ "system-deps 6.1.1", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted 0.7.1", -] - -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki", -] - [[package]] name = "webview2-com" version = "0.19.1" diff --git a/nym-wallet/nym-wallet-types/Cargo.toml b/nym-wallet/nym-wallet-types/Cargo.toml index ca422a9832..924d8168e9 100644 --- a/nym-wallet/nym-wallet-types/Cargo.toml +++ b/nym-wallet/nym-wallet-types/Cargo.toml @@ -12,7 +12,7 @@ strum = { version = "0.23", features = ["derive"] } ts-rs = "7.0.0" cosmwasm-std = "1.3.0" -cosmrs = "=0.14.0" +cosmrs = "=0.15.0" nym-config = { path = "../../common/config" } nym-network-defaults = { path = "../../common/network-defaults" } diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index eaced888a4..1182ef2d1c 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym_wallet" -version = "1.2.10" +version = "1.2.11" description = "Nym Native Wallet" authors = ["Nym Technologies SA"] license = "" @@ -49,7 +49,7 @@ base64 = "0.13" zeroize = { version = "1.5", features = ["zeroize_derive", "serde"] } cosmwasm-std = "1.3.0" -cosmrs = "=0.14.0" +cosmrs = "=0.15.0" nym-validator-client = { path = "../../common/client-libs/validator-client" } nym-crypto = { path = "../../common/crypto", features = ["asymmetric"] } diff --git a/nym-wallet/src-tauri/tauri.conf.json b/nym-wallet/src-tauri/tauri.conf.json index 43330b2587..8aabb2bc80 100644 --- a/nym-wallet/src-tauri/tauri.conf.json +++ b/nym-wallet/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "nym-wallet", - "version": "1.2.10" + "version": "1.2.11" }, "build": { "distDir": "../dist", diff --git a/sdk/rust/nym-sdk/src/mixnet/client.rs b/sdk/rust/nym-sdk/src/mixnet/client.rs index 227ee5868c..1c18a5f3d0 100644 --- a/sdk/rust/nym-sdk/src/mixnet/client.rs +++ b/sdk/rust/nym-sdk/src/mixnet/client.rs @@ -11,7 +11,9 @@ use crate::{Error, Result}; use futures::channel::mpsc; use futures::StreamExt; use log::warn; -use nym_client_core::client::base_client::storage::gateway_details::GatewayDetailsStore; +use nym_client_core::client::base_client::storage::gateway_details::{ + GatewayDetailsStore, PersistedGatewayDetails, +}; use nym_client_core::client::base_client::storage::{ Ephemeral, MixnetClientStorage, OnDiskPersistent, }; @@ -24,6 +26,7 @@ use nym_client_core::{ client::{base_client::BaseClientBuilder, replies::reply_storage::ReplyStorageBackend}, config::GatewayEndpointConfig, }; +use nym_network_defaults::{DEFAULT_CLIENT_LISTENING_PORT, WG_TUN_DEVICE_ADDRESS}; use nym_socks5_client_core::config::Socks5; use nym_task::manager::TaskStatus; use nym_task::{TaskClient, TaskHandle}; @@ -44,6 +47,7 @@ pub struct MixnetClientBuilder { gateway_config: Option, socks5_config: Option, + wireguard_mode: bool, wait_for_gateway: bool, custom_topology_provider: Option>, custom_gateway_transceiver: Option>, @@ -79,6 +83,7 @@ impl MixnetClientBuilder { storage_paths: None, gateway_config: None, socks5_config: None, + wireguard_mode: false, wait_for_gateway: false, custom_topology_provider: None, storage: storage_paths @@ -109,6 +114,7 @@ where storage_paths: None, gateway_config: None, socks5_config: None, + wireguard_mode: false, wait_for_gateway: false, custom_topology_provider: None, custom_gateway_transceiver: None, @@ -127,6 +133,7 @@ where storage_paths: self.storage_paths, gateway_config: self.gateway_config, socks5_config: self.socks5_config, + wireguard_mode: self.wireguard_mode, wait_for_gateway: self.wait_for_gateway, custom_topology_provider: self.custom_topology_provider, custom_gateway_transceiver: self.custom_gateway_transceiver, @@ -205,6 +212,13 @@ where self } + /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. + #[must_use] + pub fn with_wireguard_mode(mut self, wireguard_mode: bool) -> Self { + self.wireguard_mode = wireguard_mode; + self + } + /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. #[must_use] pub fn with_wait_for_gateway(mut self, wait_for_gateway: bool) -> Self { @@ -235,6 +249,7 @@ where .custom_gateway_transceiver(self.custom_gateway_transceiver) .custom_topology_provider(self.custom_topology_provider) .custom_shutdown(self.custom_shutdown) + .wireguard_mode(self.wireguard_mode) .wait_for_gateway(self.wait_for_gateway) .force_tls(self.force_tls); @@ -274,6 +289,9 @@ where /// advanced usage of custom gateways custom_gateway_transceiver: Option>, + /// If the client connects via Wireguard tunnel to the gateway. + wireguard_mode: bool, + /// Attempt to wait for the selected gateway (if applicable) to come online if its currently not bonded. wait_for_gateway: bool, @@ -326,6 +344,7 @@ where storage, custom_topology_provider: None, custom_gateway_transceiver: None, + wireguard_mode: false, wait_for_gateway: false, force_tls: false, custom_shutdown: None, @@ -356,6 +375,12 @@ where self } + #[must_use] + pub fn wireguard_mode(mut self, wireguard_mode: bool) -> Self { + self.wireguard_mode = wireguard_mode; + self + } + #[must_use] pub fn wait_for_gateway(mut self, wait_for_gateway: bool) -> Self { self.wait_for_gateway = wait_for_gateway; @@ -503,11 +528,7 @@ where let known_gateway = self.has_valid_gateway_info().await; - let mut base_builder: BaseClientBuilder<_, _> = - BaseClientBuilder::new(&base_config, self.storage, self.dkg_query_client) - .with_wait_for_gateway(self.wait_for_gateway); - - if !known_gateway { + let mut base_builder: BaseClientBuilder<_, _> = if !known_gateway { let selection_spec = GatewaySelectionSpecification::new( self.config.user_chosen_gateway, None, @@ -515,14 +536,49 @@ where ); let mut rng = OsRng; + let mut available_gateways = current_gateways(&mut rng, &nym_api_endpoints).await?; + if self.wireguard_mode { + available_gateways + .iter_mut() + .for_each(|node| node.host = WG_TUN_DEVICE_ADDRESS.parse().unwrap()); + } let setup = GatewaySetup::New { specification: selection_spec, - available_gateways: current_gateways(&mut rng, &nym_api_endpoints).await?, + available_gateways, overwrite_data: !self.config.key_mode.is_keep(), }; - base_builder = base_builder.with_gateway_setup(setup) - } + BaseClientBuilder::new(&base_config, self.storage, self.dkg_query_client) + .with_wait_for_gateway(self.wait_for_gateway) + .with_gateway_setup(setup) + } else if self.wireguard_mode { + if let Ok(PersistedGatewayDetails::Default(mut config)) = self + .storage + .gateway_details_store() + .load_gateway_details() + .await + { + config.details.gateway_listener = format!( + "ws://{}:{}", + WG_TUN_DEVICE_ADDRESS, DEFAULT_CLIENT_LISTENING_PORT + ); + if let Err(e) = self + .storage + .gateway_details_store() + .store_gateway_details(&PersistedGatewayDetails::Default(config)) + .await + { + warn!("Could not switch to using wireguard mode - {:?}", e); + } + } else { + warn!("Storage type not supported with wireguard mode"); + } + BaseClientBuilder::new(&base_config, self.storage, self.dkg_query_client) + .with_wait_for_gateway(self.wait_for_gateway) + } else { + BaseClientBuilder::new(&base_config, self.storage, self.dkg_query_client) + .with_wait_for_gateway(self.wait_for_gateway) + }; if let Some(topology_provider) = self.custom_topology_provider { base_builder = base_builder.with_topology_provider(topology_provider); diff --git a/service-providers/ip-packet-router/src/error.rs b/service-providers/ip-packet-router/src/error.rs index 9c417a8f6e..797dc78b81 100644 --- a/service-providers/ip-packet-router/src/error.rs +++ b/service-providers/ip-packet-router/src/error.rs @@ -30,6 +30,9 @@ pub enum IpPacketRouterError { #[error("the entity wrapping the network requester has disconnected")] DisconnectedParent, + #[error("received packet has an invalid version: {0}")] + InvalidPacketVersion(u8), + #[error("failed to deserialize tagged packet: {source}")] FailedToDeserializeTaggedPacket { source: bincode::Error }, diff --git a/service-providers/ip-packet-router/src/lib.rs b/service-providers/ip-packet-router/src/lib.rs index d77fcba90b..d85b1a744c 100644 --- a/service-providers/ip-packet-router/src/lib.rs +++ b/service-providers/ip-packet-router/src/lib.rs @@ -11,6 +11,7 @@ use nym_client_core::{ client::mix_traffic::transceiver::GatewayTransceiver, config::disk_persistence::CommonClientPaths, HardcodedTopologyProvider, TopologyProvider, }; +use nym_ip_packet_requests::{IpPacketRequest, IpPacketRequestData, IpPacketResponse}; use nym_sdk::{ mixnet::{InputMessage, MixnetMessageSender, Recipient}, NymNetworkDetails, @@ -189,8 +190,116 @@ struct IpPacketRouter { task_handle: TaskHandle, } -#[allow(unused)] +#[cfg_attr(not(target_os = "linux"), allow(unused))] impl IpPacketRouter { + async fn on_static_connect_request( + &mut self, + connect_request: nym_ip_packet_requests::StaticConnectRequest, + ) -> Result, IpPacketRouterError> { + log::info!( + "Received static connect request from {sender_address}", + sender_address = connect_request.reply_to + ); + + let request_id = connect_request.request_id; + let _requested_ip = connect_request.ip; + let reply_to = connect_request.reply_to; + // TODO: ignoring reply_to_hops and reply_to_avg_mix_delays for now + + Ok(Some(IpPacketResponse::new_static_connect_failure( + request_id, reply_to, + ))) + } + + async fn on_dynamic_connect_request( + &mut self, + connect_request: nym_ip_packet_requests::DynamicConnectRequest, + ) -> Result, IpPacketRouterError> { + log::info!( + "Received dynamic connect request from {sender_address}", + sender_address = connect_request.reply_to + ); + log::info!("Dropping request: dynamic connect requests are not yet supported"); + Ok(None) + } + + async fn on_data_request( + &mut self, + data_request: nym_ip_packet_requests::DataRequest, + ) -> Result, IpPacketRouterError> { + log::info!("Received data request"); + + // We don't forward packets that we are not able to parse. BUT, there might be a good + // reason to still forward them. + // + // For example, if we are running in a mode where we are only supposed to forward + // packets to a specific destination, we might want to forward them anyway. + // + // TODO: look into this + let ParsedPacket { + packet_type, + src_addr, + dst_addr, + dst, + } = parse_packet(&data_request.ip_packet)?; + + let dst_str = dst.map_or(dst_addr.to_string(), |dst| dst.to_string()); + log::info!("Received packet: {packet_type}: {src_addr} -> {dst_str}"); + + // Filter check + if let Some(dst) = dst { + if !self.request_filter.check_address(&dst).await { + log::warn!("Failed filter check: {dst}"); + // TODO: we could consider sending back a response here + return Err(IpPacketRouterError::AddressFailedFilterCheck { addr: dst }); + } + } else { + // TODO: we should also filter packets without port number + log::warn!("Ignoring filter check for packet without port number! TODO!"); + } + + // TODO: set the tag correctly. Can we just reuse sender_tag? + // TODO: consider changing from Vec to bytes::Bytes? + let peer_tag = 0; + self.tun_task_tx + .try_send((peer_tag, data_request.ip_packet.into())) + .map_err(|err| IpPacketRouterError::FailedToSendPacketToTun { source: err })?; + + Ok(None) + } + async fn on_reconstructed_message( + &mut self, + reconstructed: ReconstructedMessage, + ) -> Result, IpPacketRouterError> { + log::debug!( + "Received message with sender_tag: {:?}", + reconstructed.sender_tag + ); + + // Check version of request + if let Some(version) = reconstructed.message.first() { + // The idea is that in the future we can add logic here to parse older versions to stay + // backwards compatible. + if *version != nym_ip_packet_requests::CURRENT_VERSION { + log::warn!("Received packet with invalid version"); + return Err(IpPacketRouterError::InvalidPacketVersion(*version)); + } + } + + let request = IpPacketRequest::from_reconstructed_message(&reconstructed) + .map_err(|err| IpPacketRouterError::FailedToDeserializeTaggedPacket { source: err })?; + + match request.data { + IpPacketRequestData::StaticConnect(connect_request) => { + self.on_static_connect_request(connect_request).await + } + IpPacketRequestData::DynamicConnect(connect_request) => { + self.on_dynamic_connect_request(connect_request).await + } + IpPacketRequestData::Data(data_request) => self.on_data_request(data_request).await, + } + } + async fn run(mut self) -> Result<(), IpPacketRouterError> { let mut task_client = self.task_handle.fork("main_loop"); @@ -201,8 +310,31 @@ impl IpPacketRouter { }, msg = self.mixnet_client.next() => { if let Some(msg) = msg { - if let Err(err) = self.on_message(msg).await { - log::error!("Error handling mixnet message: {err}"); + match self.on_reconstructed_message(msg).await { + Ok(Some(response)) => { + let Some(recipient) = response.recipient() else { + log::error!("IpPacketRouter [main loop]: failed to get recipient from response"); + continue; + }; + let response_packet = response.to_bytes(); + let Ok(response_packet) = response_packet else { + log::error!("Failed to serialize response packet"); + continue; + }; + let lane = TransmissionLane::General; + let packet_type = None; + let input_message = InputMessage::new_regular(*recipient, response_packet, lane, packet_type); + if let Err(err) = self.mixnet_client.send(input_message).await { + log::error!("IpPacketRouter [main loop]: failed to send packet to mixnet: {err}"); + }; + }, + Ok(None) => { + continue; + }, + Err(err) => { + log::error!("Error handling mixnet message: {err}"); + } + }; } else { log::trace!("IpPacketRouter [main loop]: stopping since channel closed"); @@ -224,7 +356,12 @@ impl IpPacketRouter { if let Some(recipient) = recipient { let lane = TransmissionLane::General; let packet_type = None; - let input_message = InputMessage::new_regular(recipient, packet, lane, packet_type); + let response_packet = IpPacketResponse::new_ip_packet(packet.into()).to_bytes(); + let Ok(response_packet) = response_packet else { + log::error!("Failed to serialize response packet"); + continue; + }; + let input_message = InputMessage::new_regular(recipient, response_packet, lane, packet_type); if let Err(err) = self.mixnet_client.send(input_message).await { log::error!("IpPacketRouter [main loop]: failed to send packet to mixnet: {err}"); @@ -243,59 +380,6 @@ impl IpPacketRouter { log::info!("IpPacketRouter: stopping"); Ok(()) } - - async fn on_message( - &mut self, - reconstructed: ReconstructedMessage, - ) -> Result<(), IpPacketRouterError> { - log::debug!( - "Received message with sender_tag: {:?}", - reconstructed.sender_tag - ); - - let tagged_packet = - nym_ip_packet_requests::TaggedIpPacket::from_reconstructed_message(&reconstructed) - .map_err(|err| IpPacketRouterError::FailedToDeserializeTaggedPacket { - source: err, - })?; - - // We don't forward packets that we are not able to parse. BUT, there might be a good - // reason to still forward them. - // - // For example, if we are running in a mode where we are only supposed to forward - // packets to a specific destination, we might want to forward them anyway. - // - // TODO: look into this - let ParsedPacket { - packet_type, - src_addr, - dst_addr, - dst, - } = parse_packet(&tagged_packet.packet)?; - - let dst_str = dst.map_or(dst_addr.to_string(), |dst| dst.to_string()); - log::info!("Received packet: {packet_type}: {src_addr} -> {dst_str}"); - - // Filter check - if let Some(dst) = dst { - if !self.request_filter.check_address(&dst).await { - log::warn!("Failed filter check: {dst}"); - // TODO: we could consider sending back a response here - return Err(IpPacketRouterError::AddressFailedFilterCheck { addr: dst }); - } - } else { - // TODO: we should also filter packets without port number - log::warn!("Ignoring filter check for packet without port number! TODO!"); - } - - // TODO: set the tag correctly. Can we just reuse sender_tag? - let peer_tag = 0; - self.tun_task_tx - .try_send((peer_tag, tagged_packet.packet.into())) - .map_err(|err| IpPacketRouterError::FailedToSendPacketToTun { source: err })?; - - Ok(()) - } } struct ParsedPacket<'a> { diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index 9ea3693ab4..a530110fee 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -1,8 +1,9 @@ # Copyright 2020 - Nym Technologies SA -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: GPL-3.0-only [package] name = "nym-network-requester" +license = "GPL-3" version = "1.1.31" authors.workspace = true edition.workspace = true diff --git a/service-providers/network-requester/README.md b/service-providers/network-requester/README.md index fb414d7e75..ad40966e60 100644 --- a/service-providers/network-requester/README.md +++ b/service-providers/network-requester/README.md @@ -1,7 +1,24 @@ Copyright 2022 - Nym Technologies SA -SPDX-License-Identifier: Apache-2.0 +SPDX-License-Identifier: GPL-3.0-only --> +## License + +Copyright (C) 2022 Nym Technologies SA + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + ## Network requester The network requester is used to interpret socks5 client messages that need to diff --git a/service-providers/network-requester/src/cli/build_info.rs b/service-providers/network-requester/src/cli/build_info.rs index 55dc3bfd3f..5389e92634 100644 --- a/service-providers/network-requester/src/cli/build_info.rs +++ b/service-providers/network-requester/src/cli/build_info.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use clap::Args; use nym_bin_common::bin_info_owned; diff --git a/service-providers/network-requester/src/cli/init.rs b/service-providers/network-requester/src/cli/init.rs index d8439247b5..4333aa4970 100644 --- a/service-providers/network-requester/src/cli/init.rs +++ b/service-providers/network-requester/src/cli/init.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::cli::try_upgrade_config; use crate::config::{default_config_directory, default_config_filepath, default_data_directory}; diff --git a/service-providers/network-requester/src/cli/mod.rs b/service-providers/network-requester/src/cli/mod.rs index fcc2fe6750..2dba60cb16 100644 --- a/service-providers/network-requester/src/cli/mod.rs +++ b/service-providers/network-requester/src/cli/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_13::OldConfigV1_1_13; use crate::config::old_config_v1_1_20::ConfigV1_1_20; diff --git a/service-providers/network-requester/src/cli/run.rs b/service-providers/network-requester/src/cli/run.rs index 929ba57661..1295734bda 100644 --- a/service-providers/network-requester/src/cli/run.rs +++ b/service-providers/network-requester/src/cli/run.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::cli::{try_load_current_config, version_check}; use crate::{ diff --git a/service-providers/network-requester/src/cli/sign.rs b/service-providers/network-requester/src/cli/sign.rs index 053a431e4b..7a0dc29d7b 100644 --- a/service-providers/network-requester/src/cli/sign.rs +++ b/service-providers/network-requester/src/cli/sign.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::cli::{try_load_current_config, version_check}; use crate::error::NetworkRequesterError; diff --git a/service-providers/network-requester/src/config/mod.rs b/service-providers/network-requester/src/config/mod.rs index faaf3487ee..022b488d57 100644 --- a/service-providers/network-requester/src/config/mod.rs +++ b/service-providers/network-requester/src/config/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::persistence::NetworkRequesterPaths; use crate::config::template::CONFIG_TEMPLATE; diff --git a/service-providers/network-requester/src/config/old_config_v1_1_13.rs b/service-providers/network-requester/src/config/old_config_v1_1_13.rs index 83a9b60020..a57d9222a6 100644 --- a/service-providers/network-requester/src/config/old_config_v1_1_13.rs +++ b/service-providers/network-requester/src/config/old_config_v1_1_13.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_20::ConfigV1_1_20; use nym_client_core::config::old_config_v1_1_13::OldConfigV1_1_13 as OldBaseConfigV1_1_13; diff --git a/service-providers/network-requester/src/config/old_config_v1_1_19.rs b/service-providers/network-requester/src/config/old_config_v1_1_19.rs index 5da0601669..0a0c159d02 100644 --- a/service-providers/network-requester/src/config/old_config_v1_1_19.rs +++ b/service-providers/network-requester/src/config/old_config_v1_1_19.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_20::{ ConfigV1_1_20, DebugV1_1_20, NetworkRequesterPathsV1_1_20, diff --git a/service-providers/network-requester/src/config/old_config_v1_1_20.rs b/service-providers/network-requester/src/config/old_config_v1_1_20.rs index 71b77a8f49..a3ab8c6610 100644 --- a/service-providers/network-requester/src/config/old_config_v1_1_20.rs +++ b/service-providers/network-requester/src/config/old_config_v1_1_20.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::old_config_v1_1_20_2::{ ConfigV1_1_20_2, DebugV1_1_20_2, NetworkRequesterPathsV1_1_20_2, diff --git a/service-providers/network-requester/src/config/old_config_v1_1_20_2.rs b/service-providers/network-requester/src/config/old_config_v1_1_20_2.rs index 25aa2e1975..2263bfd42a 100644 --- a/service-providers/network-requester/src/config/old_config_v1_1_20_2.rs +++ b/service-providers/network-requester/src/config/old_config_v1_1_20_2.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::{ config::{ diff --git a/service-providers/network-requester/src/config/persistence.rs b/service-providers/network-requester/src/config/persistence.rs index d62ffcea9a..242562c1c7 100644 --- a/service-providers/network-requester/src/config/persistence.rs +++ b/service-providers/network-requester/src/config/persistence.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_client_core::config::disk_persistence::CommonClientPaths; use serde::{Deserialize, Serialize}; diff --git a/service-providers/network-requester/src/config/template.rs b/service-providers/network-requester/src/config/template.rs index ae039f5da4..ee6e3ffc51 100644 --- a/service-providers/network-requester/src/config/template.rs +++ b/service-providers/network-requester/src/config/template.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub(crate) const CONFIG_TEMPLATE: &str = // While using normal toml marshalling would have been way simpler with less overhead, diff --git a/service-providers/network-requester/src/core.rs b/service-providers/network-requester/src/core.rs index 8751b2265c..7affa6c849 100644 --- a/service-providers/network-requester/src/core.rs +++ b/service-providers/network-requester/src/core.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::{BaseClientConfig, Config}; use crate::error::NetworkRequesterError; diff --git a/service-providers/network-requester/src/error.rs b/service-providers/network-requester/src/error.rs index fb05dc976f..47d7b12bbc 100644 --- a/service-providers/network-requester/src/error.rs +++ b/service-providers/network-requester/src/error.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + pub use nym_client_core::error::ClientCoreError; use nym_exit_policy::policy::PolicyError; use nym_socks5_requests::{RemoteAddress, Socks5RequestError}; diff --git a/service-providers/network-requester/src/lib.rs b/service-providers/network-requester/src/lib.rs index 1b730aacd1..a8e54ad19f 100644 --- a/service-providers/network-requester/src/lib.rs +++ b/service-providers/network-requester/src/lib.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only pub mod config; pub mod core; diff --git a/service-providers/network-requester/src/main.rs b/service-providers/network-requester/src/main.rs index a8efdf0f76..391fe38242 100644 --- a/service-providers/network-requester/src/main.rs +++ b/service-providers/network-requester/src/main.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use clap::{crate_name, crate_version, Parser}; use error::NetworkRequesterError; diff --git a/service-providers/network-requester/src/reply.rs b/service-providers/network-requester/src/reply.rs index 4a2c620eb6..8230e1d67b 100644 --- a/service-providers/network-requester/src/reply.rs +++ b/service-providers/network-requester/src/reply.rs @@ -1,5 +1,5 @@ // Copyright 2022-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use nym_sdk::mixnet::InputMessage; use nym_service_providers_common::interface::{ diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/filter.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/filter.rs index 5b46f85c41..9a4cc04138 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/filter.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/filter.rs @@ -1,5 +1,5 @@ // Copyright 2020-2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::HostsStore; use crate::request_filter::allowed_hosts::group::HostsGroup; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/group.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/group.rs index 5b5ba4c75a..099d46cdf2 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/group.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/group.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::request_filter::allowed_hosts::host::Host; use ipnetwork::IpNetwork; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/host.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/host.rs index b2678ca34a..7f86e16aa8 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/host.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/host.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use ipnetwork::IpNetwork; use std::str::FromStr; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs index 58ac73b669..8840c78293 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/hosts.rs @@ -1,3 +1,6 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + use super::host::Host; use crate::request_filter::allowed_hosts::group::HostsGroup; use ipnetwork::IpNetwork; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/mod.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/mod.rs index 60a0a3638b..225f6418b5 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/mod.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only mod filter; mod group; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/standard_list.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/standard_list.rs index 76cc3289a0..79b7c75901 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/standard_list.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/standard_list.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::request_filter::allowed_hosts::group::HostsGroup; use crate::request_filter::allowed_hosts::host::Host; diff --git a/service-providers/network-requester/src/request_filter/allowed_hosts/stored_allowed_hosts.rs b/service-providers/network-requester/src/request_filter/allowed_hosts/stored_allowed_hosts.rs index a7d87d803e..aeccebff05 100644 --- a/service-providers/network-requester/src/request_filter/allowed_hosts/stored_allowed_hosts.rs +++ b/service-providers/network-requester/src/request_filter/allowed_hosts/stored_allowed_hosts.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::request_filter::allowed_hosts::HostsStore; use async_file_watcher::{AsyncFileWatcher, FileWatcherEventReceiver}; diff --git a/service-providers/network-requester/src/request_filter/exit_policy/mod.rs b/service-providers/network-requester/src/request_filter/exit_policy/mod.rs index beab727a2b..5fdcc28b57 100644 --- a/service-providers/network-requester/src/request_filter/exit_policy/mod.rs +++ b/service-providers/network-requester/src/request_filter/exit_policy/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::error::NetworkRequesterError; use log::trace; diff --git a/service-providers/network-requester/src/request_filter/mod.rs b/service-providers/network-requester/src/request_filter/mod.rs index c3a3697ec0..27ed3207ec 100644 --- a/service-providers/network-requester/src/request_filter/mod.rs +++ b/service-providers/network-requester/src/request_filter/mod.rs @@ -1,5 +1,5 @@ // Copyright 2023 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::config::{self, Config}; use crate::error::NetworkRequesterError; diff --git a/service-providers/network-requester/src/socks5/mod.rs b/service-providers/network-requester/src/socks5/mod.rs index 8b084b2250..c8c0b5cf74 100644 --- a/service-providers/network-requester/src/socks5/mod.rs +++ b/service-providers/network-requester/src/socks5/mod.rs @@ -1 +1,4 @@ +// Copyright 2023 - Nym Technologies SA +// SPDX-License-Identifier: GPL-3.0-only + pub(super) mod tcp; diff --git a/service-providers/network-requester/src/socks5/tcp.rs b/service-providers/network-requester/src/socks5/tcp.rs index baed05393d..a1e3eabec2 100644 --- a/service-providers/network-requester/src/socks5/tcp.rs +++ b/service-providers/network-requester/src/socks5/tcp.rs @@ -1,5 +1,5 @@ // Copyright 2020 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use crate::reply; use crate::reply::MixnetMessage; diff --git a/service-providers/network-requester/src/statistics/collector.rs b/service-providers/network-requester/src/statistics/collector.rs index e0169165fb..95bc4cce71 100644 --- a/service-providers/network-requester/src/statistics/collector.rs +++ b/service-providers/network-requester/src/statistics/collector.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use super::error::StatsError; use crate::core::new_legacy_request_version; diff --git a/service-providers/network-requester/src/statistics/error.rs b/service-providers/network-requester/src/statistics/error.rs index 0795d526df..dd81ee4ef9 100644 --- a/service-providers/network-requester/src/statistics/error.rs +++ b/service-providers/network-requester/src/statistics/error.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only use thiserror::Error; diff --git a/service-providers/network-requester/src/statistics/mod.rs b/service-providers/network-requester/src/statistics/mod.rs index 189015f2cd..e2e8dbc0cf 100644 --- a/service-providers/network-requester/src/statistics/mod.rs +++ b/service-providers/network-requester/src/statistics/mod.rs @@ -1,5 +1,5 @@ // Copyright 2022 - Nym Technologies SA -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-only mod collector; mod error; diff --git a/tools/nym-cli/Cargo.toml b/tools/nym-cli/Cargo.toml index a537c80b1c..f8332a64c5 100644 --- a/tools/nym-cli/Cargo.toml +++ b/tools/nym-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym-cli" -version = "1.1.31" +version = "1.1.32" authors.workspace = true edition = "2021"