diff --git a/Cargo.lock b/Cargo.lock index 80544e7868..50648792ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,7 +773,7 @@ dependencies = [ [[package]] name = "ant-bootstrap" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ant-logging", "ant-protocol", @@ -798,7 +798,7 @@ dependencies = [ [[package]] name = "ant-build-info" -version = "0.1.21" +version = "0.1.22" dependencies = [ "chrono", "tracing", @@ -807,7 +807,7 @@ dependencies = [ [[package]] name = "ant-cli" -version = "0.3.1" +version = "0.3.2" dependencies = [ "ant-bootstrap", "ant-build-info", @@ -838,7 +838,7 @@ dependencies = [ [[package]] name = "ant-evm" -version = "0.1.6" +version = "0.1.7" dependencies = [ "custom_debug", "evmlib", @@ -861,7 +861,7 @@ dependencies = [ [[package]] name = "ant-logging" -version = "0.2.42" +version = "0.2.43" dependencies = [ "chrono", "color-eyre", @@ -886,7 +886,7 @@ dependencies = [ [[package]] name = "ant-metrics" -version = "0.1.22" +version = "0.1.23" dependencies = [ "clap", "color-eyre", @@ -900,7 +900,7 @@ dependencies = [ [[package]] name = "ant-networking" -version = "0.3.1" +version = "0.3.2" dependencies = [ "aes-gcm-siv", "ant-bootstrap", @@ -948,7 +948,7 @@ dependencies = [ [[package]] name = "ant-node" -version = "0.3.1" +version = "0.3.2" dependencies = [ "ant-bootstrap", "ant-build-info", @@ -1006,7 +1006,7 @@ dependencies = [ [[package]] name = "ant-node-manager" -version = "0.11.5" +version = "0.11.6" dependencies = [ "ant-bootstrap", "ant-build-info", @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "ant-node-rpc-client" -version = "0.6.38" +version = "0.6.39" dependencies = [ "ant-build-info", "ant-logging", @@ -1073,7 +1073,7 @@ dependencies = [ [[package]] name = "ant-protocol" -version = "0.3.1" +version = "0.3.2" dependencies = [ "ant-build-info", "ant-evm", @@ -1103,7 +1103,7 @@ dependencies = [ [[package]] name = "ant-registers" -version = "0.4.5" +version = "0.4.6" dependencies = [ "blsttc", "crdts", @@ -1140,7 +1140,7 @@ dependencies = [ [[package]] name = "ant-service-management" -version = "0.4.5" +version = "0.4.6" dependencies = [ "ant-bootstrap", "ant-evm", @@ -1167,7 +1167,7 @@ dependencies = [ [[package]] name = "ant-token-supplies" -version = "0.1.60" +version = "0.1.61" dependencies = [ "dirs-next", "reqwest 0.11.27", @@ -1591,7 +1591,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "autonomi" -version = "0.3.1" +version = "0.3.2" dependencies = [ "alloy", "ant-bootstrap", @@ -3356,7 +3356,7 @@ dependencies = [ [[package]] name = "evm-testnet" -version = "0.1.6" +version = "0.1.7" dependencies = [ "ant-evm", "clap", @@ -3367,7 +3367,7 @@ dependencies = [ [[package]] name = "evmlib" -version = "0.1.6" +version = "0.1.7" dependencies = [ "alloy", "dirs-next", @@ -6284,7 +6284,7 @@ dependencies = [ [[package]] name = "nat-detection" -version = "0.2.13" +version = "0.2.14" dependencies = [ "ant-build-info", "ant-networking", @@ -6401,7 +6401,7 @@ dependencies = [ [[package]] name = "node-launchpad" -version = "0.5.1" +version = "0.5.2" dependencies = [ "ant-bootstrap", "ant-build-info", @@ -9321,7 +9321,7 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-utils" -version = "0.4.13" +version = "0.4.14" dependencies = [ "bytes", "color-eyre", diff --git a/ant-bootstrap/Cargo.toml b/ant-bootstrap/Cargo.toml index b71fecaec0..ef72f7a85d 100644 --- a/ant-bootstrap/Cargo.toml +++ b/ant-bootstrap/Cargo.toml @@ -7,14 +7,14 @@ license = "GPL-3.0" name = "ant-bootstrap" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.1" +version = "0.1.2" [features] local = [] [dependencies] -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } atomic-write-file = "0.2.2" chrono = { version = "0.4", features = ["serde"] } clap = { version = "4.2.1", features = ["derive", "env"] } diff --git a/ant-build-info/Cargo.toml b/ant-build-info/Cargo.toml index 50987c156f..6a7482355e 100644 --- a/ant-build-info/Cargo.toml +++ b/ant-build-info/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-build-info" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.21" +version = "0.1.22" build = "build.rs" include = ["Cargo.toml", "src/**/*", "build.rs"] diff --git a/ant-build-info/src/release_info.rs b/ant-build-info/src/release_info.rs index fa9246b5e2..74f6d99021 100644 --- a/ant-build-info/src/release_info.rs +++ b/ant-build-info/src/release_info.rs @@ -1,4 +1,4 @@ pub const RELEASE_YEAR: &str = "2024"; pub const RELEASE_MONTH: &str = "12"; pub const RELEASE_CYCLE: &str = "1"; -pub const RELEASE_CYCLE_COUNTER: &str = "6"; +pub const RELEASE_CYCLE_COUNTER: &str = "7"; diff --git a/ant-cli/Cargo.toml b/ant-cli/Cargo.toml index 35f1a76d09..52bc8916eb 100644 --- a/ant-cli/Cargo.toml +++ b/ant-cli/Cargo.toml @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers "] name = "ant-cli" description = "CLI client for the Autonomi network" license = "GPL-3.0" -version = "0.3.1" +version = "0.3.2" edition = "2021" homepage = "https://maidsafe.net" readme = "README.md" @@ -24,11 +24,11 @@ name = "files" harness = false [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } -autonomi = { path = "../autonomi", version = "0.3.1", features = [ +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } +autonomi = { path = "../autonomi", version = "0.3.2", features = [ "fs", "vault", "registers", @@ -60,7 +60,7 @@ tracing = { version = "~0.1.26" } walkdir = "2.5.0" [dev-dependencies] -autonomi = { path = "../autonomi", version = "0.3.1", features = ["fs"]} +autonomi = { path = "../autonomi", version = "0.3.2", features = ["fs"]} criterion = "0.5.1" eyre = "0.6.8" rand = { version = "~0.8.5", features = ["small_rng"] } diff --git a/ant-cli/src/actions/connect.rs b/ant-cli/src/actions/connect.rs index cba9ac217a..e7d03fd691 100644 --- a/ant-cli/src/actions/connect.rs +++ b/ant-cli/src/actions/connect.rs @@ -6,8 +6,8 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -use autonomi::Client; use autonomi::Multiaddr; +use autonomi::{get_evm_network_from_env, Client}; use color_eyre::eyre::bail; use color_eyre::eyre::Result; use indicatif::ProgressBar; @@ -23,7 +23,9 @@ pub async fn connect_to_network(peers: Vec) -> Result { progress_bar.set_message("Connecting to The Autonomi Network..."); match Client::init_with_peers(peers).await { - Ok(client) => { + Ok(mut client) => { + let evm_network = get_evm_network_from_env()?; + client.set_evm_network(evm_network); info!("Connected to the Network"); progress_bar.finish_with_message("Connected to the Network"); Ok(client) diff --git a/ant-evm/Cargo.toml b/ant-evm/Cargo.toml index bfa84568a2..691f07cc5d 100644 --- a/ant-evm/Cargo.toml +++ b/ant-evm/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-evm" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.6" +version = "0.1.7" [features] local = ["evmlib/local"] @@ -16,7 +16,7 @@ test-utils = [] [dependencies] custom_debug = "~0.6.1" -evmlib = { path = "../evmlib", version = "0.1.6" } +evmlib = { path = "../evmlib", version = "0.1.7" } hex = "~0.4.3" lazy_static = "~1.4.0" libp2p = { version = "0.54.1", features = ["identify", "kad"] } diff --git a/ant-logging/Cargo.toml b/ant-logging/Cargo.toml index 7a0a8e90f2..33ad706228 100644 --- a/ant-logging/Cargo.toml +++ b/ant-logging/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-logging" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.2.42" +version = "0.2.43" [dependencies] chrono = "~0.4.19" diff --git a/ant-metrics/Cargo.toml b/ant-metrics/Cargo.toml index a1ec36d541..ded374da71 100644 --- a/ant-metrics/Cargo.toml +++ b/ant-metrics/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-metrics" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.22" +version = "0.1.23" [[bin]] path = "src/main.rs" diff --git a/ant-networking/Cargo.toml b/ant-networking/Cargo.toml index 15d1311de8..966b7d4d6f 100644 --- a/ant-networking/Cargo.toml +++ b/ant-networking/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-networking" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.3.1" +version = "0.3.2" [features] default = [] @@ -20,11 +20,11 @@ upnp = ["libp2p/upnp"] [dependencies] aes-gcm-siv = "0.11.1" -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } -ant-registers = { path = "../ant-registers", version = "0.4.5" } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } +ant-registers = { path = "../ant-registers", version = "0.4.6" } async-trait = "0.1" bytes = { version = "1.0.1", features = ["serde"] } custom_debug = "~0.6.1" diff --git a/ant-networking/src/metrics/mod.rs b/ant-networking/src/metrics/mod.rs index ef9f636bcb..2cc80fe424 100644 --- a/ant-networking/src/metrics/mod.rs +++ b/ant-networking/src/metrics/mod.rs @@ -12,6 +12,8 @@ pub mod service; #[cfg(feature = "upnp")] mod upnp; +use std::sync::atomic::AtomicU64; + use crate::MetricsRegistries; use crate::{log_markers::Marker, target_arch::sleep}; use bad_node::{BadNodeMetrics, BadNodeMetricsMsg, TimeFrame}; @@ -62,8 +64,8 @@ pub(crate) struct NetworkMetricsRecorder { shunned_by_old_close_group: Gauge, // system info - process_memory_used_mb: Gauge, - process_cpu_usage_percentage: Gauge, + process_memory_used_mb: Gauge, + process_cpu_usage_percentage: Gauge, // helpers bad_nodes_notifier: tokio::sync::mpsc::Sender, @@ -134,14 +136,14 @@ impl NetworkMetricsRecorder { upnp_events.clone(), ); - let process_memory_used_mb = Gauge::default(); + let process_memory_used_mb = Gauge::::default(); sub_registry.register( "process_memory_used_mb", "Memory used by the process in MegaBytes", process_memory_used_mb.clone(), ); - let process_cpu_usage_percentage = Gauge::default(); + let process_cpu_usage_percentage = Gauge::::default(); sub_registry.register( "process_cpu_usage_percentage", "The percentage of CPU used by the process. Value is from 0-100", @@ -253,12 +255,14 @@ impl NetworkMetricsRecorder { if let (Some(process), Some(core_count)) = (system.process(pid), physical_core_count) { - let mem_used = process.memory() / TO_MB; - let _ = process_memory_used_mb.set(mem_used as i64); - + let mem_used = + ((process.memory() as f64 / TO_MB as f64) * 10000.0).round() / 10000.0; + let _ = process_memory_used_mb.set(mem_used); // divide by core_count to get value between 0-100 - let cpu_usage = process.cpu_usage() / core_count as f32; - let _ = process_cpu_usage_percentage.set(cpu_usage as i64); + let cpu_usage = ((process.cpu_usage() as f64 / core_count as f64) * 10000.0) + .round() + / 10000.0; + let _ = process_cpu_usage_percentage.set(cpu_usage); } sleep(UPDATE_INTERVAL).await; } diff --git a/ant-node-manager/Cargo.toml b/ant-node-manager/Cargo.toml index 9b2425e764..6d54bed2f5 100644 --- a/ant-node-manager/Cargo.toml +++ b/ant-node-manager/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-node-manager" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.11.5" +version = "0.11.6" [[bin]] name = "antctl" @@ -30,13 +30,13 @@ tcp = [] websockets = [] [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } ant-releases = { version = "0.4.0" } -ant-service-management = { path = "../ant-service-management", version = "0.4.5" } +ant-service-management = { path = "../ant-service-management", version = "0.4.6" } chrono = "~0.4.19" clap = { version = "4.4.6", features = ["derive", "env"] } colored = "2.0.4" diff --git a/ant-node-rpc-client/Cargo.toml b/ant-node-rpc-client/Cargo.toml index 9589668357..8962d19ae2 100644 --- a/ant-node-rpc-client/Cargo.toml +++ b/ant-node-rpc-client/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-node-rpc-client" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.6.38" +version = "0.6.39" [[bin]] name = "antnode_rpc_client" @@ -17,11 +17,11 @@ path = "src/main.rs" nightly = [] [dependencies] -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1", features=["rpc"] } -ant-node = { path = "../ant-node", version = "0.3.1" } -ant-service-management = { path = "../ant-service-management", version = "0.4.5" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2", features=["rpc"] } +ant-node = { path = "../ant-node", version = "0.3.2" } +ant-service-management = { path = "../ant-service-management", version = "0.4.6" } async-trait = "0.1" bls = { package = "blsttc", version = "8.0.1" } clap = { version = "4.2.1", features = ["derive"] } diff --git a/ant-node/Cargo.toml b/ant-node/Cargo.toml index f512875e16..0de618b1cd 100644 --- a/ant-node/Cargo.toml +++ b/ant-node/Cargo.toml @@ -2,7 +2,7 @@ authors = ["MaidSafe Developers "] description = "The Autonomi node binary" name = "ant-node" -version = "0.3.1" +version = "0.3.2" edition = "2021" license = "GPL-3.0" homepage = "https://maidsafe.net" @@ -26,14 +26,14 @@ otlp = ["ant-logging/otlp"] upnp = ["ant-networking/upnp"] [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-networking = { path = "../ant-networking", version = "0.3.1" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } -ant-registers = { path = "../ant-registers", version = "0.4.5" } -ant-service-management = { path = "../ant-service-management", version = "0.4.5" } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-networking = { path = "../ant-networking", version = "0.3.2" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } +ant-registers = { path = "../ant-registers", version = "0.4.6" } +ant-service-management = { path = "../ant-service-management", version = "0.4.6" } async-trait = "0.1" bls = { package = "blsttc", version = "8.0.1" } bytes = { version = "1.0.1", features = ["serde"] } @@ -83,10 +83,10 @@ walkdir = "~2.5.0" xor_name = "5.0.0" [dev-dependencies] -ant-protocol = { path = "../ant-protocol", version = "0.3.1", features = ["rpc"] } +ant-protocol = { path = "../ant-protocol", version = "0.3.2", features = ["rpc"] } assert_fs = "1.0.0" -evmlib = { path = "../evmlib", version = "0.1.6" } -autonomi = { path = "../autonomi", version = "0.3.1", features = ["registers"] } +evmlib = { path = "../evmlib", version = "0.1.7" } +autonomi = { path = "../autonomi", version = "0.3.2", features = ["registers"] } reqwest = { version = "0.12.2", default-features = false, features = [ "rustls-tls-manual-roots", ] } diff --git a/ant-protocol/Cargo.toml b/ant-protocol/Cargo.toml index 220d4fea44..d0afab1c15 100644 --- a/ant-protocol/Cargo.toml +++ b/ant-protocol/Cargo.toml @@ -7,16 +7,16 @@ license = "GPL-3.0" name = "ant-protocol" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.3.1" +version = "0.3.2" [features] default = [] rpc = ["tonic", "prost"] [dependencies] -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-registers = { path = "../ant-registers", version = "0.4.5" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-registers = { path = "../ant-registers", version = "0.4.6" } bls = { package = "blsttc", version = "8.0.1" } bytes = { version = "1.0.1", features = ["serde"] } color-eyre = "0.6.2" diff --git a/ant-registers/Cargo.toml b/ant-registers/Cargo.toml index 5f02031c5a..e021f361cf 100644 --- a/ant-registers/Cargo.toml +++ b/ant-registers/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-registers" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.4.5" +version = "0.4.6" [features] test-utils = [] diff --git a/ant-service-management/Cargo.toml b/ant-service-management/Cargo.toml index f6fce7719d..519045aed4 100644 --- a/ant-service-management/Cargo.toml +++ b/ant-service-management/Cargo.toml @@ -7,13 +7,13 @@ license = "GPL-3.0" name = "ant-service-management" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.4.5" +version = "0.4.6" [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-logging = { path = "../ant-logging", version = "0.2.42" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1", features = ["rpc"] } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2", features = ["rpc"] } async-trait = "0.1" dirs-next = "2.0.0" libp2p = { version = "0.54.1", features = ["kad"] } diff --git a/ant-token-supplies/Cargo.toml b/ant-token-supplies/Cargo.toml index 8bf9a7445b..a26791770b 100644 --- a/ant-token-supplies/Cargo.toml +++ b/ant-token-supplies/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "ant-token-supplies" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.60" +version = "0.1.61" [dependencies] diff --git a/autonomi/Cargo.toml b/autonomi/Cargo.toml index b9ad33050a..61d7767ab3 100644 --- a/autonomi/Cargo.toml +++ b/autonomi/Cargo.toml @@ -3,7 +3,7 @@ authors = ["MaidSafe Developers "] description = "Autonomi client API" name = "autonomi" license = "GPL-3.0" -version = "0.3.1" +version = "0.3.2" edition = "2021" homepage = "https://maidsafe.net" readme = "README.md" @@ -33,11 +33,11 @@ registers = [] vault = ["registers"] [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-networking = { path = "../ant-networking", version = "0.3.1" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } -ant-registers = { path = "../ant-registers", version = "0.4.5" } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-networking = { path = "../ant-networking", version = "0.3.2" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } +ant-registers = { path = "../ant-registers", version = "0.4.6" } bip39 = "2.0.0" blst = "0.3.13" blstrs = "0.7.1" @@ -68,7 +68,7 @@ xor_name = "5.0.0" [dev-dependencies] alloy = { version = "0.7.3", default-features = false, features = ["contract", "json-rpc", "network", "node-bindings", "provider-http", "reqwest-rustls-tls", "rpc-client", "rpc-types", "signer-local", "std"] } -ant-logging = { path = "../ant-logging", version = "0.2.42" } +ant-logging = { path = "../ant-logging", version = "0.2.43" } eyre = "0.6.5" sha2 = "0.10.6" # Do not specify the version field. Release process expects even the local dev deps to be published. @@ -80,7 +80,7 @@ wasm-bindgen-test = "0.3.43" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.7" -evmlib = { path = "../evmlib", version = "0.1.6", features = ["wasm-bindgen"] } +evmlib = { path = "../evmlib", version = "0.1.7", features = ["wasm-bindgen"] } # See https://github.com/sebcrozet/instant/blob/7bd13f51f5c930239fddc0476a837870fb239ed7/README.md#using-instant-for-a-wasm-platform-where-performancenow-is-not-available instant = { version = "0.1", features = ["wasm-bindgen", "inaccurate"] } js-sys = "0.3.70" diff --git a/evm-testnet/Cargo.toml b/evm-testnet/Cargo.toml index 340318956a..c843aefdad 100644 --- a/evm-testnet/Cargo.toml +++ b/evm-testnet/Cargo.toml @@ -6,13 +6,13 @@ homepage = "https://maidsafe.net" license = "GPL-3.0" name = "evm-testnet" repository = "https://github.com/maidsafe/autonomi" -version = "0.1.6" +version = "0.1.7" [dependencies] -ant-evm = { path = "../ant-evm", version = "0.1.6" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } clap = { version = "4.5", features = ["derive"] } dirs-next = "~2.0.0" -evmlib = { path = "../evmlib", version = "0.1.6" } +evmlib = { path = "../evmlib", version = "0.1.7" } tokio = { version = "1.40", features = ["rt-multi-thread", "signal"] } [lints] diff --git a/evmlib/Cargo.toml b/evmlib/Cargo.toml index 79315c0348..b2ed695a04 100644 --- a/evmlib/Cargo.toml +++ b/evmlib/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://maidsafe.net" license = "GPL-3.0" name = "evmlib" repository = "https://github.com/maidsafe/safe_network" -version = "0.1.6" +version = "0.1.7" [features] wasm-bindgen = ["alloy/wasm-bindgen"] diff --git a/evmlib/src/contract/network_token.rs b/evmlib/src/contract/network_token.rs index 10903c9fd2..df18b37a1d 100644 --- a/evmlib/src/contract/network_token.rs +++ b/evmlib/src/contract/network_token.rs @@ -8,6 +8,7 @@ use crate::common::{Address, Calldata, TxHash, U256}; use crate::contract::network_token::NetworkTokenContract::NetworkTokenContractInstance; +use crate::TX_TIMEOUT; use alloy::network::TransactionBuilder; use alloy::providers::{Network, Provider}; use alloy::sol; @@ -108,9 +109,10 @@ where .await .inspect_err(|err| { error!( - "Error approving spender {spender:?} to spend raw amt of tokens {value}: {err:?}" + "Error to send_transaction while approving spender {spender:?} to spend raw amt of tokens {value}: {err:?}" ) - })?; + })? + .with_timeout(Some(TX_TIMEOUT)); let pending_tx_hash = *pending_tx_builder.tx_hash(); @@ -150,8 +152,9 @@ where .send_transaction(transaction_request) .await .inspect_err(|err| { - error!("Error transferring raw amt of tokens to {receiver:?}: {err:?}") - })?; + error!("Error to send_transaction during transfer raw amt of tokens to {receiver:?}: {err:?}") + })? + .with_timeout(Some(TX_TIMEOUT)); let pending_tx_hash = *pending_tx_builder.tx_hash(); debug!( diff --git a/evmlib/src/contract/payment_vault/handler.rs b/evmlib/src/contract/payment_vault/handler.rs index 1000d7d108..4330f31fbe 100644 --- a/evmlib/src/contract/payment_vault/handler.rs +++ b/evmlib/src/contract/payment_vault/handler.rs @@ -2,6 +2,7 @@ use crate::common::{Address, Amount, Calldata, TxHash}; use crate::contract::payment_vault::error::Error; use crate::contract::payment_vault::interface::IPaymentVault; use crate::contract::payment_vault::interface::IPaymentVault::IPaymentVaultInstance; +use crate::TX_TIMEOUT; use alloy::network::{Network, TransactionBuilder}; use alloy::providers::Provider; use alloy::transports::Transport; @@ -59,13 +60,20 @@ where .with_to(to) .with_input(calldata); - let tx_hash = self + let pending_tx_builder = self .contract .provider() .send_transaction(transaction_request) - .await? - .watch() - .await?; + .await + .inspect_err(|err| error!("Error to send_transaction during pay_for_quotes: {err:?}"))? + .with_timeout(Some(TX_TIMEOUT)); + + let pending_tx_hash = pending_tx_builder.tx_hash(); + debug!("pay_for_quotes is pending with tx hash: {pending_tx_hash}"); + + let tx_hash = pending_tx_builder.watch().await.inspect_err(|err| { + error!("Error to watch transaction during pay_for_quotes: {err:?}") + })?; Ok(tx_hash) } diff --git a/evmlib/src/lib.rs b/evmlib/src/lib.rs index abd5d3309a..e2715c0ed6 100644 --- a/evmlib/src/lib.rs +++ b/evmlib/src/lib.rs @@ -52,6 +52,9 @@ const ARBITRUM_ONE_DATA_PAYMENTS_ADDRESS: Address = const ARBITRUM_SEPOLIA_DATA_PAYMENTS_ADDRESS: Address = address!("993C7739f50899A997fEF20860554b8a28113634"); +/// Timeout for transactions +const TX_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(60); + #[serde_as] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct CustomNetwork { diff --git a/evmlib/src/wallet.rs b/evmlib/src/wallet.rs index 0f6ba3acea..40b302ccad 100644 --- a/evmlib/src/wallet.rs +++ b/evmlib/src/wallet.rs @@ -12,7 +12,7 @@ use crate::contract::payment_vault::handler::PaymentVaultHandler; use crate::contract::payment_vault::MAX_TRANSFERS_PER_TRANSACTION; use crate::contract::{network_token, payment_vault}; use crate::utils::http_provider; -use crate::Network; +use crate::{Network, TX_TIMEOUT}; use alloy::hex::ToHexExt; use alloy::network::{Ethereum, EthereumWallet, NetworkWallet, TransactionBuilder}; use alloy::providers::fillers::{ @@ -262,7 +262,20 @@ pub async fn transfer_gas_tokens( .with_to(receiver) .with_value(amount); - let tx_hash = provider.send_transaction(tx).await?.watch().await?; + let pending_tx_builder = provider + .send_transaction(tx) + .await + .inspect_err(|err| { + error!("Error to send_transaction during transfer_gas_tokens: {err}"); + })? + .with_timeout(Some(TX_TIMEOUT)); + let pending_tx_hash = *pending_tx_builder.tx_hash(); + debug!("The transfer of gas tokens is pending with tx_hash: {pending_tx_hash}"); + + let tx_hash = pending_tx_builder.watch().await.inspect_err(|err| { + error!("Error watching transfer_gas_tokens tx with hash {pending_tx_hash}: {err}") + })?; + debug!("Transfer of gas tokens with tx_hash: {tx_hash} is successful"); Ok(tx_hash) } diff --git a/nat-detection/Cargo.toml b/nat-detection/Cargo.toml index 68f101c533..4e8b4ccae9 100644 --- a/nat-detection/Cargo.toml +++ b/nat-detection/Cargo.toml @@ -7,7 +7,7 @@ license = "GPL-3.0" name = "nat-detection" readme = "README.md" repository = "https://github.com/maidsafe/autonomi" -version = "0.2.13" +version = "0.2.14" [[bin]] name = "nat-detection" @@ -17,9 +17,9 @@ path = "src/main.rs" nightly = [] [dependencies] -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-networking = { path = "../ant-networking", version = "0.3.1" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-networking = { path = "../ant-networking", version = "0.3.2" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } clap = { version = "4.5.4", features = ["derive"] } clap-verbosity-flag = "2.2.0" color-eyre = { version = "0.6", default-features = false } diff --git a/node-launchpad/Cargo.toml b/node-launchpad/Cargo.toml index af907358f9..362421a3d9 100644 --- a/node-launchpad/Cargo.toml +++ b/node-launchpad/Cargo.toml @@ -2,7 +2,7 @@ authors = ["MaidSafe Developers "] description = "TUI for running nodes on the Autonomi network" name = "node-launchpad" -version = "0.5.1" +version = "0.5.2" edition = "2021" license = "GPL-3.0" homepage = "https://maidsafe.net" @@ -18,13 +18,13 @@ path = "src/bin/tui/main.rs" nightly = [] [dependencies] -ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.1" } -ant-build-info = { path = "../ant-build-info", version = "0.1.21" } -ant-evm = { path = "../ant-evm", version = "0.1.6" } -ant-node-manager = { version = "0.11.5", path = "../ant-node-manager" } -ant-protocol = { path = "../ant-protocol", version = "0.3.1" } +ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.2" } +ant-build-info = { path = "../ant-build-info", version = "0.1.22" } +ant-evm = { path = "../ant-evm", version = "0.1.7" } +ant-node-manager = { version = "0.11.6", path = "../ant-node-manager" } +ant-protocol = { path = "../ant-protocol", version = "0.3.2" } ant-releases = { version = "0.4.0" } -ant-service-management = { version = "0.4.5", path = "../ant-service-management" } +ant-service-management = { version = "0.4.6", path = "../ant-service-management" } arboard = "3.4.1" atty = "0.2.14" better-panic = "0.3.0" diff --git a/release-cycle-info b/release-cycle-info index 1654433584..f06fab042a 100644 --- a/release-cycle-info +++ b/release-cycle-info @@ -15,4 +15,4 @@ release-year: 2024 release-month: 12 release-cycle: 1 -release-cycle-counter: 6 +release-cycle-counter: 7 diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 2f97669449..659717380b 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -7,13 +7,13 @@ license = "GPL-3.0" name = "test-utils" readme = "README.md" repository = "https://github.com/maidsafe/safe_network" -version = "0.4.13" +version = "0.4.14" [dependencies] bytes = { version = "1.0.1", features = ["serde"] } color-eyre = "~0.6.2" dirs-next = "~2.0.0" -evmlib = { path = "../evmlib", version = "0.1.6" } +evmlib = { path = "../evmlib", version = "0.1.7" } libp2p = { version = "0.54.1", features = ["identify", "kad"] } rand = "0.8.5" serde = { version = "1.0.133", features = ["derive"] }