Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
update control pallet weights
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Sep 23, 2023
1 parent 5b0ffb9 commit bfe0107
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ use crate::{
BridgeRefundBridgeHubRococoMessages, OnBridgeHubWococoBlobDispatcher,
WithBridgeHubRococoMessageBridge,
},
xcm_config::{AllowSiblingsOnly, XcmRouter},
xcm_config::XcmRouter,
};
#[cfg(not(feature = "runtime-benchmarks"))]
use crate::xcm_config::AllowSiblingsOnly;
use bridge_runtime_common::{
messages::{source::TargetHeaderChainAdapter, target::SourceHeaderChainAdapter},
messages_xcm_extension::{XcmAsPlainPayload, XcmBlobMessageDispatch},
Expand Down Expand Up @@ -701,7 +703,10 @@ impl snowbridge_control::Config for Runtime {
type UniversalLocation = UniversalLocation;
type RelayLocation = RelayLocation;
type AgentOrigin = EnsureXcm<Everything>;
#[cfg(not(feature = "runtime-benchmarks"))]
type ChannelOrigin = EnsureXcm<AllowSiblingsOnly>;
#[cfg(feature = "runtime-benchmarks")]
type ChannelOrigin = EnsureXcm<Everything>;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

//! Autogenerated weights for `snowbridge_control`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-09-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `macbook pro 14 m2`, CPU: `m2-arm64`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
//! HOSTNAME: `MacBook Pro M1`, CPU: `M1`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024

// Executed Command:
// target/release/polkadot-parachain
Expand All @@ -13,14 +14,13 @@
// --chain=bridge-hub-rococo-dev
// --pallet=snowbridge_control
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --steps
// 50
// --repeat
// 20
// --output
// ./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_control.rs
// ./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_control.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -33,94 +33,133 @@ use core::marker::PhantomData;
/// Weight functions for `snowbridge_control`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> snowbridge_control::WeightInfo for WeightInfo<T> {
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:1 w:1)
/// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
/// Storage: MessageQueue ServiceHead (r:1 w:1)
/// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen)
/// Storage: MessageQueue Pages (r:0 w:1)
/// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:0 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
/// The range of component `x` is `[0, 1023]`.
fn upgrade(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `80`
// Estimated: `3517`
// Minimum execution time: 29_000_000 picoseconds.
Weight::from_parts(30_740_411, 0)
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(34_543_869, 0)
.saturating_add(Weight::from_parts(0, 3517))
// Standard Error: 66
.saturating_add(Weight::from_parts(8_805, 0).saturating_mul(x.into()))
// Standard Error: 55
.saturating_add(Weight::from_parts(11_330, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumControl Agents (r:1 w:1)
/// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0)
/// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: MessageQueue BookStateFor (r:1 w:1)
/// Proof: MessageQueue BookStateFor (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen)
/// Storage: MessageQueue ServiceHead (r:1 w:1)
/// Proof: MessageQueue ServiceHead (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen)
/// Storage: MessageQueue Pages (r:0 w:1)
/// Proof: MessageQueue Pages (max_values: None, max_size: Some(65585), added: 68060, mode: MaxEncodedLen)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Agents` (r:1 w:1)
/// Proof: `EthereumControl::Agents` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:0 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn create_agent() -> Weight {
// Proof Size summary in bytes:
// Measured: `84`
// Estimated: `3517`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 0)
// Minimum execution time: 38_000_000 picoseconds.
Weight::from_parts(38_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}

/// Todo: update with benchmarked
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Agents` (r:1 w:0)
/// Proof: `EthereumControl::Agents` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Channels` (r:1 w:1)
/// Proof: `EthereumControl::Channels` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:1 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn create_channel() -> Weight {
// Proof Size summary in bytes:
// Measured: `84`
// Estimated: `3517`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
// Measured: `396`
// Estimated: `69050`
// Minimum execution time: 44_000_000 picoseconds.
Weight::from_parts(45_000_000, 0)
.saturating_add(Weight::from_parts(0, 69050))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}

/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Agents` (r:1 w:0)
/// Proof: `EthereumControl::Agents` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Channels` (r:1 w:0)
/// Proof: `EthereumControl::Channels` (`max_values`: None, `max_size`: Some(12), added: 2487, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:1 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn update_channel() -> Weight {
// Proof Size summary in bytes:
// Measured: `84`
// Estimated: `3517`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
// Measured: `506`
// Estimated: `69050`
// Minimum execution time: 44_000_000 picoseconds.
Weight::from_parts(45_000_000, 0)
.saturating_add(Weight::from_parts(0, 69050))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
}

/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:0 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn set_operating_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `84`
// Measured: `80`
// Estimated: `3517`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 0)
// Minimum execution time: 29_000_000 picoseconds.
Weight::from_parts(29_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}

/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `EthereumControl::Agents` (r:1 w:0)
/// Proof: `EthereumControl::Agents` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`)
/// Storage: `EthereumOutboundQueue::PalletOperatingMode` (r:1 w:0)
/// Proof: `EthereumOutboundQueue::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `MessageQueue::Pages` (r:1 w:1)
/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65585), added: 68060, mode: `MaxEncodedLen`)
fn transfer_native_from_agent() -> Weight {
// Proof Size summary in bytes:
// Measured: `84`
// Estimated: `3517`
// Minimum execution time: 34_000_000 picoseconds.
Weight::from_parts(35_000_000, 0)
.saturating_add(Weight::from_parts(0, 3517))
// Measured: `396`
// Estimated: `69050`
// Minimum execution time: 43_000_000 picoseconds.
Weight::from_parts(44_000_000, 0)
.saturating_add(Weight::from_parts(0, 69050))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
.saturating_add(T::DbWeight::get().writes(2))
}
}
Loading

0 comments on commit bfe0107

Please sign in to comment.