Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Storage Layer for All FRAME Extrinsics #11431

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6e0ca26
add new trait
shawntabrizi May 17, 2022
9f0d290
implement DispatchableWithStorageLayer
shawntabrizi May 17, 2022
57fe674
at least one transactional
shawntabrizi May 17, 2022
28d35bd
all dispatch is at least transactional
shawntabrizi May 17, 2022
eaa330d
storage_layer api
shawntabrizi May 17, 2022
213e537
add test
shawntabrizi May 17, 2022
b8d32b9
storage layer tests
shawntabrizi May 17, 2022
a03c13f
deprecate transactional tag
shawntabrizi May 17, 2022
5dc88cd
i guess no reason to deprecate
shawntabrizi May 17, 2022
2856ecd
remove transactional from batch_all
shawntabrizi May 17, 2022
b0f7241
update tests
shawntabrizi May 17, 2022
0f26a7d
Merge remote-tracking branch 'origin/master' into shawntabrizi-dispat…
shawntabrizi May 17, 2022
f9f65db
extend trait
shawntabrizi May 19, 2022
738c021
Merge branch 'master' of https://github.com/paritytech/substrate into…
May 19, 2022
d1fd82f
cargo run --quiet --profile=production --features runtime-benchmarks …
May 19, 2022
5afa7e7
cargo run --quiet --profile=production --features runtime-benchmarks …
May 19, 2022
1a447b1
cargo run --quiet --profile=production --features runtime-benchmarks …
May 20, 2022
1e657bf
fix copy paste name
shawntabrizi May 20, 2022
5793a59
Merge branch 'master' of https://github.com/paritytech/substrate into…
May 20, 2022
09b4274
cargo run --quiet --profile=production --features runtime-benchmarks …
May 20, 2022
03c19ec
Create run_all_benchmarks.sh
shawntabrizi May 21, 2022
0e7e939
uncomment build
shawntabrizi May 21, 2022
fe1a750
update number of steps and repeats
shawntabrizi May 21, 2022
2068319
add skip build
shawntabrizi May 21, 2022
71b45db
Update run_all_benchmarks.sh
shawntabrizi May 21, 2022
c357618
Update run_all_benchmarks.sh
shawntabrizi May 21, 2022
85e7a28
new benchmarks
shawntabrizi May 21, 2022
d2aa0ed
Merge remote-tracking branch 'origin/master' into shawntabrizi-dispat…
shawntabrizi May 23, 2022
e0abb8f
Update frame/support/src/traits/dispatch.rs
shawntabrizi May 23, 2022
a87f4bc
Update frame/support/src/traits/dispatch.rs
shawntabrizi May 23, 2022
3633d3c
Update frame/support/test/tests/storage_layers.rs
shawntabrizi May 23, 2022
82b3576
Update frame/support/test/tests/storage_layers.rs
shawntabrizi May 23, 2022
db8dbe3
weights
shawntabrizi May 24, 2022
630f149
Update dispatch.rs
shawntabrizi May 24, 2022
3035fc8
Merge branch 'master' into shawntabrizi-dispatchable-with-storage-layer
shawntabrizi May 25, 2022
993383a
doc link
shawntabrizi May 26, 2022
d7530da
decl_macro support
shawntabrizi May 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 73 additions & 61 deletions frame/assets/src/weights.rs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions frame/bags-list/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_bags_list
//!
//! 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:
Expand Down Expand Up @@ -57,7 +57,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: BagsList ListNodes (r:4 w:4)
// Storage: BagsList ListBags (r:1 w:1)
fn rebag_non_terminal() -> Weight {
(51_415_000 as Weight)
(55_040_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
Expand All @@ -66,7 +66,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn rebag_terminal() -> Weight {
(49_459_000 as Weight)
(53_671_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
Expand All @@ -76,7 +76,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: BagsList CounterForListNodes (r:1 w:1)
// Storage: BagsList ListBags (r:1 w:1)
fn put_in_front_of() -> Weight {
(53_682_000 as Weight)
(56_410_000 as Weight)
.saturating_add(T::DbWeight::get().reads(10 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
Expand All @@ -89,7 +89,7 @@ impl WeightInfo for () {
// Storage: BagsList ListNodes (r:4 w:4)
// Storage: BagsList ListBags (r:1 w:1)
fn rebag_non_terminal() -> Weight {
(51_415_000 as Weight)
(55_040_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
Expand All @@ -98,7 +98,7 @@ impl WeightInfo for () {
// Storage: BagsList ListNodes (r:3 w:3)
// Storage: BagsList ListBags (r:2 w:2)
fn rebag_terminal() -> Weight {
(49_459_000 as Weight)
(53_671_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
Expand All @@ -108,7 +108,7 @@ impl WeightInfo for () {
// Storage: BagsList CounterForListNodes (r:1 w:1)
// Storage: BagsList ListBags (r:1 w:1)
fn put_in_front_of() -> Weight {
(53_682_000 as Weight)
(56_410_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(10 as Weight))
.saturating_add(RocksDbWeight::get().writes(6 as Weight))
}
Expand Down
30 changes: 15 additions & 15 deletions frame/balances/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_balances
//!
//! 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:
Expand Down Expand Up @@ -58,43 +58,43 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(35_278_000 as Weight)
(41_860_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(27_822_000 as Weight)
(32_760_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
(17_943_000 as Weight)
(22_279_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
(20_974_000 as Weight)
(25_488_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
(36_078_000 as Weight)
(42_190_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
(32_794_000 as Weight)
(37_789_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
(16_227_000 as Weight)
(20_056_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand All @@ -104,43 +104,43 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(35_278_000 as Weight)
(41_860_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(27_822_000 as Weight)
(32_760_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
(17_943_000 as Weight)
(22_279_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
(20_974_000 as Weight)
(25_488_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
(36_078_000 as Weight)
(42_190_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
(32_794_000 as Weight)
(37_789_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
(16_227_000 as Weight)
(20_056_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
Expand Down
50 changes: 23 additions & 27 deletions frame/benchmarking/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for frame_benchmarking
//!
//! 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:
Expand Down Expand Up @@ -58,79 +58,75 @@ pub trait WeightInfo {
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn addition(_i: u32, ) -> Weight {
(126_000 as Weight)
(103_000 as Weight)
}
fn subtraction(_i: u32, ) -> Weight {
(121_000 as Weight)
(105_000 as Weight)
}
fn multiplication(_i: u32, ) -> Weight {
(132_000 as Weight)
(113_000 as Weight)
}
fn division(_i: u32, ) -> Weight {
(122_000 as Weight)
(102_000 as Weight)
}
fn hashing(i: u32, ) -> Weight {
(21_059_079_000 as Weight)
// Standard Error: 117_000
.saturating_add((1_121_000 as Weight).saturating_mul(i as Weight))
fn hashing(_i: u32, ) -> Weight {
(20_865_902_000 as Weight)
}
fn sr25519_verification(i: u32, ) -> Weight {
(425_000 as Weight)
// Standard Error: 7_000
.saturating_add((47_172_000 as Weight).saturating_mul(i as Weight))
(319_000 as Weight)
// Standard Error: 8_000
.saturating_add((47_171_000 as Weight).saturating_mul(i as Weight))
}
// Storage: Skipped Metadata (r:0 w:0)
fn storage_read(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 3_000
.saturating_add((2_118_000 as Weight).saturating_mul(i as Weight))
.saturating_add((2_110_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn storage_write(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((373_000 as Weight).saturating_mul(i as Weight))
.saturating_add((372_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn addition(_i: u32, ) -> Weight {
(126_000 as Weight)
(103_000 as Weight)
}
fn subtraction(_i: u32, ) -> Weight {
(121_000 as Weight)
(105_000 as Weight)
}
fn multiplication(_i: u32, ) -> Weight {
(132_000 as Weight)
(113_000 as Weight)
}
fn division(_i: u32, ) -> Weight {
(122_000 as Weight)
(102_000 as Weight)
}
fn hashing(i: u32, ) -> Weight {
(21_059_079_000 as Weight)
// Standard Error: 117_000
.saturating_add((1_121_000 as Weight).saturating_mul(i as Weight))
fn hashing(_i: u32, ) -> Weight {
(20_865_902_000 as Weight)
}
fn sr25519_verification(i: u32, ) -> Weight {
(425_000 as Weight)
// Standard Error: 7_000
.saturating_add((47_172_000 as Weight).saturating_mul(i as Weight))
(319_000 as Weight)
// Standard Error: 8_000
.saturating_add((47_171_000 as Weight).saturating_mul(i as Weight))
}
// Storage: Skipped Metadata (r:0 w:0)
fn storage_read(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 3_000
.saturating_add((2_118_000 as Weight).saturating_mul(i as Weight))
.saturating_add((2_110_000 as Weight).saturating_mul(i as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn storage_write(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((373_000 as Weight).saturating_mul(i as Weight))
.saturating_add((372_000 as Weight).saturating_mul(i as Weight))
.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
}
Loading