Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

paras: adjust weights for root dispatchables #6347

Closed
wants to merge 1 commit into from

Conversation

slumber
Copy link
Contributor

@slumber slumber commented Nov 25, 2022

force_schedule_code_upgrade can kick off a pvf-check which should be taken into account. This one is simple.

There's also add_trusted_validation_code, it's weight cannot be computed ahead of dispatch: an edge case is when there're a lot of paras having the same code hash they want to upgrade to and this code undergoes a prechecking.

In order to know how many paras are doing it, it's necessary to access a chain state (PvfActiveVoteMap).
It's of course not crucial because pvf check always concludes or times out at worst.
One simple possible approach is to require some generous weight for the call and then compute it in flight, refunding the rest. Given it may only be used by root or governance, should be fine.

@slumber slumber added A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Nov 25, 2022
@slumber slumber requested a review from pepyakin November 25, 2022 13:14
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable
Logs: https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/2086274

@slumber
Copy link
Contributor Author

slumber commented May 2, 2023

Closed in favor of #7138

@slumber slumber closed this May 2, 2023
@slumber slumber deleted the slumber-pvf-precheck-adjust-weights branch May 2, 2023 19:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants