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
+59 -59
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_proxy
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-05-22, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-05-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
@@ -61,42 +61,42 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Proxy Proxies (r:1 w:0)
fn proxy(p: u32, ) -> Weight {
(13_918_000 as Weight)
// Standard Error: 1_000
.saturating_add((66_000 as Weight).saturating_mul(p as Weight))
(17_768_000 as Weight)
// Standard Error: 2_000
.saturating_add((76_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn proxy_announced(a: u32, p: u32, ) -> Weight {
(30_328_000 as Weight)
(35_682_000 as Weight)
// Standard Error: 2_000
.saturating_add((159_000 as Weight).saturating_mul(a as Weight))
.saturating_add((158_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 2_000
.saturating_add((64_000 as Weight).saturating_mul(p as Weight))
.saturating_add((73_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn remove_announcement(a: u32, p: u32, ) -> Weight {
(21_667_000 as Weight)
(25_586_000 as Weight)
// Standard Error: 1_000
.saturating_add((167_000 as Weight).saturating_mul(a as Weight))
.saturating_add((175_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 1_000
.saturating_add((4_000 as Weight).saturating_mul(p as Weight))
.saturating_add((18_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_announcement(a: u32, p: u32, ) -> Weight {
(21_554_000 as Weight)
(25_794_000 as Weight)
// Standard Error: 1_000
.saturating_add((171_000 as Weight).saturating_mul(a as Weight))
.saturating_add((173_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 1_000
.saturating_add((5_000 as Weight).saturating_mul(p as Weight))
.saturating_add((13_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -104,52 +104,52 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn announce(a: u32, p: u32, ) -> Weight {
(28_774_000 as Weight)
(33_002_000 as Weight)
// Standard Error: 2_000
.saturating_add((150_000 as Weight).saturating_mul(a as Weight))
.saturating_add((163_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 2_000
.saturating_add((67_000 as Weight).saturating_mul(p as Weight))
.saturating_add((79_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn add_proxy(p: u32, ) -> Weight {
(23_571_000 as Weight)
// Standard Error: 1_000
.saturating_add((110_000 as Weight).saturating_mul(p as Weight))
(28_166_000 as Weight)
// Standard Error: 2_000
.saturating_add((105_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxy(p: u32, ) -> Weight {
(23_613_000 as Weight)
// Standard Error: 2_000
.saturating_add((120_000 as Weight).saturating_mul(p as Weight))
(28_128_000 as Weight)
// Standard Error: 3_000
.saturating_add((118_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxies(p: u32, ) -> Weight {
(19_968_000 as Weight)
// Standard Error: 1_000
.saturating_add((74_000 as Weight).saturating_mul(p as Weight))
(24_066_000 as Weight)
// Standard Error: 2_000
.saturating_add((81_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
// Storage: Proxy Proxies (r:1 w:1)
fn anonymous(p: u32, ) -> Weight {
(26_479_000 as Weight)
// Standard Error: 2_000
(31_077_000 as Weight)
// Standard Error: 3_000
.saturating_add((37_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn kill_anonymous(p: u32, ) -> Weight {
(20_816_000 as Weight)
// Standard Error: 1_000
.saturating_add((67_000 as Weight).saturating_mul(p as Weight))
(24_657_000 as Weight)
// Standard Error: 2_000
.saturating_add((87_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -159,42 +159,42 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
// Storage: Proxy Proxies (r:1 w:0)
fn proxy(p: u32, ) -> Weight {
(13_918_000 as Weight)
// Standard Error: 1_000
.saturating_add((66_000 as Weight).saturating_mul(p as Weight))
(17_768_000 as Weight)
// Standard Error: 2_000
.saturating_add((76_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn proxy_announced(a: u32, p: u32, ) -> Weight {
(30_328_000 as Weight)
(35_682_000 as Weight)
// Standard Error: 2_000
.saturating_add((159_000 as Weight).saturating_mul(a as Weight))
.saturating_add((158_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 2_000
.saturating_add((64_000 as Weight).saturating_mul(p as Weight))
.saturating_add((73_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn remove_announcement(a: u32, p: u32, ) -> Weight {
(21_667_000 as Weight)
(25_586_000 as Weight)
// Standard Error: 1_000
.saturating_add((167_000 as Weight).saturating_mul(a as Weight))
.saturating_add((175_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 1_000
.saturating_add((4_000 as Weight).saturating_mul(p as Weight))
.saturating_add((18_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_announcement(a: u32, p: u32, ) -> Weight {
(21_554_000 as Weight)
(25_794_000 as Weight)
// Standard Error: 1_000
.saturating_add((171_000 as Weight).saturating_mul(a as Weight))
.saturating_add((173_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 1_000
.saturating_add((5_000 as Weight).saturating_mul(p as Weight))
.saturating_add((13_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -202,52 +202,52 @@ impl WeightInfo for () {
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn announce(a: u32, p: u32, ) -> Weight {
(28_774_000 as Weight)
(33_002_000 as Weight)
// Standard Error: 2_000
.saturating_add((150_000 as Weight).saturating_mul(a as Weight))
.saturating_add((163_000 as Weight).saturating_mul(a as Weight))
// Standard Error: 2_000
.saturating_add((67_000 as Weight).saturating_mul(p as Weight))
.saturating_add((79_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn add_proxy(p: u32, ) -> Weight {
(23_571_000 as Weight)
// Standard Error: 1_000
.saturating_add((110_000 as Weight).saturating_mul(p as Weight))
(28_166_000 as Weight)
// Standard Error: 2_000
.saturating_add((105_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxy(p: u32, ) -> Weight {
(23_613_000 as Weight)
// Standard Error: 2_000
.saturating_add((120_000 as Weight).saturating_mul(p as Weight))
(28_128_000 as Weight)
// Standard Error: 3_000
.saturating_add((118_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxies(p: u32, ) -> Weight {
(19_968_000 as Weight)
// Standard Error: 1_000
.saturating_add((74_000 as Weight).saturating_mul(p as Weight))
(24_066_000 as Weight)
// Standard Error: 2_000
.saturating_add((81_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
// Storage: Proxy Proxies (r:1 w:1)
fn anonymous(p: u32, ) -> Weight {
(26_479_000 as Weight)
// Standard Error: 2_000
(31_077_000 as Weight)
// Standard Error: 3_000
.saturating_add((37_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn kill_anonymous(p: u32, ) -> Weight {
(20_816_000 as Weight)
// Standard Error: 1_000
.saturating_add((67_000 as Weight).saturating_mul(p as Weight))
(24_657_000 as Weight)
// Standard Error: 2_000
.saturating_add((87_000 as Weight).saturating_mul(p as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}