optionally compare with partitioned rewards (#32126)

This commit is contained in:
Jeff Washington (jwash) 2023-06-14 12:55:09 -05:00 committed by GitHub
parent 2b5594a409
commit 9cf10b7aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -3155,6 +3155,21 @@ impl Bank {
metrics,
);
// this checking of an unactivated feature can be enabled in tests or with a validator by passing `--partitioned-epoch-rewards-compare-calculation`
if self
.partitioned_epoch_rewards_config()
.test_compare_partitioned_epoch_rewards
{
// immutable `&self` to avoid side effects
(self as &Bank).compare_with_partitioned_rewards(
&stake_rewards,
&vote_account_rewards,
rewarded_epoch,
thread_pool,
null_tracer(),
);
}
self.store_stake_accounts(&stake_rewards, metrics);
let vote_rewards = self.store_vote_accounts(vote_account_rewards, metrics);
self.update_reward_history(stake_rewards, vote_rewards);