The goal of this PR is to update the benchmark for on_initialize to include the weight when a new RewardEra must be created.
Closes #1949
Discussion
Separates the benchmark for on_initialize into two, start_new_epoch_if_needed and start_new_reward_era_if_needed. Those functions return the WeightInfo for their respective benchmarks.
For start_new_reward_era_if_needed, fills up the reward pool history and sets up the block and era to ensure that a new RewardEra will be created during the benchmark.
Results: The new weights are a lot larger, 19M as compared to 4M, 6 reads as compared to 2, 4 writes as compared to 1, so there's some optimization work to be done. Filed new Issue #1967
Goal
The goal of this PR is to update the benchmark for
on_initialize
to include the weight when a new RewardEra must be created.Closes #1949
Discussion
Separates the benchmark for on_initialize into two,
start_new_epoch_if_needed
andstart_new_reward_era_if_needed
. Those functions return the WeightInfo for their respective benchmarks.For
start_new_reward_era_if_needed
, fills up the reward pool history and sets up the block and era to ensure that a new RewardEra will be created during the benchmark.Results: The new weights are a lot larger, 19M as compared to 4M, 6 reads as compared to 2, 4 writes as compared to 1, so there's some optimization work to be done. Filed new Issue #1967
Checklist