connect `begin_partitioned_rewards` to bank (#32152)

This commit is contained in:
Jeff Washington (jwash) 2023-06-15 13:51:10 -05:00 committed by GitHub
parent 90812fac76
commit d79b565c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 7 deletions

View File

@ -1787,7 +1787,7 @@ impl Bank {
&mut self,
parent_epoch: Epoch,
parent_slot: Slot,
_parent_height: u64,
parent_height: u64,
reward_calc_tracer: Option<impl RewardCalcTracer>,
) {
let epoch = self.epoch();
@ -1821,12 +1821,27 @@ impl Bank {
// After saving a snapshot of stakes, apply stake rewards and commission
let (_, update_rewards_with_thread_pool_time) = measure!(
{
self.update_rewards_with_thread_pool(
parent_epoch,
reward_calc_tracer,
&thread_pool,
&mut rewards_metrics,
)
if self.is_partitioned_rewards_feature_enabled()
|| self
.partitioned_epoch_rewards_config()
.test_enable_partitioned_rewards
{
self.begin_partitioned_rewards(
reward_calc_tracer,
&thread_pool,
parent_epoch,
parent_slot,
parent_height,
&mut rewards_metrics,
);
} else {
self.update_rewards_with_thread_pool(
parent_epoch,
reward_calc_tracer,
&thread_pool,
&mut rewards_metrics,
)
}
},
"update_rewards_with_thread_pool",
);