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
+37 -37
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_recovery
//!
//! 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:
@@ -60,35 +60,35 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Recovery Proxy (r:1 w:0)
fn as_recovered() -> Weight {
(3_732_000 as Weight)
(6_579_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
}
// Storage: Recovery Proxy (r:0 w:1)
fn set_recovered() -> Weight {
(10_201_000 as Weight)
(13_402_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:1)
fn create_recovery(n: u32, ) -> Weight {
(23_334_000 as Weight)
(28_217_000 as Weight)
// Standard Error: 13_000
.saturating_add((201_000 as Weight).saturating_mul(n as Weight))
.saturating_add((172_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:0)
// Storage: Recovery ActiveRecoveries (r:1 w:1)
fn initiate_recovery() -> Weight {
(28_358_000 as Weight)
(34_082_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:0)
// Storage: Recovery ActiveRecoveries (r:1 w:1)
fn vouch_recovery(n: u32, ) -> Weight {
(17_667_000 as Weight)
// Standard Error: 13_000
.saturating_add((342_000 as Weight).saturating_mul(n as Weight))
(22_038_000 as Weight)
// Standard Error: 19_000
.saturating_add((307_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -96,33 +96,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Recovery ActiveRecoveries (r:1 w:0)
// Storage: Recovery Proxy (r:1 w:1)
fn claim_recovery(n: u32, ) -> Weight {
(24_591_000 as Weight)
// Standard Error: 14_000
.saturating_add((242_000 as Weight).saturating_mul(n as Weight))
(28_621_000 as Weight)
// Standard Error: 13_000
.saturating_add((353_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Recovery ActiveRecoveries (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn close_recovery(n: u32, ) -> Weight {
(28_763_000 as Weight)
// Standard Error: 12_000
.saturating_add((142_000 as Weight).saturating_mul(n as Weight))
(33_287_000 as Weight)
// Standard Error: 19_000
.saturating_add((264_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Recovery ActiveRecoveries (r:1 w:0)
// Storage: Recovery Recoverable (r:1 w:1)
fn remove_recovery(n: u32, ) -> Weight {
(27_357_000 as Weight)
// Standard Error: 17_000
.saturating_add((212_000 as Weight).saturating_mul(n as Weight))
(31_964_000 as Weight)
// Standard Error: 13_000
.saturating_add((222_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Proxy (r:1 w:1)
fn cancel_recovered() -> Weight {
(9_068_000 as Weight)
(12_702_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -132,35 +132,35 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
// Storage: Recovery Proxy (r:1 w:0)
fn as_recovered() -> Weight {
(3_732_000 as Weight)
(6_579_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
}
// Storage: Recovery Proxy (r:0 w:1)
fn set_recovered() -> Weight {
(10_201_000 as Weight)
(13_402_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:1)
fn create_recovery(n: u32, ) -> Weight {
(23_334_000 as Weight)
(28_217_000 as Weight)
// Standard Error: 13_000
.saturating_add((201_000 as Weight).saturating_mul(n as Weight))
.saturating_add((172_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:0)
// Storage: Recovery ActiveRecoveries (r:1 w:1)
fn initiate_recovery() -> Weight {
(28_358_000 as Weight)
(34_082_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Recoverable (r:1 w:0)
// Storage: Recovery ActiveRecoveries (r:1 w:1)
fn vouch_recovery(n: u32, ) -> Weight {
(17_667_000 as Weight)
// Standard Error: 13_000
.saturating_add((342_000 as Weight).saturating_mul(n as Weight))
(22_038_000 as Weight)
// Standard Error: 19_000
.saturating_add((307_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
@@ -168,33 +168,33 @@ impl WeightInfo for () {
// Storage: Recovery ActiveRecoveries (r:1 w:0)
// Storage: Recovery Proxy (r:1 w:1)
fn claim_recovery(n: u32, ) -> Weight {
(24_591_000 as Weight)
// Standard Error: 14_000
.saturating_add((242_000 as Weight).saturating_mul(n as Weight))
(28_621_000 as Weight)
// Standard Error: 13_000
.saturating_add((353_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Recovery ActiveRecoveries (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn close_recovery(n: u32, ) -> Weight {
(28_763_000 as Weight)
// Standard Error: 12_000
.saturating_add((142_000 as Weight).saturating_mul(n as Weight))
(33_287_000 as Weight)
// Standard Error: 19_000
.saturating_add((264_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Recovery ActiveRecoveries (r:1 w:0)
// Storage: Recovery Recoverable (r:1 w:1)
fn remove_recovery(n: u32, ) -> Weight {
(27_357_000 as Weight)
// Standard Error: 17_000
.saturating_add((212_000 as Weight).saturating_mul(n as Weight))
(31_964_000 as Weight)
// Standard Error: 13_000
.saturating_add((222_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: Recovery Proxy (r:1 w:1)
fn cancel_recovered() -> Weight {
(9_068_000 as Weight)
(12_702_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}