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
+17 -17
View File
@@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_child_bounties
//!
//! 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:
@@ -64,7 +64,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
// Storage: ChildBounties ChildBounties (r:0 w:1)
fn add_child_bounty(d: u32, ) -> Weight {
(45_917_000 as Weight)
(51_064_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(d as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
@@ -74,7 +74,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ChildBounties ChildBounties (r:1 w:1)
// Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
fn propose_curator() -> Weight {
(11_855_000 as Weight)
(15_286_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -82,7 +82,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ChildBounties ChildBounties (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn accept_curator() -> Weight {
(24_488_000 as Weight)
(29_929_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
@@ -90,14 +90,14 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Bounties Bounties (r:1 w:0)
// Storage: System Account (r:1 w:1)
fn unassign_curator() -> Weight {
(28_645_000 as Weight)
(32_449_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Bounties Bounties (r:1 w:0)
// Storage: ChildBounties ChildBounties (r:1 w:1)
fn award_child_bounty() -> Weight {
(19_760_000 as Weight)
(23_793_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -106,7 +106,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ChildBounties ParentChildBounties (r:1 w:1)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn claim_child_bounty() -> Weight {
(62_194_000 as Weight)
(67_529_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
@@ -117,7 +117,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:2 w:2)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn close_child_bounty_added() -> Weight {
(44_136_000 as Weight)
(48_436_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
@@ -128,7 +128,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: ChildBounties ParentChildBounties (r:1 w:1)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn close_child_bounty_active() -> Weight {
(53_168_000 as Weight)
(58_044_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
@@ -143,7 +143,7 @@ impl WeightInfo for () {
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
// Storage: ChildBounties ChildBounties (r:0 w:1)
fn add_child_bounty(d: u32, ) -> Weight {
(45_917_000 as Weight)
(51_064_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(d as Weight))
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
@@ -153,7 +153,7 @@ impl WeightInfo for () {
// Storage: ChildBounties ChildBounties (r:1 w:1)
// Storage: ChildBounties ChildrenCuratorFees (r:1 w:1)
fn propose_curator() -> Weight {
(11_855_000 as Weight)
(15_286_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -161,7 +161,7 @@ impl WeightInfo for () {
// Storage: ChildBounties ChildBounties (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn accept_curator() -> Weight {
(24_488_000 as Weight)
(29_929_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
@@ -169,14 +169,14 @@ impl WeightInfo for () {
// Storage: Bounties Bounties (r:1 w:0)
// Storage: System Account (r:1 w:1)
fn unassign_curator() -> Weight {
(28_645_000 as Weight)
(32_449_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: Bounties Bounties (r:1 w:0)
// Storage: ChildBounties ChildBounties (r:1 w:1)
fn award_child_bounty() -> Weight {
(19_760_000 as Weight)
(23_793_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
@@ -185,7 +185,7 @@ impl WeightInfo for () {
// Storage: ChildBounties ParentChildBounties (r:1 w:1)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn claim_child_bounty() -> Weight {
(62_194_000 as Weight)
(67_529_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(5 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
@@ -196,7 +196,7 @@ impl WeightInfo for () {
// Storage: System Account (r:2 w:2)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn close_child_bounty_added() -> Weight {
(44_136_000 as Weight)
(48_436_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(6 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
@@ -207,7 +207,7 @@ impl WeightInfo for () {
// Storage: ChildBounties ParentChildBounties (r:1 w:1)
// Storage: ChildBounties ChildBountyDescriptions (r:0 w:1)
fn close_child_bounty_active() -> Weight {
(53_168_000 as Weight)
(58_044_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(7 as Weight))
}