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
+51 -51
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_vesting
//!
//! 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:
@@ -60,22 +60,22 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Vesting Vesting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vest_locked(l: u32, s: u32, ) -> Weight {
(27_818_000 as Weight)
(32_978_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
.saturating_add((82_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((74_000 as Weight).saturating_mul(s as Weight))
.saturating_add((88_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Vesting Vesting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vest_unlocked(l: u32, s: u32, ) -> Weight {
(27_708_000 as Weight)
(32_856_000 as Weight)
// Standard Error: 1_000
.saturating_add((79_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
.saturating_add((56_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -83,11 +83,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
(27_854_000 as Weight)
(33_522_000 as Weight)
// Standard Error: 1_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
.saturating_add((74_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
.saturating_add((72_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -95,11 +95,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
(27_738_000 as Weight)
(32_558_000 as Weight)
// Standard Error: 1_000
.saturating_add((71_000 as Weight).saturating_mul(l as Weight))
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((42_000 as Weight).saturating_mul(s as Weight))
.saturating_add((61_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -107,11 +107,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vested_transfer(l: u32, s: u32, ) -> Weight {
(43_640_000 as Weight)
(49_260_000 as Weight)
// Standard Error: 1_000
.saturating_add((71_000 as Weight).saturating_mul(l as Weight))
.saturating_add((80_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 3_000
.saturating_add((45_000 as Weight).saturating_mul(s as Weight))
.saturating_add((55_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -119,11 +119,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:2 w:2)
// Storage: Balances Locks (r:1 w:1)
fn force_vested_transfer(l: u32, s: u32, ) -> Weight {
(42_850_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 3_000
.saturating_add((48_000 as Weight).saturating_mul(s as Weight))
(49_166_000 as Weight)
// Standard Error: 2_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 4_000
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
@@ -131,11 +131,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(28_683_000 as Weight)
(34_042_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
.saturating_add((83_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((63_000 as Weight).saturating_mul(s as Weight))
.saturating_add((80_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -143,11 +143,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(28_510_000 as Weight)
(33_937_000 as Weight)
// Standard Error: 1_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((65_000 as Weight).saturating_mul(s as Weight))
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
@@ -158,22 +158,22 @@ impl WeightInfo for () {
// Storage: Vesting Vesting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vest_locked(l: u32, s: u32, ) -> Weight {
(27_818_000 as Weight)
(32_978_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
.saturating_add((82_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((74_000 as Weight).saturating_mul(s as Weight))
.saturating_add((88_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Vesting Vesting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vest_unlocked(l: u32, s: u32, ) -> Weight {
(27_708_000 as Weight)
(32_856_000 as Weight)
// Standard Error: 1_000
.saturating_add((79_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
.saturating_add((56_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -181,11 +181,11 @@ impl WeightInfo for () {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
(27_854_000 as Weight)
(33_522_000 as Weight)
// Standard Error: 1_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
.saturating_add((74_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
.saturating_add((72_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
@@ -193,11 +193,11 @@ impl WeightInfo for () {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
(27_738_000 as Weight)
(32_558_000 as Weight)
// Standard Error: 1_000
.saturating_add((71_000 as Weight).saturating_mul(l as Weight))
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((42_000 as Weight).saturating_mul(s as Weight))
.saturating_add((61_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
@@ -205,11 +205,11 @@ impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn vested_transfer(l: u32, s: u32, ) -> Weight {
(43_640_000 as Weight)
(49_260_000 as Weight)
// Standard Error: 1_000
.saturating_add((71_000 as Weight).saturating_mul(l as Weight))
.saturating_add((80_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 3_000
.saturating_add((45_000 as Weight).saturating_mul(s as Weight))
.saturating_add((55_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
@@ -217,11 +217,11 @@ impl WeightInfo for () {
// Storage: System Account (r:2 w:2)
// Storage: Balances Locks (r:1 w:1)
fn force_vested_transfer(l: u32, s: u32, ) -> Weight {
(42_850_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 3_000
.saturating_add((48_000 as Weight).saturating_mul(s as Weight))
(49_166_000 as Weight)
// Standard Error: 2_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 4_000
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
@@ -229,11 +229,11 @@ impl WeightInfo for () {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(28_683_000 as Weight)
(34_042_000 as Weight)
// Standard Error: 1_000
.saturating_add((81_000 as Weight).saturating_mul(l as Weight))
.saturating_add((83_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((63_000 as Weight).saturating_mul(s as Weight))
.saturating_add((80_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
@@ -241,11 +241,11 @@ impl WeightInfo for () {
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
(28_510_000 as Weight)
(33_937_000 as Weight)
// Standard Error: 1_000
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
// Standard Error: 2_000
.saturating_add((65_000 as Weight).saturating_mul(s as Weight))
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}