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

Commit

Permalink
parachains: Fix configuration module (#4540)
Browse files Browse the repository at this point in the history
* parachains: Fix configuration module

Closes #4529
Closes #4533

I figured that trying to avoid updates does not really worth it to keep.
This is because we seem to not update the configuration often and when
we do we approach this carefully. Thus possibility of a redundant update
is really negligable. At the same time, if such a redundant update does
happen then the effects of that are really small: just some wasted
storage interactions.

On the other hand, making it work was a little bit annoying. With the
proper fix for the pending updates this would be even more annoying
since now we would have to add combinatorically more cases to test this.

So I figured that I will just scrap that and simplify the code.

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_configuration.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_configuration.rs

* review fixes

Co-authored-by: Parity Bot <admin@parity.io>
  • Loading branch information
pepyakin and Parity Bot authored Dec 21, 2021
1 parent 69ad3a0 commit b3d0778
Show file tree
Hide file tree
Showing 5 changed files with 443 additions and 177 deletions.
33 changes: 16 additions & 17 deletions runtime/kusama/src/weights/runtime_parachains_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! Autogenerated weights for `runtime_parachains::configuration`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-12-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128

// Executed Command:
Expand All @@ -33,7 +33,6 @@
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs


#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
Expand All @@ -44,47 +43,47 @@ use sp_std::marker::PhantomData;
/// Weight functions for `runtime_parachains::configuration`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> runtime_parachains::configuration::WeightInfo for WeightInfo<T> {
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
// Storage: Configuration PendingConfig (r:1 w:1)
// Storage: Configuration PendingConfigs (r:1 w:1)
// Storage: Configuration ActiveConfig (r:1 w:0)
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
fn set_config_with_block_number() -> Weight {
(12_378_000 as Weight)
(8_240_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
// Storage: Configuration PendingConfig (r:1 w:1)
// Storage: Configuration PendingConfigs (r:1 w:1)
// Storage: Configuration ActiveConfig (r:1 w:0)
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
fn set_config_with_u32() -> Weight {
(12_384_000 as Weight)
(8_123_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
// Storage: Configuration PendingConfig (r:1 w:1)
// Storage: Configuration PendingConfigs (r:1 w:1)
// Storage: Configuration ActiveConfig (r:1 w:0)
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
fn set_config_with_option_u32() -> Weight {
(12_746_000 as Weight)
(8_547_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
// Storage: Configuration PendingConfig (r:1 w:1)
// Storage: Configuration PendingConfigs (r:1 w:1)
// Storage: Configuration ActiveConfig (r:1 w:0)
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
fn set_config_with_weight() -> Weight {
(12_563_000 as Weight)
(8_379_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Benchmark Override (r:0 w:0)
fn set_hrmp_open_request_ttl() -> Weight {
(2_000_000_000_000 as Weight)
}
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
// Storage: Configuration PendingConfig (r:1 w:1)
// Storage: Configuration PendingConfigs (r:1 w:1)
// Storage: Configuration ActiveConfig (r:1 w:0)
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
fn set_config_with_balance() -> Weight {
(12_644_000 as Weight)
(8_400_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
Loading

0 comments on commit b3d0778

Please sign in to comment.