Add Proof Size to Weight Output (#11637)
* initial impl * add template test * linear fit proof size * always record proof when tracking storage * calculate worst case pov * remove duplicate worst case * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * more comment output * add cli for worst case map size * update name * clap does not support underscores * rename * expose worst case map values * improve some comments * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * update template * cargo run --quiet --profile=production --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_assets --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/assets/src/weights.rs --template=./.maintain/frame-weight-template.hbs * fix fmt * more fmt * more fmt * Dont panic when there is no proof Signed-off-by:Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix test features Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Whitelist :extrinsic_index Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use whitelist when recording proof Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add logs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add PoV testing pallet Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Deploy PoV testing pallet Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Storage benches reside in the PoV pallet Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Linear regress PoV per component Splits the PoV calculation into "measured" and "estimated". The measured part is reported by the Proof recorder and linear regressed over all components at once. The estimated part is calculated as worst-case by using the max PoV size per storage access and calculating one linear regress per component. This gives each component a (possibly) independent PoV. For now the measured size will always be lower than the PoV on Polkadot since it is measured on an empty snapshot. The measured part is therefor only used as diagnostic for debugging. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Put PoV into the weight templates Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Extra alanysis choise for PoV Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add+Fix tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Make benches faster Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Cleanup Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use same template comments Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/bench-bot.sh" pallet dev pallet_balances * ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy * Update referenda mock BlockWeights Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Take measured value size into account Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * proof_size: None Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ugly, but works Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * wup Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * WIP Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add pov_mode attribute to the benchmarks! macro Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use pov_mode attribute in PoV benchmarking Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Scheduler, Whitelist: Add pov_mode attr Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update PoV weights * Add CLI arg: default-pov-mode Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "Update PoV weights" This reverts commit 2f3ac2387396470b118122a6ff8fa4ee12216f4b. * Revert "WIP" This reverts commit c34b538cd2bc45da4544e887180184e30957904a. * Revert first approach This reverts commit range 8ddaa2fffe5930f225a30bee314d0b7c94c344dd^..4c84f8748e5395852a9e0e25b0404953fee1a59e Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add extra benchmarks Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_alliance * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_whitelist * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_scheduler * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Clippy Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Clippy
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add reference benchmarks Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix doc comments Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Undo logging Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add 'Ignored' pov_mode Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Allow multiple attributes per benchmark Turns out that the current benchmarking syntax does not support multiple attributes per bench
. Changing it to support that since otherwise the `pov_mode` would conflict with the others. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Validate pov_mode syntax Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Ignore PoV for all contract benchmarks Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Test Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * test Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Bump macro recursion limit Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update contract weights They dont have a PoV component anymore. Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fix test ffs Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pov_mode is unsupported in V2 syntax Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix pallet ui tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update pallet ui Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fix pallet ui tests Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update weights Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by:
Parity Bot <admin@parity.io> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <> Co-authored-by:
Your Name <you@example.com>
Showing
- substrate/.maintain/frame-weight-template.hbs 28 additions, 7 deletionssubstrate/.maintain/frame-weight-template.hbs
- substrate/Cargo.lock 15 additions, 0 deletionssubstrate/Cargo.lock
- substrate/Cargo.toml 1 addition, 0 deletionssubstrate/Cargo.toml
- substrate/bin/node/runtime/Cargo.toml 6 additions, 2 deletionssubstrate/bin/node/runtime/Cargo.toml
- substrate/bin/node/runtime/src/lib.rs 6 additions, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/client/db/src/bench.rs 4 additions, 0 deletionssubstrate/client/db/src/bench.rs
- substrate/client/db/src/upgrade.rs 1 addition, 1 deletionsubstrate/client/db/src/upgrade.rs
- substrate/client/db/src/utils.rs 5 additions, 2 deletionssubstrate/client/db/src/utils.rs
- substrate/frame/alliance/src/weights.rs 738 additions, 436 deletionssubstrate/frame/alliance/src/weights.rs
- substrate/frame/assets/src/weights.rs 663 additions, 398 deletionssubstrate/frame/assets/src/weights.rs
- substrate/frame/bags-list/src/weights.rs 97 additions, 52 deletionssubstrate/frame/bags-list/src/weights.rs
- substrate/frame/balances/src/weights.rs 129 additions, 72 deletionssubstrate/frame/balances/src/weights.rs
- substrate/frame/benchmarking/Cargo.toml 1 addition, 0 deletionssubstrate/frame/benchmarking/Cargo.toml
- substrate/frame/benchmarking/pov/Cargo.toml 43 additions, 0 deletionssubstrate/frame/benchmarking/pov/Cargo.toml
- substrate/frame/benchmarking/pov/src/benchmarking.rs 371 additions, 0 deletionssubstrate/frame/benchmarking/pov/src/benchmarking.rs
- substrate/frame/benchmarking/pov/src/lib.rs 131 additions, 0 deletionssubstrate/frame/benchmarking/pov/src/lib.rs
- substrate/frame/benchmarking/pov/src/tests.rs 211 additions, 0 deletionssubstrate/frame/benchmarking/pov/src/tests.rs
- substrate/frame/benchmarking/pov/src/weights.rs 807 additions, 0 deletionssubstrate/frame/benchmarking/pov/src/weights.rs
- substrate/frame/benchmarking/src/baseline.rs 11 additions, 52 deletionssubstrate/frame/benchmarking/src/baseline.rs
- substrate/frame/benchmarking/src/lib.rs 127 additions, 5 deletionssubstrate/frame/benchmarking/src/lib.rs
Please register or sign in to comment