From 6bd1dfb0f0132ccb1b0bbd6ce02f67a09d44c93f Mon Sep 17 00:00:00 2001 From: kukabi Date: Sun, 9 Mar 2025 12:51:38 +0300 Subject: [PATCH] Better logging in validator details fetch. Bump version. --- Cargo.lock | 56 +++++++++---------- _docker/compose/.env.sample | 2 +- subvt-app-service/Cargo.toml | 2 +- subvt-block-processor/Cargo.toml | 2 +- subvt-config/Cargo.toml | 2 +- subvt-governance/Cargo.toml | 2 +- subvt-kline-updater/Cargo.toml | 2 +- subvt-logging/Cargo.toml | 2 +- subvt-metrics/Cargo.toml | 2 +- subvt-network-status-server/Cargo.toml | 2 +- subvt-network-status-updater/Cargo.toml | 2 +- subvt-nft/Cargo.toml | 2 +- subvt-notification-generator/Cargo.toml | 2 +- subvt-notification-processor/Cargo.toml | 2 +- subvt-onekv-updater/Cargo.toml | 2 +- subvt-persistence/Cargo.toml | 2 +- subvt-plotter/Cargo.toml | 2 +- subvt-proc-macro/Cargo.toml | 2 +- subvt-referendum-updater/Cargo.toml | 2 +- subvt-report-service/Cargo.toml | 2 +- subvt-service-common/Cargo.toml | 2 +- .../Cargo.toml | 2 +- subvt-substrate-client/Cargo.toml | 2 +- subvt-telegram-bot/Cargo.toml | 2 +- subvt-telemetry-processor/Cargo.toml | 2 +- subvt-types/Cargo.toml | 2 +- subvt-utility/Cargo.toml | 2 +- subvt-validator-details-server/Cargo.toml | 2 +- subvt-validator-list-server/Cargo.toml | 2 +- subvt-validator-list-updater/Cargo.toml | 2 +- subvt-validator-list-updater/src/lib.rs | 22 ++++++-- 31 files changed, 73 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d86d0abd..28ff0c6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6961,7 +6961,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subvt-app-service" -version = "0.22.6" +version = "0.22.7" dependencies = [ "actix-http", "actix-rt", @@ -6989,7 +6989,7 @@ dependencies = [ [[package]] name = "subvt-block-processor" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-lock", @@ -7011,7 +7011,7 @@ dependencies = [ [[package]] name = "subvt-config" -version = "0.22.6" +version = "0.22.7" dependencies = [ "config", "serde", @@ -7019,7 +7019,7 @@ dependencies = [ [[package]] name = "subvt-governance" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "lazy_static", @@ -7031,7 +7031,7 @@ dependencies = [ [[package]] name = "subvt-kline-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7050,7 +7050,7 @@ dependencies = [ [[package]] name = "subvt-logging" -version = "0.22.6" +version = "0.22.7" dependencies = [ "env_logger", "log", @@ -7059,7 +7059,7 @@ dependencies = [ [[package]] name = "subvt-metrics" -version = "0.22.6" +version = "0.22.7" dependencies = [ "log", "once_cell", @@ -7071,7 +7071,7 @@ dependencies = [ [[package]] name = "subvt-network-status-server" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7093,7 +7093,7 @@ dependencies = [ [[package]] name = "subvt-network-status-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7114,7 +7114,7 @@ dependencies = [ [[package]] name = "subvt-nft" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "lazy_static", @@ -7125,7 +7125,7 @@ dependencies = [ [[package]] name = "subvt-notification-generator" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-lock", @@ -7151,7 +7151,7 @@ dependencies = [ [[package]] name = "subvt-notification-processor" -version = "0.22.6" +version = "0.22.7" dependencies = [ "a2", "anyhow", @@ -7184,7 +7184,7 @@ dependencies = [ [[package]] name = "subvt-onekv-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7203,7 +7203,7 @@ dependencies = [ [[package]] name = "subvt-persistence" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "chrono", @@ -7220,7 +7220,7 @@ dependencies = [ [[package]] name = "subvt-plotter" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "chrono", @@ -7241,7 +7241,7 @@ dependencies = [ [[package]] name = "subvt-proc-macro" -version = "0.22.6" +version = "0.22.7" dependencies = [ "proc-macro2", "quote", @@ -7250,7 +7250,7 @@ dependencies = [ [[package]] name = "subvt-referendum-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7270,7 +7270,7 @@ dependencies = [ [[package]] name = "subvt-report-service" -version = "0.22.6" +version = "0.22.7" dependencies = [ "actix-web", "anyhow", @@ -7295,7 +7295,7 @@ dependencies = [ [[package]] name = "subvt-service-common" -version = "0.22.6" +version = "0.22.7" dependencies = [ "actix-web", "anyhow", @@ -7311,7 +7311,7 @@ dependencies = [ [[package]] name = "subvt-session-validator-performance-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7328,7 +7328,7 @@ dependencies = [ [[package]] name = "subvt-substrate-client" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-recursion", @@ -7349,7 +7349,7 @@ dependencies = [ [[package]] name = "subvt-telegram-bot" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-recursion", @@ -7384,7 +7384,7 @@ dependencies = [ [[package]] name = "subvt-telemetry-processor" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-lock", @@ -7405,7 +7405,7 @@ dependencies = [ [[package]] name = "subvt-types" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "chrono", @@ -7445,7 +7445,7 @@ dependencies = [ [[package]] name = "subvt-utility" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "hex", @@ -7455,7 +7455,7 @@ dependencies = [ [[package]] name = "subvt-validator-details-server" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7478,7 +7478,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-server" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-trait", @@ -7502,7 +7502,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-updater" -version = "0.22.6" +version = "0.22.7" dependencies = [ "anyhow", "async-lock", diff --git a/_docker/compose/.env.sample b/_docker/compose/.env.sample index 7773fc86..343c5ea0 100644 --- a/_docker/compose/.env.sample +++ b/_docker/compose/.env.sample @@ -1,4 +1,4 @@ -VERSION=0.22.6 +VERSION=0.22.7 ENV=production LOG_LEVEL=debug diff --git a/subvt-app-service/Cargo.toml b/subvt-app-service/Cargo.toml index 99dfc327..5294c50c 100644 --- a/subvt-app-service/Cargo.toml +++ b/subvt-app-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-app-service" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-block-processor/Cargo.toml b/subvt-block-processor/Cargo.toml index 110fc8d8..a9fb603e 100644 --- a/subvt-block-processor/Cargo.toml +++ b/subvt-block-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-block-processor" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-config/Cargo.toml b/subvt-config/Cargo.toml index e0467e4c..aad2e338 100644 --- a/subvt-config/Cargo.toml +++ b/subvt-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-config" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-governance/Cargo.toml b/subvt-governance/Cargo.toml index 222b3314..4091f6b9 100644 --- a/subvt-governance/Cargo.toml +++ b/subvt-governance/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-governance" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-kline-updater/Cargo.toml b/subvt-kline-updater/Cargo.toml index ab33af2d..54bae1a0 100644 --- a/subvt-kline-updater/Cargo.toml +++ b/subvt-kline-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-kline-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-logging/Cargo.toml b/subvt-logging/Cargo.toml index 2a8c7f59..4983b257 100644 --- a/subvt-logging/Cargo.toml +++ b/subvt-logging/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-logging" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-metrics/Cargo.toml b/subvt-metrics/Cargo.toml index 8dae556f..3ac6731f 100644 --- a/subvt-metrics/Cargo.toml +++ b/subvt-metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-metrics" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-server/Cargo.toml b/subvt-network-status-server/Cargo.toml index 5683388a..c459f8b8 100644 --- a/subvt-network-status-server/Cargo.toml +++ b/subvt-network-status-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-network-status-server" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-updater/Cargo.toml b/subvt-network-status-updater/Cargo.toml index b0cb725d..a214d18b 100644 --- a/subvt-network-status-updater/Cargo.toml +++ b/subvt-network-status-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-network-status-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-nft/Cargo.toml b/subvt-nft/Cargo.toml index 998d2e8b..ef0c5e16 100644 --- a/subvt-nft/Cargo.toml +++ b/subvt-nft/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-nft" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-generator/Cargo.toml b/subvt-notification-generator/Cargo.toml index c1df56bb..e2567df1 100644 --- a/subvt-notification-generator/Cargo.toml +++ b/subvt-notification-generator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-generator" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-processor/Cargo.toml b/subvt-notification-processor/Cargo.toml index 7a90d77c..a1fc8c49 100644 --- a/subvt-notification-processor/Cargo.toml +++ b/subvt-notification-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-processor" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-onekv-updater/Cargo.toml b/subvt-onekv-updater/Cargo.toml index 201dfa47..2a339231 100644 --- a/subvt-onekv-updater/Cargo.toml +++ b/subvt-onekv-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-onekv-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-persistence/Cargo.toml b/subvt-persistence/Cargo.toml index 2e662537..f465c652 100644 --- a/subvt-persistence/Cargo.toml +++ b/subvt-persistence/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-persistence" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-plotter/Cargo.toml b/subvt-plotter/Cargo.toml index 5341e3a7..2f2f9a8c 100644 --- a/subvt-plotter/Cargo.toml +++ b/subvt-plotter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-plotter" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-proc-macro/Cargo.toml b/subvt-proc-macro/Cargo.toml index 024e0ea1..5f4a87fa 100644 --- a/subvt-proc-macro/Cargo.toml +++ b/subvt-proc-macro/Cargo.toml @@ -3,7 +3,7 @@ proc-macro = true [package] name = "subvt-proc-macro" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-referendum-updater/Cargo.toml b/subvt-referendum-updater/Cargo.toml index b312c3ec..5ea552b2 100644 --- a/subvt-referendum-updater/Cargo.toml +++ b/subvt-referendum-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-referendum-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-report-service/Cargo.toml b/subvt-report-service/Cargo.toml index 19dc1bf9..da468f05 100644 --- a/subvt-report-service/Cargo.toml +++ b/subvt-report-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-report-service" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-service-common/Cargo.toml b/subvt-service-common/Cargo.toml index d666f5dc..f6dcbbd9 100644 --- a/subvt-service-common/Cargo.toml +++ b/subvt-service-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-service-common" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-session-validator-performance-updater/Cargo.toml b/subvt-session-validator-performance-updater/Cargo.toml index a4668320..50b43a86 100644 --- a/subvt-session-validator-performance-updater/Cargo.toml +++ b/subvt-session-validator-performance-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-session-validator-performance-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-substrate-client/Cargo.toml b/subvt-substrate-client/Cargo.toml index e4e1d917..1424c488 100644 --- a/subvt-substrate-client/Cargo.toml +++ b/subvt-substrate-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-substrate-client" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-telegram-bot/Cargo.toml b/subvt-telegram-bot/Cargo.toml index 40711016..23fbc27c 100644 --- a/subvt-telegram-bot/Cargo.toml +++ b/subvt-telegram-bot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telegram-bot" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-telemetry-processor/Cargo.toml b/subvt-telemetry-processor/Cargo.toml index f5a45906..55dbd874 100644 --- a/subvt-telemetry-processor/Cargo.toml +++ b/subvt-telemetry-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telemetry-processor" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-types/Cargo.toml b/subvt-types/Cargo.toml index 8c352316..e39a6838 100644 --- a/subvt-types/Cargo.toml +++ b/subvt-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-types" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-utility/Cargo.toml b/subvt-utility/Cargo.toml index e1928fb1..68812796 100644 --- a/subvt-utility/Cargo.toml +++ b/subvt-utility/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-utility" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-details-server/Cargo.toml b/subvt-validator-details-server/Cargo.toml index 45126672..c1045a21 100644 --- a/subvt-validator-details-server/Cargo.toml +++ b/subvt-validator-details-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-details-server" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-server/Cargo.toml b/subvt-validator-list-server/Cargo.toml index f44a8ae2..e4d7c531 100644 --- a/subvt-validator-list-server/Cargo.toml +++ b/subvt-validator-list-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-list-server" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-updater/Cargo.toml b/subvt-validator-list-updater/Cargo.toml index 33a5a603..90725ef4 100644 --- a/subvt-validator-list-updater/Cargo.toml +++ b/subvt-validator-list-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-list-updater" -version = "0.22.6" +version = "0.22.7" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-updater/src/lib.rs b/subvt-validator-list-updater/src/lib.rs index 84e3532b..73855d3e 100644 --- a/subvt-validator-list-updater/src/lib.rs +++ b/subvt-validator-list-updater/src/lib.rs @@ -13,6 +13,7 @@ use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, }; +use std::time::Instant; use subvt_config::Config; use subvt_persistence::postgres::network::PostgreSQLNetworkStorage; use subvt_service_common::Service; @@ -226,12 +227,7 @@ impl ValidatorListUpdater { log::info!("Get RDB content for {} validators.", validators.len()); let mut db_validator_infos: Vec = Vec::new(); for (i, validator) in validators.iter().enumerate() { - log::info!( - "Validator {} of {} : {}", - i + 1, - validators.len(), - validator.account.id - ); + let start = Instant::now(); let db_validator = postgres .get_validator_info( &finalized_block_hash, @@ -240,6 +236,20 @@ impl ValidatorListUpdater { active_era.index, ) .await?; + let duration = start.elapsed(); + log::info!( + "Era {} :: {} :: Validator {} of {} : {} :: {} ms", + active_era.index, + if validator.is_active { + "Active" + } else { + "Inactive" + }, + i + 1, + validators.len(), + validator.account.id, + duration.as_millis(), + ); db_validator_infos.push(db_validator); } /*