add compare_with_partitioned_rewards (#32108)

This commit is contained in:
Jeff Washington (jwash) 2023-06-14 09:43:09 -05:00 committed by GitHub
parent ffe4c06a19
commit 2968587d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -3094,6 +3094,32 @@ impl Bank {
);
}
#[allow(dead_code)]
/// compare the vote and stake accounts between the normal rewards calculation code
/// and the partitioned rewards calculation code
/// `stake_rewards_expected` and `vote_rewards_expected` are the results of the normal rewards calculation code
/// This fn should have NO side effects.
fn compare_with_partitioned_rewards(
&self,
stake_rewards_expected: &[StakeReward],
vote_rewards_expected: &DashMap<Pubkey, VoteReward>,
rewarded_epoch: Epoch,
thread_pool: &ThreadPool,
reward_calc_tracer: Option<impl RewardCalcTracer>,
) {
let partitioned_rewards = self.calculate_rewards_for_partitioning(
rewarded_epoch,
reward_calc_tracer,
thread_pool,
&mut RewardsMetrics::default(),
);
Self::compare_with_partitioned_rewards_results(
stake_rewards_expected,
vote_rewards_expected,
partitioned_rewards,
);
}
fn load_vote_and_stake_accounts(
&mut self,
thread_pool: &ThreadPool,