Storage Layer for All FRAME Extrinsics (#11431)

* add new trait

* implement DispatchableWithStorageLayer

* at least one transactional

* all dispatch is at least transactional

* storage_layer api

* add test

* storage layer tests

* deprecate transactional tag

* i guess no reason to deprecate

* remove transactional from batch_all

* update tests

* extend trait

* 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_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* 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_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* 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_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* fix copy paste name

* 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_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* Create run_all_benchmarks.sh

* uncomment build

* update number of steps and repeats

* add skip build

* Update run_all_benchmarks.sh

* Update run_all_benchmarks.sh

* new benchmarks

* Update frame/support/src/traits/dispatch.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/traits/dispatch.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/test/tests/storage_layers.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/test/tests/storage_layers.rs

* weights

* Update dispatch.rs

* doc link

* decl_macro support

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2022-05-26 15:28:32 -04:00
committed by GitHub
parent ea469886f8
commit 8e7adaf283
52 changed files with 1741 additions and 1355 deletions
+33 -33
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_tips
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-05-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-05-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
@@ -58,16 +58,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Tips Reasons (r:1 w:1)
// Storage: Tips Tips (r:1 w:1)
fn report_awesome(r: u32, ) -> Weight {
(26_613_000 as Weight)
(30_669_000 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(r as Weight))
.saturating_add((4_000 as Weight).saturating_mul(r as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Tips Tips (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn retract_tip() -> Weight {
(25_001_000 as Weight)
(28_768_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -75,20 +75,20 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Tips Reasons (r:1 w:1)
// Storage: Tips Tips (r:0 w:1)
fn tip_new(r: u32, t: u32, ) -> Weight {
(17_490_000 as Weight)
(20_385_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 5_000
.saturating_add((183_000 as Weight).saturating_mul(t as Weight))
.saturating_add((2_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 3_000
.saturating_add((166_000 as Weight).saturating_mul(t as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Elections Members (r:1 w:0)
// Storage: Tips Tips (r:1 w:1)
fn tip(t: u32, ) -> Weight {
(9_634_000 as Weight)
// Standard Error: 7_000
.saturating_add((343_000 as Weight).saturating_mul(t as Weight))
(12_287_000 as Weight)
// Standard Error: 6_000
.saturating_add((363_000 as Weight).saturating_mul(t as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -97,18 +97,18 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn close_tip(t: u32, ) -> Weight {
(41_967_000 as Weight)
// Standard Error: 10_000
.saturating_add((264_000 as Weight).saturating_mul(t as Weight))
(45_656_000 as Weight)
// Standard Error: 14_000
.saturating_add((276_000 as Weight).saturating_mul(t as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: Tips Tips (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn slash_tip(t: u32, ) -> Weight {
(14_917_000 as Weight)
// Standard Error: 4_000
.saturating_add((61_000 as Weight).saturating_mul(t as Weight))
(18_525_000 as Weight)
// Standard Error: 5_000
.saturating_add((37_000 as Weight).saturating_mul(t as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -119,16 +119,16 @@ impl WeightInfo for () {
// Storage: Tips Reasons (r:1 w:1)
// Storage: Tips Tips (r:1 w:1)
fn report_awesome(r: u32, ) -> Weight {
(26_613_000 as Weight)
(30_669_000 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(r as Weight))
.saturating_add((4_000 as Weight).saturating_mul(r as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Tips Tips (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn retract_tip() -> Weight {
(25_001_000 as Weight)
(28_768_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -136,20 +136,20 @@ impl WeightInfo for () {
// Storage: Tips Reasons (r:1 w:1)
// Storage: Tips Tips (r:0 w:1)
fn tip_new(r: u32, t: u32, ) -> Weight {
(17_490_000 as Weight)
(20_385_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 5_000
.saturating_add((183_000 as Weight).saturating_mul(t as Weight))
.saturating_add((2_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 3_000
.saturating_add((166_000 as Weight).saturating_mul(t as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Elections Members (r:1 w:0)
// Storage: Tips Tips (r:1 w:1)
fn tip(t: u32, ) -> Weight {
(9_634_000 as Weight)
// Standard Error: 7_000
.saturating_add((343_000 as Weight).saturating_mul(t as Weight))
(12_287_000 as Weight)
// Standard Error: 6_000
.saturating_add((363_000 as Weight).saturating_mul(t as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
@@ -158,18 +158,18 @@ impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn close_tip(t: u32, ) -> Weight {
(41_967_000 as Weight)
// Standard Error: 10_000
.saturating_add((264_000 as Weight).saturating_mul(t as Weight))
(45_656_000 as Weight)
// Standard Error: 14_000
.saturating_add((276_000 as Weight).saturating_mul(t as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
// Storage: Tips Tips (r:1 w:1)
// Storage: Tips Reasons (r:0 w:1)
fn slash_tip(t: u32, ) -> Weight {
(14_917_000 as Weight)
// Standard Error: 4_000
.saturating_add((61_000 as Weight).saturating_mul(t as Weight))
(18_525_000 as Weight)
// Standard Error: 5_000
.saturating_add((37_000 as Weight).saturating_mul(t as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}