Automatic weights documentation
Parse the weight files to calculate both extrinsic weights and relative weights, and include the results in the documentation #128 (closed).
This requires:
- The pallet weights computed on the reference machine.
- The extrinsic weights computed on the reference machine to get the weight overhead of the execution of one extrinsic.
- The paritydb weights computed on the reference machine to get the weight of read and write in the database.
Include in the docs: The relative weight for all extrinsics available as:
- In the case where the extrinsic has a complexity parameter, the weight is calculated as the worst-case scenario, i.e., the maximal value set during benchmarking.
- In the case where no weight is available, the value is set to -1% and translated to "No weight available" in the doc.
To-do list:
-
parse weight files. -
compute weights from files. -
add relative weight in % of block max. -
fix overhead benchmark. -
include computed weights in the autogenerated documentation. -
fix missing weights. -
automatic block max extraction from metadata.
Merge request reports
Activity
assigned to @bgallois
added 1 commit
- 3b59192c - fix weight evaluation with complexity parameters
added 1 commit
- b9da1a76 - fix weight evaluation with complexity parameters
added RN-silent label
changed milestone to %runtime-800
added 2 commits
added 1 commit
- ab7501c1 - add automatic max block weight from metadata
requested review from @HugoTrentesaux
- Resolved by Hugo Trentesaux
In the case where no weight is available, the value is set to 0%.
Since the documentation is targeting human reader, the following is not informative enough:
transfer(dest, value) Taking 0 % of a block.
This can be fixed by only changing the template to something like
{% if call.weight == 0 %} No available weight. {% else %} Taking {{ call.weight }} % of a block. {% endif %}
(see https://keats.github.io/tera/docs/#if for template documentation).
The MR is a nice addition and a good step towards #128 (closed).
- Resolved by Hugo Trentesaux
added 24 commits
-
a1caf6e7...bd45d2f6 - 2 commits from branch
nodes/rust:master
- bd45d2f6...8e2b1a46 - 12 earlier commits
- 5de41fad - add extrinsic base weight overhead
- 073d4308 - update docs
- 00adb9aa - remove all unwrap
- b03cc8f3 - add automatic max block weight from metadata
- 8e1af7f5 - add generic constructor
- 06e9be76 - refactor using if let chaining
- a421ce35 - refactor doc generation
- 84417ec3 - refactor error handling
- 7a0d89d1 - add const documentation
- 67b1e8f8 - fix no weight
Toggle commit list-
a1caf6e7...bd45d2f6 - 2 commits from branch
enabled an automatic merge when the pipeline for 67b1e8f8 succeeds