-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chores/update capacity benchmarks #1949 #1966
Chores/update capacity benchmarks #1949 #1966
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. If you look at the on_initialize
it consists of start_new_epoch_if_needed
weights + start_new_reward_era_if_needed
weights and inside each of them you are reusing T::WeightInfo::on_initialize()
which makes this whole calculation kinda recursive!?
I think one way to fix this is to benchmark start_new_epoch_if_needed
and start_new_reward_era_if_needed
separately and maybe add them to get the weights for on_initialize
You are correct, I'd completely overlooked that it was doing that, and I'm not sure why it was set up that way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Ship it!
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