connect `begin_partitioned_rewards` to bank (#32152)
This commit is contained in:
parent
90812fac76
commit
d79b565c72
|
@ -1787,7 +1787,7 @@ impl Bank {
|
||||||
&mut self,
|
&mut self,
|
||||||
parent_epoch: Epoch,
|
parent_epoch: Epoch,
|
||||||
parent_slot: Slot,
|
parent_slot: Slot,
|
||||||
_parent_height: u64,
|
parent_height: u64,
|
||||||
reward_calc_tracer: Option<impl RewardCalcTracer>,
|
reward_calc_tracer: Option<impl RewardCalcTracer>,
|
||||||
) {
|
) {
|
||||||
let epoch = self.epoch();
|
let epoch = self.epoch();
|
||||||
|
@ -1821,12 +1821,27 @@ impl Bank {
|
||||||
// After saving a snapshot of stakes, apply stake rewards and commission
|
// After saving a snapshot of stakes, apply stake rewards and commission
|
||||||
let (_, update_rewards_with_thread_pool_time) = measure!(
|
let (_, update_rewards_with_thread_pool_time) = measure!(
|
||||||
{
|
{
|
||||||
self.update_rewards_with_thread_pool(
|
if self.is_partitioned_rewards_feature_enabled()
|
||||||
parent_epoch,
|
|| self
|
||||||
reward_calc_tracer,
|
.partitioned_epoch_rewards_config()
|
||||||
&thread_pool,
|
.test_enable_partitioned_rewards
|
||||||
&mut rewards_metrics,
|
{
|
||||||
)
|
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",
|
"update_rewards_with_thread_pool",
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue