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
@@ -18,12 +18,13 @@
//! Autogenerated weights for pallet_state_trie_migration
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-03-04, 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:
// target/production/substrate
// ./target/production/substrate
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
@@ -31,9 +32,8 @@
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/state-trie-migration/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
// --output=./frame/state-trie-migration/src/weights.rs
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -56,32 +56,33 @@ pub trait WeightInfo {
/// Weights for pallet_state_trie_migration using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
// Storage: StateTrieMigration MigrationProcess (r:1 w:1)
fn continue_migrate() -> Weight {
(13_385_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
(19_019_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: StateTrieMigration MigrationProcess (r:1 w:0)
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
fn continue_migrate_wrong_witness() -> Weight {
(1_757_000 as Weight)
(1_874_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
}
fn migrate_custom_top_success() -> Weight {
(12_813_000 as Weight)
(16_381_000 as Weight)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_top_fail() -> Weight {
(24_961_000 as Weight)
(25_966_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn migrate_custom_child_success() -> Weight {
(13_132_000 as Weight)
(16_712_000 as Weight)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_child_fail() -> Weight {
(29_215_000 as Weight)
(29_885_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
@@ -97,32 +98,33 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// For backwards compatibility and tests
impl WeightInfo for () {
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
// Storage: StateTrieMigration MigrationProcess (r:1 w:1)
fn continue_migrate() -> Weight {
(13_385_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
(19_019_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: StateTrieMigration MigrationProcess (r:1 w:0)
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
fn continue_migrate_wrong_witness() -> Weight {
(1_757_000 as Weight)
(1_874_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
}
fn migrate_custom_top_success() -> Weight {
(12_813_000 as Weight)
(16_381_000 as Weight)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_top_fail() -> Weight {
(24_961_000 as Weight)
(25_966_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn migrate_custom_child_success() -> Weight {
(13_132_000 as Weight)
(16_712_000 as Weight)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_child_fail() -> Weight {
(29_215_000 as Weight)
(29_885_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}