From c82f5cc0a3a73b769f7927d3393d98c962840157 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 14 Apr 2023 15:10:26 +0200 Subject: [PATCH 1/2] Make CI fail on old files Signed-off-by: Oliver Tale-Yazdi --- .../kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs | 1 + runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | 2 +- .../rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs | 2 +- runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | 2 +- .../westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs | 2 +- .../westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 480e509b825a..e1470d21c278 100644 --- a/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -51,6 +51,7 @@ impl WeightInfo { .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // FAIL-CI update me // Storage: System Account (r:2 w:2) pub(crate) fn transfer_asset() -> Weight { Weight::from_parts(32_756_000 as u64, 0) diff --git a/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 4bc4c74af59a..dc078b731ac7 100644 --- a/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/runtime/kusama/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -19,7 +19,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-04-18, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 - +// FAIL-CI update me // Executed Command: // target/production/polkadot // benchmark diff --git a/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index e8efa7ab95ee..7045186e96d6 100644 --- a/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -19,7 +19,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-03-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 - +// FAIL-CI update me // Executed Command: // target/production/polkadot // benchmark diff --git a/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index d49345abf80f..837cc89880c2 100644 --- a/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/runtime/rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -19,7 +19,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-03-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 - +// FAIL-CI update me // Executed Command: // target/production/polkadot // benchmark diff --git a/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index 5f5ef52956e8..50530941007a 100644 --- a/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -19,7 +19,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-03-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 - +// FAIL-CI update me // Executed Command: // target/production/polkadot // benchmark diff --git a/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index a2e599d6b888..99607abe5a7f 100644 --- a/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -19,7 +19,7 @@ //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2022-12-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 - +// FAIL-CI update me // Executed Command: // /home/benchbot/cargo_target_dir/production/polkadot // benchmark From 71983ac364fc386dc6474d8f2a51a866b96377b9 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 14 Apr 2023 15:15:54 +0200 Subject: [PATCH 2/2] Update template Signed-off-by: Oliver Tale-Yazdi --- xcm/pallet-xcm-benchmarks/template.hbs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/xcm/pallet-xcm-benchmarks/template.hbs b/xcm/pallet-xcm-benchmarks/template.hbs index 7171f6599019..7a7c21630298 100644 --- a/xcm/pallet-xcm-benchmarks/template.hbs +++ b/xcm/pallet-xcm-benchmarks/template.hbs @@ -39,27 +39,37 @@ impl WeightInfo { {{#each benchmark.comments as |comment|}} // {{comment}} {{/each}} - pub(crate) fn {{benchmark.name~}} + {{#each benchmark.component_ranges as |range|}} + /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. + {{/each}} + pub fn {{benchmark.name~}} ( {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - Weight::from_ref_time({{underscore benchmark.base_weight}} as u64) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}} as u64).saturating_mul({{cw.name}} as u64)) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as u64)) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) {{/if}} {{#each benchmark.component_reads as |cr|}} - .saturating_add(T::DbWeight::get().reads(({{cr.slope}} as u64).saturating_mul({{cr.name}} as u64))) + .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as u64)) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}} as u64).saturating_mul({{cw.name}} as u64))) + .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) {{/each}} } {{/each}}