Skip to content

Commit 09ba7bf

Browse files
Merge pull request #44 from hashed-io/feature/benchmark/fund-admin
Benchmarks Fund admin pallet
2 parents 0ecd18f + 76bc2dc commit 09ba7bf

File tree

9 files changed

+2922
-287
lines changed

9 files changed

+2922
-287
lines changed

.maintain/frame-weight-template.hbs

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{{header}}
2-
//! Autogenerated weights for {{pallet}}
2+
//! Autogenerated weights for `{{pallet}}`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
5-
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
5+
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
6+
//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}`
67
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`
7-
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
8+
//! WASM-EXECUTION: `{{cmd.wasm_execution}}`, CHAIN: `{{cmd.chain}}`, DB CACHE: `{{cmd.db_cache}}`
89

910
// Executed Command:
1011
{{#each args as |arg|}}
@@ -14,11 +15,12 @@
1415
#![cfg_attr(rustfmt, rustfmt_skip)]
1516
#![allow(unused_parens)]
1617
#![allow(unused_imports)]
18+
#![allow(missing_docs)]
1719

1820
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
19-
use sp_std::marker::PhantomData;
21+
use core::marker::PhantomData;
2022

21-
/// Weight functions needed for {{pallet}}.
23+
/// Weight functions needed for `{{pallet}}`.
2224
pub trait WeightInfo {
2325
{{#each benchmarks as |benchmark|}}
2426
fn {{benchmark.name~}}
@@ -29,7 +31,7 @@ pub trait WeightInfo {
2931
{{/each}}
3032
}
3133

32-
/// Weights for {{pallet}} using the Substrate node and recommended hardware.
34+
/// Weights for `{{pallet}}` using the Substrate node and recommended hardware.
3335
pub struct SubstrateWeight<T>(PhantomData<T>);
3436
{{#if (eq pallet "frame_system")}}
3537
impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
@@ -38,7 +40,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
3840
{{/if}}
3941
{{#each benchmarks as |benchmark|}}
4042
{{#each benchmark.comments as |comment|}}
41-
// {{comment}}
43+
/// {{comment}}
4244
{{/each}}
4345
{{#each benchmark.component_ranges as |range|}}
4446
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
@@ -48,33 +50,39 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
4850
{{~#each benchmark.components as |c| ~}}
4951
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
5052
) -> Weight {
51-
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
52-
Weight::from_ref_time({{underscore benchmark.base_weight}})
53+
// Proof Size summary in bytes:
54+
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
55+
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
56+
// Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds.
57+
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
5358
{{#each benchmark.component_weight as |cw|}}
5459
// Standard Error: {{underscore cw.error}}
55-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
60+
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
5661
{{/each}}
5762
{{#if (ne benchmark.base_reads "0")}}
58-
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}))
63+
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))
5964
{{/if}}
6065
{{#each benchmark.component_reads as |cr|}}
6166
.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
6267
{{/each}}
6368
{{#if (ne benchmark.base_writes "0")}}
64-
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}))
69+
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))
6570
{{/if}}
6671
{{#each benchmark.component_writes as |cw|}}
6772
.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
6873
{{/each}}
74+
{{#each benchmark.component_calculated_proof_size as |cp|}}
75+
.saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into()))
76+
{{/each}}
6977
}
7078
{{/each}}
7179
}
7280

73-
// For backwards compatibility and tests
81+
// For backwards compatibility and tests.
7482
impl WeightInfo for () {
7583
{{#each benchmarks as |benchmark|}}
7684
{{#each benchmark.comments as |comment|}}
77-
// {{comment}}
85+
/// {{comment}}
7886
{{/each}}
7987
{{#each benchmark.component_ranges as |range|}}
8088
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
@@ -84,24 +92,30 @@ impl WeightInfo for () {
8492
{{~#each benchmark.components as |c| ~}}
8593
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
8694
) -> Weight {
87-
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
88-
Weight::from_ref_time({{underscore benchmark.base_weight}})
95+
// Proof Size summary in bytes:
96+
// Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
97+
// Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`
98+
// Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds.
99+
Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})
89100
{{#each benchmark.component_weight as |cw|}}
90101
// Standard Error: {{underscore cw.error}}
91-
.saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into()))
102+
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
92103
{{/each}}
93104
{{#if (ne benchmark.base_reads "0")}}
94-
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}))
105+
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64))
95106
{{/if}}
96107
{{#each benchmark.component_reads as |cr|}}
97108
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
98109
{{/each}}
99110
{{#if (ne benchmark.base_writes "0")}}
100-
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}))
111+
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64))
101112
{{/if}}
102113
{{#each benchmark.component_writes as |cw|}}
103114
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
104115
{{/each}}
116+
{{#each benchmark.component_calculated_proof_size as |cp|}}
117+
.saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into()))
118+
{{/each}}
105119
}
106120
{{/each}}
107121
}

.vscode/settings.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"rust-analyzer.linkedProjects": [
3-
"./pallets/afloat/Cargo.toml",
4-
"./pallets/rbac/Cargo.toml",
5-
"./pallets/gated-marketplace/Cargo.toml",
6-
"./pallets/fruniques/Cargo.toml",
7-
],
8-
"rust-analyzer.showUnlinkedFileNotification": false
2+
"rust-analyzer.linkedProjects": [
3+
"./pallets/afloat/Cargo.toml",
4+
"./pallets/rbac/Cargo.toml",
5+
"./pallets/gated-marketplace/Cargo.toml",
6+
"./pallets/fruniques/Cargo.toml",
7+
],
8+
"rust-analyzer.showUnlinkedFileNotification": false
99
}

0 commit comments

Comments
 (0)