From 3b316a32a901bce800c26c7cc497bc7da4b5782f Mon Sep 17 00:00:00 2001 From: paulo Date: Thu, 1 Aug 2024 20:45:35 +0100 Subject: [PATCH] fix session stats by skipping subset --- src/runtimes/kusama.rs | 5 +++++ src/runtimes/paseo.rs | 5 +++++ src/runtimes/polkadot.rs | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/runtimes/kusama.rs b/src/runtimes/kusama.rs index 77be23f..5f9f8bf 100644 --- a/src/runtimes/kusama.rs +++ b/src/runtimes/kusama.rs @@ -3447,6 +3447,11 @@ pub async fn cache_session_stats_records( .try_into() .unwrap(); + // check to skip subset stats if no validators + if ss.vals_total == 0 { + continue; + } + // active validators ss.vals_active = validators .iter() diff --git a/src/runtimes/paseo.rs b/src/runtimes/paseo.rs index 6ff5bfa..b477b72 100644 --- a/src/runtimes/paseo.rs +++ b/src/runtimes/paseo.rs @@ -3441,6 +3441,11 @@ pub async fn cache_session_stats_records( .try_into() .unwrap(); + // check to skip subset stats if no validators + if ss.vals_total == 0 { + continue; + } + // active validators ss.vals_active = validators .iter() diff --git a/src/runtimes/polkadot.rs b/src/runtimes/polkadot.rs index 7ccf95a..210da44 100644 --- a/src/runtimes/polkadot.rs +++ b/src/runtimes/polkadot.rs @@ -3447,6 +3447,11 @@ pub async fn cache_session_stats_records( .try_into() .unwrap(); + // check to skip subset stats if no validators + if ss.vals_total == 0 { + continue; + } + // active validators ss.vals_active = validators .iter()