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

Commit

Permalink
Fixes PoV over-estimation (#13766)
Browse files Browse the repository at this point in the history
* Align log

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use max instead of sum

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make comment ordering deterministic

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Dont add Pov overhead when all is ignored

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update test pallet weights

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Re-run weights on bm2

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Actually use new weights

Fucked up the merge for this file...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update contract weights

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez authored Apr 13, 2023
1 parent a6cb6d0 commit be58e48
Show file tree
Hide file tree
Showing 54 changed files with 5,500 additions and 5,508 deletions.
475 changes: 236 additions & 239 deletions frame/alliance/src/weights.rs

Large diffs are not rendered by default.

347 changes: 176 additions & 171 deletions frame/assets/src/weights.rs

Large diffs are not rendered by default.

43 changes: 20 additions & 23 deletions frame/bags-list/src/weights.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 42 additions & 43 deletions frame/balances/src/weights.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frame/benchmarking/pov/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ frame_benchmarking::benchmarks! {

// Same as above, but we still expect a mathematical worst case PoV size for the bounded one.
storage_value_bounded_and_unbounded_read {
(0..1024).for_each(|i| Map1M::<T>::insert(i, i));
}: {
assert!(UnboundedValue::<T>::get().is_none());
assert!(BoundedValue::<T>::get().is_none());
Expand Down
4 changes: 2 additions & 2 deletions frame/benchmarking/pov/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ fn unbounded_read_best_effort() {
fn partial_unbounded_read_best_effort() {
let w_unbounded = W::storage_value_unbounded_read().proof_size();
let w_bounded = W::storage_value_bounded_read().proof_size();
let w_partial = W::storage_value_bounded_and_unbounded_read().proof_size();
let w_both = W::storage_value_bounded_and_unbounded_read().proof_size();

assert_eq!(w_bounded + w_unbounded, w_partial, "The bounded part increases the PoV");
assert!(w_both > w_bounded && w_both > w_unbounded, "The bounded part increases the PoV");
}

#[test]
Expand Down
Loading

0 comments on commit be58e48

Please sign in to comment.