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

Ensure weights are correct #5792

Open
eskimor opened this issue Sep 20, 2024 · 4 comments
Open

Ensure weights are correct #5792

eskimor opened this issue Sep 20, 2024 · 4 comments

Comments

@eskimor
Copy link
Member

eskimor commented Sep 20, 2024

Implement a (generic) fuzzy test to fill up a blocks with random transactions and parameters. Then verify that the resulting block is valid in terms of actual execution time and size.

This test should be generic or easily adjustable and part of any templates. Both system chains and community chains should run this test by default in CI.

@kianenigma
Copy link
Contributor

This, plus #152 would make great tools to ensure it is REALLY HARD to mess your parachains' weights.

@kianenigma
Copy link
Contributor

plus #3581

@kianenigma
Copy link
Contributor

@rockbmb and I talked about this. A quick summary.

There are two weights in any given block.

  1. The weight stored in system::BlockWeight storage item. This is computed (excluding the PoV reclaim mechanism) purely based on benchmarking outcome. There is no real measurement of time/proof involved in this. Once the block is done, this number can be seen as a claim: The runtime thinks it has at most consumed this much weight.
  2. Then, there is the real weight, which can be calculated by re-executing the very same block, over the reference hardware, in an environment as close to production as possible.

Based on @ggwpez, the building block of this testing is mostly present in benchmark block command which re-executes blocks.

@kianenigma
Copy link
Contributor

plus #5891 is a good step in this direction.

@kianenigma kianenigma moved this to Backlog in AHM Oct 21, 2024
@kianenigma kianenigma added this to AHM Oct 21, 2024
@kianenigma kianenigma removed this from AHM Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants