diff --git a/Cargo.lock b/Cargo.lock index 29052b2b..921d0596 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7614,7 +7614,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "subvt-app-service" -version = "0.17.25" +version = "0.17.26" dependencies = [ "actix-http", "actix-rt", @@ -7643,7 +7643,7 @@ dependencies = [ [[package]] name = "subvt-block-processor" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-lock", @@ -7669,7 +7669,7 @@ dependencies = [ [[package]] name = "subvt-config" -version = "0.17.25" +version = "0.17.26" dependencies = [ "config", "serde", @@ -7677,7 +7677,7 @@ dependencies = [ [[package]] name = "subvt-governance" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "lazy_static", @@ -7691,7 +7691,7 @@ dependencies = [ [[package]] name = "subvt-logging" -version = "0.17.25" +version = "0.17.26" dependencies = [ "env_logger", "log", @@ -7700,7 +7700,7 @@ dependencies = [ [[package]] name = "subvt-metrics" -version = "0.17.25" +version = "0.17.26" dependencies = [ "env_logger", "log", @@ -7714,7 +7714,7 @@ dependencies = [ [[package]] name = "subvt-network-status-server" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -7739,7 +7739,7 @@ dependencies = [ [[package]] name = "subvt-network-status-updater" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -7761,7 +7761,7 @@ dependencies = [ [[package]] name = "subvt-nft" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "lazy_static", @@ -7773,7 +7773,7 @@ dependencies = [ [[package]] name = "subvt-notification-generator" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-lock", @@ -7800,7 +7800,7 @@ dependencies = [ [[package]] name = "subvt-notification-processor" -version = "0.17.25" +version = "0.17.26" dependencies = [ "a2", "anyhow", @@ -7835,7 +7835,7 @@ dependencies = [ [[package]] name = "subvt-onekv-updater" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -7857,7 +7857,7 @@ dependencies = [ [[package]] name = "subvt-persistence" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "chrono", @@ -7876,7 +7876,7 @@ dependencies = [ [[package]] name = "subvt-plotter" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "chrono", @@ -7899,7 +7899,7 @@ dependencies = [ [[package]] name = "subvt-proc-macro" -version = "0.17.25" +version = "0.17.26" dependencies = [ "proc-macro2", "quote", @@ -7908,7 +7908,7 @@ dependencies = [ [[package]] name = "subvt-referendum-updater" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -7932,7 +7932,7 @@ dependencies = [ [[package]] name = "subvt-report-service" -version = "0.17.25" +version = "0.17.26" dependencies = [ "actix-web", "anyhow", @@ -7958,7 +7958,7 @@ dependencies = [ [[package]] name = "subvt-service-common" -version = "0.17.25" +version = "0.17.26" dependencies = [ "actix-web", "anyhow", @@ -7975,7 +7975,7 @@ dependencies = [ [[package]] name = "subvt-substrate-client" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-lock", @@ -8004,7 +8004,7 @@ dependencies = [ [[package]] name = "subvt-telegram-bot" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-recursion", @@ -8042,7 +8042,7 @@ dependencies = [ [[package]] name = "subvt-telemetry-processor" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-lock", @@ -8066,7 +8066,7 @@ dependencies = [ [[package]] name = "subvt-types" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "chrono", @@ -8107,7 +8107,7 @@ dependencies = [ [[package]] name = "subvt-utility" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "hex", @@ -8117,7 +8117,7 @@ dependencies = [ [[package]] name = "subvt-validator-details-server" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -8141,7 +8141,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-server" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-trait", @@ -8168,7 +8168,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-updater" -version = "0.17.25" +version = "0.17.26" dependencies = [ "anyhow", "async-lock", diff --git a/_docker/compose/.env.sample b/_docker/compose/.env.sample index 515bb26b..d8ae05e1 100644 --- a/_docker/compose/.env.sample +++ b/_docker/compose/.env.sample @@ -1,4 +1,4 @@ -VERSION=0.17.25 +VERSION=0.17.26 ENV=production LOG_LEVEL=debug diff --git a/subvt-app-service/Cargo.toml b/subvt-app-service/Cargo.toml index 9d4f2201..4209de6a 100644 --- a/subvt-app-service/Cargo.toml +++ b/subvt-app-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-app-service" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-block-processor/Cargo.toml b/subvt-block-processor/Cargo.toml index 3df29235..e7fabf35 100644 --- a/subvt-block-processor/Cargo.toml +++ b/subvt-block-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-block-processor" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-block-processor/src/lib.rs b/subvt-block-processor/src/lib.rs index 1668ce1d..224b6d66 100644 --- a/subvt-block-processor/src/lib.rs +++ b/subvt-block-processor/src/lib.rs @@ -166,6 +166,7 @@ impl BlockProcessor { let era_stakers = substrate_client .get_era_stakers(&active_era, &block_hash) .await?; + log::error!("ERA STAKERS :: {}", era_stakers.stakers.len()); if last_epoch_index != current_epoch.index { log::info!("New epoch. Persist epoch, and persist era if it doesn't exist."); let total_stake = substrate_client diff --git a/subvt-config/Cargo.toml b/subvt-config/Cargo.toml index ae81039f..bd421b1b 100644 --- a/subvt-config/Cargo.toml +++ b/subvt-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-config" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-governance/Cargo.toml b/subvt-governance/Cargo.toml index deb5841e..b6627c8a 100644 --- a/subvt-governance/Cargo.toml +++ b/subvt-governance/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-governance" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-logging/Cargo.toml b/subvt-logging/Cargo.toml index bb6f6bac..9e47162d 100644 --- a/subvt-logging/Cargo.toml +++ b/subvt-logging/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-logging" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-metrics/Cargo.toml b/subvt-metrics/Cargo.toml index e7f57b92..db02dd75 100644 --- a/subvt-metrics/Cargo.toml +++ b/subvt-metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-metrics" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-server/Cargo.toml b/subvt-network-status-server/Cargo.toml index 9bafef6e..892dbdd9 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-updater/Cargo.toml b/subvt-network-status-updater/Cargo.toml index 855ecdce..b2e20b35 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-nft/Cargo.toml b/subvt-nft/Cargo.toml index 16b3f262..9ddae6d2 100644 --- a/subvt-nft/Cargo.toml +++ b/subvt-nft/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-nft" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-generator/Cargo.toml b/subvt-notification-generator/Cargo.toml index c5d892cf..deaac5ac 100644 --- a/subvt-notification-generator/Cargo.toml +++ b/subvt-notification-generator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-generator" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-processor/Cargo.toml b/subvt-notification-processor/Cargo.toml index f72e1aa1..595b8929 100644 --- a/subvt-notification-processor/Cargo.toml +++ b/subvt-notification-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-processor" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-onekv-updater/Cargo.toml b/subvt-onekv-updater/Cargo.toml index 1befc8a2..2443565a 100644 --- a/subvt-onekv-updater/Cargo.toml +++ b/subvt-onekv-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-onekv-updater" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-persistence/Cargo.toml b/subvt-persistence/Cargo.toml index 2fb40c0b..1357b012 100644 --- a/subvt-persistence/Cargo.toml +++ b/subvt-persistence/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-persistence" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-plotter/Cargo.toml b/subvt-plotter/Cargo.toml index 04d429a9..99e9df25 100644 --- a/subvt-plotter/Cargo.toml +++ b/subvt-plotter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-plotter" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-proc-macro/Cargo.toml b/subvt-proc-macro/Cargo.toml index ca84698e..ff5cadbf 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-referendum-updater/Cargo.toml b/subvt-referendum-updater/Cargo.toml index 24f54178..05560c5a 100644 --- a/subvt-referendum-updater/Cargo.toml +++ b/subvt-referendum-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-referendum-updater" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-report-service/Cargo.toml b/subvt-report-service/Cargo.toml index 21e4252c..fc1db0b4 100644 --- a/subvt-report-service/Cargo.toml +++ b/subvt-report-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-report-service" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-service-common/Cargo.toml b/subvt-service-common/Cargo.toml index 222256a9..890b6100 100644 --- a/subvt-service-common/Cargo.toml +++ b/subvt-service-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-service-common" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-substrate-client/Cargo.toml b/subvt-substrate-client/Cargo.toml index 9b925432..afd51271 100644 --- a/subvt-substrate-client/Cargo.toml +++ b/subvt-substrate-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-substrate-client" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-substrate-client/src/lib.rs b/subvt-substrate-client/src/lib.rs index 514f50b3..e528d07c 100644 --- a/subvt-substrate-client/src/lib.rs +++ b/subvt-substrate-client/src/lib.rs @@ -4,7 +4,6 @@ use crate::storage_utility::{ get_rpc_paged_keys_params, get_rpc_paged_map_keys_params, get_rpc_storage_map_params, get_rpc_storage_plain_params, get_storage_double_map_key, get_storage_map_key, - module_has_storage_item, }; use async_recursion::async_recursion; use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed, RuntimeMetadataV14}; @@ -1140,9 +1139,6 @@ impl SubstrateClient { /// Get all the active stakes for the given era. pub async fn get_era_stakers(&self, era: &Era, block_hash: &str) -> anyhow::Result { - if !module_has_storage_item(&self.metadata, "Staking", "ErasStakersPaged") { - return self.get_era_stakers_legacy(era, true, block_hash).await; - } let exposure_metadata_map = self.get_exposure_metadata_map(era, block_hash).await?; let mut all_keys: Vec = Vec::new(); loop { @@ -1172,6 +1168,9 @@ impl SubstrateClient { break; } } + if all_keys.is_empty() { + return self.get_era_stakers_legacy(era, true, block_hash).await; + } let mut stakers: Vec = Vec::new(); for chunk in all_keys.chunks(KEY_QUERY_PAGE_SIZE) { diff --git a/subvt-substrate-client/src/storage_utility.rs b/subvt-substrate-client/src/storage_utility.rs index 5cfe4c82..896f4d2b 100644 --- a/subvt-substrate-client/src/storage_utility.rs +++ b/subvt-substrate-client/src/storage_utility.rs @@ -62,24 +62,6 @@ pub fn get_rpc_paged_keys_params<'a>( params } -pub fn module_has_storage_item( - metadata: &RuntimeMetadataV14, - module_name: &str, - storage_name: &str, -) -> bool { - metadata - .pallets - .iter() - .find(|p| p.name == module_name) - .unwrap() - .storage - .as_ref() - .unwrap() - .entries - .iter() - .any(|s| s.name == storage_name) -} - fn get_map_key_hash( metadata: &RuntimeMetadataV14, module_name: &str, diff --git a/subvt-telegram-bot/Cargo.toml b/subvt-telegram-bot/Cargo.toml index ba02d78b..559f82c8 100644 --- a/subvt-telegram-bot/Cargo.toml +++ b/subvt-telegram-bot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telegram-bot" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-telemetry-processor/Cargo.toml b/subvt-telemetry-processor/Cargo.toml index 9c4f0dbf..8bdd2fe2 100644 --- a/subvt-telemetry-processor/Cargo.toml +++ b/subvt-telemetry-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telemetry-processor" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-types/Cargo.toml b/subvt-types/Cargo.toml index 609c2508..7f006e8d 100644 --- a/subvt-types/Cargo.toml +++ b/subvt-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-types" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-utility/Cargo.toml b/subvt-utility/Cargo.toml index 80003bd7..189a5eec 100644 --- a/subvt-utility/Cargo.toml +++ b/subvt-utility/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-utility" -version = "0.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-details-server/Cargo.toml b/subvt-validator-details-server/Cargo.toml index ef29d0f1..c6d8a1f0 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-server/Cargo.toml b/subvt-validator-list-server/Cargo.toml index 4db73290..574b0b0c 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-updater/Cargo.toml b/subvt-validator-list-updater/Cargo.toml index bf30168c..9e6e338b 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.17.25" +version = "0.17.26" edition = "2021" rust-version = "1.67.0"