Skip to content
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

Fix new_session benchmark in pallet_collator_selection #3189

Conversation

georgepisaltu
Copy link
Contributor

Issue was discovered by enabling async backing on all parachains in this PR.

The reason it happened is because with the move to async backing, the DAYS and HOURS constants doubled compared to the previously imported values from parachain_common, which led to the Period doubling. This matters because in pallet_collator_selection::Config, the allowed period of inactivity for collators is a Period. When a new session is initialized, candidates which don't meet the criteria here are removed.

The benchmark code hardcoded the last active block value which is safe from kick to the pervious value of a period, 1800, with the chain starting at 0. When running the check, KickThreshold was 1800, so it would pass, but it obviously doesn't work if the Period isn't 1800.

This PR fixes the benchmark by setting the new_block value to T::KickThreshold::get(), which will work for any chosen Period.

Opening this PR against the original branch to expedite the merge.

@georgepisaltu georgepisaltu added R0-silent Changes should not be mentioned in any release notes T12-benchmarks This PR/Issue is related to benchmarking and weights. labels Feb 2, 2024
@bkchr bkchr merged commit 8bf9c79 into paritytech:mrcnski/enable-async-backing-on-testnet-system-chains Feb 2, 2024
129 of 135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants