Skip to content

Commit

Permalink
Ron/sno 632 (#71)
Browse files Browse the repository at this point in the history
* Add OwnParaId

* Add type HighPriorityCommands

* Remove HighPriority from config

* enable benchmarks for outbound queue

* Add weights for outbound queue pallet

---------

Co-authored-by: ron <yrong1997@gmail.com>
  • Loading branch information
vgeddes and yrong authored Oct 20, 2023
1 parent 25267ed commit a802149
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
5 changes: 3 additions & 2 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,11 @@ impl snowbridge_outbound_queue::Config for Runtime {
type Balance = Balance;
type MaxMessagePayloadSize = MaxMessagePayloadSize;
type MaxMessagesPerBlock = MaxMessagesPerBlock;
type OwnParaId = ParachainInfo;
type DeliveryFeePerGas = DeliveryFeePerGas;
type DeliveryRefundPerGas = DeliveryRefundPerGas;
type DeliveryReward = DeliveryReward;
type WeightInfo = ();
type WeightInfo = weights::snowbridge_outbound_queue::WeightInfo<Runtime>;
}

#[cfg(not(feature = "beacon-spec-mainnet"))]
Expand Down Expand Up @@ -823,7 +824,7 @@ mod benches {
[pallet_bridge_relayers, BridgeRelayersBench::<Runtime>]
// Ethereum Bridge
[snowbridge_inbound_queue, EthereumInboundQueue]
// [snowbridge_outbound_queue, EthereumOutboundChannel]
[snowbridge_outbound_queue, EthereumOutboundQueue]
[snowbridge_control, EthereumControl]
[snowbridge_ethereum_beacon_client, EthereumBeaconClient]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ pub mod pallet_utility;
pub mod pallet_xcm;
pub mod paritydb_weights;
pub mod rocksdb_weights;
pub mod snowbridge_control;
pub mod snowbridge_ethereum_beacon_client;
pub mod snowbridge_inbound_queue;
pub mod snowbridge_control;
pub mod snowbridge_outbound_queue;
pub mod xcm;

pub use block_weights::constants::BlockExecutionWeight;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

//! Autogenerated weights for `snowbridge_outbound_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-20, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `192.168.1.13`, CPU: `<UNKNOWN>`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024

// Executed Command:
// ../target/release/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --pallet=snowbridge_outbound_queue
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --output
// ../parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `snowbridge_outbound_queue`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> snowbridge_outbound_queue::WeightInfo for WeightInfo<T> {
/// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:1)
/// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: EthereumOutboundQueue PendingHighPriorityMessageCount (r:1 w:1)
/// Proof: EthereumOutboundQueue PendingHighPriorityMessageCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue Nonce (r:1 w:1)
/// Proof: EthereumOutboundQueue Nonce (max_values: None, max_size: Some(20), added: 2495, mode: MaxEncodedLen)
/// Storage: EthereumOutboundQueue Messages (r:1 w:1)
/// Proof Skipped: EthereumOutboundQueue Messages (max_values: Some(1), max_size: None, mode: Measured)
fn do_process_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3485`
// Minimum execution time: 38_000_000 picoseconds.
Weight::from_parts(38_000_000, 0)
.saturating_add(Weight::from_parts(0, 3485))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:0)
/// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: System Digest (r:1 w:1)
/// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured)
fn on_finalize() -> Weight {
// Proof Size summary in bytes:
// Measured: `1094`
// Estimated: `2579`
// Minimum execution time: 28_000_000 picoseconds.
Weight::from_parts(28_000_000, 0)
.saturating_add(Weight::from_parts(0, 2579))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}

0 comments on commit a802149

Please sign in to comment.