Fix weight accounting
-
Review changes -
-
Download -
Patches
-
Plain diff
The problem is slightly different from the previously raised issue due to the deletion of instance pallets. Currently, the problem lies in having two tuple handlers (OnIdtyChange
and Event
). The weight of the function calling these handlers is the sum of each implementation. If these functions are not called in hooks, it will be possible to take the worst possible path as an approximation. However, some are called in on_initialize
, and the worst case is close to 7% of a block, approximately 10 times the average path.
-
Add weight return in OnIdtyChange
andEvent
handlers. -
Account for the weight where these handlers are called. -
Replace all +=
,-=
bysaturating_add
andsaturating_sub
for consistency. -
Closes #163 (closed). -
Closes #203 (closed)
Note: Some handlers are difficult to benchmark using a benchmark function, so the accounting is performed by counting reads and writes, inspired by the staking pallet from Substrate.
Closes #167 (closed)
Edited by Benjamin Gallois
Merge request reports
Compare and
- version 405af7fb36
- version 3992f7eb90
- version 38c1dcab1e
- version 37ce5c69c3
- version 36e8d237b1
- version 35f061aae8
- version 34b39bb540
- version 3310093033
- version 3214b2bd06
- version 31db24d4b5
- version 3085ca9955
- version 295d99fe3c
- version 2814451d41
- version 273b995c40
- version 26dfb94450
- version 25861a05e8
- version 24f524b725
- version 2355d4a9ac
- version 22244c2bb5
- version 21343b2bd4
- version 200598a9ad
- version 1930a1e89d
- version 18b85432a3
- version 173ffc3b77
- version 1679df6ae6
- version 1501120550
- version 143a3f0ab6
- version 13b73e1662
- version 12ec23546a
- version 11058c45ab
- version 10cb498ceb
- version 9e2c9235b
- version 8abb09e95
- version 74ab90444
- version 68ce00073
- version 550c24247
- version 4275124e6
- version 3fe9a9f30
- version 2fe9a9f30
- version 1ae7999c9
- master (base)
- latest versionab5524f516 commits,
- version 405af7fb3616 commits,
- version 3992f7eb9015 commits,
- version 38c1dcab1e14 commits,
- version 37ce5c69c313 commits,
- version 36e8d237b113 commits,
- version 35f061aae812 commits,
- version 34b39bb54012 commits,
- version 331009303311 commits,
- version 3214b2bd0610 commits,
- version 31db24d4b510 commits,
- version 3085ca99559 commits,
- version 295d99fe3c8 commits,
- version 2814451d417 commits,
- version 273b995c406 commits,
- version 26dfb944506 commits,
- version 25861a05e89 commits,
- version 24f524b7259 commits,
- version 2355d4a9ac8 commits,
- version 22244c2bb58 commits,
- version 21343b2bd48 commits,
- version 200598a9ad7 commits,
- version 1930a1e89d3 commits,
- version 18b85432a33 commits,
- version 173ffc3b772 commits,
- version 1679df6ae62 commits,
- version 15011205502 commits,
- version 143a3f0ab62 commits,
- version 13b73e16622 commits,
- version 12ec23546a2 commits,
- version 11058c45ab2 commits,
- version 10cb498ceb2 commits,
- version 9e2c9235b2 commits,
- version 8abb09e952 commits,
- version 74ab904442 commits,
- version 68ce000732 commits,
- version 550c242472 commits,
- version 4275124e62 commits,
- version 3fe9a9f301 commit,
- version 2fe9a9f301 commit,
- version 1ae7999c91 commit,
Compare changes
- Side-by-side
- Inline
Files
19Loading