From f65c3ce97e90db44f747d6533bea78b06dfa66fe Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 2 Jun 2021 20:45:40 -0700 Subject: [PATCH] Add 'Validators by stake level' line to epoch summary --- bot/src/stake_pool.rs | 7 ++++++- bot/src/stake_pool_v0.rs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bot/src/stake_pool.rs b/bot/src/stake_pool.rs index a16050a5..4e32950a 100644 --- a/bot/src/stake_pool.rs +++ b/bot/src/stake_pool.rs @@ -158,6 +158,7 @@ impl GenericStakePool for StakePoolOMatic { desired_validator_stake: &[ValidatorStake], ) -> Result<(EpochStakeNotes, ValidatorStakeActions), Box> { let mut validator_stake_actions = HashMap::default(); + let mut no_stake_node_count = 0; let mut bonus_stake_node_count = 0; let mut baseline_stake_node_count = 0; @@ -175,7 +176,7 @@ impl GenericStakePool for StakePoolOMatic { match stake_state { ValidatorStakeState::Bonus => bonus_stake_node_count += 1, ValidatorStakeState::Baseline => baseline_stake_node_count += 1, - ValidatorStakeState::None => (), + ValidatorStakeState::None => no_stake_node_count += 1, } } @@ -288,6 +289,10 @@ impl GenericStakePool for StakePoolOMatic { ), format!("Baseline stake amount: {}", Sol(self.baseline_stake_amount)), format!("Bonus stake amount: {}", Sol(bonus_stake_amount)), + format!( + "Validators by stake level: None={}, Baseline={}, Bonus={}", + no_stake_node_count, baseline_stake_node_count, bonus_stake_node_count + ), ]; let busy_validators = validator_stake_actions diff --git a/bot/src/stake_pool_v0.rs b/bot/src/stake_pool_v0.rs index 7ef09a03..63f0b595 100644 --- a/bot/src/stake_pool_v0.rs +++ b/bot/src/stake_pool_v0.rs @@ -220,6 +220,10 @@ impl GenericStakePool for StakePool { ), format!("Baseline stake amount: {}", Sol(self.baseline_stake_amount)), format!("Bonus stake amount: {}", Sol(bonus_stake_amount)), + format!( + "Validators by stake level: None={}, Baseline={}, Bonus={}", + min_stake_node_count, baseline_stake_node_count, bonus_stake_node_count + ), ]; let busy_validators = validator_stake_actions