[testnet] Add AssetHubRococo <-> AssetHubWestend asset bridging support (#1967)

## Summary

Asset bridging support for AssetHub**Rococo** <-> AssetHub**Wococo** was
added [here](https://github.com/paritytech/polkadot-sdk/pull/1215), so
now we aim to bridge AssetHub**Rococo** and AssetHub**Westend**. (And
perhaps retire AssetHubWococo and the Wococo chains).

## Solution

**bridge-hub-westend-runtime**
- added new runtime as a copy of `bridge-hub-rococo-runtime`
- added support for bridging to `BridgeHubRococo`
- added tests and benchmarks

**bridge-hub-rococo-runtime**
- added support for bridging to `BridgeHubWestend`
- added tests and benchmarks
- internal refactoring by splitting bridge configuration per network,
e.g., `bridge_to_whatevernetwork_config.rs`.

**asset-hub-rococo-runtime**
- added support for asset bridging to `AssetHubWestend` (allows to
receive only WNDs)
- added new xcm router for `Westend`
- added tests and benchmarks

**asset-hub-westend-runtime**
- added support for asset bridging to `AssetHubRococo` (allows to
receive only ROCs)
- added new xcm router for `Rococo`
- added tests and benchmarks

## Deployment

All changes will be deployed as a part of
https://github.com/paritytech/polkadot-sdk/issues/1988.

## TODO

- [x] benchmarks for all pallet instances
- [x] integration tests
- [x] local run scripts


Relates to:
https://github.com/paritytech/parity-bridges-common/issues/2602
Relates to: https://github.com/paritytech/polkadot-sdk/issues/1988

---------

Co-authored-by: command-bot <>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This commit is contained in:
Branislav Kontur
2023-11-02 00:39:49 +01:00
committed by GitHub
parent c66ae375e6
commit 1b1fab0da3
112 changed files with 10028 additions and 1638 deletions
Generated
+126 -1
View File
@@ -905,6 +905,7 @@ dependencies = [
"asset-test-utils",
"assets-common",
"bp-asset-hub-rococo",
"bp-asset-hub-westend",
"bp-asset-hub-wococo",
"bp-bridge-hub-rococo",
"bp-bridge-hub-wococo",
@@ -1015,6 +1016,9 @@ version = "0.9.420"
dependencies = [
"asset-test-utils",
"assets-common",
"bp-asset-hub-rococo",
"bp-asset-hub-westend",
"bp-bridge-hub-westend",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -1052,6 +1056,7 @@ dependencies = [
"pallet-utility",
"pallet-xcm",
"pallet-xcm-benchmarks",
"pallet-xcm-bridge-hub-router",
"parachains-common",
"parity-scale-codec",
"polkadot-core-primitives",
@@ -1066,7 +1071,6 @@ dependencies = [
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
@@ -1682,6 +1686,16 @@ dependencies = [
"scale-info",
]
[[package]]
name = "bp-asset-hub-westend"
version = "0.1.0"
dependencies = [
"bp-xcm-bridge-hub-router",
"frame-support",
"parity-scale-codec",
"scale-info",
]
[[package]]
name = "bp-asset-hub-wococo"
version = "0.1.0"
@@ -1745,6 +1759,19 @@ dependencies = [
"sp-std",
]
[[package]]
name = "bp-bridge-hub-westend"
version = "0.1.0"
dependencies = [
"bp-bridge-hub-cumulus",
"bp-messages",
"bp-runtime",
"frame-support",
"sp-api",
"sp-runtime",
"sp-std",
]
[[package]]
name = "bp-bridge-hub-wococo"
version = "0.1.0"
@@ -1937,6 +1964,18 @@ dependencies = [
"sp-trie",
]
[[package]]
name = "bp-westend"
version = "0.1.0"
dependencies = [
"bp-header-chain",
"bp-polkadot-core",
"bp-runtime",
"frame-support",
"sp-api",
"sp-std",
]
[[package]]
name = "bp-wococo"
version = "0.1.0"
@@ -2114,8 +2153,10 @@ name = "bridge-hub-rococo-runtime"
version = "0.1.0"
dependencies = [
"bp-asset-hub-rococo",
"bp-asset-hub-westend",
"bp-asset-hub-wococo",
"bp-bridge-hub-rococo",
"bp-bridge-hub-westend",
"bp-bridge-hub-wococo",
"bp-header-chain",
"bp-messages",
@@ -2124,6 +2165,7 @@ dependencies = [
"bp-relayers",
"bp-rococo",
"bp-runtime",
"bp-westend",
"bp-wococo",
"bridge-hub-test-utils",
"bridge-runtime-common",
@@ -2239,6 +2281,88 @@ dependencies = [
"staging-xcm-executor",
]
[[package]]
name = "bridge-hub-westend-runtime"
version = "0.1.0"
dependencies = [
"bp-asset-hub-westend",
"bp-bridge-hub-rococo",
"bp-bridge-hub-westend",
"bp-header-chain",
"bp-messages",
"bp-parachains",
"bp-polkadot-core",
"bp-relayers",
"bp-rococo",
"bp-runtime",
"bp-westend",
"bridge-hub-test-utils",
"bridge-runtime-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-core",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-bridge-grandpa",
"pallet-bridge-messages",
"pallet-bridge-parachains",
"pallet-bridge-relayers",
"pallet-collator-selection",
"pallet-multisig",
"pallet-session",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-utility",
"pallet-xcm",
"pallet-xcm-benchmarks",
"parachains-common",
"parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"serde",
"smallvec",
"sp-api",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-keyring",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std",
"sp-storage",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"static_assertions",
"substrate-wasm-builder",
"westend-runtime-constants",
]
[[package]]
name = "bridge-runtime-common"
version = "0.1.0"
@@ -12524,6 +12648,7 @@ dependencies = [
"bridge-hub-kusama-runtime",
"bridge-hub-polkadot-runtime",
"bridge-hub-rococo-runtime",
"bridge-hub-westend-runtime",
"clap 4.4.6",
"collectives-polkadot-runtime",
"color-print",
+4
View File
@@ -17,16 +17,19 @@ members = [
"bridges/primitives/chain-asset-hub-kusama",
"bridges/primitives/chain-asset-hub-polkadot",
"bridges/primitives/chain-asset-hub-rococo",
"bridges/primitives/chain-asset-hub-westend",
"bridges/primitives/chain-asset-hub-wococo",
"bridges/primitives/chain-bridge-hub-cumulus",
"bridges/primitives/chain-bridge-hub-kusama",
"bridges/primitives/chain-bridge-hub-polkadot",
"bridges/primitives/chain-bridge-hub-rococo",
"bridges/primitives/chain-bridge-hub-westend",
"bridges/primitives/chain-bridge-hub-wococo",
"bridges/primitives/chain-kusama",
"bridges/primitives/chain-polkadot",
"bridges/primitives/chain-polkadot-bulletin",
"bridges/primitives/chain-rococo",
"bridges/primitives/chain-westend",
"bridges/primitives/chain-wococo",
"bridges/primitives/header-chain",
"bridges/primitives/messages",
@@ -78,6 +81,7 @@ members = [
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend",
"cumulus/parachains/runtimes/bridge-hubs/test-utils",
"cumulus/parachains/runtimes/collectives/collectives-polkadot",
"cumulus/parachains/runtimes/contracts/contracts-rococo",
+43 -1
View File
@@ -325,6 +325,12 @@ pub mod pallet {
rewards_account_params,
new_reward,
);
Self::deposit_event(Event::<T>::RewardRegistered {
relayer: relayer.clone(),
rewards_account_params,
reward,
});
},
);
}
@@ -369,6 +375,15 @@ pub mod pallet {
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// Relayer reward has been registered and may be claimed later.
RewardRegistered {
/// Relayer account that can claim reward.
relayer: T::AccountId,
/// Relayer can claim reward from this account.
rewards_account_params: RewardsAccountParams,
/// Reward amount.
reward: T::Reward,
},
/// Reward has been paid to the relayer.
RewardPaid {
/// Relayer account that has been rewarded.
@@ -455,7 +470,7 @@ mod tests {
use super::*;
use mock::{RuntimeEvent as TestEvent, *};
use crate::Event::RewardPaid;
use crate::Event::{RewardPaid, RewardRegistered};
use bp_messages::LaneId;
use bp_relayers::RewardsAccountOwner;
use frame_support::{
@@ -470,6 +485,33 @@ mod tests {
System::<TestRuntime>::reset_events();
}
#[test]
fn register_relayer_reward_emit_event() {
run_test(|| {
get_ready_for_events();
Pallet::<TestRuntime>::register_relayer_reward(
TEST_REWARDS_ACCOUNT_PARAMS,
&REGULAR_RELAYER,
100,
);
// Check if the `RewardRegistered` event was emitted.
assert_eq!(
System::<TestRuntime>::events().last(),
Some(&EventRecord {
phase: Phase::Initialization,
event: TestEvent::Relayers(RewardRegistered {
relayer: REGULAR_RELAYER,
rewards_account_params: TEST_REWARDS_ACCOUNT_PARAMS,
reward: 100
}),
topics: vec![],
}),
);
});
}
#[test]
fn root_cant_claim_anything() {
run_test(|| {
@@ -335,7 +335,7 @@ impl<T: Config<I>, I: 'static> SendXcm for Pallet<T, I> {
// just use exporter to validate destination and insert instructions to pay message fee
// at the sibling/child bridge hub
//
// the cost will include both cost of: (1) to-sibling bridg hub delivery (returned by
// the cost will include both cost of: (1) to-sibling bridge hub delivery (returned by
// the `Config::ToBridgeHubSender`) and (2) to-bridged bridge hub delivery (returned by
// `Self::exporter_for`)
ViaBridgeHubExporter::<T, I>::validate(dest, xcm)
@@ -37,6 +37,9 @@ pub enum Call {
/// `ToWococoXcmRouter` bridge pallet.
#[codec(index = 43)]
ToWococoXcmRouter(XcmBridgeHubRouterCall),
/// `ToWestendXcmRouter` bridge pallet.
#[codec(index = 45)]
ToWestendXcmRouter(XcmBridgeHubRouterCall),
}
frame_support::parameter_types! {
@@ -44,8 +47,8 @@ frame_support::parameter_types! {
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);
/// Base delivery fee to `BridgeHubRococo`.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer`)
pub const BridgeHubRococoBaseFeeInRocs: u128 = 1214739988;
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubRococoBaseFeeInRocs: u128 = 1624803349;
}
/// Identifier of AssetHubRococo in the Rococo relay chain.
@@ -0,0 +1,26 @@
[package]
name = "bp-asset-hub-westend"
description = "Primitives of AssetHubWestend parachain runtime."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
# Substrate Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
# Bridge Dependencies
bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }
[features]
default = [ "std" ]
std = [
"bp-xcm-bridge-hub-router/std",
"codec/std",
"frame-support/std",
"scale-info/std",
]
@@ -0,0 +1,52 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity Bridges Common is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
//! Module with configuration which reflects AssetHubWestend runtime setup.
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use scale_info::TypeInfo;
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
/// `AssetHubWestend` Runtime `Call` enum.
///
/// The enum represents a subset of possible `Call`s we can send to `AssetHubWestend` chain.
/// Ideally this code would be auto-generated from metadata, because we want to
/// avoid depending directly on the ENTIRE runtime just to get the encoding of `Dispatchable`s.
///
/// All entries here (like pretty much in the entire file) must be kept in sync with
/// `AssetHubWestend` `construct_runtime`, so that we maintain SCALE-compatibility.
#[allow(clippy::large_enum_variant)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub enum Call {
/// `ToRococoXcmRouter` bridge pallet.
#[codec(index = 34)]
ToRococoXcmRouter(XcmBridgeHubRouterCall),
}
frame_support::parameter_types! {
/// Some sane weight to execute `xcm::Transact(pallet-xcm-bridge-hub-router::Call::report_bridge_status)`.
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);
/// Base delivery fee to `BridgeHubWestend`.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWestendBaseFeeInWnds: u128 = 487441010000;
}
/// Identifier of AssetHubWestend in the Westend relay chain.
pub const ASSET_HUB_WESTEND_PARACHAIN_ID: u32 = 1000;
@@ -44,8 +44,8 @@ frame_support::parameter_types! {
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);
/// Base delivery fee to `BridgeHubWococo`.
/// (initially was calculated by test `BridgeHubWococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer`)
pub const BridgeHubWococoBaseFeeInWocs: u128 = 1214739988;
/// (initially was calculated by test `BridgeHubWococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWococoBaseFeeInWocs: u128 = 1624803349;
}
/// Identifier of AssetHubWococo in the Wococo relay chain.
@@ -68,15 +68,17 @@ pub type Address = MultiAddress<AccountId, ()>;
pub const BRIDGE_HUB_ROCOCO_PARACHAIN_ID: u32 = 1013;
/// Name of the With-BridgeHubRococo messages pallet instance that is deployed at bridged chains.
pub const WITH_BRIDGE_HUB_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_NAME: &str =
"BridgeWococoToRococoMessages";
pub const WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME: &str = "BridgeRococoMessages";
/// Name of the With-BridgeHubRococo bridge-relayers pallet instance that is deployed at bridged
/// chains.
pub const WITH_BRIDGE_HUB_ROCOCO_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";
/// Pallet index of `BridgeRococoToWococoMessages: pallet_bridge_messages::<Instance1>`.
/// Pallet index of `BridgeWococoMessages: pallet_bridge_messages::<Instance1>`.
pub const WITH_BRIDGE_ROCOCO_TO_WOCOCO_MESSAGES_PALLET_INDEX: u8 = 46;
/// Pallet index of `BridgeWestendMessages: pallet_bridge_messages::<Instance3>`.
pub const WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX: u8 = 51;
decl_bridge_finality_runtime_apis!(bridge_hub_rococo);
decl_bridge_messages_runtime_apis!(bridge_hub_rococo);
@@ -0,0 +1,34 @@
[package]
name = "bp-bridge-hub-westend"
description = "Primitives of BridgeHubWestend parachain runtime."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
# Bridge Dependencies
bp-bridge-hub-cumulus = { path = "../chain-bridge-hub-cumulus", default-features = false }
bp-runtime = { path = "../../primitives/runtime", default-features = false }
bp-messages = { path = "../../primitives/messages", default-features = false }
# Substrate Based Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
sp-api = { path = "../../../substrate/primitives/api", default-features = false }
sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
std = [
"bp-bridge-hub-cumulus/std",
"bp-messages/std",
"bp-runtime/std",
"frame-support/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
]
@@ -0,0 +1,75 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity Bridges Common is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
//! Module with configuration which reflects BridgeHubWestend runtime setup
//! (AccountId, Headers, Hashes...)
#![cfg_attr(not(feature = "std"), no_std)]
pub use bp_bridge_hub_cumulus::*;
use bp_messages::*;
use bp_runtime::{
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, Parachain,
};
use frame_support::dispatch::DispatchClass;
use sp_runtime::RuntimeDebug;
/// BridgeHubWestend parachain.
#[derive(RuntimeDebug)]
pub struct BridgeHubWestend;
impl Chain for BridgeHubWestend {
type BlockNumber = BlockNumber;
type Hash = Hash;
type Hasher = Hasher;
type Header = Header;
type AccountId = AccountId;
type Balance = Balance;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
*BlockLength::get().max.get(DispatchClass::Normal)
}
fn max_extrinsic_weight() -> Weight {
BlockWeights::get()
.get(DispatchClass::Normal)
.max_extrinsic
.unwrap_or(Weight::MAX)
}
}
impl Parachain for BridgeHubWestend {
const PARACHAIN_ID: u32 = BRIDGE_HUB_WESTEND_PARACHAIN_ID;
}
/// Identifier of BridgeHubWestend in the Westend relay chain.
pub const BRIDGE_HUB_WESTEND_PARACHAIN_ID: u32 = 1002;
/// Name of the With-BridgeHubWestend messages pallet instance that is deployed at bridged chains.
pub const WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME: &str = "BridgeWestendMessages";
/// Name of the With-BridgeHubWestend bridge-relayers pallet instance that is deployed at bridged
/// chains.
pub const WITH_BRIDGE_HUB_WESTEND_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";
/// Pallet index of `BridgeRococoMessages: pallet_bridge_messages::<Instance1>`.
pub const WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 44;
decl_bridge_finality_runtime_apis!(bridge_hub_westend);
decl_bridge_messages_runtime_apis!(bridge_hub_westend);
@@ -62,14 +62,13 @@ impl Parachain for BridgeHubWococo {
pub const BRIDGE_HUB_WOCOCO_PARACHAIN_ID: u32 = 1014;
/// Name of the With-BridgeHubWococo messages pallet instance that is deployed at bridged chains.
pub const WITH_BRIDGE_HUB_ROCOCO_TO_WOCOCO_MESSAGES_PALLET_NAME: &str =
"BridgeRococoToWococoMessages";
pub const WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME: &str = "BridgeWococoMessages";
/// Name of the With-BridgeHubWococo bridge-relayers pallet instance that is deployed at bridged
/// chains.
pub const WITH_BRIDGE_HUB_WOCOCO_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";
/// Pallet index of `BridgeWococoToRococoMessages: pallet_bridge_messages::<Instance2>`.
/// Pallet index of `BridgeRococoMessages: pallet_bridge_messages::<Instance2>`.
pub const WITH_BRIDGE_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 45;
decl_bridge_finality_runtime_apis!(bridge_hub_wococo);
@@ -2,8 +2,8 @@
name = "bp-polkadot-bulletin"
description = "Primitives of Polkadot Bulletin chain runtime."
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
+1 -1
View File
@@ -16,9 +16,9 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
sp-api = { path = "../../../substrate/primitives/api", default-features = false }
sp-std = { path = "../../../substrate/primitives/std", default-features = false }
frame-support = { path = "../../../substrate/frame/support", default-features = false }
[features]
default = [ "std" ]
@@ -0,0 +1,32 @@
[package]
name = "bp-westend"
description = "Primitives of Westend runtime."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
# Bridge Dependencies
bp-header-chain = { path = "../header-chain", default-features = false }
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
sp-api = { path = "../../../substrate/primitives/api", default-features = false }
sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
std = [
"bp-header-chain/std",
"bp-polkadot-core/std",
"bp-runtime/std",
"frame-support/std",
"sp-api/std",
"sp-std/std",
]
@@ -0,0 +1,79 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity Bridges Common is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
#![cfg_attr(not(feature = "std"), no_std)]
// RuntimeApi generated functions
#![allow(clippy::too_many_arguments)]
pub use bp_polkadot_core::*;
use bp_header_chain::ChainWithGrandpa;
use bp_runtime::{decl_bridge_finality_runtime_apis, Chain};
use frame_support::{parameter_types, weights::Weight};
/// Westend Chain
pub struct Westend;
impl Chain for Westend {
type BlockNumber = <PolkadotLike as Chain>::BlockNumber;
type Hash = <PolkadotLike as Chain>::Hash;
type Hasher = <PolkadotLike as Chain>::Hasher;
type Header = <PolkadotLike as Chain>::Header;
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
PolkadotLike::max_extrinsic_size()
}
fn max_extrinsic_weight() -> Weight {
PolkadotLike::max_extrinsic_weight()
}
}
impl ChainWithGrandpa for Westend {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_WESTEND_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
const MAX_HEADER_SIZE: u32 = MAX_HEADER_SIZE;
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32 = AVERAGE_HEADER_SIZE_IN_JUSTIFICATION;
}
parameter_types! {
pub const SS58Prefix: u8 = 42;
}
// The SignedExtension used by Westend.
pub use bp_polkadot_core::CommonSignedExtension as SignedExtension;
/// Name of the parachains pallet in the Rococo runtime.
pub const PARAS_PALLET_NAME: &str = "Paras";
/// Name of the With-Westend GRANDPA pallet instance that is deployed at bridged chains.
pub const WITH_WESTEND_GRANDPA_PALLET_NAME: &str = "BridgeWestendGrandpa";
/// Maximal size of encoded `bp_parachains::ParaStoredHeaderData` structure among all Westend
/// parachains.
///
/// It includes the block number and state root, so it shall be near 40 bytes, but let's have some
/// reserve.
pub const MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE: u32 = 128;
decl_bridge_finality_runtime_apis!(westend, grandpa);
+3 -1
View File
@@ -23,7 +23,6 @@ use frame_support::{
pallet_prelude::DispatchResult, weights::Weight, PalletError, StorageHasher, StorageValue,
};
use frame_system::RawOrigin;
use log;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_core::storage::StorageKey;
@@ -98,6 +97,9 @@ pub const BRIDGE_HUB_ROCOCO_CHAIN_ID: ChainId = *b"bhro";
/// BridgeHubWococo chain id.
pub const BRIDGE_HUB_WOCOCO_CHAIN_ID: ChainId = *b"bhwo";
/// BridgeHubWestend chain id.
pub const BRIDGE_HUB_WESTEND_CHAIN_ID: ChainId = *b"bhwd";
/// BridgeHubKusama chain id.
pub const BRIDGE_HUB_KUSAMA_CHAIN_ID: ChainId = *b"bhks";
-1
View File
@@ -74,7 +74,6 @@ rm -rf $BRIDGES_FOLDER/primitives/beefy
rm -rf $BRIDGES_FOLDER/primitives/chain-millau
rm -rf $BRIDGES_FOLDER/primitives/chain-rialto
rm -rf $BRIDGES_FOLDER/primitives/chain-rialto-parachain
rm -rf $BRIDGES_FOLDER/primitives/chain-westend
rm -rf $BRIDGES_FOLDER/relays
rm -rf $BRIDGES_FOLDER/scripts/add_license.sh
rm -rf $BRIDGES_FOLDER/scripts/build-containers.sh
+31
View File
@@ -0,0 +1,31 @@
# Bridges Tests for Local Rococo <> Wococo Bridge
This folder contains [zombienet](https://github.com/paritytech/zombienet/) based integration tests for both
onchain and offchain bridges code. Due to some
[technical diffuculties](https://github.com/paritytech/parity-bridges-common/pull/2649#issue-1965339051), we
are using native zombienet provider, which means that you need to build some binaries locally.
To start those tests, you need to:
- download latest [zombienet release](https://github.com/paritytech/zombienet/releases);
- build Polkadot binary by running `cargo build -p polkadot --release` command in the
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone;
- build Polkadot Parachain binary by running `cargo build -p polkadot-parachain-bin --release` command in the
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone;
- ensure that you have [`node`](https://nodejs.org/en) installed. Additionally, we'll need globally installed
`polkadot/api-cli` package (use `npm install -g @polkadot/api-cli@beta` to install it);
- build Substrate relay by running `cargo build -p substrate-relay --release` command in the
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone.
- copy fresh `substrate-relay` binary, built in previous point, to the `~/local_bridge_testing/bin/substrate-relay`;
- change the `POLKADOT_SDK_FOLDER` and `ZOMBIENET_BINARY_PATH` (and ensure that the nearby variables
have correct values) in the `./run-tests.sh`.
After that, you could run tests with the `./run-tests.sh` command. Hopefully, it'll show the
"All tests have completed successfully" message in the end. Otherwise, it'll print paths to zombienet
process logs, which, in turn, may be used to track locations of all spinned relay and parachain nodes.
@@ -0,0 +1,25 @@
async function run(nodeName, networkInfo, args) {
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
// TODO: could be replaced with https://github.com/polkadot-js/api/issues/4930 (depends on metadata v15) later
const bridgedChainName = args[0];
const expectedBridgedChainHeaderNumber = Number(args[1]);
const runtimeApiMethod = bridgedChainName + "FinalityApi_best_finalized";
while (true) {
const encodedBestFinalizedHeaderId = await api.rpc.state.call(runtimeApiMethod, []);
const bestFinalizedHeaderId = api.createType("Option<BpRuntimeHeaderId>", encodedBestFinalizedHeaderId);
if (bestFinalizedHeaderId.isSome) {
const bestFinalizedHeaderNumber = Number(bestFinalizedHeaderId.unwrap().toHuman()[0]);
if (bestFinalizedHeaderNumber > expectedBridgedChainHeaderNumber) {
return bestFinalizedHeaderNumber;
}
}
// else sleep and retry
await new Promise((resolve) => setTimeout(resolve, 12000));
}
}
module.exports = { run }
@@ -0,0 +1,28 @@
async function run(nodeName, networkInfo, args) {
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
// TODO: could be replaced with https://github.com/polkadot-js/api/issues/4930 (depends on metadata v15) later
const relayerAccountAddress = args[0];
const laneId = args[1];
const bridgedChainId = args[2];
const relayerFundOwner = args[3];
const expectedRelayerReward = BigInt(args[4]);
while (true) {
const relayerReward = await api.query.bridgeRelayers.relayerRewards(
relayerAccountAddress,
{ laneId: laneId, bridgedChainId: bridgedChainId, owner: relayerFundOwner }
);
if (relayerReward.isSome) {
const relayerRewardBalance = relayerReward.unwrap().toBigInt();
if (relayerRewardBalance > expectedRelayerReward) {
return relayerRewardBalance;
}
}
// else sleep and retry
await new Promise((resolve) => setTimeout(resolve, 12000));
}
}
module.exports = { run }
@@ -0,0 +1,26 @@
async function run(nodeName, networkInfo, args) {
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
const api = await zombie.connect(wsUri, userDefinedTypes);
// TODO: could be replaced with https://github.com/polkadot-js/api/issues/4930 (depends on metadata v15) later
const accountAddress = args[0];
const expectedForeignAssetBalance = BigInt(args[1]);
const bridgedNetworkName = args[2];
while (true) {
const foreignAssetAccount = await api.query.foreignAssets.account(
{ parents: 2, interior: { X1: { GlobalConsensus: bridgedNetworkName } } },
accountAddress
);
if (foreignAssetAccount.isSome) {
const foreignAssetAccountBalance = foreignAssetAccount.unwrap().balance.toBigInt();
if (foreignAssetAccountBalance > expectedForeignAssetBalance) {
return foreignAssetAccountBalance;
}
}
// else sleep and retry
await new Promise((resolve) => setTimeout(resolve, 12000));
}
}
module.exports = { run }
+97
View File
@@ -0,0 +1,97 @@
#!/bin/bash
#set -eu
shopt -s nullglob
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
# assuming that we'll be using native provide && all processes will be executing locally
# (we need absolute paths here, because they're used when scripts are called by zombienet from tmp folders)
export POLKADOT_SDK_FOLDER=`realpath $(dirname "$0")/../..`
export BRIDGE_TESTS_FOLDER=$POLKADOT_SDK_FOLDER/bridges/zombienet/tests
export POLKADOT_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot
export POLKADOT_PARACHAIN_BINARY_PATH=$POLKADOT_SDK_FOLDER/target/release/polkadot-parachain
export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=$POLKADOT_PARACHAIN_BINARY_PATH
export POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WOCOCO=$POLKADOT_PARACHAIN_BINARY_PATH
export ZOMBIENET_BINARY_PATH=~/local_bridge_testing/bin/zombienet-linux
# bridge configuration
export LANE_ID="00000001"
# tests configuration
ALL_TESTS_FOLDER=`mktemp -d`
function start_coproc() {
local command=$1
local name=$2
local coproc_log=`mktemp -p $TEST_FOLDER`
coproc COPROC {
$command >$coproc_log 2>&1
}
TEST_COPROCS[$COPROC_PID, 0]=$name
TEST_COPROCS[$COPROC_PID, 1]=$coproc_log
echo "Spawned $name coprocess. StdOut + StdErr: $coproc_log"
return $COPROC_PID
}
# execute every test from tests folder
TEST_INDEX=1
while true
do
declare -A TEST_COPROCS
TEST_COPROCS_COUNT=0
TEST_PREFIX=$(printf "%04d" $TEST_INDEX)
# it'll be used by the `sync-exit.sh` script
export TEST_FOLDER=`mktemp -d -p $ALL_TESTS_FOLDER`
# check if there are no more tests
zndsl_files=($BRIDGE_TESTS_FOLDER/$TEST_PREFIX-*.zndsl)
if [ ${#zndsl_files[@]} -eq 0 ]; then
break
fi
# start relay
if [ -f $BRIDGE_TESTS_FOLDER/$TEST_PREFIX-start-relay.sh ]; then
start_coproc "${BRIDGE_TESTS_FOLDER}/${TEST_PREFIX}-start-relay.sh" "relay"
RELAY_COPROC=$COPROC_PID
((TEST_COPROCS_COUNT++))
fi
# start tests
for zndsl_file in "${zndsl_files[@]}"; do
start_coproc "$ZOMBIENET_BINARY_PATH --provider native test $zndsl_file" "$zndsl_file"
echo -n "1">>$TEST_FOLDER/exit-sync
((TEST_COPROCS_COUNT++))
done
# wait until all tests are completed
relay_exited=0
for n in `seq 1 $TEST_COPROCS_COUNT`; do
wait -n -p COPROC_PID
exit_code=$?
coproc_name=${TEST_COPROCS[$COPROC_PID, 0]}
coproc_log=${TEST_COPROCS[$COPROC_PID, 1]}
coproc_stdout=$(cat $coproc_log)
relay_exited=$(expr "${coproc_name}" == "relay")
echo "Process $coproc_name has finished with exit code: $exit_code"
# if exit code is not zero, exit
if [ $exit_code -ne 0 ]; then
echo "====================================================================="
echo "=== Shutting down. Log of failed process below ==="
echo "====================================================================="
echo $coproc_stdout
exit 1
fi
# if last test has exited, exit relay too
if [ $n -eq $(($TEST_COPROCS_COUNT - 1)) ] && [ $relay_exited -eq 0 ]; then
kill $RELAY_COPROC
break
fi
done
((TEST_INDEX++))
done
echo "====================================================================="
echo "=== All tests have completed successfully ==="
echo "====================================================================="
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
pushd $POLKADOT_SDK_FOLDER/cumulus/scripts
./bridges_rococo_wococo.sh $1
popd
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
# every network adds a char to the file, let's remove ours
truncate -s -1 $TEST_FOLDER/exit-sync
# when all chars are removed, then our test is done
while true
do
if [ `stat --printf="%s" $TEST_FOLDER/exit-sync` -eq 0 ]; then
exit
fi
sleep 100
done
@@ -0,0 +1,25 @@
Description: User is able to transfer ROC from Rococo Asset Hub to Wococo Asset Hub
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml
Creds: config
# step 1: initialize Wococo asset hub
asset-hub-wococo-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-wococo-local" within 120 seconds
# step 2: initialize Wococo bridge hub
bridge-hub-wococo-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-wococo-local" within 120 seconds
# step 3: relay is started elsewhere - let's wait until with-Rococo GRANPDA pallet is initialized at Wococo
bridge-hub-wococo-collator1: js-script ../helpers/best-finalized-header-at-bridged-chain.js with "Rococo,0" within 400 seconds
# step 2: send WOC to Rococo
asset-hub-wococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-wococo-local" within 60 seconds
# step 3: elsewhere Rococo has sent ROC to //Alice - let's wait for it
asset-hub-wococo-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Rococo" within 600 seconds
# step 4: check that the relayer //Charlie is rewarded by both our AH and target AH
bridge-hub-wococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000001,0x6268726F,BridgedChain,0" within 300 seconds
bridge-hub-wococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000001,0x6268726F,ThisChain,0" within 300 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-wococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
@@ -0,0 +1,25 @@
Description: User is able to transfer WOC from Wococo Asset Hub to Rococo Asset Hub
Network: ../../../cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
Creds: config
# step 1: initialize Rococo asset hub
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-asset-hub-rococo-local" within 120 seconds
# step 2: initialize Rococo bridge hub
bridge-hub-rococo-collator1: run ../scripts/invoke-script.sh with "init-bridge-hub-rococo-local" within 120 seconds
# step 3: relay is started elsewhere - let's wait until with-Wococo GRANPDA pallet is initialized at Rococo
bridge-hub-rococo-collator1: js-script ../helpers/best-finalized-header-at-bridged-chain.js with "Wococo,0" within 400 seconds
# step 4: send ROC to Wococo
asset-hub-rococo-collator1: run ../scripts/invoke-script.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 60 seconds
# step 5: elsewhere Wococo has sent WOC to //Alice - let's wait for it
asset-hub-rococo-collator1: js-script ../helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Wococo" within 600 seconds
# step 6: check that the relayer //Charlie is rewarded by both our AH and target AH
bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000001,0x6268776F,BridgedChain,0" within 300 seconds
bridge-hub-rococo-collator1: js-script ../helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000001,0x6268776F,ThisChain,0" within 300 seconds
# wait until other network test has completed OR exit with an error too
asset-hub-rococo-collator1: run ../scripts/sync-exit.sh within 600 seconds
@@ -0,0 +1,5 @@
#!/bin/bash
pushd $POLKADOT_SDK_FOLDER/cumulus/scripts
./bridges_rococo_wococo.sh run-relay
popd
@@ -249,15 +249,15 @@ fn reserve_transfer_native_asset_from_relay_to_system_para_fails() {
test.set_dispatchable::<Rococo>(relay_reserve_transfer_assets);
test.assert();
let sender_balance_after = test.sender.balance;
let receiver_balance_after = test.receiver.balance;
let delivery_fees = Rococo::execute_with(|| {
xcm_helpers::transfer_assets_delivery_fees::<
<RococoXcmConfig as xcm_executor::Config>::XcmSender,
>(test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest)
});
let sender_balance_after = test.sender.balance;
let receiver_balance_after = test.receiver.balance;
assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after);
assert_eq!(receiver_balance_before, receiver_balance_after);
}
@@ -38,7 +38,10 @@ fn relay_origin_assertions(t: RelayToSystemParaTest) {
}
fn system_para_dest_assertions(_t: RelayToSystemParaTest) {
AssetHubWestend::assert_dmp_queue_error(Error::WeightNotComputable);
AssetHubWestend::assert_dmp_queue_incomplete(
Some(Weight::from_parts(31_352_000, 1489)),
Some(Error::UntrustedReserveLocation),
);
}
fn system_para_to_relay_assertions(_t: SystemParaToRelayTest) {
@@ -64,7 +64,7 @@ fn example() {
outcome: Outcome::Complete(_),
..
}) => {},
RuntimeEvent::BridgeRococoToWococoMessages(pallet_bridge_messages::Event::MessageAccepted {
RuntimeEvent::BridgeWococoMessages(pallet_bridge_messages::Event::MessageAccepted {
lane_id: LaneId([0, 0, 0, 1]),
nonce: 1,
}) => {},
@@ -669,16 +669,14 @@ pub mod bridge_hub_rococo {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
..Default::default()
},
bridge_wococo_to_rococo_messages:
bridge_hub_rococo_runtime::BridgeWococoToRococoMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
..Default::default()
},
bridge_rococo_to_wococo_messages:
bridge_hub_rococo_runtime::BridgeRococoToWococoMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
..Default::default()
},
bridge_rococo_messages: bridge_hub_rococo_runtime::BridgeRococoMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
..Default::default()
},
bridge_wococo_messages: bridge_hub_rococo_runtime::BridgeWococoMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
..Default::default()
},
..Default::default()
};
@@ -83,6 +83,7 @@ assets-common = { path = "../common", default-features = false }
# Bridges
pallet-xcm-bridge-hub-router = { path = "../../../../../bridges/modules/xcm-bridge-hub-router", default-features = false }
bp-asset-hub-rococo = { path = "../../../../../bridges/primitives/chain-asset-hub-rococo", default-features = false }
bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-hub-westend", default-features = false }
bp-asset-hub-wococo = { path = "../../../../../bridges/primitives/chain-asset-hub-wococo", default-features = false }
bp-bridge-hub-rococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
bp-bridge-hub-wococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-wococo", default-features = false }
@@ -171,6 +172,7 @@ try-runtime = [
std = [
"assets-common/std",
"bp-asset-hub-rococo/std",
"bp-asset-hub-westend/std",
"bp-asset-hub-wococo/std",
"bp-bridge-hub-rococo/std",
"bp-bridge-hub-wococo/std",
@@ -123,7 +123,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 10006,
spec_version: 1_003_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
@@ -136,7 +136,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
spec_version: 10006,
spec_version: 1_003_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
@@ -833,7 +833,7 @@ impl pallet_nfts::Config for Runtime {
/// XCM router instance to BridgeHub with bridging capabilities for `Wococo` global
/// consensus with dynamic fees and back-pressure.
pub type ToWococoXcmRouterInstance = pallet_assets::Instance1;
pub type ToWococoXcmRouterInstance = pallet_xcm_bridge_hub_router::Instance1;
impl pallet_xcm_bridge_hub_router::Config<ToWococoXcmRouterInstance> for Runtime {
type WeightInfo = weights::pallet_xcm_bridge_hub_router_to_wococo::WeightInfo<Runtime>;
@@ -864,7 +864,7 @@ impl pallet_xcm_bridge_hub_router::Config<ToWococoXcmRouterInstance> for Runtime
/// XCM router instance to BridgeHub with bridging capabilities for `Rococo` global
/// consensus with dynamic fees and back-pressure.
pub type ToRococoXcmRouterInstance = pallet_assets::Instance2;
pub type ToRococoXcmRouterInstance = pallet_xcm_bridge_hub_router::Instance2;
impl pallet_xcm_bridge_hub_router::Config<ToRococoXcmRouterInstance> for Runtime {
type WeightInfo = weights::pallet_xcm_bridge_hub_router_to_rococo::WeightInfo<Runtime>;
@@ -893,6 +893,37 @@ impl pallet_xcm_bridge_hub_router::Config<ToRococoXcmRouterInstance> for Runtime
type FeeAsset = xcm_config::bridging::XcmBridgeHubRouterFeeAssetId;
}
/// XCM router instance to BridgeHub with bridging capabilities for `Westend` global
/// consensus with dynamic fees and back-pressure.
pub type ToWestendXcmRouterInstance = pallet_xcm_bridge_hub_router::Instance3;
impl pallet_xcm_bridge_hub_router::Config<ToWestendXcmRouterInstance> for Runtime {
type WeightInfo = weights::pallet_xcm_bridge_hub_router_to_westend::WeightInfo<Runtime>;
type UniversalLocation = xcm_config::UniversalLocation;
type BridgedNetworkId = xcm_config::bridging::to_westend::WestendNetwork;
type Bridges = xcm_config::bridging::NetworkExportTable;
#[cfg(not(feature = "runtime-benchmarks"))]
type BridgeHubOrigin = EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>;
#[cfg(feature = "runtime-benchmarks")]
type BridgeHubOrigin = EitherOfDiverse<
// for running benchmarks
EnsureRoot<AccountId>,
// for running tests with `--feature runtime-benchmarks`
EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>,
>;
type ToBridgeHubSender = XcmpQueue;
type WithBridgeHubChannel =
cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider<
xcm_config::bridging::SiblingBridgeHubParaId,
Runtime,
>;
type ByteFee = xcm_config::bridging::XcmBridgeHubRouterByteFee;
type FeeAsset = xcm_config::bridging::XcmBridgeHubRouterFeeAssetId;
}
// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime
@@ -931,6 +962,7 @@ construct_runtime!(
// Bridge utilities.
ToWococoXcmRouter: pallet_xcm_bridge_hub_router::<Instance1>::{Pallet, Storage, Call} = 43,
ToRococoXcmRouter: pallet_xcm_bridge_hub_router::<Instance2>::{Pallet, Storage, Call} = 44,
ToWestendXcmRouter: pallet_xcm_bridge_hub_router::<Instance3>::{Pallet, Storage, Call} = 45,
// The main stage.
Assets: pallet_assets::<Instance1>::{Pallet, Call, Storage, Event<T>} = 50,
@@ -1006,6 +1038,7 @@ mod benches {
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm_bridge_hub_router, ToWococo]
[pallet_xcm_bridge_hub_router, ToWestend]
[pallet_xcm_bridge_hub_router, ToRococo]
// XCM
[pallet_xcm, PolkadotXcm]
@@ -1263,6 +1296,7 @@ impl_runtime_apis! {
type Pool = pallet_assets::Pallet::<Runtime, PoolAssetsInstance>;
type ToWococo = XcmBridgeHubRouterBench<Runtime, ToWococoXcmRouterInstance>;
type ToWestend = XcmBridgeHubRouterBench<Runtime, ToWestendXcmRouterInstance>;
type ToRococo = XcmBridgeHubRouterBench<Runtime, ToRococoXcmRouterInstance>;
let mut list = Vec::<BenchmarkList>::new();
@@ -1311,6 +1345,19 @@ impl_runtime_apis! {
xcm_config::bridging::to_wococo::AssetHubWococo::get()
}
}
impl XcmBridgeHubRouterConfig<ToWestendXcmRouterInstance> for Runtime {
fn make_congested() {
cumulus_pallet_xcmp_queue::bridging::suspend_channel_for_benchmarks::<Runtime>(
xcm_config::bridging::SiblingBridgeHubParaId::get().into()
);
}
fn ensure_bridged_target_destination() -> MultiLocation {
ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(
xcm_config::bridging::SiblingBridgeHubParaId::get().into()
);
xcm_config::bridging::to_westend::AssetHubWestend::get()
}
}
impl XcmBridgeHubRouterConfig<ToRococoXcmRouterInstance> for Runtime {
fn make_congested() {
cumulus_pallet_xcmp_queue::bridging::suspend_channel_for_benchmarks::<Runtime>(
@@ -1461,6 +1508,7 @@ impl_runtime_apis! {
type Pool = pallet_assets::Pallet::<Runtime, PoolAssetsInstance>;
type ToWococo = XcmBridgeHubRouterBench<Runtime, ToWococoXcmRouterInstance>;
type ToWestend = XcmBridgeHubRouterBench<Runtime, ToWestendXcmRouterInstance>;
type ToRococo = XcmBridgeHubRouterBench<Runtime, ToRococoXcmRouterInstance>;
let whitelist: Vec<TrackedStorageKey> = vec![
@@ -34,6 +34,7 @@ pub mod pallet_uniques;
pub mod pallet_utility;
pub mod pallet_xcm;
pub mod pallet_xcm_bridge_hub_router_to_rococo;
pub mod pallet_xcm_bridge_hub_router_to_westend;
pub mod pallet_xcm_bridge_hub_router_to_wococo;
pub mod paritydb_weights;
pub mod rocksdb_weights;
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_bridge_hub_router`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-guclnr1q-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -50,34 +50,36 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for WeightInfo<T> {
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn on_initialize_when_non_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `232`
// Estimated: `3697`
// Minimum execution time: 10_861_000 picoseconds.
Weight::from_parts(11_253_000, 0)
.saturating_add(Weight::from_parts(0, 3697))
// Measured: `265`
// Estimated: `3730`
// Minimum execution time: 9_084_000 picoseconds.
Weight::from_parts(9_441_000, 0)
.saturating_add(Weight::from_parts(0, 3730))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn on_initialize_when_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `169`
// Estimated: `3634`
// Minimum execution time: 5_807_000 picoseconds.
Weight::from_parts(6_018_000, 0)
.saturating_add(Weight::from_parts(0, 3634))
.saturating_add(T::DbWeight::get().reads(2))
// Measured: `202`
// Estimated: `3667`
// Minimum execution time: 5_971_000 picoseconds.
Weight::from_parts(6_260_000, 0)
.saturating_add(Weight::from_parts(0, 3667))
.saturating_add(T::DbWeight::get().reads(3))
}
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
@@ -85,8 +87,8 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
// Proof Size summary in bytes:
// Measured: `117`
// Estimated: `1502`
// Minimum execution time: 11_479_000 picoseconds.
Weight::from_parts(11_831_000, 0)
// Minimum execution time: 10_231_000 picoseconds.
Weight::from_parts(10_861_000, 0)
.saturating_add(Weight::from_parts(0, 1502))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -99,6 +101,8 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
/// Proof: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -109,16 +113,18 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn send_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `445`
// Estimated: `3910`
// Minimum execution time: 52_670_000 picoseconds.
Weight::from_parts(54_368_000, 0)
.saturating_add(Weight::from_parts(0, 3910))
.saturating_add(T::DbWeight::get().reads(9))
// Measured: `478`
// Estimated: `3943`
// Minimum execution time: 53_966_000 picoseconds.
Weight::from_parts(55_224_000, 0)
.saturating_add(Weight::from_parts(0, 3943))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -0,0 +1,130 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm_bridge_hub_router`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_xcm_bridge_hub_router
// --chain=asset-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/
#![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 `pallet_xcm_bridge_hub_router`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for WeightInfo<T> {
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ToWestendXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWestendXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn on_initialize_when_non_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `193`
// Estimated: `3658`
// Minimum execution time: 8_528_000 picoseconds.
Weight::from_parts(8_886_000, 0)
.saturating_add(Weight::from_parts(0, 3658))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn on_initialize_when_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `183`
// Estimated: `3648`
// Minimum execution time: 5_170_000 picoseconds.
Weight::from_parts(5_433_000, 0)
.saturating_add(Weight::from_parts(0, 3648))
.saturating_add(T::DbWeight::get().reads(3))
}
/// Storage: `ToWestendXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWestendXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn report_bridge_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `150`
// Estimated: `1502`
// Minimum execution time: 10_283_000 picoseconds.
Weight::from_parts(10_762_000, 0)
.saturating_add(Weight::from_parts(0, 1502))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Storage: `ToWestendXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWestendXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn send_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `387`
// Estimated: `3852`
// Minimum execution time: 52_040_000 picoseconds.
Weight::from_parts(53_500_000, 0)
.saturating_add(Weight::from_parts(0, 3852))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_bridge_hub_router`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-guclnr1q-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -50,34 +50,36 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for WeightInfo<T> {
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ToWococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn on_initialize_when_non_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `3663`
// Minimum execution time: 10_936_000 picoseconds.
Weight::from_parts(11_432_000, 0)
.saturating_add(Weight::from_parts(0, 3663))
// Measured: `231`
// Estimated: `3696`
// Minimum execution time: 9_115_000 picoseconds.
Weight::from_parts(9_522_000, 0)
.saturating_add(Weight::from_parts(0, 3696))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn on_initialize_when_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `150`
// Estimated: `3615`
// Minimum execution time: 5_165_000 picoseconds.
Weight::from_parts(5_356_000, 0)
.saturating_add(Weight::from_parts(0, 3615))
.saturating_add(T::DbWeight::get().reads(2))
// Measured: `183`
// Estimated: `3648`
// Minimum execution time: 5_207_000 picoseconds.
Weight::from_parts(5_534_000, 0)
.saturating_add(Weight::from_parts(0, 3648))
.saturating_add(T::DbWeight::get().reads(3))
}
/// Storage: `ToWococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
@@ -85,8 +87,8 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
// Proof Size summary in bytes:
// Measured: `83`
// Estimated: `1502`
// Minimum execution time: 11_420_000 picoseconds.
Weight::from_parts(11_946_000, 0)
// Minimum execution time: 10_437_000 picoseconds.
Weight::from_parts(10_956_000, 0)
.saturating_add(Weight::from_parts(0, 1502))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -99,6 +101,8 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
/// Proof: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Storage: `ToWococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToWococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -109,16 +113,18 @@ impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for Weigh
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn send_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `392`
// Estimated: `3857`
// Minimum execution time: 52_129_000 picoseconds.
Weight::from_parts(53_552_000, 0)
.saturating_add(Weight::from_parts(0, 3857))
.saturating_add(T::DbWeight::get().reads(9))
// Measured: `425`
// Estimated: `3890`
// Minimum execution time: 52_176_000 picoseconds.
Weight::from_parts(54_067_000, 0)
.saturating_add(Weight::from_parts(0, 3890))
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::fungible`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ayothjw6-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
@@ -54,8 +54,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `101`
// Estimated: `3593`
// Minimum execution time: 20_408_000 picoseconds.
Weight::from_parts(21_066_000, 3593)
// Minimum execution time: 20_940_000 picoseconds.
Weight::from_parts(21_453_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -65,8 +65,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `101`
// Estimated: `6196`
// Minimum execution time: 42_449_000 picoseconds.
Weight::from_parts(43_065_000, 6196)
// Minimum execution time: 44_310_000 picoseconds.
Weight::from_parts(44_948_000, 6196)
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
@@ -92,8 +92,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `8799`
// Minimum execution time: 85_637_000 picoseconds.
Weight::from_parts(86_550_000, 8799)
// Minimum execution time: 87_226_000 picoseconds.
Weight::from_parts(89_399_000, 8799)
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(5))
}
@@ -105,8 +105,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `39`
// Estimated: `3504`
// Minimum execution time: 7_006_000 picoseconds.
Weight::from_parts(7_185_000, 3504)
// Minimum execution time: 7_320_000 picoseconds.
Weight::from_parts(7_453_000, 3504)
.saturating_add(T::DbWeight::get().reads(2))
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
@@ -131,8 +131,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 185_307_000 picoseconds.
Weight::from_parts(189_716_000, 6196)
// Minimum execution time: 183_539_000 picoseconds.
Weight::from_parts(190_968_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -140,8 +140,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_934_000 picoseconds.
Weight::from_parts(3_078_000, 0)
// Minimum execution time: 3_068_000 picoseconds.
Weight::from_parts(3_228_000, 0)
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
@@ -149,8 +149,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 18_701_000 picoseconds.
Weight::from_parts(19_221_000, 3593)
// Minimum execution time: 18_788_000 picoseconds.
Weight::from_parts(19_240_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -176,8 +176,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `6196`
// Minimum execution time: 57_182_000 picoseconds.
Weight::from_parts(58_877_000, 6196)
// Minimum execution time: 58_577_000 picoseconds.
Weight::from_parts(59_729_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -203,8 +203,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 45_073_000 picoseconds.
Weight::from_parts(45_927_000, 3610)
// Minimum execution time: 45_804_000 picoseconds.
Weight::from_parts(46_702_000, 3610)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(3))
}
@@ -17,28 +17,26 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-rococo-dev"), DB CACHE: 1024
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// target/production/polkadot-parachain
// benchmark
// pallet
// --template=./templates/xcm-bench-template.hbs
// --chain=asset-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_xcm_benchmarks::generic
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_xcm_benchmarks::generic
// --chain=asset-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --template=./cumulus/templates/xcm-bench-template.hbs
// --output=./cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/xcm/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -50,33 +48,39 @@ use sp_std::marker::PhantomData;
/// Weights for `pallet_xcm_benchmarks::generic`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo<T> {
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_holding() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 432_196_000 picoseconds.
Weight::from_parts(438_017_000, 3574)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 415_688_000 picoseconds.
Weight::from_parts(433_876_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_223_000 picoseconds.
Weight::from_parts(4_412_000, 0)
// Minimum execution time: 3_209_000 picoseconds.
Weight::from_parts(3_465_000, 0)
}
// Storage: `PolkadotXcm::Queries` (r:1 w:0)
// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -84,79 +88,85 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `3568`
// Minimum execution time: 11_582_000 picoseconds.
Weight::from_parts(11_830_000, 3568)
// Minimum execution time: 7_940_000 picoseconds.
Weight::from_parts(8_208_000, 3568)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_955_000 picoseconds.
Weight::from_parts(14_320_000, 0)
// Minimum execution time: 9_336_000 picoseconds.
Weight::from_parts(9_733_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_423_000 picoseconds.
Weight::from_parts(4_709_000, 0)
// Minimum execution time: 3_368_000 picoseconds.
Weight::from_parts(3_700_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_028_000 picoseconds.
Weight::from_parts(3_151_000, 0)
// Minimum execution time: 1_868_000 picoseconds.
Weight::from_parts(2_034_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_966_000 picoseconds.
Weight::from_parts(3_076_000, 0)
// Minimum execution time: 1_870_000 picoseconds.
Weight::from_parts(1_972_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_971_000 picoseconds.
Weight::from_parts(3_119_000, 0)
// Minimum execution time: 1_890_000 picoseconds.
Weight::from_parts(1_962_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_772_000 picoseconds.
Weight::from_parts(3_853_000, 0)
// Minimum execution time: 2_660_000 picoseconds.
Weight::from_parts(2_744_000, 0)
}
pub fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_940_000 picoseconds.
Weight::from_parts(3_050_000, 0)
// Minimum execution time: 1_845_000 picoseconds.
Weight::from_parts(1_945_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 27_734_000 picoseconds.
Weight::from_parts(28_351_000, 3574)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 54_283_000 picoseconds.
Weight::from_parts(54_969_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1)
// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -164,8 +174,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `3625`
// Minimum execution time: 16_456_000 picoseconds.
Weight::from_parts(16_846_000, 3625)
// Minimum execution time: 11_850_000 picoseconds.
Weight::from_parts(12_328_000, 3625)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -173,11 +183,13 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_974_000 picoseconds.
Weight::from_parts(3_108_000, 0)
// Minimum execution time: 1_891_000 picoseconds.
Weight::from_parts(1_950_000, 0)
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1)
// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -190,11 +202,11 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn subscribe_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 29_823_000 picoseconds.
Weight::from_parts(30_776_000, 3574)
.saturating_add(T::DbWeight::get().reads(6))
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 23_644_000 picoseconds.
Weight::from_parts(24_296_000, 3610)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1)
@@ -203,137 +215,151 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_966_000 picoseconds.
Weight::from_parts(5_157_000, 0)
// Minimum execution time: 3_719_000 picoseconds.
Weight::from_parts(3_896_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 141_875_000 picoseconds.
Weight::from_parts(144_925_000, 0)
// Minimum execution time: 125_710_000 picoseconds.
Weight::from_parts(132_434_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_147_000 picoseconds.
Weight::from_parts(13_420_000, 0)
// Minimum execution time: 11_650_000 picoseconds.
Weight::from_parts(12_277_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_050_000 picoseconds.
Weight::from_parts(3_161_000, 0)
// Minimum execution time: 1_978_000 picoseconds.
Weight::from_parts(2_070_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_930_000 picoseconds.
Weight::from_parts(3_077_000, 0)
// Minimum execution time: 1_899_000 picoseconds.
Weight::from_parts(2_002_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_188_000 picoseconds.
Weight::from_parts(3_299_000, 0)
// Minimum execution time: 2_133_000 picoseconds.
Weight::from_parts(2_194_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn query_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 31_678_000 picoseconds.
Weight::from_parts(32_462_000, 3574)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 58_644_000 picoseconds.
Weight::from_parts(60_614_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_638_000 picoseconds.
Weight::from_parts(5_756_000, 0)
// Minimum execution time: 5_185_000 picoseconds.
Weight::from_parts(5_366_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 27_556_000 picoseconds.
Weight::from_parts(28_240_000, 3574)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 54_443_000 picoseconds.
Weight::from_parts(55_873_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_932_000 picoseconds.
Weight::from_parts(3_097_000, 0)
// Minimum execution time: 1_909_000 picoseconds.
Weight::from_parts(2_011_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_860_000 picoseconds.
Weight::from_parts(2_957_000, 0)
// Minimum execution time: 1_814_000 picoseconds.
Weight::from_parts(1_956_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_886_000 picoseconds.
Weight::from_parts(3_015_000, 0)
// Minimum execution time: 1_875_000 picoseconds.
Weight::from_parts(2_003_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub fn universal_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1489`
// Minimum execution time: 5_088_000 picoseconds.
Weight::from_parts(5_253_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
// Measured: `39`
// Estimated: `3504`
// Minimum execution time: 7_376_000 picoseconds.
Weight::from_parts(7_620_000, 3504)
.saturating_add(T::DbWeight::get().reads(2))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_874_000 picoseconds.
Weight::from_parts(3_060_000, 0)
// Minimum execution time: 1_863_000 picoseconds.
Weight::from_parts(1_964_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_029_000 picoseconds.
Weight::from_parts(3_158_000, 0)
// Minimum execution time: 1_956_000 picoseconds.
Weight::from_parts(2_057_000, 0)
}
}
@@ -17,8 +17,8 @@ use super::{
AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, BaseDeliveryFee,
FeeAssetId, ForeignAssets, ForeignAssetsInstance, ParachainInfo, ParachainSystem, PolkadotXcm,
PoolAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeFlavor, RuntimeOrigin,
ToRococoXcmRouter, ToWococoXcmRouter, TransactionByteFee, TrustBackedAssetsInstance,
WeightToFee, XcmpQueue,
ToRococoXcmRouter, ToWestendXcmRouter, ToWococoXcmRouter, TransactionByteFee,
TrustBackedAssetsInstance, WeightToFee, XcmpQueue,
};
use assets_common::{
local_and_foreign_assets::MatchesLocalAndForeignAssetsMultiLocation,
@@ -44,16 +44,16 @@ use rococo_runtime_constants::system_parachain;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllAssets, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily,
EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription,
IsConcrete, LocalMint, LocationWithAssetFilters, NetworkExportTableItem, NoChecking,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeeManagerFromComponents, XcmFeeToAccount,
IsConcrete, LocalMint, NetworkExportTableItem, NoChecking, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, StartsWith,
StartsWithExplicitGlobalConsensus, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
XcmFeeToAccount,
};
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
@@ -260,10 +260,6 @@ match_types! {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(_) }
};
pub type WithParentsZeroOrOne: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, .. } |
MultiLocation { parents: 1, .. }
};
}
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
@@ -478,6 +474,8 @@ impl Contains<RuntimeCall> for SafeCallFilter {
pallet_uniques::Call::buy_item { .. }
) | RuntimeCall::ToWococoXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
) | RuntimeCall::ToWestendXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
) | RuntimeCall::ToRococoXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
)
@@ -567,11 +565,13 @@ impl xcm_executor::Config for XcmConfig {
type XcmSender = XcmRouter;
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// Asset Hub trusts only particular configured bridge locations as reserve locations.
// Asset Hub may _act_ as a reserve location for ROC and assets created under `pallet-assets`.
// Users must use teleport where allowed (e.g. ROC with the Relay Chain).
// Asset Hub trusts only particular, pre-configured bridged locations from a different consensus
// as reserve locations (we trust the Bridge Hub to relay the message that a reserve is being
// held). Asset Hub may _act_ as a reserve location for ROC and assets created
// under `pallet-assets`. Users must use teleport where allowed (e.g. ROC with the Relay Chain).
type IsReserve = (
bridging::to_wococo::IsTrustedBridgedReserveLocationForConcreteAsset,
bridging::to_westend::IsTrustedBridgedReserveLocationForConcreteAsset,
bridging::to_rococo::IsTrustedBridgedReserveLocationForConcreteAsset,
);
type IsTeleporter = TrustedTeleporters;
@@ -624,8 +624,11 @@ impl xcm_executor::Config for XcmConfig {
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
type MessageExporter = ();
type UniversalAliases =
(bridging::to_wococo::UniversalAliases, bridging::to_rococo::UniversalAliases);
type UniversalAliases = (
bridging::to_wococo::UniversalAliases,
bridging::to_rococo::UniversalAliases,
bridging::to_westend::UniversalAliases,
);
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
@@ -653,6 +656,9 @@ pub type XcmRouter = WithUniqueTopic<(
// Router which wraps and sends xcm to BridgeHub to be delivered to the Wococo
// GlobalConsensus
ToWococoXcmRouter,
// Router which wraps and sends xcm to BridgeHub to be delivered to the Westend
// GlobalConsensus
ToWestendXcmRouter,
// Router which wraps and sends xcm to BridgeHub to be delivered to the Rococo
// GlobalConsensus
ToRococoXcmRouter,
@@ -675,14 +681,7 @@ impl pallet_xcm::Config for Runtime {
type XcmExecuteFilter = Nothing;
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
// Allow reserve based transfer to everywhere except for bridging, here we strictly check what
// assets are allowed.
type XcmReserveTransferFilter = (
LocationWithAssetFilters<WithParentsZeroOrOne, AllAssets>,
bridging::to_rococo::AllowedReserveTransferAssets,
bridging::to_wococo::AllowedReserveTransferAssets,
);
type XcmReserveTransferFilter = Everything;
type Weigher = WeightInfoBounds<
crate::weights::xcm::AssetHubRococoXcmWeight<RuntimeCall>,
RuntimeCall,
@@ -775,6 +774,7 @@ pub mod bridging {
pub BridgeTable: sp_std::vec::Vec<NetworkExportTableItem> =
sp_std::vec::Vec::new().into_iter()
.chain(to_wococo::BridgeTable::get())
.chain(to_westend::BridgeTable::get())
.chain(to_rococo::BridgeTable::get())
.collect();
}
@@ -819,13 +819,6 @@ pub mod bridging {
)
];
/// Allowed assets for reserve transfer to `AssetHubWococo`.
pub AllowedReserveTransferAssetsToAssetHubWococo: sp_std::vec::Vec<MultiAssetFilter> = sp_std::vec![
// allow send only ROC
Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) }),
// and nothing else
];
/// Universal aliases
pub UniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter(
sp_std::vec![
@@ -852,12 +845,6 @@ pub mod bridging {
),
>;
/// Allows to reserve transfer assets to `AssetHubWococo`.
pub type AllowedReserveTransferAssets = LocationWithAssetFilters<
Equals<AssetHubWococo>,
AllowedReserveTransferAssetsToAssetHubWococo,
>;
impl Contains<RuntimeCall> for ToWococoXcmRouter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
@@ -870,6 +857,82 @@ pub mod bridging {
}
}
pub mod to_westend {
use super::*;
parameter_types! {
pub SiblingBridgeHubWithBridgeHubWestendInstance: MultiLocation = MultiLocation::new(
1,
X2(
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(bp_bridge_hub_rococo::WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX)
)
);
pub const WestendNetwork: NetworkId = NetworkId::Westend;
pub AssetHubWestend: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(WestendNetwork::get()), Parachain(bp_asset_hub_westend::ASSET_HUB_WESTEND_PARACHAIN_ID)));
pub WndLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(WestendNetwork::get())));
pub WndFromAssetHubWestend: (MultiAssetFilter, MultiLocation) = (
Wild(AllOf { fun: WildFungible, id: Concrete(WndLocation::get()) }),
AssetHubWestend::get()
);
/// Set up exporters configuration.
/// `Option<MultiAsset>` represents static "base fee" which is used for total delivery fee calculation.
pub BridgeTable: sp_std::vec::Vec<NetworkExportTableItem> = sp_std::vec![
NetworkExportTableItem::new(
WestendNetwork::get(),
Some(sp_std::vec![
AssetHubWestend::get().interior.split_global().expect("invalid configuration for AssetHubWestend").1,
]),
SiblingBridgeHub::get(),
// base delivery fee to local `BridgeHub`
Some((
XcmBridgeHubRouterFeeAssetId::get(),
bp_asset_hub_rococo::BridgeHubRococoBaseFeeInRocs::get(),
).into())
)
];
/// Universal aliases
pub UniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter(
sp_std::vec![
(SiblingBridgeHubWithBridgeHubWestendInstance::get(), GlobalConsensus(WestendNetwork::get()))
]
);
}
impl Contains<(MultiLocation, Junction)> for UniversalAliases {
fn contains(alias: &(MultiLocation, Junction)) -> bool {
UniversalAliases::get().contains(alias)
}
}
/// Trusted reserve locations filter for `xcm_executor::Config::IsReserve`.
/// Locations from which the runtime accepts reserved assets.
pub type IsTrustedBridgedReserveLocationForConcreteAsset =
matching::IsTrustedBridgedReserveLocationForConcreteAsset<
UniversalLocation,
(
// allow receive WND from AssetHubWestend
xcm_builder::Case<WndFromAssetHubWestend>,
// and nothing else
),
>;
impl Contains<RuntimeCall> for ToWestendXcmRouter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
call,
RuntimeCall::ToWestendXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
)
)
}
}
}
pub mod to_rococo {
use super::*;
@@ -908,13 +971,6 @@ pub mod bridging {
)
];
/// Allowed assets for reserve transfer to `AssetHubWococo`.
pub AllowedReserveTransferAssetsToAssetHubRococo: sp_std::vec::Vec<MultiAssetFilter> = sp_std::vec![
// allow send only WOC
Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) }),
// and nothing else
];
/// Universal aliases
pub UniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter(
sp_std::vec![
@@ -941,12 +997,6 @@ pub mod bridging {
),
>;
/// Allows to reserve transfer assets to `AssetHubRococo`.
pub type AllowedReserveTransferAssets = LocationWithAssetFilters<
Equals<AssetHubRococo>,
AllowedReserveTransferAssetsToAssetHubRococo,
>;
impl Contains<RuntimeCall> for ToRococoXcmRouter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
@@ -967,15 +1017,17 @@ pub mod bridging {
impl BridgingBenchmarksHelper {
pub fn prepare_universal_alias() -> Option<(MultiLocation, Junction)> {
let alias =
to_wococo::UniversalAliases::get().into_iter().find_map(|(location, junction)| {
match to_wococo::SiblingBridgeHubWithBridgeHubWococoInstance::get()
.eq(&location)
{
true => Some((location, junction)),
false => None,
}
});
assert!(alias.is_some(), "we expect here BridgeHubRococo to Polkadot mapping at least");
to_westend::UniversalAliases::get()
.into_iter()
.find_map(|(location, junction)| {
match to_westend::SiblingBridgeHubWithBridgeHubWestendInstance::get()
.eq(&location)
{
true => Some((location, junction)),
false => None,
}
});
assert!(alias.is_some(), "we expect here BridgeHubRococo to Westend mapping at least");
Some(alias.unwrap())
}
}
@@ -29,14 +29,16 @@ pub use asset_hub_rococo_runtime::{
AllPalletsWithoutSystem, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets,
ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime,
RuntimeCall, RuntimeEvent, RuntimeFlavor, SessionKeys, System, ToRococoXcmRouterInstance,
ToWococoXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue,
ToWestendXcmRouterInstance, ToWococoXcmRouterInstance, TrustBackedAssetsInstance, XcmpQueue,
};
use asset_test_utils::{
test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, ExtBuilder,
};
use asset_test_utils::{CollatorSessionKey, CollatorSessionKeys, ExtBuilder};
use codec::{Decode, Encode};
use cumulus_primitives_utility::ChargeWeightInFungibles;
use frame_support::{
assert_noop, assert_ok,
traits::{fungibles::InspectEnumerable, Contains},
traits::fungibles::InspectEnumerable,
weights::{Weight, WeightToFee as WeightToFeeT},
};
use parachains_common::{
@@ -642,11 +644,43 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p
})
);
fn limited_reserve_transfer_assets_for_native_asset_over_bridge_works(
bridging_configuration: fn() -> TestBridgingConfig,
) {
asset_test_utils::test_cases_over_bridge::limited_reserve_transfer_assets_for_native_asset_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
XcmpQueue,
LocationToAccountId,
>(
collator_session_keys(),
ExistentialDeposit::get(),
AccountId::from(ALICE),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
bridging_configuration,
WeightLimit::Unlimited,
Some(xcm_config::bridging::XcmBridgeHubRouterFeeAssetId::get()),
Some(xcm_config::TreasuryAccount::get()),
)
}
mod asset_hub_rococo_tests {
use super::*;
fn bridging_to_asset_hub_wococo() -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig
{
fn bridging_to_asset_hub_wococo() -> TestBridgingConfig {
asset_test_utils::test_cases_over_bridge::TestBridgingConfig {
bridged_network: bridging::to_wococo::WococoNetwork::get(),
local_bridge_hub_para_id: bridging::SiblingBridgeHubParaId::get(),
@@ -655,35 +689,26 @@ mod asset_hub_rococo_tests {
}
}
fn bridging_to_asset_hub_westend() -> TestBridgingConfig {
asset_test_utils::test_cases_over_bridge::TestBridgingConfig {
bridged_network: bridging::to_westend::WestendNetwork::get(),
local_bridge_hub_para_id: bridging::SiblingBridgeHubParaId::get(),
local_bridge_hub_location: bridging::SiblingBridgeHub::get(),
bridged_target_location: bridging::to_westend::AssetHubWestend::get(),
}
}
#[test]
fn limited_reserve_transfer_assets_for_native_asset_over_bridge_works() {
asset_test_utils::test_cases_over_bridge::limited_reserve_transfer_assets_for_native_asset_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
XcmpQueue,
LocationToAccountId,
>(
collator_session_keys(),
ExistentialDeposit::get(),
AccountId::from(ALICE),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_wococo_works() {
limited_reserve_transfer_assets_for_native_asset_over_bridge_works(
bridging_to_asset_hub_wococo,
WeightLimit::Unlimited,
Some(xcm_config::bridging::XcmBridgeHubRouterFeeAssetId::get()),
Some(xcm_config::TreasuryAccount::get()),
)
}
#[test]
fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_westend_works() {
limited_reserve_transfer_assets_for_native_asset_over_bridge_works(
bridging_to_asset_hub_westend,
)
}
@@ -713,7 +738,32 @@ mod asset_hub_rococo_tests {
}
#[test]
fn report_bridge_status_from_xcm_bridge_router_works() {
fn receive_reserve_asset_deposited_wnd_from_asset_hub_westend_works() {
const BLOCK_AUTHOR_ACCOUNT: [u8; 32] = [13; 32];
asset_test_utils::test_cases_over_bridge::receive_reserve_asset_deposited_from_different_consensus_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
LocationToAccountId,
ForeignAssetsInstance,
>(
collator_session_keys().add(collator_session_key(BLOCK_AUTHOR_ACCOUNT)),
ExistentialDeposit::get(),
AccountId::from([73; 32]),
AccountId::from(BLOCK_AUTHOR_ACCOUNT),
// receiving WNDs
(MultiLocation { parents: 2, interior: X1(GlobalConsensus(Westend)) }, 1000000000000, 1_000_000_000),
bridging_to_asset_hub_westend,
(
X1(PalletInstance(bp_bridge_hub_rococo::WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX)),
GlobalConsensus(Westend),
X1(Parachain(1000))
)
)
}
#[test]
fn report_bridge_status_from_xcm_bridge_router_for_wococo_works() {
asset_test_utils::test_cases_over_bridge::report_bridge_status_from_xcm_bridge_router_works::<
Runtime,
AllPalletsWithoutSystem,
@@ -764,6 +814,58 @@ mod asset_hub_rococo_tests {
)
}
#[test]
fn report_bridge_status_from_xcm_bridge_router_for_westend_works() {
asset_test_utils::test_cases_over_bridge::report_bridge_status_from_xcm_bridge_router_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
LocationToAccountId,
ToWestendXcmRouterInstance,
>(
collator_session_keys(),
bridging_to_asset_hub_westend,
|| {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_rococo::Call::ToWestendXcmRouter(
bp_asset_hub_rococo::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
)
.encode()
.into(),
}
]
.into()
},
|| {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_rococo::Call::ToWestendXcmRouter(
bp_asset_hub_rococo::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: false,
}
)
.encode()
.into(),
}
]
.into()
},
)
}
#[test]
fn test_report_bridge_status_call_compatibility() {
// if this test fails, make sure `bp_asset_hub_rococo` has valid encoding
@@ -782,14 +884,43 @@ mod asset_hub_rococo_tests {
}
)
.encode()
)
);
assert_eq!(
RuntimeCall::ToWestendXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
)
.encode(),
bp_asset_hub_rococo::Call::ToWestendXcmRouter(
bp_asset_hub_rococo::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
)
.encode()
);
}
#[test]
fn check_sane_weight_report_bridge_status() {
fn check_sane_weight_report_bridge_status_for_wococo() {
use pallet_xcm_bridge_hub_router::WeightInfo;
let actual = <Runtime as pallet_xcm_bridge_hub_router::Config<ToWococoXcmRouterInstance>>::WeightInfo::report_bridge_status();
let max_weight = bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get();
assert!(
actual.all_lte(max_weight),
"max_weight: {:?} should be adjusted to actual {:?}",
max_weight,
actual
);
}
#[test]
fn check_sane_weight_report_bridge_status_for_westend() {
use pallet_xcm_bridge_hub_router::WeightInfo;
let actual = <Runtime as pallet_xcm_bridge_hub_router::Config<
ToWococoXcmRouterInstance,
ToWestendXcmRouterInstance,
>>::WeightInfo::report_bridge_status();
let max_weight = bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get();
assert!(
@@ -804,9 +935,8 @@ mod asset_hub_rococo_tests {
mod asset_hub_wococo_tests {
use super::*;
fn bridging_to_asset_hub_rococo() -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig
{
asset_test_utils::test_cases_over_bridge::TestBridgingConfig {
fn bridging_to_asset_hub_rococo() -> TestBridgingConfig {
TestBridgingConfig {
bridged_network: bridging::to_rococo::RococoNetwork::get(),
local_bridge_hub_para_id: bridging::SiblingBridgeHubParaId::get(),
local_bridge_hub_location: bridging::SiblingBridgeHub::get(),
@@ -837,41 +967,15 @@ mod asset_hub_wococo_tests {
assert_eq!(flavor, xcm_config::Flavor::get());
}
fn with_wococo_flavor_bridging_to_asset_hub_rococo(
) -> asset_test_utils::test_cases_over_bridge::TestBridgingConfig {
fn with_wococo_flavor_bridging_to_asset_hub_rococo() -> TestBridgingConfig {
set_wococo_flavor();
bridging_to_asset_hub_rococo()
}
#[test]
fn limited_reserve_transfer_assets_for_native_asset_over_bridge_works() {
asset_test_utils::test_cases_over_bridge::limited_reserve_transfer_assets_for_native_asset_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
XcmpQueue,
LocationToAccountId,
>(
collator_session_keys(),
ExistentialDeposit::get(),
AccountId::from(ALICE),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_rococo_works() {
limited_reserve_transfer_assets_for_native_asset_over_bridge_works(
with_wococo_flavor_bridging_to_asset_hub_rococo,
WeightLimit::Unlimited,
Some(xcm_config::bridging::XcmBridgeHubRouterFeeAssetId::get()),
Some(xcm_config::TreasuryAccount::get()),
)
}
@@ -989,113 +1093,6 @@ mod asset_hub_wococo_tests {
}
}
/// Tests expected configuration of isolated `pallet_xcm::Config::XcmReserveTransferFilter`.
#[test]
fn xcm_reserve_transfer_filter_works() {
// prepare assets
let only_native_assets = || vec![MultiAsset::from((TokenLocation::get(), 1000))];
let only_trust_backed_assets = || {
vec![MultiAsset::from((
AssetIdForTrustBackedAssetsConvert::convert_back(&12345).unwrap(),
2000,
))]
};
let only_sibling_foreign_assets =
|| vec![MultiAsset::from((MultiLocation::new(1, X1(Parachain(12345))), 3000))];
let only_different_global_consensus_foreign_assets = || {
vec![MultiAsset::from((
MultiLocation::new(2, X2(GlobalConsensus(Wococo), Parachain(12345))),
4000,
))]
};
// prepare destinations
let relaychain = MultiLocation::parent();
let sibling_parachain = MultiLocation::new(1, X1(Parachain(54321)));
let different_global_consensus_parachain_other_than_asset_hub_wococo =
MultiLocation::new(2, X2(GlobalConsensus(Kusama), Parachain(12345)));
let bridged_asset_hub_wococo = bridging::to_wococo::AssetHubWococo::get();
let bridged_asset_hub_rococo = bridging::to_rococo::AssetHubRococo::get();
// prepare expected test data sets: (destination, assets, expected_result)
let test_data = vec![
(relaychain, only_native_assets(), true),
(relaychain, only_trust_backed_assets(), true),
(relaychain, only_sibling_foreign_assets(), true),
(relaychain, only_different_global_consensus_foreign_assets(), true),
(sibling_parachain, only_native_assets(), true),
(sibling_parachain, only_trust_backed_assets(), true),
(sibling_parachain, only_sibling_foreign_assets(), true),
(sibling_parachain, only_different_global_consensus_foreign_assets(), true),
(
different_global_consensus_parachain_other_than_asset_hub_wococo,
only_native_assets(),
false,
),
(
different_global_consensus_parachain_other_than_asset_hub_wococo,
only_trust_backed_assets(),
false,
),
(
different_global_consensus_parachain_other_than_asset_hub_wococo,
only_sibling_foreign_assets(),
false,
),
(
different_global_consensus_parachain_other_than_asset_hub_wococo,
only_different_global_consensus_foreign_assets(),
false,
),
];
let additional_test_data_for_rococo_flavor = vec![
(bridged_asset_hub_wococo, only_native_assets(), true),
(bridged_asset_hub_wococo, only_trust_backed_assets(), false),
(bridged_asset_hub_wococo, only_sibling_foreign_assets(), false),
(bridged_asset_hub_wococo, only_different_global_consensus_foreign_assets(), false),
];
let additional_test_data_for_wococo_flavor = vec![
(bridged_asset_hub_rococo, only_native_assets(), true),
(bridged_asset_hub_rococo, only_trust_backed_assets(), false),
(bridged_asset_hub_rococo, only_sibling_foreign_assets(), false),
(bridged_asset_hub_rococo, only_different_global_consensus_foreign_assets(), false),
];
// lets test filter with test data
ExtBuilder::<Runtime>::default()
.with_collators(collator_session_keys().collators())
.with_session_keys(collator_session_keys().session_keys())
.with_tracing()
.build()
.execute_with(|| {
type XcmReserveTransferFilter =
<Runtime as pallet_xcm::Config>::XcmReserveTransferFilter;
fn do_test(data: Vec<(MultiLocation, Vec<MultiAsset>, bool)>) {
for (dest, assets, expected_result) in data {
assert_eq!(
expected_result,
XcmReserveTransferFilter::contains(&(dest, assets.clone())),
"expected_result: {} for dest: {:?} and assets: {:?}",
expected_result,
dest,
assets
);
}
}
// check for Rococo flavor
do_test(test_data.clone());
do_test(additional_test_data_for_rococo_flavor);
// check for Wococo flavor
asset_hub_wococo_tests::set_wococo_flavor();
do_test(test_data);
do_test(additional_test_data_for_wococo_flavor);
})
}
#[test]
fn change_xcm_bridge_hub_router_byte_fee_by_governance_works() {
asset_test_utils::test_cases::change_storage_constant_by_governance_works::<
@@ -71,7 +71,7 @@ cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-fea
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] }
cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false}
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false, features = ["bridging"] }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
@@ -79,10 +79,15 @@ parachain-info = { package = "staging-parachain-info", path = "../../../pallets/
parachains-common = { path = "../../../common", default-features = false }
assets-common = { path = "../common", default-features = false }
# Bridges
pallet-xcm-bridge-hub-router = { path = "../../../../../bridges/modules/xcm-bridge-hub-router", default-features = false }
bp-asset-hub-rococo = { path = "../../../../../bridges/primitives/chain-asset-hub-rococo", default-features = false }
bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-hub-westend", default-features = false }
bp-bridge-hub-westend = { path = "../../../../../bridges/primitives/chain-bridge-hub-westend", default-features = false }
[dev-dependencies]
hex-literal = "0.4.1"
asset-test-utils = { path = "../test-utils" }
sp-io = { path = "../../../../../substrate/primitives/io" }
[build-dependencies]
substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder", optional = true }
@@ -112,6 +117,7 @@ runtime-benchmarks = [
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm-bridge-hub-router/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
@@ -146,6 +152,7 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm-bridge-hub-router/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polkadot-runtime-common/try-runtime",
@@ -153,6 +160,9 @@ try-runtime = [
]
std = [
"assets-common/std",
"bp-asset-hub-rococo/std",
"bp-asset-hub-westend/std",
"bp-bridge-hub-westend/std",
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
@@ -189,6 +199,7 @@ std = [
"pallet-uniques/std",
"pallet-utility/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm-bridge-hub-router/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
@@ -43,7 +43,7 @@ use frame_support::{
ord_parameter_types, parameter_types,
traits::{
tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32,
ConstU64, ConstU8, InstanceFilter,
ConstU64, ConstU8, Equals, InstanceFilter,
},
weights::{ConstantMultiplier, Weight},
BoundedVec, PalletId,
@@ -54,6 +54,7 @@ use frame_system::{
};
use pallet_asset_conversion_tx_payment::AssetConversionAdapter;
use pallet_nfts::PalletFeatures;
use pallet_xcm::EnsureXcm;
pub use parachains_common as common;
use parachains_common::{
impls::DealWithFees,
@@ -108,7 +109,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westmint"),
impl_name: create_runtime_str!("westmint"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_003_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
@@ -794,6 +795,37 @@ impl pallet_nfts::Config for Runtime {
type Helper = ();
}
/// XCM router instance to BridgeHub with bridging capabilities for `Rococo` global
/// consensus with dynamic fees and back-pressure.
pub type ToRococoXcmRouterInstance = pallet_xcm_bridge_hub_router::Instance1;
impl pallet_xcm_bridge_hub_router::Config<ToRococoXcmRouterInstance> for Runtime {
type WeightInfo = weights::pallet_xcm_bridge_hub_router::WeightInfo<Runtime>;
type UniversalLocation = xcm_config::UniversalLocation;
type BridgedNetworkId = xcm_config::bridging::to_rococo::RococoNetwork;
type Bridges = xcm_config::bridging::NetworkExportTable;
#[cfg(not(feature = "runtime-benchmarks"))]
type BridgeHubOrigin = EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>;
#[cfg(feature = "runtime-benchmarks")]
type BridgeHubOrigin = frame_support::traits::EitherOfDiverse<
// for running benchmarks
EnsureRoot<AccountId>,
// for running tests with `--feature runtime-benchmarks`
EnsureXcm<Equals<xcm_config::bridging::SiblingBridgeHub>>,
>;
type ToBridgeHubSender = XcmpQueue;
type WithBridgeHubChannel =
cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider<
xcm_config::bridging::SiblingBridgeHubParaId,
Runtime,
>;
type ByteFee = xcm_config::bridging::XcmBridgeHubRouterByteFee;
type FeeAsset = xcm_config::bridging::XcmBridgeHubRouterFeeAssetId;
}
// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime
@@ -825,6 +857,8 @@ construct_runtime!(
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 31,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
// Bridge utilities.
ToRococoXcmRouter: pallet_xcm_bridge_hub_router::<Instance1>::{Pallet, Storage, Call} = 34,
// Handy utilities.
Utility: pallet_utility::{Pallet, Call, Event} = 40,
@@ -946,6 +980,7 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_xcm_bridge_hub_router, ToRococo]
// XCM
[pallet_xcm, PolkadotXcm]
// NOTE: Make sure you point to the individual modules below.
@@ -1231,6 +1266,7 @@ impl_runtime_apis! {
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
use pallet_xcm_bridge_hub_router::benchmarking::Pallet as XcmBridgeHubRouterBench;
// This is defined once again in dispatch_benchmark, because list_benchmarks!
// and add_benchmarks! are macros exported by define_benchmarks! macros and those types
@@ -1246,6 +1282,8 @@ impl_runtime_apis! {
type Foreign = pallet_assets::Pallet::<Runtime, ForeignAssetsInstance>;
type Pool = pallet_assets::Pallet::<Runtime, PoolAssetsInstance>;
type ToRococo = XcmBridgeHubRouterBench<Runtime, ToRococoXcmRouterInstance>;
let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);
@@ -1274,6 +1312,25 @@ impl_runtime_apis! {
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
impl cumulus_pallet_session_benchmarking::Config for Runtime {}
use pallet_xcm_bridge_hub_router::benchmarking::{
Pallet as XcmBridgeHubRouterBench,
Config as XcmBridgeHubRouterConfig,
};
impl XcmBridgeHubRouterConfig<ToRococoXcmRouterInstance> for Runtime {
fn make_congested() {
cumulus_pallet_xcmp_queue::bridging::suspend_channel_for_benchmarks::<Runtime>(
xcm_config::bridging::SiblingBridgeHubParaId::get().into()
);
}
fn ensure_bridged_target_destination() -> MultiLocation {
ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(
xcm_config::bridging::SiblingBridgeHubParaId::get().into()
);
xcm_config::bridging::to_rococo::AssetHubRococo::get()
}
}
use xcm::latest::prelude::*;
use xcm_config::{MaxAssetsIntoHolding, WestendLocation};
use pallet_xcm_benchmarks::asset_instance_from;
@@ -1329,7 +1386,13 @@ impl_runtime_apis! {
MultiAsset { fun: Fungible(UNITS), id: Concrete(WestendLocation::get()) },
));
pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None;
pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None;
// AssetHubWestend trusts AssetHubRococo as reserve for ROCs
pub TrustedReserve: Option<(MultiLocation, MultiAsset)> = Some(
(
xcm_config::bridging::to_rococo::AssetHubRococo::get(),
MultiAsset::from((xcm_config::bridging::to_rococo::RocLocation::get(), 1000000000000 as u128))
)
);
}
impl pallet_xcm_benchmarks::fungible::Config for Runtime {
@@ -1360,7 +1423,10 @@ impl_runtime_apis! {
}
fn universal_alias() -> Result<(MultiLocation, Junction), BenchmarkError> {
Err(BenchmarkError::Skip)
match xcm_config::bridging::BridgingBenchmarksHelper::prepare_universal_alias() {
Some(alias) => Ok(alias),
None => Err(BenchmarkError::Skip)
}
}
fn transact_origin_and_runtime_call() -> Result<(MultiLocation, RuntimeCall), BenchmarkError> {
@@ -1399,6 +1465,8 @@ impl_runtime_apis! {
type Foreign = pallet_assets::Pallet::<Runtime, ForeignAssetsInstance>;
type Pool = pallet_assets::Pallet::<Runtime, PoolAssetsInstance>;
type ToRococo = XcmBridgeHubRouterBench<Runtime, ToRococoXcmRouterInstance>;
let whitelist: Vec<TrackedStorageKey> = vec![
// Block Number
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),
@@ -33,6 +33,7 @@ pub mod pallet_timestamp;
pub mod pallet_uniques;
pub mod pallet_utility;
pub mod pallet_xcm;
pub mod pallet_xcm_bridge_hub_router;
pub mod paritydb_weights;
pub mod rocksdb_weights;
pub mod xcm;
@@ -0,0 +1,124 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm_bridge_hub_router`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_xcm_bridge_hub_router
// --chain=asset-hub-westend-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/
#![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 `pallet_xcm_bridge_hub_router`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm_bridge_hub_router::WeightInfo for WeightInfo<T> {
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn on_initialize_when_non_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `193`
// Estimated: `1678`
// Minimum execution time: 8_157_000 picoseconds.
Weight::from_parts(8_481_000, 0)
.saturating_add(Weight::from_parts(0, 1678))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn on_initialize_when_congested() -> Weight {
// Proof Size summary in bytes:
// Measured: `111`
// Estimated: `1596`
// Minimum execution time: 3_319_000 picoseconds.
Weight::from_parts(3_445_000, 0)
.saturating_add(Weight::from_parts(0, 1596))
.saturating_add(T::DbWeight::get().reads(2))
}
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
fn report_bridge_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `117`
// Estimated: `1502`
// Minimum execution time: 10_396_000 picoseconds.
Weight::from_parts(10_914_000, 0)
.saturating_add(Weight::from_parts(0, 1502))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x0973fe64c85043ba1c965cbc38eb63c7` (r:1 w:0)
/// Storage: `ToRococoXcmRouter::Bridge` (r:1 w:1)
/// Proof: `ToRococoXcmRouter::Bridge` (`max_values`: Some(1), `max_size`: Some(17), added: 512, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::InboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::InboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn send_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `426`
// Estimated: `3891`
// Minimum execution time: 45_902_000 picoseconds.
Weight::from_parts(46_887_000, 0)
.saturating_add(Weight::from_parts(0, 3891))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -209,7 +209,7 @@ impl<Call> XcmWeightInfo<Call> for AssetHubWestendXcmWeight<Call> {
XcmGeneric::<Runtime>::clear_transact_status()
}
fn universal_origin(_: &Junction) -> Weight {
Weight::MAX
XcmGeneric::<Runtime>::universal_origin()
}
fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight {
Weight::MAX
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::fungible`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-nbnwcyh-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024
// Executed Command:
@@ -54,8 +54,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `101`
// Estimated: `3593`
// Minimum execution time: 25_407_000 picoseconds.
Weight::from_parts(25_949_000, 3593)
// Minimum execution time: 20_295_000 picoseconds.
Weight::from_parts(21_142_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -65,15 +65,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `101`
// Estimated: `6196`
// Minimum execution time: 51_335_000 picoseconds.
Weight::from_parts(52_090_000, 6196)
// Minimum execution time: 42_356_000 picoseconds.
Weight::from_parts(43_552_000, 6196)
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: `System::Account` (r:2 w:2)
// Storage: `System::Account` (r:3 w:3)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -87,48 +89,53 @@ impl<T: frame_system::Config> WeightInfo<T> {
pub fn transfer_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 74_312_000 picoseconds.
Weight::from_parts(76_725_000, 6196)
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: `Benchmark::Override` (r:0 w:0)
// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
pub fn reserve_asset_deposited() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight::from_parts(18_446_744_073_709_551_000, 0)
// Estimated: `8799`
// Minimum execution time: 85_553_000 picoseconds.
Weight::from_parts(87_177_000, 8799)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(5))
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub fn reserve_asset_deposited() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1489`
// Minimum execution time: 6_166_000 picoseconds.
Weight::from_parts(6_352_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn initiate_reserve_withdraw() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 446_848_000 picoseconds.
Weight::from_parts(466_251_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 184_462_000 picoseconds.
Weight::from_parts(189_593_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn receive_teleported_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_602_000 picoseconds.
Weight::from_parts(3_844_000, 0)
// Minimum execution time: 3_018_000 picoseconds.
Weight::from_parts(3_098_000, 0)
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
@@ -136,15 +143,17 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 25_480_000 picoseconds.
Weight::from_parts(26_142_000, 3593)
// Minimum execution time: 18_583_000 picoseconds.
Weight::from_parts(19_057_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: `System::Account` (r:1 w:1)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -158,20 +167,24 @@ impl<T: frame_system::Config> WeightInfo<T> {
pub fn deposit_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 51_540_000 picoseconds.
Weight::from_parts(53_744_000, 3610)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
// Estimated: `6196`
// Minimum execution time: 56_666_000 picoseconds.
Weight::from_parts(58_152_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
@@ -180,9 +193,9 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 32_279_000 picoseconds.
Weight::from_parts(33_176_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Minimum execution time: 44_197_000 picoseconds.
Weight::from_parts(45_573_000, 3610)
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -17,28 +17,26 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-westend-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// target/production/polkadot-parachain
// benchmark
// pallet
// --template=./templates/xcm-bench-template.hbs
// --chain=asset-hub-westend-dev
// --wasm-execution=compiled
// --pallet=pallet_xcm_benchmarks::generic
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_xcm_benchmarks::generic
// --chain=asset-hub-westend-dev
// --header=./cumulus/file_header.txt
// --template=./cumulus/templates/xcm-bench-template.hbs
// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/xcm/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -52,31 +50,35 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> 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: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_holding() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 405_795_000 picoseconds.
Weight::from_parts(421_225_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 415_033_000 picoseconds.
Weight::from_parts(429_573_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_021_000 picoseconds.
Weight::from_parts(4_234_000, 0)
// Minimum execution time: 3_193_000 picoseconds.
Weight::from_parts(3_620_000, 0)
}
// Storage: `PolkadotXcm::Queries` (r:1 w:0)
// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -84,79 +86,83 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `3568`
// Minimum execution time: 11_004_000 picoseconds.
Weight::from_parts(11_217_000, 3568)
// Minimum execution time: 8_045_000 picoseconds.
Weight::from_parts(8_402_000, 3568)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 12_888_000 picoseconds.
Weight::from_parts(13_249_000, 0)
// Minimum execution time: 9_827_000 picoseconds.
Weight::from_parts(10_454_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_504_000 picoseconds.
Weight::from_parts(4_984_000, 0)
// Minimum execution time: 3_330_000 picoseconds.
Weight::from_parts(3_677_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_733_000 picoseconds.
Weight::from_parts(2_887_000, 0)
// Minimum execution time: 1_947_000 picoseconds.
Weight::from_parts(2_083_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_753_000 picoseconds.
Weight::from_parts(2_844_000, 0)
// Minimum execution time: 1_915_000 picoseconds.
Weight::from_parts(1_993_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_741_000 picoseconds.
Weight::from_parts(2_826_000, 0)
// Minimum execution time: 1_918_000 picoseconds.
Weight::from_parts(2_048_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_417_000 picoseconds.
Weight::from_parts(3_525_000, 0)
// Minimum execution time: 2_683_000 picoseconds.
Weight::from_parts(3_064_000, 0)
}
pub fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_775_000 picoseconds.
Weight::from_parts(2_853_000, 0)
// Minimum execution time: 1_893_000 picoseconds.
Weight::from_parts(2_159_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 27_035_000 picoseconds.
Weight::from_parts(27_734_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 53_116_000 picoseconds.
Weight::from_parts(54_154_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1)
// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -164,8 +170,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `3625`
// Minimum execution time: 15_728_000 picoseconds.
Weight::from_parts(16_145_000, 3625)
// Minimum execution time: 12_381_000 picoseconds.
Weight::from_parts(12_693_000, 3625)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -173,11 +179,13 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_630_000 picoseconds.
Weight::from_parts(2_700_000, 0)
// Minimum execution time: 1_933_000 picoseconds.
Weight::from_parts(1_983_000, 0)
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1)
// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -192,9 +200,9 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 29_996_000 picoseconds.
Weight::from_parts(30_620_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
// Minimum execution time: 24_251_000 picoseconds.
Weight::from_parts(24_890_000, 3610)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1)
@@ -203,127 +211,145 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_629_000 picoseconds.
Weight::from_parts(4_861_000, 0)
// Minimum execution time: 3_850_000 picoseconds.
Weight::from_parts(4_082_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 135_145_000 picoseconds.
Weight::from_parts(142_115_000, 0)
// Minimum execution time: 112_248_000 picoseconds.
Weight::from_parts(124_454_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 11_948_000 picoseconds.
Weight::from_parts(12_160_000, 0)
// Minimum execution time: 11_457_000 picoseconds.
Weight::from_parts(12_060_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_718_000 picoseconds.
Weight::from_parts(2_794_000, 0)
// Minimum execution time: 1_959_000 picoseconds.
Weight::from_parts(2_076_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_590_000 picoseconds.
Weight::from_parts(2_674_000, 0)
// Minimum execution time: 1_920_000 picoseconds.
Weight::from_parts(1_994_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_858_000 picoseconds.
Weight::from_parts(2_939_000, 0)
// Minimum execution time: 2_149_000 picoseconds.
Weight::from_parts(2_394_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn query_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 30_652_000 picoseconds.
Weight::from_parts(31_552_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 58_011_000 picoseconds.
Weight::from_parts(59_306_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_408_000 picoseconds.
Weight::from_parts(5_597_000, 0)
// Minimum execution time: 5_031_000 picoseconds.
Weight::from_parts(5_243_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 27_144_000 picoseconds.
Weight::from_parts(27_736_000, 3610)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `246`
// Estimated: `6196`
// Minimum execution time: 53_078_000 picoseconds.
Weight::from_parts(54_345_000, 6196)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_696_000 picoseconds.
Weight::from_parts(2_802_000, 0)
// Minimum execution time: 1_936_000 picoseconds.
Weight::from_parts(2_002_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_655_000 picoseconds.
Weight::from_parts(2_720_000, 0)
// Minimum execution time: 1_855_000 picoseconds.
Weight::from_parts(1_950_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_599_000 picoseconds.
Weight::from_parts(2_723_000, 0)
// Minimum execution time: 1_882_000 picoseconds.
Weight::from_parts(1_977_000, 0)
}
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
pub fn universal_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1489`
// Minimum execution time: 3_912_000 picoseconds.
Weight::from_parts(4_167_000, 1489)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_630_000 picoseconds.
Weight::from_parts(2_728_000, 0)
// Minimum execution time: 1_911_000 picoseconds.
Weight::from_parts(1_971_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_797_000 picoseconds.
Weight::from_parts(2_928_000, 0)
// Minimum execution time: 1_990_000 picoseconds.
Weight::from_parts(2_076_000, 0)
}
}
@@ -15,11 +15,10 @@
use super::{
AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, BaseDeliveryFee,
FeeAssetId, ParachainInfo, ParachainSystem, PolkadotXcm, PoolAssets, Runtime, RuntimeCall,
RuntimeEvent, RuntimeOrigin, TransactionByteFee, TrustBackedAssetsInstance, WeightToFee,
XcmpQueue,
FeeAssetId, ForeignAssets, ForeignAssetsInstance, ParachainInfo, ParachainSystem, PolkadotXcm,
PoolAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ToRococoXcmRouter,
TransactionByteFee, TrustBackedAssetsInstance, WeightToFee, XcmpQueue,
};
use crate::ForeignAssets;
use assets_common::{
local_and_foreign_assets::MatchesLocalAndForeignAssetsMultiLocation,
matching::{FromSiblingParachain, IsForeignConcreteAsset},
@@ -47,12 +46,13 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeFamily, DescribePalletTerminal,
EnsureXcmOrigin, FungiblesAdapter, HashedDescription, IsConcrete, LocalMint, NoChecking,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeeManagerFromComponents, XcmFeeToAccount,
EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription,
IsConcrete, LocalMint, NetworkExportTableItem, NoChecking, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, StartsWith,
StartsWithExplicitGlobalConsensus, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
XcmFeeToAccount,
};
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
@@ -90,6 +90,9 @@ pub type LocationToAccountId = (
// Foreign chain account alias into local accounts according to a hash of their standard
// description.
HashedDescription<AccountId, DescribeFamily<DescribePalletTerminal>>,
// Different global consensus parachain sovereign account.
// (Used for over-bridge transfers and reserve processing)
GlobalConsensusParachainConvertsFor<UniversalLocation, AccountId>,
);
/// Means for transacting the native currency on this chain.
@@ -256,6 +259,14 @@ impl Contains<RuntimeCall> for SafeCallFilter {
}
}
// Allow to change dedicated storage items (called by governance-like)
match call {
RuntimeCall::System(frame_system::Call::set_storage { items })
if items.iter().all(|(k, _)| k.eq(&bridging::XcmBridgeHubRouterByteFee::key())) =>
return true,
_ => (),
};
matches!(
call,
RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) |
@@ -445,7 +456,9 @@ impl Contains<RuntimeCall> for SafeCallFilter {
pallet_uniques::Call::set_accept_ownership { .. } |
pallet_uniques::Call::set_collection_max_supply { .. } |
pallet_uniques::Call::set_price { .. } |
pallet_uniques::Call::buy_item { .. },
pallet_uniques::Call::buy_item { .. }
) | RuntimeCall::ToRococoXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
)
)
}
@@ -469,6 +482,7 @@ pub type Barrier = TrailingSetTopicAsId<
AllowExplicitUnpaidExecutionFrom<(
ParentOrParentsPlurality,
Equals<RelayTreasuryLocation>,
Equals<bridging::SiblingBridgeHub>,
)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<Everything>,
@@ -492,6 +506,15 @@ pub type AssetFeeAsExistentialDepositMultiplierFeeCharger = AssetFeeAsExistentia
TrustBackedAssetsInstance,
>;
/// Multiplier used for dedicated `TakeFirstAssetTrader` with `ForeignAssets` instance.
pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
AssetFeeAsExistentialDepositMultiplier<
Runtime,
WeightToFee,
pallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto, ForeignAssetsInstance>,
ForeignAssetsInstance,
>;
match_types! {
pub type SystemParachains: impl Contains<MultiLocation> = {
MultiLocation {
@@ -526,10 +549,11 @@ impl xcm_executor::Config for XcmConfig {
type XcmSender = XcmRouter;
type AssetTransactor = AssetTransactors;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
// Asset Hub Westend does not recognize a reserve location for any asset. This does not prevent
// Asset Hub acting _as_ a reserve location for WND and assets created under `pallet-assets`.
// For WND, users must use teleport where allowed (e.g. with the Relay Chain).
type IsReserve = ();
// Asset Hub trusts only particular, pre-configured bridged locations from a different consensus
// as reserve locations (we trust the Bridge Hub to relay the message that a reserve is being
// held). Asset Hub may _act_ as a reserve location for WND and assets created
// under `pallet-assets`. Users must use teleport where allowed (e.g. WND with the Relay Chain).
type IsReserve = (bridging::to_rococo::IsTrustedBridgedReserveLocationForConcreteAsset,);
type IsTeleporter = TrustedTeleporters;
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
@@ -553,6 +577,19 @@ impl xcm_executor::Config for XcmConfig {
XcmAssetFeesReceiver,
>,
>,
// This trader allows to pay with `is_sufficient=true` "Foreign" assets from dedicated
// `pallet_assets` instance - `ForeignAssets`.
cumulus_primitives_utility::TakeFirstAssetTrader<
AccountId,
ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger,
ForeignAssetsConvertedConcreteId,
ForeignAssets,
cumulus_primitives_utility::XcmFeesTo32ByteAccount<
ForeignFungiblesTransactor,
AccountId,
XcmAssetFeesReceiver,
>,
>,
);
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
@@ -567,7 +604,7 @@ impl xcm_executor::Config for XcmConfig {
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
type MessageExporter = ();
type UniversalAliases = Nothing;
type UniversalAliases = (bridging::to_rococo::UniversalAliases,);
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
@@ -579,13 +616,21 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, R
pub type PriceForParentDelivery =
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, ParachainSystem>;
/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
pub type XcmRouter = WithUniqueTopic<(
/// For routing XCM messages which do not cross local consensus boundary.
type LocalXcmRouter = (
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, PriceForParentDelivery>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
pub type XcmRouter = WithUniqueTopic<(
LocalXcmRouter,
// Router which wraps and sends xcm to BridgeHub to be delivered to the Rococo
// GlobalConsensus
ToRococoXcmRouter,
)>;
#[cfg(feature = "runtime-benchmarks")]
@@ -672,3 +717,124 @@ where
sp_std::boxed::Box::new(Self::asset_id(asset_id))
}
}
/// All configuration related to bridging
pub mod bridging {
use super::*;
use assets_common::matching;
use sp_std::collections::btree_set::BTreeSet;
parameter_types! {
pub SiblingBridgeHubParaId: u32 = bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID;
pub SiblingBridgeHub: MultiLocation = MultiLocation::new(1, X1(Parachain(SiblingBridgeHubParaId::get())));
/// Router expects payment with this `AssetId`.
/// (`AssetId` has to be aligned with `BridgeTable`)
pub XcmBridgeHubRouterFeeAssetId: AssetId = WestendLocation::get().into();
/// Price per byte - can be adjusted via governance `set_storage` call.
pub storage XcmBridgeHubRouterByteFee: Balance = TransactionByteFee::get();
pub BridgeTable: sp_std::vec::Vec<NetworkExportTableItem> =
sp_std::vec::Vec::new().into_iter()
.chain(to_rococo::BridgeTable::get())
.collect();
}
pub type NetworkExportTable = xcm_builder::NetworkExportTable<BridgeTable>;
pub mod to_rococo {
use super::*;
parameter_types! {
pub SiblingBridgeHubWithBridgeHubRococoInstance: MultiLocation = MultiLocation::new(
1,
X2(
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(bp_bridge_hub_westend::WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX)
)
);
pub const RococoNetwork: NetworkId = NetworkId::Rococo;
pub AssetHubRococo: MultiLocation = MultiLocation::new(2, X2(GlobalConsensus(RococoNetwork::get()), Parachain(bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID)));
pub RocLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(RococoNetwork::get())));
pub RocFromAssetHubRococo: (MultiAssetFilter, MultiLocation) = (
Wild(AllOf { fun: WildFungible, id: Concrete(RocLocation::get()) }),
AssetHubRococo::get()
);
/// Set up exporters configuration.
/// `Option<MultiAsset>` represents static "base fee" which is used for total delivery fee calculation.
pub BridgeTable: sp_std::vec::Vec<NetworkExportTableItem> = sp_std::vec![
NetworkExportTableItem::new(
RococoNetwork::get(),
Some(sp_std::vec![
AssetHubRococo::get().interior.split_global().expect("invalid configuration for AssetHubRococo").1,
]),
SiblingBridgeHub::get(),
// base delivery fee to local `BridgeHub`
Some((
XcmBridgeHubRouterFeeAssetId::get(),
bp_asset_hub_westend::BridgeHubWestendBaseFeeInWnds::get(),
).into())
)
];
/// Universal aliases
pub UniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter(
sp_std::vec![
(SiblingBridgeHubWithBridgeHubRococoInstance::get(), GlobalConsensus(RococoNetwork::get()))
]
);
}
impl Contains<(MultiLocation, Junction)> for UniversalAliases {
fn contains(alias: &(MultiLocation, Junction)) -> bool {
UniversalAliases::get().contains(alias)
}
}
/// Reserve locations filter for `xcm_executor::Config::IsReserve`.
/// Locations from which the runtime accepts reserved assets.
pub type IsTrustedBridgedReserveLocationForConcreteAsset =
matching::IsTrustedBridgedReserveLocationForConcreteAsset<
UniversalLocation,
(
// allow receive ROC from AssetHubRococo
xcm_builder::Case<RocFromAssetHubRococo>,
// and nothing else
),
>;
impl Contains<RuntimeCall> for ToRococoXcmRouter {
fn contains(call: &RuntimeCall) -> bool {
matches!(
call,
RuntimeCall::ToRococoXcmRouter(
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
)
)
}
}
}
/// Benchmarks helper for bridging configuration.
#[cfg(feature = "runtime-benchmarks")]
pub struct BridgingBenchmarksHelper;
#[cfg(feature = "runtime-benchmarks")]
impl BridgingBenchmarksHelper {
pub fn prepare_universal_alias() -> Option<(MultiLocation, Junction)> {
let alias =
to_rococo::UniversalAliases::get().into_iter().find_map(|(location, junction)| {
match to_rococo::SiblingBridgeHubWithBridgeHubRococoInstance::get()
.eq(&location)
{
true => Some((location, junction)),
false => None,
}
});
assert!(alias.is_some(), "we expect here BridgeHubWestend to Rococo mapping at least");
Some(alias.unwrap())
}
}
}
@@ -19,20 +19,19 @@
use asset_hub_westend_runtime::{
xcm_config::{
AssetFeeAsExistentialDepositMultiplierFeeCharger, ForeignCreatorsSovereignAccountOf,
WestendLocation,
self, bridging, AssetFeeAsExistentialDepositMultiplierFeeCharger, CheckingAccount,
ForeignCreatorsSovereignAccountOf, LocationToAccountId, TrustBackedAssetsPalletLocation,
WestendLocation, XcmConfig,
},
AllPalletsWithoutSystem, MetadataDepositBase, MetadataDepositPerByte, RuntimeCall,
RuntimeEvent,
AllPalletsWithoutSystem, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets,
ForeignAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, ParachainSystem, Runtime,
RuntimeCall, RuntimeEvent, SessionKeys, ToRococoXcmRouterInstance, TrustBackedAssetsInstance,
XcmpQueue,
};
pub use asset_hub_westend_runtime::{
xcm_config::{CheckingAccount, TrustBackedAssetsPalletLocation, XcmConfig},
AllowMultiAssetPools, AssetDeposit, Assets, Balances, ExistentialDeposit, ForeignAssets,
ForeignAssetsInstance, ParachainSystem, Runtime, SessionKeys, System,
TrustBackedAssetsInstance,
use asset_test_utils::{
test_cases_over_bridge::TestBridgingConfig, CollatorSessionKey, CollatorSessionKeys, ExtBuilder,
};
use asset_test_utils::{CollatorSessionKeys, ExtBuilder, XcmReceivedFrom};
use codec::{Decode, DecodeLimit, Encode};
use codec::{Decode, Encode};
use cumulus_primitives_utility::ChargeWeightInFungibles;
use frame_support::{
assert_noop, assert_ok,
@@ -42,14 +41,10 @@ use frame_support::{
use parachains_common::{
westend::fee::WeightToFee, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance,
};
use sp_io;
use sp_runtime::traits::MaybeEquivalence;
use std::convert::Into;
use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH};
use xcm_executor::{
traits::{Identity, JustTry, WeightTrader},
XcmExecutor,
};
use xcm::latest::prelude::*;
use xcm_executor::traits::{Identity, JustTry, WeightTrader};
const ALICE: [u8; 32] = [1u8; 32];
const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32];
@@ -59,14 +54,18 @@ type AssetIdForTrustBackedAssetsConvert =
type RuntimeHelper = asset_test_utils::RuntimeHelper<Runtime, AllPalletsWithoutSystem>;
fn collator_session_keys() -> CollatorSessionKeys<Runtime> {
CollatorSessionKeys::new(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
fn collator_session_key(account: [u8; 32]) -> CollatorSessionKey<Runtime> {
CollatorSessionKey::new(
AccountId::from(account),
AccountId::from(account),
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(account)) },
)
}
fn collator_session_keys() -> CollatorSessionKeys<Runtime> {
CollatorSessionKeys::default().add(collator_session_key(ALICE))
}
#[test]
fn test_asset_xcm_trader() {
ExtBuilder::<Runtime>::default()
@@ -253,7 +252,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() {
// Set Alice as block author, who will receive fees
RuntimeHelper::run_to_block(2, AccountId::from(ALICE));
// We are going to buy 5e9 weight
// We are going to buy small amount
let bought = Weight::from_parts(500_000_000u64, 0);
let asset_multilocation = AssetIdForTrustBackedAssetsConvert::convert_back(&1).unwrap();
@@ -641,28 +640,178 @@ asset_test_utils::include_create_and_manage_foreign_assets_for_local_consensus_p
})
);
#[test]
fn plain_receive_teleported_asset_works() {
ExtBuilder::<Runtime>::default()
.with_collators(vec![AccountId::from(ALICE)])
.with_session_keys(vec![(
AccountId::from(ALICE),
AccountId::from(ALICE),
SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) },
)])
.build()
.execute_with(|| {
let data = hex_literal::hex!("02100204000100000b00a0724e18090a13000100000b00a0724e180901e20f5e480d010004000101001299557001f55815d3fcb53c74463acb0cf6d14d4639b340982c60877f384609").to_vec();
let message_id = sp_io::hashing::blake2_256(&data);
let maybe_msg = VersionedXcm::<RuntimeCall>::decode_all_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut data.as_ref(),
)
.map(xcm::v3::Xcm::<RuntimeCall>::try_from).expect("failed").expect("failed");
let outcome =
XcmExecutor::<XcmConfig>::execute_xcm(Parent, maybe_msg, message_id, RuntimeHelper::xcm_max_weight(XcmReceivedFrom::Parent));
assert_eq!(outcome.ensure_complete(), Ok(()));
})
fn bridging_to_asset_hub_rococo() -> TestBridgingConfig {
TestBridgingConfig {
bridged_network: bridging::to_rococo::RococoNetwork::get(),
local_bridge_hub_para_id: bridging::SiblingBridgeHubParaId::get(),
local_bridge_hub_location: bridging::SiblingBridgeHub::get(),
bridged_target_location: bridging::to_rococo::AssetHubRococo::get(),
}
}
#[test]
fn limited_reserve_transfer_assets_for_native_asset_to_asset_hub_rococo_works() {
asset_test_utils::test_cases_over_bridge::limited_reserve_transfer_assets_for_native_asset_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
XcmpQueue,
LocationToAccountId,
>(
collator_session_keys(),
ExistentialDeposit::get(),
AccountId::from(ALICE),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::PolkadotXcm(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
bridging_to_asset_hub_rococo,
WeightLimit::Unlimited,
Some(xcm_config::bridging::XcmBridgeHubRouterFeeAssetId::get()),
Some(xcm_config::TreasuryAccount::get()),
)
}
#[test]
fn receive_reserve_asset_deposited_roc_from_asset_hub_rococo_works() {
const BLOCK_AUTHOR_ACCOUNT: [u8; 32] = [13; 32];
asset_test_utils::test_cases_over_bridge::receive_reserve_asset_deposited_from_different_consensus_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
LocationToAccountId,
ForeignAssetsInstance,
>(
collator_session_keys().add(collator_session_key(BLOCK_AUTHOR_ACCOUNT)),
ExistentialDeposit::get(),
AccountId::from([73; 32]),
AccountId::from(BLOCK_AUTHOR_ACCOUNT),
// receiving ROCs
(MultiLocation { parents: 2, interior: X1(GlobalConsensus(Rococo)) }, 1000000000000, 1_000_000_000),
bridging_to_asset_hub_rococo,
(
X1(PalletInstance(bp_bridge_hub_westend::WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX)),
GlobalConsensus(Rococo),
X1(Parachain(1000))
)
)
}
#[test]
fn report_bridge_status_from_xcm_bridge_router_for_rococo_works() {
asset_test_utils::test_cases_over_bridge::report_bridge_status_from_xcm_bridge_router_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
LocationToAccountId,
ToRococoXcmRouterInstance,
>(
collator_session_keys(),
bridging_to_asset_hub_rococo,
|| {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_westend::Call::ToRococoXcmRouter(
bp_asset_hub_westend::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
)
.encode()
.into(),
}
]
.into()
},
|| {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_westend::Call::ToRococoXcmRouter(
bp_asset_hub_westend::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: false,
}
)
.encode()
.into(),
}
]
.into()
},
)
}
#[test]
fn test_report_bridge_status_call_compatibility() {
// if this test fails, make sure `bp_asset_hub_rococo` has valid encoding
assert_eq!(
RuntimeCall::ToRococoXcmRouter(pallet_xcm_bridge_hub_router::Call::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
})
.encode(),
bp_asset_hub_westend::Call::ToRococoXcmRouter(
bp_asset_hub_westend::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
)
.encode()
)
}
#[test]
fn check_sane_weight_report_bridge_status() {
use pallet_xcm_bridge_hub_router::WeightInfo;
let actual = <Runtime as pallet_xcm_bridge_hub_router::Config<
ToRococoXcmRouterInstance,
>>::WeightInfo::report_bridge_status();
let max_weight = bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get();
assert!(
actual.all_lte(max_weight),
"max_weight: {:?} should be adjusted to actual {:?}",
max_weight,
actual
);
}
#[test]
fn change_xcm_bridge_hub_router_byte_fee_by_governance_works() {
asset_test_utils::test_cases::change_storage_constant_by_governance_works::<
Runtime,
bridging::XcmBridgeHubRouterByteFee,
Balance,
>(
collator_session_keys(),
1000,
Box::new(|call| RuntimeCall::System(call).encode()),
|| {
(
bridging::XcmBridgeHubRouterByteFee::key().to_vec(),
bridging::XcmBridgeHubRouterByteFee::get(),
)
},
|old_value| {
if let Some(new_value) = old_value.checked_add(1) {
new_value
} else {
old_value.checked_sub(1).unwrap()
}
},
)
}
@@ -9,6 +9,15 @@
- [Send messages - transfer asset over bridge (ROCs/WOCs)](#send-messages---transfer-asset-over-bridge-rocswocs)
- [Claim relayer's rewards on BridgeHubRococo and
BridgeHubWococo](#claim-relayers-rewards-on-bridgehubrococo-and-bridgehubwococo)
- [How to test local Rococo <-> Westend bridge](#how-to-test-local-rococo---westend-bridge)
- [Run Rococo/Westend chains with zombienet](#run-rococowestend-chains-with-zombienet)
- [Init bridge and run relayer between BridgeHubRococo and
BridgeHubWestend](#init-bridge-and-run-relayer-between-bridgehubrococo-and-bridgehubwestend)
- [Initialize configuration for transfer asset over bridge
(ROCs/WNDs)](#initialize-configuration-for-transfer-asset-over-bridge-rocswnds)
- [Send messages - transfer asset over bridge (ROCs/WNDs)](#send-messages---transfer-asset-over-bridge-rocswnds)
- [Claim relayer's rewards on BridgeHubRococo and
BridgeHubWestend](#claim-relayers-rewards-on-bridgehubrococo-and-bridgehubwestend)
- [How to test local BridgeHubKusama/BridgeHubPolkadot](#how-to-test-local-bridgehubkusamabridgehubpolkadot)
# Bridge-hub Parachains
@@ -136,9 +145,9 @@ cd <polkadot-sdk-git-repo-dir>
**Check parachain headers relaying:**
- Rococo parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate - Pallet:
**bridgeWococoParachain** - Keys: **parasInfo(None)**
**bridgeWococoParachains** - Keys: **parasInfo(None)**
- Wococo parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8945#/chainstate - Pallet:
**bridgeRococoParachain** - Keys: **parasInfo(None)**
**bridgeRococoParachains** - Keys: **parasInfo(None)**
### Initialize configuration for transfer asset over bridge (ROCs/WOCs)
@@ -172,10 +181,10 @@ cd <polkadot-sdk-git-repo-dir>
- open explorers: (see zombienets)
- AssetHubRococo (see events `xcmpQueue.XcmpMessageSent`, `polkadotXcm.Attempted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9910#/explorer
- BridgeHubRococo (see `bridgeRococoToWococoMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubWococo (see `bridgeWococoToRococoMessages.MessagesReceived`, `xcmpQueue.XcmpMessageSent`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer
- BridgeHubRococo (see `bridgeWococoMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubWococo (see `bridgeRococoMessages.MessagesReceived`, `xcmpQueue.XcmpMessageSent`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer
- AssetHubWococo (see `foreignAssets.Issued`, `xcmpQueue.Success`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9010#/explorer
- BridgeHubRocococ (see `bridgeRococoToWococoMessages.MessagesDelivered`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubRocococ (see `bridgeWococoMessages.MessagesDelivered`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
### Claim relayer's rewards on BridgeHubRococo and BridgeHubWococo
@@ -197,6 +206,111 @@ cd <polkadot-sdk-git-repo-dir>
- BridgeHubRococo (see 2x `bridgeRelayers.RewardPaid`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubWococo (see 2x `bridgeRelayers.RewardPaid`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer
## How to test local Rococo <-> Westend bridge
### Run Rococo/Westend chains with zombienet
```
cd <polkadot-sdk-git-repo-dir>
# Rococo + BridgeHubRococo + AssetHub for Rococo (mirroring Kusama)
POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \
POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=~/local_bridge_testing/bin/polkadot-parachain-asset-hub \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./cumulus/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml
```
```
cd <polkadot-sdk-git-repo-dir>
# Westend + BridgeHubWestend + AssetHub for Westend (mirroring Polkadot)
POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \
POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WESTEND=~/local_bridge_testing/bin/polkadot-parachain-asset-hub \
~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./cumulus/zombienet/bridge-hubs/bridge_hub_westend_local_network.toml
```
### Init bridge and run relayer between BridgeHubRococo and BridgeHubWestend
**Accounts of BridgeHub parachains:**
- `Bob` is pallet owner of all bridge pallets
#### Run with script
```
cd <polkadot-sdk-git-repo-dir>
./cumulus/scripts/bridges_rococo_westend.sh run-relay
```
**Check relay-chain headers relaying:**
- Rococo parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate - Pallet:
**bridgeWestendGrandpa** - Keys: **bestFinalized()**
- Westend parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8945#/chainstate - Pallet:
**bridgeRococoGrandpa** - Keys: **bestFinalized()**
**Check parachain headers relaying:**
- Rococo parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8943#/chainstate - Pallet:
**bridgeWestendParachains** - Keys: **parasInfo(None)**
- Westend parachain: - https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A8945#/chainstate - Pallet:
**bridgeRococoParachains** - Keys: **parasInfo(None)**
### Initialize configuration for transfer asset over bridge (ROCs/WNDs)
This initialization does several things:
- creates `ForeignAssets` for wrappedROCs/wrappedWNDs
- drips SA for AssetHubRococo on AssetHubWestend (and vice versa) which holds reserved assets on source chains
```
cd <polkadot-sdk-git-repo-dir>
./cumulus/scripts/bridges_rococo_westend.sh init-asset-hub-rococo-local
./cumulus/scripts/bridges_rococo_westend.sh init-bridge-hub-rococo-local
./cumulus/scripts/bridges_rococo_westend.sh init-asset-hub-westend-local
./cumulus/scripts/bridges_rococo_westend.sh init-bridge-hub-westend-local
```
### Send messages - transfer asset over bridge (ROCs/WNDs)
Do (asset) transfers:
```
cd <polkadot-sdk-git-repo-dir>
# ROCs from Rococo's Asset Hub to Westend's.
./cumulus/scripts/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-rococo-local
```
```
cd <polkadot-sdk-git-repo-dir>
# WNDs from Westend's Asset Hub to Rococo's.
./cumulus/scripts/bridges_rococo_westend.sh reserve-transfer-assets-from-asset-hub-westend-local
```
- open explorers: (see zombienets)
- AssetHubRococo (see events `xcmpQueue.XcmpMessageSent`, `polkadotXcm.Attempted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9910#/explorer
- BridgeHubRococo (see `bridgeWestendMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubWestend (see `bridgeRococoMessages.MessagesReceived`, `xcmpQueue.XcmpMessageSent`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer
- AssetHubWestend (see `foreignAssets.Issued`, `xcmpQueue.Success`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9010#/explorer
- BridgeHubRocococ (see `bridgeWestendMessages.MessagesDelivered`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
### Claim relayer's rewards on BridgeHubRococo and BridgeHubWestend
**Accounts of BridgeHub parachains:**
- `//Charlie` is relayer account on BridgeHubRococo
- `//Charlie` is relayer account on BridgeHubWestend
```
cd <polkadot-sdk-git-repo-dir>
# Claim rewards on BridgeHubWestend:
./cumulus/scripts/bridges_rococo_westend.sh claim-rewards-bridge-hub-rococo-local
# Claim rewards on BridgeHubWestend:
./cumulus/scripts/bridges_rococo_westend.sh claim-rewards-bridge-hub-westend-local
```
- open explorers: (see zombienets)
- BridgeHubRococo (see 2x `bridgeRelayers.RewardPaid`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer
- BridgeHubWestend (see 2x `bridgeRelayers.RewardPaid`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer
## How to test local BridgeHubKusama/BridgeHubPolkadot
TODO: see `# !!! READ HERE` above
@@ -75,8 +75,10 @@ parachains-common = { path = "../../../common", default-features = false }
# Bridges
bp-asset-hub-rococo = { path = "../../../../../bridges/primitives/chain-asset-hub-rococo", default-features = false }
bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-hub-westend", default-features = false }
bp-asset-hub-wococo = { path = "../../../../../bridges/primitives/chain-asset-hub-wococo", default-features = false }
bp-bridge-hub-rococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
bp-bridge-hub-westend = { path = "../../../../../bridges/primitives/chain-bridge-hub-westend", default-features = false }
bp-bridge-hub-wococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-wococo", default-features = false }
bp-header-chain = { path = "../../../../../bridges/primitives/header-chain", default-features = false }
bp-messages = { path = "../../../../../bridges/primitives/messages", default-features = false }
@@ -85,6 +87,7 @@ bp-polkadot-core = { path = "../../../../../bridges/primitives/polkadot-core", d
bp-relayers = { path = "../../../../../bridges/primitives/relayers", default-features = false }
bp-runtime = { path = "../../../../../bridges/primitives/runtime", default-features = false }
bp-rococo = { path = "../../../../../bridges/primitives/chain-rococo", default-features = false }
bp-westend = { path = "../../../../../bridges/primitives/chain-westend", default-features = false }
bp-wococo = { path = "../../../../../bridges/primitives/chain-wococo", default-features = false }
pallet-bridge-grandpa = { path = "../../../../../bridges/modules/grandpa", default-features = false }
pallet-bridge-messages = { path = "../../../../../bridges/modules/messages", default-features = false }
@@ -102,8 +105,10 @@ sp-keyring = { path = "../../../../../substrate/primitives/keyring" }
default = [ "std" ]
std = [
"bp-asset-hub-rococo/std",
"bp-asset-hub-westend/std",
"bp-asset-hub-wococo/std",
"bp-bridge-hub-rococo/std",
"bp-bridge-hub-westend/std",
"bp-bridge-hub-wococo/std",
"bp-header-chain/std",
"bp-messages/std",
@@ -112,6 +117,7 @@ std = [
"bp-relayers/std",
"bp-rococo/std",
"bp-runtime/std",
"bp-westend/std",
"bp-wococo/std",
"bridge-runtime-common/std",
"codec/std",
@@ -33,6 +33,8 @@ parameter_types! {
pub const MaxRococoParaHeadDataSize: u32 = bp_rococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE;
pub const WococoBridgeParachainPalletName: &'static str = "Paras";
pub const MaxWococoParaHeadDataSize: u32 = bp_wococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE;
pub const WestendBridgeParachainPalletName: &'static str = "Paras";
pub const MaxWestendParaHeadDataSize: u32 = bp_westend::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE;
pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000;
pub const RelayerStakeLease: u32 = 8;
@@ -87,6 +89,29 @@ impl pallet_bridge_parachains::Config<BridgeParachainRococoInstance> for Runtime
type MaxParaHeadDataSize = MaxRococoParaHeadDataSize;
}
/// Add GRANDPA bridge pallet to track Westend relay chain.
pub type BridgeGrandpaWestendInstance = pallet_bridge_grandpa::Instance3;
impl pallet_bridge_grandpa::Config<BridgeGrandpaWestendInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type BridgedChain = bp_westend::Westend;
type MaxFreeMandatoryHeadersPerBlock = ConstU32<4>;
type HeadersToKeep = RelayChainHeadersToKeep;
type WeightInfo = weights::pallet_bridge_grandpa_westend_finality::WeightInfo<Runtime>;
}
/// Add parachain bridge pallet to track Westend BridgeHub parachain
pub type BridgeParachainWestendInstance = pallet_bridge_parachains::Instance3;
impl pallet_bridge_parachains::Config<BridgeParachainWestendInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_bridge_parachains_within_westend::WeightInfo<Runtime>;
type BridgesGrandpaPalletInstance = BridgeGrandpaWestendInstance;
type ParasPalletName = WestendBridgeParachainPalletName;
type ParaStoredHeaderDataBuilder =
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_westend::BridgeHubWestend>;
type HeadsToKeep = ParachainHeadsToKeep;
type MaxParaHeadDataSize = MaxWestendParaHeadDataSize;
}
/// Allows collect and claim rewards for relayers
impl pallet_bridge_relayers::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Bridge definitions used on BridgeHub with the Wococo flavor.
//! Bridge definitions used on BridgeHub with the Wococo flavor for bridging to BridgeHubRococo.
use crate::{
bridge_common_config::{BridgeParachainRococoInstance, DeliveryRewardInBalance},
weights, AccountId, BridgeWococoToRococoMessages, ParachainInfo, Runtime, RuntimeEvent,
RuntimeOrigin, XcmRouter,
weights, AccountId, BridgeRococoMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin,
XcmRouter,
};
use bp_messages::LaneId;
use bridge_runtime_common::{
@@ -54,23 +54,26 @@ parameter_types! {
bp_bridge_hub_wococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
pub const BridgeHubRococoChainId: bp_runtime::ChainId = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID;
pub BridgeHubWococoUniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(Wococo), Parachain(ParachainInfo::parachain_id().into()));
pub BridgeWococoToRococoMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeWococoToRococoMessages as PalletInfoAccess>::index() as u8));
pub BridgeWococoToRococoMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeRococoMessages as PalletInfoAccess>::index() as u8));
pub RococoGlobalConsensusNetwork: NetworkId = NetworkId::Rococo;
pub ActiveOutboundLanesToBridgeHubRococo: &'static [bp_messages::LaneId] = &[DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO];
pub ActiveOutboundLanesToBridgeHubRococo: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO];
pub const AssetHubWococoToAssetHubRococoMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO;
// see the `FEE_BOOST_PER_MESSAGE` constant to get the meaning of this value
pub PriorityBoostPerMessage: u64 = 182_044_444_444_444;
pub AssetHubWococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_wococo::ASSET_HUB_WOCOCO_PARACHAIN_ID.into();
pub AssetHubRococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID.into();
pub FromAssetHubWococoToAssetHubRococoRoute: SenderAndLane = SenderAndLane::new(
ParentThen(X1(Parachain(AssetHubWococoParaId::get().into()))).into(),
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
);
pub CongestedMessage: Xcm<()> = build_congestion_message(true).into();
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();
}
pub const XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO: LaneId = LaneId([0, 0, 0, 1]);
fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instruction<Call>> {
sp_std::vec![
@@ -99,7 +102,7 @@ pub type ToRococoBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_rococo::Hash>;
/// Dispatches received XCM messages from other bridge
pub type OnBridgeHubWococoBlobDispatcher = BridgeBlobDispatcher<
type FromRococoMessageBlobDispatcher = BridgeBlobDispatcher<
XcmRouter,
BridgeHubWococoUniversalLocation,
BridgeWococoToRococoMessagesPalletInstance,
@@ -117,20 +120,19 @@ impl XcmBlobHauler for ToBridgeHubRococoXcmBlobHauler {
type MessagesInstance = WithBridgeHubRococoMessagesInstance;
type SenderAndLane = FromAssetHubWococoToAssetHubRococoRoute;
type ToSourceChainSender = crate::XcmRouter;
type ToSourceChainSender = XcmRouter;
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO: LaneId = LaneId([0, 0, 0, 1]);
/// On messages delivered callback.
pub type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>;
type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>;
/// Messaging Bridge configuration for BridgeHubWococo -> BridgeHubRococo
pub struct WithBridgeHubRococoMessageBridge;
impl MessageBridge for WithBridgeHubRococoMessageBridge {
const BRIDGED_MESSAGES_PALLET_NAME: &'static str =
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_ROCOCO_TO_WOCOCO_MESSAGES_PALLET_NAME;
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME;
type ThisChain = BridgeHubWococo;
type BridgedChain = BridgeHubRococo;
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
@@ -171,21 +173,20 @@ impl ThisChainWithMessages for BridgeHubWococo {
}
/// Signed extension that refunds relayers that are delivering messages from the Rococo parachain.
pub type BridgeRefundBridgeHubRococoMessages = RefundSignedExtensionAdapter<
pub type OnBridgeHubWococoRefundBridgeHubRococoMessages = RefundSignedExtensionAdapter<
RefundBridgedParachainMessages<
Runtime,
RefundableParachain<BridgeParachainRococoInstance, bp_bridge_hub_rococo::BridgeHubRococo>,
RefundableMessagesLane<WithBridgeHubRococoMessagesInstance, BridgeHubRococoMessagesLane>,
RefundableMessagesLane<
WithBridgeHubRococoMessagesInstance,
AssetHubWococoToAssetHubRococoMessagesLane,
>,
ActualFeeRefund<Runtime>,
PriorityBoostPerMessage,
StrBridgeRefundBridgeHubRococoMessages,
StrOnBridgeHubWococoRefundBridgeHubRococoMessages,
>,
>;
bp_runtime::generate_static_str_provider!(BridgeRefundBridgeHubRococoMessages);
parameter_types! {
pub const BridgeHubRococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO;
}
bp_runtime::generate_static_str_provider!(OnBridgeHubWococoRefundBridgeHubRococoMessages);
/// Add XCM messages support for BridgeHubWococo to support Wococo->Rococo XCM messages
pub type WithBridgeHubRococoMessagesInstance = pallet_bridge_messages::Instance2;
@@ -214,7 +215,7 @@ impl pallet_bridge_messages::Config<WithBridgeHubRococoMessagesInstance> for Run
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubRococoMessageBridge>;
type MessageDispatch = XcmBlobMessageDispatch<
OnBridgeHubWococoBlobDispatcher,
FromRococoMessageBlobDispatcher,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider<
AssetHubWococoParaId,
@@ -293,10 +294,10 @@ mod tests {
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_ROCOCO_TO_WOCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name: bp_rococo::WITH_ROCOCO_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
},
});
@@ -0,0 +1,322 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Bridge definitions used on BridgeHub with the Rococo flavor for bridging to BridgeHubWestend.
use crate::{
bridge_common_config::{BridgeParachainWestendInstance, DeliveryRewardInBalance},
weights, AccountId, BridgeWestendMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin,
XcmRouter,
};
use bp_messages::LaneId;
use bridge_runtime_common::{
messages,
messages::{
source::{FromBridgedChainMessagesDeliveryProof, TargetHeaderChainAdapter},
target::{FromBridgedChainMessagesProof, SourceHeaderChainAdapter},
MessageBridge, ThisChainWithMessages, UnderlyingChainProvider,
},
messages_xcm_extension::{
SenderAndLane, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter,
XcmBlobMessageDispatch,
},
refund_relayer_extension::{
ActualFeeRefund, RefundBridgedParachainMessages, RefundSignedExtensionAdapter,
RefundableMessagesLane, RefundableParachain,
},
};
use codec::Encode;
use frame_support::{parameter_types, traits::PalletInfoAccess};
use sp_runtime::RuntimeDebug;
use xcm::{
latest::prelude::*,
prelude::{InteriorMultiLocation, NetworkId},
};
use xcm_builder::{BridgeBlobDispatcher, HaulBlobExporter};
parameter_types! {
pub const MaxUnrewardedRelayerEntriesAtInboundLane: bp_messages::MessageNonce =
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
pub const MaxUnconfirmedMessagesAtInboundLane: bp_messages::MessageNonce =
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
pub const BridgeHubWestendChainId: bp_runtime::ChainId = bp_runtime::BRIDGE_HUB_WESTEND_CHAIN_ID;
pub BridgeRococoToWestendMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeWestendMessages as PalletInfoAccess>::index() as u8));
pub BridgeHubRococoUniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(Rococo), Parachain(ParachainInfo::parachain_id().into()));
pub WestendGlobalConsensusNetwork: NetworkId = NetworkId::Westend;
pub ActiveOutboundLanesToBridgeHubWestend: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND];
pub const AssetHubRococoToAssetHubWestendMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND;
// see the `FEE_BOOST_PER_MESSAGE` constant to get the meaning of this value
pub PriorityBoostPerMessage: u64 = 182_044_444_444_444;
pub AssetHubRococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID.into();
pub AssetHubWestendParaId: cumulus_primitives_core::ParaId = bp_asset_hub_westend::ASSET_HUB_WESTEND_PARACHAIN_ID.into();
pub FromAssetHubRococoToAssetHubWestendRoute: SenderAndLane = SenderAndLane::new(
ParentThen(X1(Parachain(AssetHubRococoParaId::get().into()))).into(),
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
);
pub CongestedMessage: Xcm<()> = build_congestion_message(true).into();
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();
}
pub const XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND: LaneId = LaneId([0, 0, 0, 2]);
fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instruction<Call>> {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_rococo::Call::ToWestendXcmRouter(
bp_asset_hub_rococo::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested,
}
)
.encode()
.into(),
}
]
}
/// Proof of messages, coming from Westend.
pub type FromWestendBridgeHubMessagesProof =
FromBridgedChainMessagesProof<bp_bridge_hub_westend::Hash>;
/// Messages delivery proof for Rococo Bridge Hub -> Westend Bridge Hub messages.
pub type ToWestendBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_westend::Hash>;
/// Dispatches received XCM messages from other bridge
type FromWestendMessageBlobDispatcher = BridgeBlobDispatcher<
XcmRouter,
BridgeHubRococoUniversalLocation,
BridgeRococoToWestendMessagesPalletInstance,
>;
/// Export XCM messages to be relayed to the other side
pub type ToBridgeHubWestendHaulBlobExporter = HaulBlobExporter<
XcmBlobHaulerAdapter<ToBridgeHubWestendXcmBlobHauler>,
WestendGlobalConsensusNetwork,
(),
>;
pub struct ToBridgeHubWestendXcmBlobHauler;
impl XcmBlobHauler for ToBridgeHubWestendXcmBlobHauler {
type Runtime = Runtime;
type MessagesInstance = WithBridgeHubWestendMessagesInstance;
type SenderAndLane = FromAssetHubRococoToAssetHubWestendRoute;
type ToSourceChainSender = XcmRouter;
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}
/// On messages delivered callback.
type OnMessagesDeliveredFromWestend = XcmBlobHaulerAdapter<ToBridgeHubWestendXcmBlobHauler>;
/// Messaging Bridge configuration for BridgeHubRococo -> BridgeHubWestend
pub struct WithBridgeHubWestendMessageBridge;
impl MessageBridge for WithBridgeHubWestendMessageBridge {
const BRIDGED_MESSAGES_PALLET_NAME: &'static str =
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME;
type ThisChain = BridgeHubRococo;
type BridgedChain = BridgeHubWestend;
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
Runtime,
BridgeParachainWestendInstance,
bp_bridge_hub_westend::BridgeHubWestend,
>;
}
/// Message verifier for BridgeHubWestend messages sent from BridgeHubRococo
pub type ToBridgeHubWestendMessageVerifier =
messages::source::FromThisChainMessageVerifier<WithBridgeHubWestendMessageBridge>;
/// Maximal outbound payload size of BridgeHubRococo -> BridgeHubWestend messages.
pub type ToBridgeHubWestendMaximalOutboundPayloadSize =
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubWestendMessageBridge>;
/// BridgeHubWestend chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
pub struct BridgeHubWestend;
impl UnderlyingChainProvider for BridgeHubWestend {
type Chain = bp_bridge_hub_westend::BridgeHubWestend;
}
impl messages::BridgedChainWithMessages for BridgeHubWestend {}
/// BridgeHubRococo chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
pub struct BridgeHubRococo;
impl UnderlyingChainProvider for BridgeHubRococo {
type Chain = bp_bridge_hub_rococo::BridgeHubRococo;
}
impl ThisChainWithMessages for BridgeHubRococo {
type RuntimeOrigin = RuntimeOrigin;
}
/// Signed extension that refunds relayers that are delivering messages from the Westend parachain.
pub type OnBridgeHubRococoRefundBridgeHubWestendMessages = RefundSignedExtensionAdapter<
RefundBridgedParachainMessages<
Runtime,
RefundableParachain<
BridgeParachainWestendInstance,
bp_bridge_hub_westend::BridgeHubWestend,
>,
RefundableMessagesLane<
WithBridgeHubWestendMessagesInstance,
AssetHubRococoToAssetHubWestendMessagesLane,
>,
ActualFeeRefund<Runtime>,
PriorityBoostPerMessage,
StrOnBridgeHubRococoRefundBridgeHubWestendMessages,
>,
>;
bp_runtime::generate_static_str_provider!(OnBridgeHubRococoRefundBridgeHubWestendMessages);
/// Add XCM messages support for BridgeHubRococo to support Rococo->Westend XCM messages
pub type WithBridgeHubWestendMessagesInstance = pallet_bridge_messages::Instance3;
impl pallet_bridge_messages::Config<WithBridgeHubWestendMessagesInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_bridge_messages_rococo_to_westend::WeightInfo<Runtime>;
type BridgedChainId = BridgeHubWestendChainId;
type ActiveOutboundLanes = ActiveOutboundLanesToBridgeHubWestend;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane;
type MaximalOutboundPayloadSize = ToBridgeHubWestendMaximalOutboundPayloadSize;
type OutboundPayload = XcmAsPlainPayload;
type InboundPayload = XcmAsPlainPayload;
type InboundRelayer = AccountId;
type DeliveryPayments = ();
type TargetHeaderChain = TargetHeaderChainAdapter<WithBridgeHubWestendMessageBridge>;
type LaneMessageVerifier = ToBridgeHubWestendMessageVerifier;
type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
Runtime,
WithBridgeHubWestendMessagesInstance,
DeliveryRewardInBalance,
>;
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubWestendMessageBridge>;
type MessageDispatch = XcmBlobMessageDispatch<
FromWestendMessageBlobDispatcher,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider<
AssetHubRococoParaId,
Runtime,
>,
>;
type OnMessagesDelivered = OnMessagesDeliveredFromWestend;
}
#[cfg(test)]
mod tests {
use super::*;
use crate::bridge_common_config::BridgeGrandpaWestendInstance;
use bridge_runtime_common::{
assert_complete_bridge_types,
integrity::{
assert_complete_bridge_constants, check_message_lane_weights,
AssertBridgeMessagesPalletConstants, AssertBridgePalletNames, AssertChainConstants,
AssertCompleteBridgeConstants,
},
};
use parachains_common::{rococo, Balance};
/// Every additional message in the message delivery transaction boosts its priority.
/// So the priority of transaction with `N+1` messages is larger than priority of
/// transaction with `N` messages by the `PriorityBoostPerMessage`.
///
/// Economically, it is an equivalent of adding tip to the transaction with `N` messages.
/// The `FEE_BOOST_PER_MESSAGE` constant is the value of this tip.
///
/// We want this tip to be large enough (delivery transactions with more messages = less
/// operational costs and a faster bridge), so this value should be significant.
const FEE_BOOST_PER_MESSAGE: Balance = 2 * rococo::currency::UNITS;
#[test]
fn ensure_bridge_hub_rococo_message_lane_weights_are_correct() {
check_message_lane_weights::<
bp_bridge_hub_rococo::BridgeHubRococo,
Runtime,
WithBridgeHubWestendMessagesInstance,
>(
bp_bridge_hub_westend::EXTRA_STORAGE_PROOF_SIZE,
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
true,
);
}
#[test]
fn ensure_bridge_integrity() {
assert_complete_bridge_types!(
runtime: Runtime,
with_bridged_chain_grandpa_instance: BridgeGrandpaWestendInstance,
with_bridged_chain_messages_instance: WithBridgeHubWestendMessagesInstance,
bridge: WithBridgeHubWestendMessageBridge,
this_chain: bp_rococo::Rococo,
bridged_chain: bp_westend::Westend,
);
assert_complete_bridge_constants::<
Runtime,
BridgeGrandpaWestendInstance,
WithBridgeHubWestendMessagesInstance,
WithBridgeHubWestendMessageBridge,
>(AssertCompleteBridgeConstants {
this_chain_constants: AssertChainConstants {
block_length: bp_bridge_hub_rococo::BlockLength::get(),
block_weights: bp_bridge_hub_rococo::BlockWeights::get(),
},
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
max_unrewarded_relayers_in_bridged_confirmation_tx:
bp_bridge_hub_westend::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_messages_in_bridged_confirmation_tx:
bp_bridge_hub_westend::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bridged_chain_id: bp_runtime::BRIDGE_HUB_WESTEND_CHAIN_ID,
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name:
bp_westend::WITH_WESTEND_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
},
});
bridge_runtime_common::priority_calculator::ensure_priority_boost_is_sane::<
Runtime,
WithBridgeHubWestendMessagesInstance,
PriorityBoostPerMessage,
>(FEE_BOOST_PER_MESSAGE);
assert_eq!(
BridgeRococoToWestendMessagesPalletInstance::get(),
X1(PalletInstance(
bp_bridge_hub_rococo::WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX
))
);
}
}
@@ -14,12 +14,12 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Bridge definitions used on BridgeHub with the Rococo flavor.
//! Bridge definitions used on BridgeHub with the Rococo flavor for bridging to BridgeHubWococo.
use crate::{
bridge_common_config::{BridgeParachainWococoInstance, DeliveryRewardInBalance},
weights, AccountId, BridgeRococoToWococoMessages, ParachainInfo, Runtime, RuntimeEvent,
RuntimeOrigin, XcmRouter,
weights, AccountId, BridgeWococoMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin,
XcmRouter,
};
use bp_messages::LaneId;
use bridge_runtime_common::{
@@ -54,24 +54,27 @@ parameter_types! {
pub const MaxUnconfirmedMessagesAtInboundLane: bp_messages::MessageNonce =
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
pub const BridgeHubWococoChainId: bp_runtime::ChainId = bp_runtime::BRIDGE_HUB_WOCOCO_CHAIN_ID;
pub BridgeRococoToWococoMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeRococoToWococoMessages as PalletInfoAccess>::index() as u8));
pub BridgeRococoToWococoMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeWococoMessages as PalletInfoAccess>::index() as u8));
pub BridgeHubRococoUniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(Rococo), Parachain(ParachainInfo::parachain_id().into()));
pub WococoGlobalConsensusNetwork: NetworkId = NetworkId::Wococo;
pub ActiveOutboundLanesToBridgeHubWococo: &'static [bp_messages::LaneId] = &[DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO];
pub ActiveOutboundLanesToBridgeHubWococo: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO];
pub const AssetHubRococoToAssetHubWococoMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO;
// see the `FEE_BOOST_PER_MESSAGE` constant to get the meaning of this value
pub PriorityBoostPerMessage: u64 = 182_044_444_444_444;
pub AssetHubRococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_rococo::ASSET_HUB_ROCOCO_PARACHAIN_ID.into();
pub AssetHubWococoParaId: cumulus_primitives_core::ParaId = bp_asset_hub_wococo::ASSET_HUB_WOCOCO_PARACHAIN_ID.into();
pub FromAssetHubRococoToAssetHubWococoRoute: SenderAndLane = SenderAndLane::new(
ParentThen(X1(Parachain(AssetHubRococoParaId::get().into()))).into(),
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
);
pub CongestedMessage: Xcm<()> = build_congestion_message(true).into();
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();
}
pub const XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO: LaneId = LaneId([0, 0, 0, 1]);
fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instruction<Call>> {
sp_std::vec![
@@ -100,7 +103,7 @@ pub type ToWococoBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_wococo::Hash>;
/// Dispatches received XCM messages from other bridge
pub type OnBridgeHubRococoBlobDispatcher = BridgeBlobDispatcher<
type FromWococoMessageBlobDispatcher = BridgeBlobDispatcher<
XcmRouter,
BridgeHubRococoUniversalLocation,
BridgeRococoToWococoMessagesPalletInstance,
@@ -118,20 +121,19 @@ impl XcmBlobHauler for ToBridgeHubWococoXcmBlobHauler {
type MessagesInstance = WithBridgeHubWococoMessagesInstance;
type SenderAndLane = FromAssetHubRococoToAssetHubWococoRoute;
type ToSourceChainSender = crate::XcmRouter;
type ToSourceChainSender = XcmRouter;
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO: LaneId = LaneId([0, 0, 0, 1]);
/// On messages delivered callback.
pub type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubWococoXcmBlobHauler>;
type OnMessagesDeliveredFromWococo = XcmBlobHaulerAdapter<ToBridgeHubWococoXcmBlobHauler>;
/// Messaging Bridge configuration for BridgeHubRococo -> BridgeHubWococo
pub struct WithBridgeHubWococoMessageBridge;
impl MessageBridge for WithBridgeHubWococoMessageBridge {
const BRIDGED_MESSAGES_PALLET_NAME: &'static str =
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_NAME;
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME;
type ThisChain = BridgeHubRococo;
type BridgedChain = BridgeHubWococo;
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
@@ -172,21 +174,20 @@ impl ThisChainWithMessages for BridgeHubRococo {
}
/// Signed extension that refunds relayers that are delivering messages from the Wococo parachain.
pub type BridgeRefundBridgeHubWococoMessages = RefundSignedExtensionAdapter<
pub type OnBridgeHubRococoRefundBridgeHubWococoMessages = RefundSignedExtensionAdapter<
RefundBridgedParachainMessages<
Runtime,
RefundableParachain<BridgeParachainWococoInstance, bp_bridge_hub_wococo::BridgeHubWococo>,
RefundableMessagesLane<WithBridgeHubWococoMessagesInstance, BridgeHubWococoMessagesLane>,
RefundableMessagesLane<
WithBridgeHubWococoMessagesInstance,
AssetHubRococoToAssetHubWococoMessagesLane,
>,
ActualFeeRefund<Runtime>,
PriorityBoostPerMessage,
StrBridgeRefundBridgeHubWococoMessages,
StrOnBridgeHubRococoRefundBridgeHubWococoMessages,
>,
>;
bp_runtime::generate_static_str_provider!(BridgeRefundBridgeHubWococoMessages);
parameter_types! {
pub const BridgeHubWococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO;
}
bp_runtime::generate_static_str_provider!(OnBridgeHubRococoRefundBridgeHubWococoMessages);
/// Add XCM messages support for BridgeHubRococo to support Rococo->Wococo XCM messages
pub type WithBridgeHubWococoMessagesInstance = pallet_bridge_messages::Instance1;
@@ -215,14 +216,14 @@ impl pallet_bridge_messages::Config<WithBridgeHubWococoMessagesInstance> for Run
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubWococoMessageBridge>;
type MessageDispatch = XcmBlobMessageDispatch<
OnBridgeHubRococoBlobDispatcher,
FromWococoMessageBlobDispatcher,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider<
AssetHubRococoParaId,
Runtime,
>,
>;
type OnMessagesDelivered = OnMessagesDelivered;
type OnMessagesDelivered = OnMessagesDeliveredFromWococo;
}
#[cfg(test)]
@@ -294,10 +295,10 @@ mod tests {
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name: bp_wococo::WITH_WOCOCO_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_ROCOCO_TO_WOCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME,
},
});
@@ -16,11 +16,15 @@
//! # Bridge Hub Rococo Runtime
//!
//! This runtime is also used for Bridge Hub Wococo. But we dont want to create another exact copy
//! of Bridge Hub Rococo, so we injected some tweaks backed by `RuntimeFlavor` and `pub storage
//! Flavor: RuntimeFlavor`. (For example this is needed for successful asset transfer between Asset
//! Hub Rococo and Asset Hub Wococo, where we need to have correct `xcm_config::UniversalLocation`
//! with correct `GlobalConsensus`.
//! This runtime is also used for Bridge Hub Wococo. We dont want to create
//! another exact copy of Bridge Hub Rococo, so we injected some tweaks backed by `RuntimeFlavor`
//! and `pub storage Flavor: RuntimeFlavor`. (For example this is needed for successful asset
//! transfer between Asset Hub Rococo and Asset Hub Wococo, where we need to have correct
//! `xcm_config::UniversalLocation` with correct `GlobalConsensus`.
//!
//! This runtime currently supports bridging between:
//! - Rococo <> Wococo
//! - Rococo <> Westend
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
@@ -31,8 +35,9 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
pub mod bridge_common_config;
pub mod bridge_hub_rococo_config;
pub mod bridge_hub_wococo_config;
pub mod bridge_to_rococo_config;
pub mod bridge_to_westend_config;
pub mod bridge_to_wococo_config;
mod weights;
pub mod xcm_config;
@@ -67,7 +72,7 @@ use frame_system::{
};
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin};
use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin, XcmRouter};
use bp_runtime::HeaderId;
@@ -79,10 +84,6 @@ use xcm::latest::prelude::*;
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use crate::{
bridge_hub_rococo_config::BridgeRefundBridgeHubWococoMessages,
bridge_hub_wococo_config::BridgeRefundBridgeHubRococoMessages, xcm_config::XcmRouter,
};
use parachains_common::{
impls::DealWithFees,
rococo::{consensus::*, currency::*, fee::WeightToFee},
@@ -123,7 +124,11 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
BridgeRejectObsoleteHeadersAndMessages,
(BridgeRefundBridgeHubRococoMessages, BridgeRefundBridgeHubWococoMessages),
(
bridge_to_wococo_config::OnBridgeHubRococoRefundBridgeHubWococoMessages,
bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages,
bridge_to_rococo_config::OnBridgeHubWococoRefundBridgeHubRococoMessages,
),
);
/// Unchecked extrinsic type as expected by this runtime.
@@ -187,7 +192,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-rococo"),
impl_name: create_runtime_str!("bridge-hub-rococo"),
authoring_version: 1,
spec_version: 10000,
spec_version: 1_003_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
@@ -491,19 +496,38 @@ construct_runtime!(
Utility: pallet_utility::{Pallet, Call, Event} = 40,
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 36,
// Rococo and Wococo BridgeHubs are sharing the runtime, so this runtime has two sets of
// bridge pallets. Both are deployed at both runtimes, but only one set is actually used
// at particular runtime.
// Rococo, Wococo and Westend BridgeHubs are sharing the runtime, so this runtime has several sets of
// bridge pallets.
//
// BridgeHubRococo uses:
// - BridgeWococoGrandpa
// - BridgeWestendGrandpa
// - BridgeWococoParachains
// - BridgeWestendParachains
// - BridgeWococoMessages
// - BridgeWestendMessages
// - BridgeRelayers
//
// BridgeHubWococo uses:
// - BridgeRococoGrandpa
// - BridgeRococoParachains
// - BridgeRococoMessages
// - BridgeRelayers
// With-Wococo bridge modules that are active (used) at Rococo BridgeHub runtime.
// GRANDPA bridge modules.
BridgeWococoGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 41,
BridgeWococoParachain: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage, Event<T>} = 42,
BridgeRococoToWococoMessages: pallet_bridge_messages::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 46,
// With-Rococo bridge modules that are active (used) at Wococo BridgeHub runtime.
BridgeRococoGrandpa: pallet_bridge_grandpa::<Instance2>::{Pallet, Call, Storage, Event<T>, Config<T>} = 43,
BridgeRococoParachain: pallet_bridge_parachains::<Instance2>::{Pallet, Call, Storage, Event<T>} = 44,
BridgeWococoToRococoMessages: pallet_bridge_messages::<Instance2>::{Pallet, Call, Storage, Event<T>, Config<T>} = 45,
BridgeWestendGrandpa: pallet_bridge_grandpa::<Instance3>::{Pallet, Call, Storage, Event<T>, Config<T>} = 48,
// Parachain bridge modules.
BridgeWococoParachains: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage, Event<T>} = 42,
BridgeRococoParachains: pallet_bridge_parachains::<Instance2>::{Pallet, Call, Storage, Event<T>} = 44,
BridgeWestendParachains: pallet_bridge_parachains::<Instance3>::{Pallet, Call, Storage, Event<T>} = 49,
// Messaging bridge modules.
BridgeWococoMessages: pallet_bridge_messages::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 46,
BridgeRococoMessages: pallet_bridge_messages::<Instance2>::{Pallet, Call, Storage, Event<T>, Config<T>} = 45,
BridgeWestendMessages: pallet_bridge_messages::<Instance3>::{Pallet, Call, Storage, Event<T>, Config<T>} = 51,
BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event<T>} = 47,
}
@@ -512,11 +536,11 @@ construct_runtime!(
bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! {
RuntimeCall, AccountId,
// Grandpa
BridgeRococoGrandpa, BridgeWococoGrandpa,
BridgeRococoGrandpa, BridgeWococoGrandpa, BridgeWestendGrandpa,
// Parachains
BridgeRococoParachain, BridgeWococoParachain,
BridgeRococoParachains, BridgeWococoParachains, BridgeWestendParachains,
// Messages
BridgeWococoToRococoMessages, BridgeRococoToWococoMessages
BridgeRococoMessages, BridgeWococoMessages, BridgeWestendMessages
}
#[cfg(feature = "runtime-benchmarks")]
@@ -539,15 +563,16 @@ mod benches {
// NOTE: Make sure you point to the individual modules below.
[pallet_xcm_benchmarks::fungible, XcmBalances]
[pallet_xcm_benchmarks::generic, XcmGeneric]
// Bridge pallets at Rococo
// Bridge pallets
[pallet_bridge_grandpa, WococoFinality]
[pallet_bridge_parachains, WithinWococo]
[pallet_bridge_messages, RococoToWococo]
// Bridge pallets at Wococo
[pallet_bridge_grandpa, WestendFinality]
[pallet_bridge_grandpa, RococoFinality]
[pallet_bridge_parachains, WithinWococo]
[pallet_bridge_parachains, WithinWestend]
[pallet_bridge_parachains, WithinRococo]
[pallet_bridge_messages, RococoToWococo]
[pallet_bridge_messages, RococoToWestend]
[pallet_bridge_messages, WococoToRococo]
// Bridge relayer pallets
[pallet_bridge_relayers, BridgeRelayersBench::<Runtime>]
);
}
@@ -716,10 +741,19 @@ impl_runtime_apis! {
}
}
impl bp_westend::WestendFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<bp_westend::Hash, bp_westend::BlockNumber>> {
BridgeWestendGrandpa::best_finalized()
}
fn synced_headers_grandpa_info(
) -> Vec<bp_header_chain::StoredHeaderGrandpaInfo<bp_westend::Header>> {
BridgeWestendGrandpa::synced_headers_grandpa_info()
}
}
impl bp_bridge_hub_rococo::BridgeHubRococoFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<Hash, BlockNumber>> {
BridgeRococoParachain::best_parachain_head_id::<
BridgeRococoParachains::best_parachain_head_id::<
bp_bridge_hub_rococo::BridgeHubRococo
>().unwrap_or(None)
}
@@ -727,12 +761,20 @@ impl_runtime_apis! {
impl bp_bridge_hub_wococo::BridgeHubWococoFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<Hash, BlockNumber>> {
BridgeWococoParachain::best_parachain_head_id::<
BridgeWococoParachains::best_parachain_head_id::<
bp_bridge_hub_wococo::BridgeHubWococo
>().unwrap_or(None)
}
}
impl bp_bridge_hub_westend::BridgeHubWestendFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<Hash, BlockNumber>> {
BridgeWestendParachains::best_parachain_head_id::<
bp_bridge_hub_westend::BridgeHubWestend
>().unwrap_or(None)
}
}
// This is exposed by BridgeHubRococo
impl bp_bridge_hub_wococo::FromBridgeHubWococoInboundLaneApi<Block> for Runtime {
fn message_details(
@@ -741,7 +783,7 @@ impl_runtime_apis! {
) -> Vec<bp_messages::InboundMessageDetails> {
bridge_runtime_common::messages_api::inbound_message_details::<
Runtime,
bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance,
bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance,
>(lane, messages)
}
}
@@ -755,7 +797,34 @@ impl_runtime_apis! {
) -> Vec<bp_messages::OutboundMessageDetails> {
bridge_runtime_common::messages_api::outbound_message_details::<
Runtime,
bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance,
bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance,
>(lane, begin, end)
}
}
// This is exposed by BridgeHubRococo
impl bp_bridge_hub_westend::FromBridgeHubWestendInboundLaneApi<Block> for Runtime {
fn message_details(
lane: bp_messages::LaneId,
messages: Vec<(bp_messages::MessagePayload, bp_messages::OutboundMessageDetails)>,
) -> Vec<bp_messages::InboundMessageDetails> {
bridge_runtime_common::messages_api::inbound_message_details::<
Runtime,
bridge_to_westend_config::WithBridgeHubWestendMessagesInstance,
>(lane, messages)
}
}
// This is exposed by BridgeHubRococo
impl bp_bridge_hub_westend::ToBridgeHubWestendOutboundLaneApi<Block> for Runtime {
fn message_details(
lane: bp_messages::LaneId,
begin: bp_messages::MessageNonce,
end: bp_messages::MessageNonce,
) -> Vec<bp_messages::OutboundMessageDetails> {
bridge_runtime_common::messages_api::outbound_message_details::<
Runtime,
bridge_to_westend_config::WithBridgeHubWestendMessagesInstance,
>(lane, begin, end)
}
}
@@ -766,24 +835,36 @@ impl_runtime_apis! {
lane: bp_messages::LaneId,
messages: Vec<(bp_messages::MessagePayload, bp_messages::OutboundMessageDetails)>,
) -> Vec<bp_messages::InboundMessageDetails> {
bridge_runtime_common::messages_api::inbound_message_details::<
Runtime,
bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance,
>(lane, messages)
// use different instance according to flavor
match xcm_config::Flavor::get() {
RuntimeFlavor::Wococo => {
bridge_runtime_common::messages_api::inbound_message_details::<
Runtime,
bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance,
>(lane, messages)
},
flavor @ _ => unimplemented!("Unsupported `FromBridgeHubRococoInboundLaneApi` for flavor: {:?}", flavor)
}
}
}
// This is exposed by BridgeHubWococo
// This is exposed by BridgeHubWococo and BridgeHubWestend
impl bp_bridge_hub_rococo::ToBridgeHubRococoOutboundLaneApi<Block> for Runtime {
fn message_details(
lane: bp_messages::LaneId,
begin: bp_messages::MessageNonce,
end: bp_messages::MessageNonce,
) -> Vec<bp_messages::OutboundMessageDetails> {
bridge_runtime_common::messages_api::outbound_message_details::<
Runtime,
bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance,
>(lane, begin, end)
// use different instance according to flavor
match xcm_config::Flavor::get() {
RuntimeFlavor::Wococo => {
bridge_runtime_common::messages_api::outbound_message_details::<
Runtime,
bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance,
>(lane, begin, end)
},
flavor @ _ => unimplemented!("Unsupported `ToBridgeHubRococoOutboundLaneApi` for flavor: {:?}", flavor)
}
}
}
@@ -826,11 +907,14 @@ impl_runtime_apis! {
use pallet_bridge_relayers::benchmarking::Pallet as BridgeRelayersBench;
// Change weight file names.
type WococoFinality = BridgeWococoGrandpa;
type WestendFinality = BridgeWestendGrandpa;
type RococoFinality = BridgeRococoGrandpa;
type WithinWococo = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainWococoInstance>;
type WithinWestend = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainWestendInstance>;
type WithinRococo = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainRococoInstance>;
type RococoToWococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance>;
type WococoToRococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance>;
type RococoToWococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance>;
type RococoToWestend = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>;
type WococoToRococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>;
let mut list = Vec::<BenchmarkList>::new();
list_benchmarks!(list, extra);
@@ -966,11 +1050,14 @@ impl_runtime_apis! {
type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;
type WococoFinality = BridgeWococoGrandpa;
type WestendFinality = BridgeWestendGrandpa;
type RococoFinality = BridgeRococoGrandpa;
type WithinWococo = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainWococoInstance>;
type WithinWestend = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainWestendInstance>;
type WithinRococo = pallet_bridge_parachains::benchmarking::Pallet::<Runtime, bridge_common_config::BridgeParachainRococoInstance>;
type RococoToWococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance>;
type WococoToRococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance>;
type RococoToWococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance>;
type RococoToWestend = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>;
type WococoToRococo = pallet_bridge_messages::benchmarking::Pallet ::<Runtime, bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>;
use bridge_runtime_common::messages_benchmarking::{
prepare_message_delivery_proof_from_parachain,
@@ -983,9 +1070,9 @@ impl_runtime_apis! {
MessageProofParams,
};
impl BridgeMessagesConfig<bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance> for Runtime {
impl BridgeMessagesConfig<bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance> for Runtime {
fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_hub_rococo_config::WithBridgeHubWococoMessagesInstance>>::bench_lane_id();
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_wococo_config::WithBridgeHubWococoMessagesInstance>>::bench_lane_id();
let bridged_chain_id = bp_runtime::BRIDGE_HUB_WOCOCO_CHAIN_ID;
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward(
relayer,
@@ -999,24 +1086,24 @@ impl_runtime_apis! {
fn prepare_message_proof(
params: MessageProofParams,
) -> (bridge_hub_rococo_config::FromWococoBridgeHubMessagesProof, Weight) {
) -> (bridge_to_wococo_config::FromWococoBridgeHubMessagesProof, Weight) {
use cumulus_primitives_core::XcmpMessageSource;
assert!(XcmpQueue::take_outbound_messages(usize::MAX).is_empty());
ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into());
prepare_message_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaWococoInstance,
bridge_hub_rococo_config::WithBridgeHubWococoMessageBridge,
bridge_to_wococo_config::WithBridgeHubWococoMessageBridge,
>(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Rococo), Parachain(42))))
}
fn prepare_message_delivery_proof(
params: MessageDeliveryProofParams<AccountId>,
) -> bridge_hub_rococo_config::ToWococoBridgeHubMessagesDeliveryProof {
) -> bridge_to_wococo_config::ToWococoBridgeHubMessagesDeliveryProof {
prepare_message_delivery_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaWococoInstance,
bridge_hub_rococo_config::WithBridgeHubWococoMessageBridge,
bridge_to_wococo_config::WithBridgeHubWococoMessageBridge,
>(params)
}
@@ -1026,9 +1113,52 @@ impl_runtime_apis! {
}
}
impl BridgeMessagesConfig<bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance> for Runtime {
impl BridgeMessagesConfig<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance> for Runtime {
fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_hub_wococo_config::WithBridgeHubRococoMessagesInstance>>::bench_lane_id();
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_westend_config::WithBridgeHubWestendMessagesInstance>>::bench_lane_id();
let bridged_chain_id = bp_runtime::BRIDGE_HUB_WESTEND_CHAIN_ID;
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward(
relayer,
bp_relayers::RewardsAccountParams::new(
bench_lane_id,
bridged_chain_id,
bp_relayers::RewardsAccountOwner::BridgedChain
)
).is_some()
}
fn prepare_message_proof(
params: MessageProofParams,
) -> (bridge_to_westend_config::FromWestendBridgeHubMessagesProof, Weight) {
use cumulus_primitives_core::XcmpMessageSource;
assert!(XcmpQueue::take_outbound_messages(usize::MAX).is_empty());
ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into());
prepare_message_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaWestendInstance,
bridge_to_westend_config::WithBridgeHubWestendMessageBridge,
>(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Rococo), Parachain(42))))
}
fn prepare_message_delivery_proof(
params: MessageDeliveryProofParams<AccountId>,
) -> bridge_to_westend_config::ToWestendBridgeHubMessagesDeliveryProof {
prepare_message_delivery_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaWestendInstance,
bridge_to_westend_config::WithBridgeHubWestendMessageBridge,
>(params)
}
fn is_message_successfully_dispatched(_nonce: bp_messages::MessageNonce) -> bool {
use cumulus_primitives_core::XcmpMessageSource;
!XcmpQueue::take_outbound_messages(usize::MAX).is_empty()
}
}
impl BridgeMessagesConfig<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance> for Runtime {
fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool {
let bench_lane_id = <Self as BridgeMessagesConfig<bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance>>::bench_lane_id();
let bridged_chain_id = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID;
pallet_bridge_relayers::Pallet::<Runtime>::relayer_reward(
relayer,
@@ -1042,24 +1172,24 @@ impl_runtime_apis! {
fn prepare_message_proof(
params: MessageProofParams,
) -> (bridge_hub_wococo_config::FromRococoBridgeHubMessagesProof, Weight) {
) -> (bridge_to_rococo_config::FromRococoBridgeHubMessagesProof, Weight) {
use cumulus_primitives_core::XcmpMessageSource;
assert!(XcmpQueue::take_outbound_messages(usize::MAX).is_empty());
ParachainSystem::open_outbound_hrmp_channel_for_benchmarks_or_tests(42.into());
prepare_message_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaRococoInstance,
bridge_hub_wococo_config::WithBridgeHubRococoMessageBridge,
bridge_to_rococo_config::WithBridgeHubRococoMessageBridge,
>(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(Wococo), Parachain(42))))
}
fn prepare_message_delivery_proof(
params: MessageDeliveryProofParams<AccountId>,
) -> bridge_hub_wococo_config::ToRococoBridgeHubMessagesDeliveryProof {
) -> bridge_to_rococo_config::ToRococoBridgeHubMessagesDeliveryProof {
prepare_message_delivery_proof_from_parachain::<
Runtime,
bridge_common_config::BridgeGrandpaRococoInstance,
bridge_hub_wococo_config::WithBridgeHubRococoMessageBridge,
bridge_to_rococo_config::WithBridgeHubRococoMessageBridge,
>(params)
}
@@ -1100,6 +1230,30 @@ impl_runtime_apis! {
}
}
impl BridgeParachainsConfig<bridge_common_config::BridgeParachainWestendInstance> for Runtime {
fn parachains() -> Vec<bp_polkadot_core::parachains::ParaId> {
use bp_runtime::Parachain;
vec![bp_polkadot_core::parachains::ParaId(bp_bridge_hub_westend::BridgeHubWestend::PARACHAIN_ID)]
}
fn prepare_parachain_heads_proof(
parachains: &[bp_polkadot_core::parachains::ParaId],
parachain_head_size: u32,
proof_size: bp_runtime::StorageProofSize,
) -> (
pallet_bridge_parachains::RelayBlockNumber,
pallet_bridge_parachains::RelayBlockHash,
bp_polkadot_core::parachains::ParaHeadsProof,
Vec<(bp_polkadot_core::parachains::ParaId, bp_polkadot_core::parachains::ParaHash)>,
) {
prepare_parachain_heads_proof::<Runtime, bridge_common_config::BridgeParachainWestendInstance>(
parachains,
parachain_head_size,
proof_size,
)
}
}
impl BridgeParachainsConfig<bridge_common_config::BridgeParachainRococoInstance> for Runtime {
fn parachains() -> Vec<bp_polkadot_core::parachains::ParaId> {
use bp_runtime::Parachain;
@@ -1205,11 +1359,13 @@ mod tests {
pallet_transaction_payment::ChargeTransactionPayment::from(10),
BridgeRejectObsoleteHeadersAndMessages,
(
BridgeRefundBridgeHubRococoMessages::default(),
BridgeRefundBridgeHubWococoMessages::default(),
bridge_to_wococo_config::OnBridgeHubRococoRefundBridgeHubWococoMessages::default(),
bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages::default(),
bridge_to_rococo_config::OnBridgeHubWococoRefundBridgeHubRococoMessages::default(),
),
);
// for BridgeHubRococo
{
let bhr_indirect_payload = bp_bridge_hub_rococo::SignedExtension::from_params(
VERSION.spec_version,
@@ -1227,8 +1383,9 @@ mod tests {
)
}
// for BridgeHubWococo
{
let bhw_indirect_payload = bp_bridge_hub_rococo::SignedExtension::from_params(
let bhw_indirect_payload = bp_bridge_hub_wococo::SignedExtension::from_params(
VERSION.spec_version,
VERSION.transaction_version,
bp_runtime::TransactionEra::Immortal,
@@ -23,10 +23,13 @@ pub mod extrinsic_weights;
pub mod frame_system;
pub mod pallet_balances;
pub mod pallet_bridge_grandpa_rococo_finality;
pub mod pallet_bridge_grandpa_westend_finality;
pub mod pallet_bridge_grandpa_wococo_finality;
pub mod pallet_bridge_messages_rococo_to_westend;
pub mod pallet_bridge_messages_rococo_to_wococo;
pub mod pallet_bridge_messages_wococo_to_rococo;
pub mod pallet_bridge_parachains_within_rococo;
pub mod pallet_bridge_parachains_within_westend;
pub mod pallet_bridge_parachains_within_wococo;
pub mod pallet_bridge_relayers;
pub mod pallet_collator_selection;
@@ -84,6 +87,23 @@ impl pallet_bridge_messages::WeightInfoExt
}
}
impl pallet_bridge_messages::WeightInfoExt
for pallet_bridge_messages_rococo_to_westend::WeightInfo<crate::Runtime>
{
fn expected_extra_storage_proof_size() -> u32 {
bp_bridge_hub_westend::EXTRA_STORAGE_PROOF_SIZE
}
fn receive_messages_proof_overhead_from_runtime() -> Weight {
pallet_bridge_relayers::WeightInfo::<Runtime>::receive_messages_proof_overhead_from_runtime(
)
}
fn receive_messages_delivery_proof_overhead_from_runtime() -> Weight {
pallet_bridge_relayers::WeightInfo::<Runtime>::receive_messages_delivery_proof_overhead_from_runtime()
}
}
impl pallet_bridge_parachains::WeightInfoExt
for pallet_bridge_parachains_within_rococo::WeightInfo<crate::Runtime>
{
@@ -92,6 +112,14 @@ impl pallet_bridge_parachains::WeightInfoExt
}
}
impl pallet_bridge_parachains::WeightInfoExt
for pallet_bridge_parachains_within_westend::WeightInfo<crate::Runtime>
{
fn expected_extra_storage_proof_size() -> u32 {
bp_bridge_hub_westend::EXTRA_STORAGE_PROOF_SIZE
}
}
impl pallet_bridge_parachains::WeightInfoExt
for pallet_bridge_parachains_within_wococo::WeightInfo<crate::Runtime>
{
@@ -1,81 +0,0 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_grandpa`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./artifacts/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet=pallet_bridge_grandpa
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.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 `pallet_bridge_grandpa`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T> {
/// Storage: BridgeRococoGrandpa PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoGrandpa PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: BridgeRococoGrandpa BestFinalized (r:1 w:1)
/// Proof: BridgeRococoGrandpa BestFinalized (max_values: Some(1), max_size: Some(36), added: 531, mode: MaxEncodedLen)
/// Storage: BridgeRococoGrandpa CurrentAuthoritySet (r:1 w:0)
/// Proof: BridgeRococoGrandpa CurrentAuthoritySet (max_values: Some(1), max_size: Some(50250), added: 50745, mode: MaxEncodedLen)
/// Storage: BridgeRococoGrandpa ImportedHashesPointer (r:1 w:1)
/// Proof: BridgeRococoGrandpa ImportedHashesPointer (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
/// Storage: BridgeRococoGrandpa ImportedHashes (r:1 w:1)
/// Proof: BridgeRococoGrandpa ImportedHashes (max_values: Some(1024), max_size: Some(36), added: 1521, mode: MaxEncodedLen)
/// Storage: BridgeRococoGrandpa ImportedHeaders (r:0 w:2)
/// Proof: BridgeRococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen)
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `231 + p * (60 ±0)`
// Estimated: `51735`
// Minimum execution time: 241_332_000 picoseconds.
Weight::from_parts(69_790_821, 0)
.saturating_add(Weight::from_parts(0, 51735))
// Standard Error: 6_013
.saturating_add(Weight::from_parts(47_580_554, 0).saturating_mul(p.into()))
// Standard Error: 100_298
.saturating_add(Weight::from_parts(1_213_475, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_grandpa`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -64,17 +64,19 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `231 + p * (60 ±0)`
// Measured: `268 + p * (60 ±0)`
// Estimated: `51735`
// Minimum execution time: 292_425_000 picoseconds.
Weight::from_parts(294_025_000, 0)
// Minimum execution time: 304_726_000 picoseconds.
Weight::from_parts(16_868_060, 0)
.saturating_add(Weight::from_parts(0, 51735))
// Standard Error: 3_450
.saturating_add(Weight::from_parts(55_743_036, 0).saturating_mul(p.into()))
// Standard Error: 26_622
.saturating_add(Weight::from_parts(327_706, 0).saturating_mul(v.into()))
// Standard Error: 2_802
.saturating_add(Weight::from_parts(55_200_017, 0).saturating_mul(p.into()))
// Standard Error: 46_745
.saturating_add(Weight::from_parts(2_689_151, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
@@ -0,0 +1,83 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_grandpa`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_grandpa
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_grandpa`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeWestendGrandpa::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendGrandpa::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::BestFinalized` (r:1 w:1)
/// Proof: `BridgeWestendGrandpa::BestFinalized` (`max_values`: Some(1), `max_size`: Some(36), added: 531, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::CurrentAuthoritySet` (r:1 w:0)
/// Proof: `BridgeWestendGrandpa::CurrentAuthoritySet` (`max_values`: Some(1), `max_size`: Some(50250), added: 50745, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHashesPointer` (r:1 w:1)
/// Proof: `BridgeWestendGrandpa::ImportedHashesPointer` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHashes` (r:1 w:1)
/// Proof: `BridgeWestendGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:0 w:2)
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `335 + p * (60 ±0)`
// Estimated: `51735`
// Minimum execution time: 305_905_000 picoseconds.
Weight::from_parts(2_636_863, 0)
.saturating_add(Weight::from_parts(0, 51735))
// Standard Error: 2_724
.saturating_add(Weight::from_parts(55_199_477, 0).saturating_mul(p.into()))
// Standard Error: 45_444
.saturating_add(Weight::from_parts(2_835_596, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_grandpa`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -64,17 +64,19 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `268 + p * (60 ±0)`
// Measured: `302 + p * (60 ±0)`
// Estimated: `51735`
// Minimum execution time: 294_211_000 picoseconds.
Weight::from_parts(43_087_768, 0)
// Minimum execution time: 305_146_000 picoseconds.
Weight::from_parts(308_711_000, 0)
.saturating_add(Weight::from_parts(0, 51735))
// Standard Error: 5_610
.saturating_add(Weight::from_parts(55_863_061, 0).saturating_mul(p.into()))
// Standard Error: 93_579
.saturating_add(Weight::from_parts(2_409_156, 0).saturating_mul(v.into()))
// Standard Error: 2_651
.saturating_add(Weight::from_parts(55_082_480, 0).saturating_mul(p.into()))
// Standard Error: 20_462
.saturating_add(Weight::from_parts(298_367, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
@@ -1,231 +0,0 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_messages`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./artifacts/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet=pallet_bridge_messages
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_messages.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 `pallet_bridge_messages`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<T> {
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn receive_single_message_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `52645`
// Minimum execution time: 43_187_000 picoseconds.
Weight::from_parts(43_681_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn receive_two_messages_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `52645`
// Minimum execution time: 54_131_000 picoseconds.
Weight::from_parts(54_813_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen)
/// Storage: ParachainInfo ParachainId (r:1 w:0)
/// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen)
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `52645`
// Minimum execution time: 48_120_000 picoseconds.
Weight::from_parts(48_733_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen)
fn receive_single_message_proof_1_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `335`
// Estimated: `52645`
// Minimum execution time: 41_028_000 picoseconds.
Weight::from_parts(41_635_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, mode: MaxEncodedLen)
fn receive_single_message_proof_16_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `335`
// Estimated: `52645`
// Minimum execution time: 68_499_000 picoseconds.
Weight::from_parts(69_263_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen)
/// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
/// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
fn receive_delivery_proof_for_single_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 32_277_000 picoseconds.
Weight::from_parts(32_880_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen)
/// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
/// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 32_504_000 picoseconds.
Weight::from_parts(33_085_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages OutboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages OutboundLanes (max_values: Some(1), max_size: Some(44), added: 539, mode: MaxEncodedLen)
/// Storage: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof Skipped: unknown `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: BridgeRelayers RelayerRewards (r:2 w:2)
/// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(73), added: 2548, mode: MaxEncodedLen)
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Estimated: `6086`
// Minimum execution time: 34_963_000 picoseconds.
Weight::from_parts(35_473_000, 0)
.saturating_add(Weight::from_parts(0, 6086))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: BridgeRococoMessages PalletOperatingMode (r:1 w:0)
/// Proof: BridgeRococoMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen)
/// Storage: BridgeRococoParachain ImportedParaHeads (r:1 w:0)
/// Proof: BridgeRococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// Storage: BridgeRococoMessages InboundLanes (r:1 w:1)
/// Proof: BridgeRococoMessages InboundLanes (max_values: None, max_size: Some(49180), added: 51655, 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: PolkadotXcm SupportedVersion (r:1 w:0)
/// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured)
/// Storage: PolkadotXcm VersionDiscoveryQueue (r:1 w:1)
/// Proof Skipped: PolkadotXcm VersionDiscoveryQueue (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: PolkadotXcm SafeXcmVersion (r:1 w:0)
/// Proof Skipped: PolkadotXcm SafeXcmVersion (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParachainSystem RelevantMessagingState (r:1 w:0)
/// Proof Skipped: ParachainSystem RelevantMessagingState (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: XcmpQueue OutboundXcmpStatus (r:1 w:1)
/// Proof Skipped: XcmpQueue OutboundXcmpStatus (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: XcmpQueue OutboundXcmpMessages (r:0 w:1)
/// Proof Skipped: XcmpQueue OutboundXcmpMessages (max_values: None, max_size: None, mode: Measured)
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `635`
// Estimated: `52645`
// Minimum execution time: 129_978_000 picoseconds.
Weight::from_parts(98_246_356, 0)
.saturating_add(Weight::from_parts(0, 52645))
// Standard Error: 2_554
.saturating_add(Weight::from_parts(544_728, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -0,0 +1,245 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_messages`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_messages
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_messages`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `643`
// Estimated: `52645`
// Minimum execution time: 41_873_000 picoseconds.
Weight::from_parts(43_434_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_two_messages_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `643`
// Estimated: `52645`
// Minimum execution time: 53_328_000 picoseconds.
Weight::from_parts(54_592_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `643`
// Estimated: `52645`
// Minimum execution time: 47_486_000 picoseconds.
Weight::from_parts(48_721_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_1_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `611`
// Estimated: `52645`
// Minimum execution time: 41_093_000 picoseconds.
Weight::from_parts(42_050_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_16_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `611`
// Estimated: `52645`
// Minimum execution time: 71_947_000 picoseconds.
Weight::from_parts(74_564_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_single_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `482`
// Estimated: `3947`
// Minimum execution time: 31_235_000 picoseconds.
Weight::from_parts(32_051_000, 0)
.saturating_add(Weight::from_parts(0, 3947))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
// Proof Size summary in bytes:
// Measured: `482`
// Estimated: `3947`
// Minimum execution time: 31_320_000 picoseconds.
Weight::from_parts(31_973_000, 0)
.saturating_add(Weight::from_parts(0, 3947))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:2 w:2)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
// Proof Size summary in bytes:
// Measured: `482`
// Estimated: `6086`
// Minimum execution time: 33_656_000 picoseconds.
Weight::from_parts(34_779_000, 0)
.saturating_add(Weight::from_parts(0, 6086))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeRococoToWestendMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWestendMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWestendMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWestendMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `772`
// Estimated: `52645`
// Minimum execution time: 61_671_000 picoseconds.
Weight::from_parts(62_656_321, 0)
.saturating_add(Weight::from_parts(0, 52645))
// Standard Error: 25
.saturating_add(Weight::from_parts(6_641, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_messages`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -48,170 +48,170 @@ use core::marker::PhantomData;
/// Weight functions for `pallet_bridge_messages`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `504`
// Measured: `609`
// Estimated: `52645`
// Minimum execution time: 42_043_000 picoseconds.
Weight::from_parts(43_557_000, 0)
// Minimum execution time: 42_407_000 picoseconds.
Weight::from_parts(43_917_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_two_messages_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `504`
// Measured: `609`
// Estimated: `52645`
// Minimum execution time: 53_080_000 picoseconds.
Weight::from_parts(55_107_000, 0)
// Minimum execution time: 53_258_000 picoseconds.
Weight::from_parts(55_144_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `504`
// Measured: `609`
// Estimated: `52645`
// Minimum execution time: 47_757_000 picoseconds.
Weight::from_parts(49_024_000, 0)
// Minimum execution time: 47_950_000 picoseconds.
Weight::from_parts(49_315_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_1_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `472`
// Measured: `577`
// Estimated: `52645`
// Minimum execution time: 41_434_000 picoseconds.
Weight::from_parts(42_468_000, 0)
// Minimum execution time: 41_383_000 picoseconds.
Weight::from_parts(42_898_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_16_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `472`
// Measured: `577`
// Estimated: `52645`
// Minimum execution time: 76_285_000 picoseconds.
Weight::from_parts(77_717_000, 0)
// Minimum execution time: 72_118_000 picoseconds.
Weight::from_parts(74_643_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_single_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `376`
// Estimated: `3841`
// Minimum execution time: 31_296_000 picoseconds.
Weight::from_parts(32_147_000, 0)
.saturating_add(Weight::from_parts(0, 3841))
// Measured: `448`
// Estimated: `3913`
// Minimum execution time: 30_993_000 picoseconds.
Weight::from_parts(31_793_000, 0)
.saturating_add(Weight::from_parts(0, 3913))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
// Proof Size summary in bytes:
// Measured: `376`
// Estimated: `3841`
// Minimum execution time: 31_114_000 picoseconds.
Weight::from_parts(31_937_000, 0)
.saturating_add(Weight::from_parts(0, 3841))
// Measured: `448`
// Estimated: `3913`
// Minimum execution time: 30_894_000 picoseconds.
Weight::from_parts(31_925_000, 0)
.saturating_add(Weight::from_parts(0, 3913))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:2 w:2)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
// Proof Size summary in bytes:
// Measured: `376`
// Measured: `448`
// Estimated: `6086`
// Minimum execution time: 33_620_000 picoseconds.
Weight::from_parts(34_604_000, 0)
// Minimum execution time: 33_804_000 picoseconds.
Weight::from_parts(34_560_000, 0)
.saturating_add(Weight::from_parts(0, 6086))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeWococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoToWococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoToWococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
@@ -228,15 +228,17 @@ impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `672`
// Measured: `811`
// Estimated: `52645`
// Minimum execution time: 63_809_000 picoseconds.
Weight::from_parts(65_441_614, 0)
// Minimum execution time: 62_616_000 picoseconds.
Weight::from_parts(64_073_891, 0)
.saturating_add(Weight::from_parts(0, 52645))
// Standard Error: 61
.saturating_add(Weight::from_parts(6_729, 0).saturating_mul(i.into()))
// Standard Error: 43
.saturating_add(Weight::from_parts(6_525, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_messages`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -48,170 +48,170 @@ use core::marker::PhantomData;
/// Weight functions for `pallet_bridge_messages`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `467`
// Measured: `537`
// Estimated: `52645`
// Minimum execution time: 41_613_000 picoseconds.
Weight::from_parts(42_942_000, 0)
// Minimum execution time: 42_086_000 picoseconds.
Weight::from_parts(42_833_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_two_messages_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `467`
// Measured: `537`
// Estimated: `52645`
// Minimum execution time: 52_657_000 picoseconds.
Weight::from_parts(54_020_000, 0)
// Minimum execution time: 51_927_000 picoseconds.
Weight::from_parts(53_847_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `467`
// Measured: `537`
// Estimated: `52645`
// Minimum execution time: 47_484_000 picoseconds.
Weight::from_parts(48_318_000, 0)
// Minimum execution time: 47_218_000 picoseconds.
Weight::from_parts(48_380_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_1_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `435`
// Measured: `505`
// Estimated: `52645`
// Minimum execution time: 40_860_000 picoseconds.
Weight::from_parts(41_720_000, 0)
// Minimum execution time: 40_585_000 picoseconds.
Weight::from_parts(41_714_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_16_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `435`
// Measured: `505`
// Estimated: `52645`
// Minimum execution time: 75_743_000 picoseconds.
Weight::from_parts(76_862_000, 0)
// Minimum execution time: 71_197_000 picoseconds.
Weight::from_parts(73_983_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_single_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 30_195_000 picoseconds.
Weight::from_parts(31_047_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
// Measured: `376`
// Estimated: `3841`
// Minimum execution time: 30_823_000 picoseconds.
Weight::from_parts(31_501_000, 0)
.saturating_add(Weight::from_parts(0, 3841))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 30_410_000 picoseconds.
Weight::from_parts(31_057_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
// Measured: `376`
// Estimated: `3841`
// Minimum execution time: 30_854_000 picoseconds.
Weight::from_parts(31_663_000, 0)
.saturating_add(Weight::from_parts(0, 3841))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:2 w:2)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
// Proof Size summary in bytes:
// Measured: `339`
// Measured: `376`
// Estimated: `6086`
// Minimum execution time: 33_096_000 picoseconds.
Weight::from_parts(33_710_000, 0)
// Minimum execution time: 33_463_000 picoseconds.
Weight::from_parts(34_290_000, 0)
.saturating_add(Weight::from_parts(0, 6086))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWococoToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `BridgeWococoToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWococoToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
@@ -228,15 +228,17 @@ impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `635`
// Measured: `739`
// Estimated: `52645`
// Minimum execution time: 63_158_000 picoseconds.
Weight::from_parts(63_769_302, 0)
// Minimum execution time: 61_523_000 picoseconds.
Weight::from_parts(62_686_055, 0)
.saturating_add(Weight::from_parts(0, 52645))
// Standard Error: 35
.saturating_add(Weight::from_parts(6_896, 0).saturating_mul(i.into()))
// Standard Error: 26
.saturating_add(Weight::from_parts(6_563, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
@@ -1,113 +0,0 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_parachains`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./artifacts/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet=pallet_bridge_parachains
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_parachains.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 `pallet_bridge_parachains`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInfo<T> {
/// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0)
/// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0)
/// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ParasInfo (r:1 w:1)
/// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1)
/// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1)
/// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(_p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 34_759_000 picoseconds.
Weight::from_parts(35_709_034, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0)
/// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0)
/// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ParasInfo (r:1 w:1)
/// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1)
/// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1)
/// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
fn submit_parachain_heads_with_1kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 36_005_000 picoseconds.
Weight::from_parts(36_492_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: BridgeWococoParachain PalletOperatingMode (r:1 w:0)
/// Proof: BridgeWococoParachain PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen)
/// Storage: BridgeWococoGrandpa ImportedHeaders (r:1 w:0)
/// Proof: BridgeWococoGrandpa ImportedHeaders (max_values: Some(1024), max_size: Some(68), added: 1553, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ParasInfo (r:1 w:1)
/// Proof: BridgeWococoParachain ParasInfo (max_values: Some(1), max_size: Some(60), added: 555, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHashes (r:1 w:1)
/// Proof: BridgeWococoParachain ImportedParaHashes (max_values: Some(64), max_size: Some(64), added: 1054, mode: MaxEncodedLen)
/// Storage: BridgeWococoParachain ImportedParaHeads (r:0 w:1)
/// Proof: BridgeWococoParachain ImportedParaHeads (max_values: Some(64), max_size: Some(196), added: 1186, mode: MaxEncodedLen)
fn submit_parachain_heads_with_16kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 62_374_000 picoseconds.
Weight::from_parts(62_977_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_parachains`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -60,12 +60,13 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(_p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `294`
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 31_409_000 picoseconds.
Weight::from_parts(32_561_631, 0)
// Minimum execution time: 31_241_000 picoseconds.
Weight::from_parts(32_488_584, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -82,10 +83,10 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_1kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `294`
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 32_828_000 picoseconds.
Weight::from_parts(33_681_000, 0)
// Minimum execution time: 32_962_000 picoseconds.
Weight::from_parts(33_658_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -102,10 +103,10 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_16kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `294`
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 65_531_000 picoseconds.
Weight::from_parts(66_418_000, 0)
// Minimum execution time: 62_685_000 picoseconds.
Weight::from_parts(64_589_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -0,0 +1,116 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_parachains`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_parachains
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_parachains`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeWestendParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `468`
// Estimated: `2543`
// Minimum execution time: 31_493_000 picoseconds.
Weight::from_parts(32_511_270, 0)
.saturating_add(Weight::from_parts(0, 2543))
// Standard Error: 33_650
.saturating_add(Weight::from_parts(20_764, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeWestendParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_1kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `468`
// Estimated: `2543`
// Minimum execution time: 32_976_000 picoseconds.
Weight::from_parts(33_647_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeWestendParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeWestendParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_16kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `468`
// Estimated: `2543`
// Minimum execution time: 62_898_000 picoseconds.
Weight::from_parts(64_463_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_parachains`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -60,13 +60,16 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(_p: u32, ) -> Weight {
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Measured: `435`
// Estimated: `2543`
// Minimum execution time: 32_627_000 picoseconds.
Weight::from_parts(33_806_957, 0)
// Minimum execution time: 31_573_000 picoseconds.
Weight::from_parts(32_739_400, 0)
.saturating_add(Weight::from_parts(0, 2543))
// Standard Error: 49_518
.saturating_add(Weight::from_parts(5_166, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
@@ -82,10 +85,10 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_1kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Measured: `435`
// Estimated: `2543`
// Minimum execution time: 34_360_000 picoseconds.
Weight::from_parts(35_212_000, 0)
// Minimum execution time: 32_780_000 picoseconds.
Weight::from_parts(33_797_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -102,10 +105,10 @@ impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInf
/// Proof: `BridgeWococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_16kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Measured: `435`
// Estimated: `2543`
// Minimum execution time: 66_678_000 picoseconds.
Weight::from_parts(67_571_000, 0)
// Minimum execution time: 62_847_000 picoseconds.
Weight::from_parts(63_991_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_bridge_relayers`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-t2sp1qqs-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -56,8 +56,8 @@ impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<
// Proof Size summary in bytes:
// Measured: `207`
// Estimated: `3593`
// Minimum execution time: 46_239_000 picoseconds.
Weight::from_parts(47_442_000, 0)
// Minimum execution time: 45_338_000 picoseconds.
Weight::from_parts(45_836_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
@@ -72,8 +72,8 @@ impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<
// Proof Size summary in bytes:
// Measured: `61`
// Estimated: `4714`
// Minimum execution time: 23_977_000 picoseconds.
Weight::from_parts(24_837_000, 0)
// Minimum execution time: 23_561_000 picoseconds.
Weight::from_parts(24_012_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
@@ -86,8 +86,8 @@ impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `4714`
// Minimum execution time: 25_798_000 picoseconds.
Weight::from_parts(26_495_000, 0)
// Minimum execution time: 25_133_000 picoseconds.
Weight::from_parts(25_728_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
@@ -102,8 +102,8 @@ impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<
// Proof Size summary in bytes:
// Measured: `263`
// Estimated: `4714`
// Minimum execution time: 27_382_000 picoseconds.
Weight::from_parts(27_936_000, 0)
// Minimum execution time: 27_356_000 picoseconds.
Weight::from_parts(27_828_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
@@ -114,8 +114,8 @@ impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<
// Proof Size summary in bytes:
// Measured: `6`
// Estimated: `3538`
// Minimum execution time: 2_944_000 picoseconds.
Weight::from_parts(3_093_000, 0)
// Minimum execution time: 2_955_000 picoseconds.
Weight::from_parts(3_084_000, 0)
.saturating_add(Weight::from_parts(0, 3538))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::fungible`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-09-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-nbnwcyh-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
@@ -54,8 +54,8 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `101`
// Estimated: `3593`
// Minimum execution time: 23_601_000 picoseconds.
Weight::from_parts(24_226_000, 3593)
// Minimum execution time: 19_037_000 picoseconds.
Weight::from_parts(19_602_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -65,15 +65,19 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `153`
// Estimated: `6196`
// Minimum execution time: 51_043_000 picoseconds.
Weight::from_parts(52_326_000, 6196)
// Minimum execution time: 43_115_000 picoseconds.
Weight::from_parts(43_897_000, 6196)
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
// Storage: `System::Account` (r:2 w:2)
// Storage: `System::Account` (r:3 w:3)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -86,12 +90,12 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn transfer_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `260`
// Estimated: `6196`
// Minimum execution time: 75_639_000 picoseconds.
Weight::from_parts(76_736_000, 6196)
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(4))
// Measured: `294`
// Estimated: `8799`
// Minimum execution time: 90_267_000 picoseconds.
Weight::from_parts(91_460_000, 8799)
.saturating_add(T::DbWeight::get().reads(11))
.saturating_add(T::DbWeight::get().writes(5))
}
// Storage: `Benchmark::Override` (r:0 w:0)
// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
@@ -102,33 +106,39 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight::from_parts(18_446_744_073_709_551_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn initiate_reserve_withdraw() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 31_190_000 picoseconds.
Weight::from_parts(32_150_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `242`
// Estimated: `6196`
// Minimum execution time: 60_477_000 picoseconds.
Weight::from_parts(61_314_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn receive_teleported_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_603_000 picoseconds.
Weight::from_parts(3_721_000, 0)
// Minimum execution time: 2_996_000 picoseconds.
Weight::from_parts(3_107_000, 0)
}
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
@@ -136,15 +146,19 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `52`
// Estimated: `3593`
// Minimum execution time: 24_265_000 picoseconds.
Weight::from_parts(25_004_000, 3593)
// Minimum execution time: 18_907_000 picoseconds.
Weight::from_parts(19_475_000, 3593)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
// Storage: `System::Account` (r:1 w:1)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -157,32 +171,38 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn deposit_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `159`
// Estimated: `3624`
// Minimum execution time: 51_882_000 picoseconds.
Weight::from_parts(53_228_000, 3624)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
// Measured: `193`
// Estimated: `6196`
// Minimum execution time: 59_143_000 picoseconds.
Weight::from_parts(60_316_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:1 w:1)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn initiate_teleport() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 32_195_000 picoseconds.
Weight::from_parts(33_206_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `141`
// Estimated: `3606`
// Minimum execution time: 44_459_000 picoseconds.
Weight::from_parts(45_365_000, 3606)
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -17,28 +17,26 @@
//! Autogenerated weights for `pallet_xcm_benchmarks::generic`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// target/production/polkadot-parachain
// benchmark
// pallet
// --template=./templates/xcm-bench-template.hbs
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_xcm_benchmarks::generic
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_xcm_benchmarks::generic
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --template=./cumulus/templates/xcm-bench-template.hbs
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -50,122 +48,134 @@ use sp_std::marker::PhantomData;
/// Weights for `pallet_xcm_benchmarks::generic`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo<T> {
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_holding() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 37_350_000 picoseconds.
Weight::from_parts(38_105_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `242`
// Estimated: `6196`
// Minimum execution time: 62_732_000 picoseconds.
Weight::from_parts(64_581_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn buy_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_042_000 picoseconds.
Weight::from_parts(3_117_000, 0)
// Minimum execution time: 1_987_000 picoseconds.
Weight::from_parts(2_107_000, 0)
}
// Storage: `PolkadotXcm::Queries` (r:1 w:0)
// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
pub fn query_response() -> Weight {
// Proof Size summary in bytes:
// Measured: `69`
// Estimated: `3534`
// Minimum execution time: 11_037_000 picoseconds.
Weight::from_parts(11_465_000, 3534)
// Measured: `103`
// Estimated: `3568`
// Minimum execution time: 8_098_000 picoseconds.
Weight::from_parts(8_564_000, 3568)
.saturating_add(T::DbWeight::get().reads(1))
}
pub fn transact() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 12_359_000 picoseconds.
Weight::from_parts(12_741_000, 0)
// Minimum execution time: 8_539_000 picoseconds.
Weight::from_parts(9_085_000, 0)
}
pub fn refund_surplus() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_165_000 picoseconds.
Weight::from_parts(3_295_000, 0)
// Minimum execution time: 2_205_000 picoseconds.
Weight::from_parts(2_369_000, 0)
}
pub fn set_error_handler() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_847_000 picoseconds.
Weight::from_parts(2_893_000, 0)
// Minimum execution time: 1_828_000 picoseconds.
Weight::from_parts(1_994_000, 0)
}
pub fn set_appendix() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_847_000 picoseconds.
Weight::from_parts(2_936_000, 0)
// Minimum execution time: 1_869_000 picoseconds.
Weight::from_parts(1_946_000, 0)
}
pub fn clear_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_856_000 picoseconds.
Weight::from_parts(2_933_000, 0)
// Minimum execution time: 1_842_000 picoseconds.
Weight::from_parts(1_949_000, 0)
}
pub fn descend_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_635_000 picoseconds.
Weight::from_parts(3_710_000, 0)
// Minimum execution time: 2_460_000 picoseconds.
Weight::from_parts(2_593_000, 0)
}
pub fn clear_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_822_000 picoseconds.
Weight::from_parts(2_899_000, 0)
// Minimum execution time: 1_868_000 picoseconds.
Weight::from_parts(2_003_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 29_399_000 picoseconds.
Weight::from_parts(30_284_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `242`
// Estimated: `6196`
// Minimum execution time: 56_813_000 picoseconds.
Weight::from_parts(57_728_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1)
// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`)
pub fn claim_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `126`
// Estimated: `3591`
// Minimum execution time: 16_173_000 picoseconds.
Weight::from_parts(16_576_000, 3591)
// Measured: `160`
// Estimated: `3625`
// Minimum execution time: 11_364_000 picoseconds.
Weight::from_parts(11_872_000, 3625)
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -173,11 +183,13 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_882_000 picoseconds.
Weight::from_parts(3_017_000, 0)
// Minimum execution time: 1_821_000 picoseconds.
Weight::from_parts(1_936_000, 0)
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1)
// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
@@ -190,11 +202,11 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn subscribe_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 29_839_000 picoseconds.
Weight::from_parts(30_519_000, 3540)
.saturating_add(T::DbWeight::get().reads(6))
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 23_081_000 picoseconds.
Weight::from_parts(23_512_000, 3574)
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
// Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1)
@@ -203,147 +215,163 @@ impl<T: frame_system::Config> WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_806_000 picoseconds.
Weight::from_parts(5_042_000, 0)
// Minimum execution time: 3_747_000 picoseconds.
Weight::from_parts(4_068_000, 0)
.saturating_add(T::DbWeight::get().writes(1))
}
pub fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_407_000 picoseconds.
Weight::from_parts(4_548_000, 0)
// Minimum execution time: 3_045_000 picoseconds.
Weight::from_parts(3_208_000, 0)
}
pub fn expect_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_930_000 picoseconds.
Weight::from_parts(3_042_000, 0)
// Minimum execution time: 1_962_000 picoseconds.
Weight::from_parts(2_284_000, 0)
}
pub fn expect_origin() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_915_000 picoseconds.
Weight::from_parts(3_052_000, 0)
// Minimum execution time: 1_951_000 picoseconds.
Weight::from_parts(2_026_000, 0)
}
pub fn expect_error() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_823_000 picoseconds.
Weight::from_parts(2_912_000, 0)
// Minimum execution time: 1_837_000 picoseconds.
Weight::from_parts(2_084_000, 0)
}
pub fn expect_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_119_000 picoseconds.
Weight::from_parts(3_205_000, 0)
// Minimum execution time: 2_042_000 picoseconds.
Weight::from_parts(2_145_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn query_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 33_394_000 picoseconds.
Weight::from_parts(34_497_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `242`
// Estimated: `6196`
// Minimum execution time: 61_350_000 picoseconds.
Weight::from_parts(62_440_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn expect_pallet() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_471_000 picoseconds.
Weight::from_parts(5_640_000, 0)
// Minimum execution time: 4_993_000 picoseconds.
Weight::from_parts(5_309_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `System::Account` (r:2 w:2)
// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
pub fn report_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `3572`
// Minimum execution time: 29_932_000 picoseconds.
Weight::from_parts(30_478_000, 3572)
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
// Measured: `242`
// Estimated: `6196`
// Minimum execution time: 57_133_000 picoseconds.
Weight::from_parts(58_100_000, 6196)
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
pub fn clear_transact_status() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_807_000 picoseconds.
Weight::from_parts(2_941_000, 0)
// Minimum execution time: 1_899_000 picoseconds.
Weight::from_parts(2_153_000, 0)
}
pub fn set_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_785_000 picoseconds.
Weight::from_parts(2_894_000, 0)
// Minimum execution time: 1_880_000 picoseconds.
Weight::from_parts(1_960_000, 0)
}
pub fn clear_topic() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_844_000 picoseconds.
Weight::from_parts(2_943_000, 0)
// Minimum execution time: 1_825_000 picoseconds.
Weight::from_parts(1_960_000, 0)
}
// Storage: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Proof: UNKNOWN KEY `0x48297505634037ef48c848c99c0b1f1b` (r:1 w:0)
// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
// Storage: `BridgeWococoMessages::PalletOperatingMode` (r:1 w:0)
// Proof: `BridgeWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
// Storage: `BridgeWococoMessages::OutboundLanes` (r:1 w:1)
// Proof: `BridgeWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
// Storage: `BridgeWococoMessages::OutboundMessages` (r:0 w:1)
// Proof: `BridgeWococoMessages::OutboundMessages` (`max_values`: None, `max_size`: Some(2621472), added: 2623947, mode: `MaxEncodedLen`)
// Storage: `BridgeRococoToWococoMessages::PalletOperatingMode` (r:1 w:0)
// Proof: `BridgeRococoToWococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
// Storage: `BridgeRococoToWococoMessages::OutboundLanes` (r:1 w:1)
// Proof: `BridgeRococoToWococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
// Storage: `BridgeRococoToWococoMessages::OutboundLanesCongestedSignals` (r:1 w:0)
// Proof: `BridgeRococoToWococoMessages::OutboundLanesCongestedSignals` (`max_values`: Some(1), `max_size`: Some(21), added: 516, mode: `MaxEncodedLen`)
// Storage: `BridgeRococoToWococoMessages::OutboundMessages` (r:0 w:1)
// Proof: `BridgeRococoToWococoMessages::OutboundMessages` (`max_values`: None, `max_size`: Some(2621472), added: 2623947, mode: `MaxEncodedLen`)
/// The range of component `x` is `[1, 1000]`.
pub fn export_message(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `95`
// Estimated: `1529`
// Minimum execution time: 28_427_000 picoseconds.
Weight::from_parts(28_755_860, 1529)
// Standard Error: 383
.saturating_add(Weight::from_parts(393_744, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(3))
// Measured: `139`
// Estimated: `3604`
// Minimum execution time: 28_419_000 picoseconds.
Weight::from_parts(29_387_791, 3604)
// Standard Error: 552
.saturating_add(Weight::from_parts(316_277, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
pub fn set_fees_mode() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_781_000 picoseconds.
Weight::from_parts(2_907_000, 0)
// Minimum execution time: 1_903_000 picoseconds.
Weight::from_parts(2_023_000, 0)
}
pub fn unpaid_execution() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 3_001_000 picoseconds.
Weight::from_parts(3_117_000, 0)
// Minimum execution time: 1_963_000 picoseconds.
Weight::from_parts(2_143_000, 0)
}
}
@@ -19,19 +19,9 @@ use super::{
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeFlavor, RuntimeOrigin,
TransactionByteFee, WeightToFee, XcmpQueue,
};
use crate::{
bridge_common_config::{
BridgeGrandpaRococoInstance, BridgeGrandpaWococoInstance, DeliveryRewardInBalance,
RequiredStakeForStakeAndSlash,
},
bridge_hub_rococo_config::{
AssetHubRococoParaId, BridgeHubWococoChainId, BridgeHubWococoMessagesLane,
ToBridgeHubWococoHaulBlobExporter, WococoGlobalConsensusNetwork,
},
bridge_hub_wococo_config::{
AssetHubWococoParaId, BridgeHubRococoChainId, BridgeHubRococoMessagesLane,
RococoGlobalConsensusNetwork, ToBridgeHubRococoHaulBlobExporter,
},
use crate::bridge_common_config::{
BridgeGrandpaRococoInstance, BridgeGrandpaWestendInstance, BridgeGrandpaWococoInstance,
DeliveryRewardInBalance, RequiredStakeForStakeAndSlash,
};
use bp_messages::LaneId;
use bp_relayers::{PayRewardFromAccount, RewardsAccountOwner, RewardsAccountParams};
@@ -65,7 +55,7 @@ use xcm_builder::{
XcmFeeToAccount,
};
use xcm_executor::{
traits::{ExportXcm, FeeReason, TransactAsset, WithOriginFilter},
traits::{FeeReason, TransactAsset, WithOriginFilter},
XcmExecutor,
};
@@ -213,6 +203,10 @@ impl Contains<RuntimeCall> for SafeCallFilter {
Runtime,
BridgeGrandpaRococoInstance,
>::initialize { .. }) |
RuntimeCall::BridgeWestendGrandpa(pallet_bridge_grandpa::Call::<
Runtime,
BridgeGrandpaWestendInstance,
>::initialize { .. }) |
RuntimeCall::BridgeWococoGrandpa(pallet_bridge_grandpa::Call::<
Runtime,
BridgeGrandpaWococoInstance,
@@ -306,22 +300,33 @@ impl xcm_executor::Config for XcmConfig {
(
XcmExportFeeToRelayerRewardAccounts<
Self::AssetTransactor,
WococoGlobalConsensusNetwork,
AssetHubWococoParaId,
BridgeHubWococoChainId,
BridgeHubWococoMessagesLane,
crate::bridge_to_wococo_config::WococoGlobalConsensusNetwork,
crate::bridge_to_wococo_config::AssetHubWococoParaId,
crate::bridge_to_wococo_config::BridgeHubWococoChainId,
crate::bridge_to_wococo_config::AssetHubRococoToAssetHubWococoMessagesLane,
>,
XcmExportFeeToRelayerRewardAccounts<
Self::AssetTransactor,
RococoGlobalConsensusNetwork,
AssetHubRococoParaId,
BridgeHubRococoChainId,
BridgeHubRococoMessagesLane,
crate::bridge_to_westend_config::WestendGlobalConsensusNetwork,
crate::bridge_to_westend_config::AssetHubWestendParaId,
crate::bridge_to_westend_config::BridgeHubWestendChainId,
crate::bridge_to_westend_config::AssetHubRococoToAssetHubWestendMessagesLane,
>,
XcmExportFeeToRelayerRewardAccounts<
Self::AssetTransactor,
crate::bridge_to_rococo_config::RococoGlobalConsensusNetwork,
crate::bridge_to_rococo_config::AssetHubRococoParaId,
crate::bridge_to_rococo_config::BridgeHubRococoChainId,
crate::bridge_to_rococo_config::AssetHubWococoToAssetHubRococoMessagesLane,
>,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
),
>;
type MessageExporter = BridgeHubRococoOrBridgeHubWococoSwitchExporter;
type MessageExporter = (
crate::bridge_to_westend_config::ToBridgeHubWestendHaulBlobExporter,
crate::bridge_to_wococo_config::ToBridgeHubWococoHaulBlobExporter,
crate::bridge_to_rococo_config::ToBridgeHubRococoHaulBlobExporter,
);
type UniversalAliases = Nothing;
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
@@ -388,50 +393,6 @@ impl cumulus_pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
}
/// Hacky switch implementation, because we have just one runtime for Rococo and Wococo BridgeHub,
/// so it means we have just one XcmConfig
pub struct BridgeHubRococoOrBridgeHubWococoSwitchExporter;
impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter {
type Ticket = (NetworkId, (sp_std::prelude::Vec<u8>, XcmHash));
fn validate(
network: NetworkId,
channel: u32,
universal_source: &mut Option<InteriorMultiLocation>,
destination: &mut Option<InteriorMultiLocation>,
message: &mut Option<Xcm<()>>,
) -> SendResult<Self::Ticket> {
match network {
Rococo => ToBridgeHubRococoHaulBlobExporter::validate(
network,
channel,
universal_source,
destination,
message,
)
.map(|result| ((Rococo, result.0), result.1)),
Wococo => ToBridgeHubWococoHaulBlobExporter::validate(
network,
channel,
universal_source,
destination,
message,
)
.map(|result| ((Wococo, result.0), result.1)),
_ => unimplemented!("Unsupported network: {:?}", network),
}
}
fn deliver(ticket: Self::Ticket) -> Result<XcmHash, SendError> {
let (network, ticket) = ticket;
match network {
Rococo => ToBridgeHubRococoHaulBlobExporter::deliver(ticket),
Wococo => ToBridgeHubWococoHaulBlobExporter::deliver(ticket),
_ => unimplemented!("Unsupported network: {:?}", network),
}
}
}
/// A `HandleFee` implementation that simply deposits the fees for `ExportMessage` XCM instructions
/// into the accounts that are used for paying the relayer rewards.
/// Burns the fees in case of a failure.
@@ -439,22 +400,22 @@ pub struct XcmExportFeeToRelayerRewardAccounts<
AssetTransactor,
DestNetwork,
DestParaId,
DestBridgeHubId,
DestBridgedChainId,
BridgeLaneId,
>(PhantomData<(AssetTransactor, DestNetwork, DestParaId, DestBridgeHubId, BridgeLaneId)>);
>(PhantomData<(AssetTransactor, DestNetwork, DestParaId, DestBridgedChainId, BridgeLaneId)>);
impl<
AssetTransactor: TransactAsset,
DestNetwork: Get<NetworkId>,
DestParaId: Get<cumulus_primitives_core::ParaId>,
DestBridgeHubId: Get<ChainId>,
DestBridgedChainId: Get<ChainId>,
BridgeLaneId: Get<LaneId>,
> HandleFee
for XcmExportFeeToRelayerRewardAccounts<
AssetTransactor,
DestNetwork,
DestParaId,
DestBridgeHubId,
DestBridgedChainId,
BridgeLaneId,
>
{
@@ -478,7 +439,7 @@ impl<
AccountId,
>::rewards_account(RewardsAccountParams::new(
BridgeLaneId::get(),
DestBridgeHubId::get(),
DestBridgedChainId::get(),
RewardsAccountOwner::ThisChain,
));
@@ -487,7 +448,7 @@ impl<
AccountId,
>::rewards_account(RewardsAccountParams::new(
BridgeLaneId::get(),
DestBridgeHubId::get(),
DestBridgedChainId::get(),
RewardsAccountOwner::BridgedChain,
));
@@ -18,7 +18,8 @@
use bp_polkadot_core::Signature;
use bridge_hub_rococo_runtime::{
bridge_common_config, bridge_hub_rococo_config, bridge_hub_wococo_config,
bridge_common_config, bridge_to_rococo_config, bridge_to_westend_config,
bridge_to_wococo_config,
xcm_config::{RelayNetwork, TokenLocation, XcmConfig},
AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages, Executive, ExistentialDeposit,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, SessionKeys, SignedExtra,
@@ -57,8 +58,9 @@ fn construct_extrinsic(
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
BridgeRejectObsoleteHeadersAndMessages::default(),
(
bridge_hub_wococo_config::BridgeRefundBridgeHubRococoMessages::default(),
bridge_hub_rococo_config::BridgeRefundBridgeHubWococoMessages::default(),
bridge_to_wococo_config::OnBridgeHubRococoRefundBridgeHubWococoMessages::default(),
bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages::default(),
bridge_to_rococo_config::OnBridgeHubWococoRefundBridgeHubRococoMessages::default(),
),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
@@ -96,12 +98,17 @@ fn collator_session_keys() -> bridge_hub_test_utils::CollatorSessionKeys<Runtime
mod bridge_hub_rococo_tests {
use super::*;
use bridge_common_config::{
BridgeGrandpaWococoInstance, BridgeParachainWococoInstance, DeliveryRewardInBalance,
RequiredStakeForStakeAndSlash,
BridgeGrandpaWestendInstance, BridgeGrandpaWococoInstance, BridgeParachainWestendInstance,
BridgeParachainWococoInstance, DeliveryRewardInBalance, RequiredStakeForStakeAndSlash,
};
use bridge_hub_rococo_config::{
WithBridgeHubWococoMessageBridge, WithBridgeHubWococoMessagesInstance,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
use bridge_to_westend_config::{
BridgeHubWestendChainId, WestendGlobalConsensusNetwork, WithBridgeHubWestendMessageBridge,
WithBridgeHubWestendMessagesInstance, XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
};
use bridge_to_wococo_config::{
BridgeHubWococoChainId, WithBridgeHubWococoMessageBridge,
WithBridgeHubWococoMessagesInstance, WococoGlobalConsensusNetwork,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
};
bridge_hub_test_utils::test_cases::include_teleports_for_native_asset_works!(
@@ -130,6 +137,7 @@ mod bridge_hub_rococo_tests {
#[test]
fn initialize_bridge_by_governance_works() {
// for Wococo finality
bridge_hub_test_utils::test_cases::initialize_bridge_by_governance_works::<
Runtime,
BridgeGrandpaWococoInstance,
@@ -137,6 +145,15 @@ mod bridge_hub_rococo_tests {
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
Box::new(|call| RuntimeCall::BridgeWococoGrandpa(call).encode()),
);
// for Westend finality
bridge_hub_test_utils::test_cases::initialize_bridge_by_governance_works::<
Runtime,
BridgeGrandpaWestendInstance,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
Box::new(|call| RuntimeCall::BridgeWestendGrandpa(call).encode()),
)
}
@@ -177,6 +194,7 @@ mod bridge_hub_rococo_tests {
#[test]
fn handle_export_message_from_system_parachain_add_to_outbound_queue_works() {
// for Wococo
bridge_hub_test_utils::test_cases::handle_export_message_from_system_parachain_to_outbound_queue_works::<
Runtime,
XcmConfig,
@@ -187,12 +205,34 @@ mod bridge_hub_rococo_tests {
SIBLING_PARACHAIN_ID,
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::BridgeRococoToWococoMessages(event)) => Some(event),
Ok(RuntimeEvent::BridgeWococoMessages(event)) => Some(event),
_ => None,
}
}),
|| ExportMessage { network: Wococo, destination: X1(Parachain(1234)), xcm: Xcm(vec![]) },
bridge_hub_rococo_config::DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
Some((TokenLocation::get(), ExistentialDeposit::get()).into()),
// value should be >= than value generated by `can_calculate_weight_for_paid_export_message_with_reserve_transfer`
Some((TokenLocation::get(), bp_asset_hub_rococo::BridgeHubRococoBaseFeeInRocs::get()).into()),
|| (),
);
// for Westend
bridge_hub_test_utils::test_cases::handle_export_message_from_system_parachain_to_outbound_queue_works::<
Runtime,
XcmConfig,
WithBridgeHubWestendMessagesInstance,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::BridgeWestendMessages(event)) => Some(event),
_ => None,
}
}),
|| ExportMessage { network: Westend, destination: X1(Parachain(1234)), xcm: Xcm(vec![]) },
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
Some((TokenLocation::get(), ExistentialDeposit::get()).into()),
// value should be >= than value generated by `can_calculate_weight_for_paid_export_message_with_reserve_transfer`
Some((TokenLocation::get(), bp_asset_hub_rococo::BridgeHubRococoBaseFeeInRocs::get()).into()),
@@ -202,6 +242,7 @@ mod bridge_hub_rococo_tests {
#[test]
fn message_dispatch_routing_works() {
// from Wococo
bridge_hub_test_utils::test_cases::message_dispatch_routing_works::<
Runtime,
AllPalletsWithoutSystem,
@@ -209,7 +250,7 @@ mod bridge_hub_rococo_tests {
ParachainSystem,
WithBridgeHubWococoMessagesInstance,
RelayNetwork,
bridge_hub_rococo_config::WococoGlobalConsensusNetwork,
WococoGlobalConsensusNetwork,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
@@ -226,13 +267,42 @@ mod bridge_hub_rococo_tests {
_ => None,
}
}),
bridge_hub_rococo_config::DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
|| (),
);
// from Westend
bridge_hub_test_utils::test_cases::message_dispatch_routing_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
WithBridgeHubWococoMessagesInstance,
RelayNetwork,
WestendGlobalConsensusNetwork,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::ParachainSystem(event)) => Some(event),
_ => None,
}
}),
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::XcmpQueue(event)) => Some(event),
_ => None,
}
}),
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
|| (),
)
}
#[test]
fn relayed_incoming_message_works() {
// from Wococo
bridge_hub_test_utils::test_cases::relayed_incoming_message_works::<
Runtime,
AllPalletsWithoutSystem,
@@ -248,13 +318,33 @@ mod bridge_hub_rococo_tests {
bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
Rococo,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
|| (),
);
// from Westend
bridge_hub_test_utils::test_cases::relayed_incoming_message_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
BridgeGrandpaWestendInstance,
BridgeParachainWestendInstance,
WithBridgeHubWestendMessagesInstance,
WithBridgeHubWestendMessageBridge,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
Rococo,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
|| (),
)
}
#[test]
pub fn complex_relay_extrinsic_works() {
// for Wococo
bridge_hub_test_utils::test_cases::complex_relay_extrinsic_works::<
Runtime,
AllPalletsWithoutSystem,
@@ -269,9 +359,32 @@ mod bridge_hub_rococo_tests {
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
bridge_hub_rococo_config::BridgeHubWococoChainId::get(),
BridgeHubWococoChainId::get(),
Rococo,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WOCOCO,
ExistentialDeposit::get(),
executive_init_block,
construct_and_apply_extrinsic,
|| (),
);
// for Westend
bridge_hub_test_utils::test_cases::complex_relay_extrinsic_works::<
Runtime,
AllPalletsWithoutSystem,
XcmConfig,
ParachainSystem,
BridgeGrandpaWestendInstance,
BridgeParachainWestendInstance,
WithBridgeHubWestendMessagesInstance,
WithBridgeHubWestendMessageBridge,
>(
collator_session_keys(),
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
BridgeHubWestendChainId::get(),
Rococo,
XCM_LANE_FOR_ASSET_HUB_ROCOCO_TO_ASSET_HUB_WESTEND,
ExistentialDeposit::get(),
executive_init_block,
construct_and_apply_extrinsic,
@@ -305,9 +418,9 @@ mod bridge_hub_wococo_tests {
RequiredStakeForStakeAndSlash,
};
use bridge_hub_rococo_runtime::{xcm_config, AllPalletsWithoutSystem, RuntimeFlavor};
use bridge_hub_wococo_config::{
WithBridgeHubRococoMessageBridge, WithBridgeHubRococoMessagesInstance,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
use bridge_to_rococo_config::{
BridgeHubRococoChainId, RococoGlobalConsensusNetwork, WithBridgeHubRococoMessageBridge,
WithBridgeHubRococoMessagesInstance, XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
};
use frame_support::assert_ok;
@@ -419,12 +532,12 @@ mod bridge_hub_wococo_tests {
SIBLING_PARACHAIN_ID,
Box::new(|runtime_event_encoded: Vec<u8>| {
match RuntimeEvent::decode(&mut &runtime_event_encoded[..]) {
Ok(RuntimeEvent::BridgeWococoToRococoMessages(event)) => Some(event),
Ok(RuntimeEvent::BridgeRococoMessages(event)) => Some(event),
_ => None,
}
}),
|| ExportMessage { network: Rococo, destination: X1(Parachain(4321)), xcm: Xcm(vec![]) },
bridge_hub_wococo_config::DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
Some((TokenLocation::get(), ExistentialDeposit::get()).into()),
// value should be >= than value generated by `can_calculate_weight_for_paid_export_message_with_reserve_transfer`
Some((TokenLocation::get(), bp_asset_hub_wococo::BridgeHubWococoBaseFeeInWocs::get()).into()),
@@ -441,7 +554,7 @@ mod bridge_hub_wococo_tests {
ParachainSystem,
WithBridgeHubRococoMessagesInstance,
RelayNetwork,
bridge_hub_wococo_config::RococoGlobalConsensusNetwork,
RococoGlobalConsensusNetwork,
>(
collator_session_keys(),
bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID,
@@ -458,7 +571,7 @@ mod bridge_hub_wococo_tests {
_ => None,
}
}),
bridge_hub_wococo_config::DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
set_wococo_flavor,
)
}
@@ -480,7 +593,7 @@ mod bridge_hub_wococo_tests {
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
Wococo,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
set_wococo_flavor,
)
}
@@ -501,9 +614,9 @@ mod bridge_hub_wococo_tests {
bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID,
bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID,
SIBLING_PARACHAIN_ID,
bridge_hub_wococo_config::BridgeHubRococoChainId::get(),
BridgeHubRococoChainId::get(),
Wococo,
DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO,
XCM_LANE_FOR_ASSET_HUB_WOCOCO_TO_ASSET_HUB_ROCOCO,
ExistentialDeposit::get(),
executive_init_block,
construct_and_apply_extrinsic,
@@ -0,0 +1,239 @@
[package]
name = "bridge-hub-westend-runtime"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
description = "Westend's BridgeHub parachain runtime"
license = "Apache-2.0"
[build-dependencies]
substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder", optional = true }
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
hex-literal = { version = "0.4.1" }
log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.188", optional = true, features = ["derive"] }
smallvec = "1.11.0"
# Substrate
frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true}
frame-executive = { path = "../../../../../substrate/frame/executive", default-features = false}
frame-support = { path = "../../../../../substrate/frame/support", default-features = false}
frame-system = { path = "../../../../../substrate/frame/system", default-features = false}
frame-system-benchmarking = { path = "../../../../../substrate/frame/system/benchmarking", default-features = false, optional = true}
frame-system-rpc-runtime-api = { path = "../../../../../substrate/frame/system/rpc/runtime-api", default-features = false}
frame-try-runtime = { path = "../../../../../substrate/frame/try-runtime", default-features = false, optional = true}
pallet-aura = { path = "../../../../../substrate/frame/aura", default-features = false}
pallet-authorship = { path = "../../../../../substrate/frame/authorship", default-features = false}
pallet-balances = { path = "../../../../../substrate/frame/balances", default-features = false}
pallet-session = { path = "../../../../../substrate/frame/session", default-features = false}
pallet-multisig = { path = "../../../../../substrate/frame/multisig", default-features = false}
pallet-timestamp = { path = "../../../../../substrate/frame/timestamp", default-features = false}
pallet-transaction-payment = { path = "../../../../../substrate/frame/transaction-payment", default-features = false}
pallet-transaction-payment-rpc-runtime-api = { path = "../../../../../substrate/frame/transaction-payment/rpc/runtime-api", default-features = false}
pallet-utility = { path = "../../../../../substrate/frame/utility", default-features = false}
sp-api = { path = "../../../../../substrate/primitives/api", default-features = false}
sp-block-builder = { path = "../../../../../substrate/primitives/block-builder", default-features = false}
sp-consensus-aura = { path = "../../../../../substrate/primitives/consensus/aura", default-features = false}
sp-core = { path = "../../../../../substrate/primitives/core", default-features = false}
sp-genesis-builder = { path = "../../../../../substrate/primitives/genesis-builder", default-features = false }
sp-inherents = { path = "../../../../../substrate/primitives/inherents", default-features = false}
sp-io = { path = "../../../../../substrate/primitives/io", default-features = false}
sp-offchain = { path = "../../../../../substrate/primitives/offchain", default-features = false}
sp-runtime = { path = "../../../../../substrate/primitives/runtime", default-features = false}
sp-session = { path = "../../../../../substrate/primitives/session", default-features = false}
sp-std = { path = "../../../../../substrate/primitives/std", default-features = false}
sp-storage = { path = "../../../../../substrate/primitives/storage", default-features = false}
sp-transaction-pool = { path = "../../../../../substrate/primitives/transaction-pool", default-features = false}
sp-version = { path = "../../../../../substrate/primitives/version", default-features = false}
# Polkadot
westend-runtime-constants = { path = "../../../../../polkadot/runtime/westend/constants", default-features = false}
pallet-xcm = { path = "../../../../../polkadot/xcm/pallet-xcm", default-features = false}
pallet-xcm-benchmarks = { path = "../../../../../polkadot/xcm/pallet-xcm-benchmarks", default-features = false, optional = true }
polkadot-core-primitives = { path = "../../../../../polkadot/core-primitives", default-features = false}
polkadot-parachain-primitives = { path = "../../../../../polkadot/parachain", default-features = false}
polkadot-runtime-common = { path = "../../../../../polkadot/runtime/common", default-features = false}
xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm", default-features = false}
xcm-builder = { package = "staging-xcm-builder", path = "../../../../../polkadot/xcm/xcm-builder", default-features = false}
xcm-executor = { package = "staging-xcm-executor", path = "../../../../../polkadot/xcm/xcm-executor", default-features = false}
# Cumulus
cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false }
cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false }
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] }
cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false}
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false, features = ["bridging"] }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }
# Bridges
bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-hub-westend", default-features = false }
bp-bridge-hub-rococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
bp-bridge-hub-westend = { path = "../../../../../bridges/primitives/chain-bridge-hub-westend", default-features = false }
bp-header-chain = { path = "../../../../../bridges/primitives/header-chain", default-features = false }
bp-messages = { path = "../../../../../bridges/primitives/messages", default-features = false }
bp-parachains = { path = "../../../../../bridges/primitives/parachains", default-features = false }
bp-polkadot-core = { path = "../../../../../bridges/primitives/polkadot-core", default-features = false }
bp-relayers = { path = "../../../../../bridges/primitives/relayers", default-features = false }
bp-runtime = { path = "../../../../../bridges/primitives/runtime", default-features = false }
bp-rococo = { path = "../../../../../bridges/primitives/chain-rococo", default-features = false }
bp-westend = { path = "../../../../../bridges/primitives/chain-westend", default-features = false }
pallet-bridge-grandpa = { path = "../../../../../bridges/modules/grandpa", default-features = false }
pallet-bridge-messages = { path = "../../../../../bridges/modules/messages", default-features = false }
pallet-bridge-parachains = { path = "../../../../../bridges/modules/parachains", default-features = false }
pallet-bridge-relayers = { path = "../../../../../bridges/modules/relayers", default-features = false }
bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", default-features = false }
[dev-dependencies]
static_assertions = "1.1"
bridge-hub-test-utils = { path = "../test-utils" }
bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", features = ["integrity-test"] }
sp-keyring = { path = "../../../../../substrate/primitives/keyring" }
[features]
default = [ "std" ]
std = [
"bp-asset-hub-westend/std",
"bp-bridge-hub-rococo/std",
"bp-bridge-hub-westend/std",
"bp-header-chain/std",
"bp-messages/std",
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-relayers/std",
"bp-rococo/std",
"bp-runtime/std",
"bp-westend/std",
"bridge-runtime-common/std",
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-core/std",
"cumulus-primitives-utility/std",
"frame-benchmarking/std",
"frame-executive/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"frame-try-runtime?/std",
"log/std",
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-parachains/std",
"pallet-bridge-relayers/std",
"pallet-collator-selection/std",
"pallet-multisig/std",
"pallet-session/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
"polkadot-core-primitives/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"scale-info/std",
"serde",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
]
runtime-benchmarks = [
"bridge-runtime-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-primitives-utility/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-parachains/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-dmp-queue/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-bridge-grandpa/try-runtime",
"pallet-bridge-messages/try-runtime",
"pallet-bridge-parachains/try-runtime",
"pallet-bridge-relayers/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-multisig/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]
experimental = [ "pallet-aura/experimental" ]
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = [ "sp-api/disable-logging" ]
@@ -0,0 +1,26 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#[cfg(feature = "std")]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
}
#[cfg(not(feature = "std"))]
fn main() {}
@@ -0,0 +1,50 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Bridge definitions that can be used by multiple BridgeHub flavors.
//! All configurations here should be dedicated to a single chain; in other words, we don't need two
//! chains for a single pallet configuration.
//!
//! For example, the messaging pallet needs to know the sending and receiving chains, but the
//! GRANDPA tracking pallet only needs to be aware of one chain.
use super::{weights, AccountId, Balance, Balances, BlockNumber, Runtime, RuntimeEvent};
use frame_support::parameter_types;
parameter_types! {
pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000;
pub const RelayerStakeLease: u32 = 8;
pub const RelayerStakeReserveId: [u8; 8] = *b"brdgrlrs";
pub storage DeliveryRewardInBalance: u64 = 1_000_000;
}
/// Allows collect and claim rewards for relayers
impl pallet_bridge_relayers::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Reward = Balance;
type PaymentProcedure =
bp_relayers::PayRewardFromAccount<pallet_balances::Pallet<Runtime>, AccountId>;
type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
AccountId,
BlockNumber,
Balances,
RelayerStakeReserveId,
RequiredStakeForStakeAndSlash,
RelayerStakeLease,
>;
type WeightInfo = weights::pallet_bridge_relayers::WeightInfo<Runtime>;
}
@@ -0,0 +1,347 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Bridge definitions used on BridgeHub with the Westend flavor.
use crate::{
bridge_common_config::DeliveryRewardInBalance, weights, AccountId, BridgeRococoMessages,
ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin, XcmRouter,
};
use bp_messages::LaneId;
use bp_parachains::SingleParaStoredHeaderDataBuilder;
use bridge_runtime_common::{
messages,
messages::{
source::{FromBridgedChainMessagesDeliveryProof, TargetHeaderChainAdapter},
target::{FromBridgedChainMessagesProof, SourceHeaderChainAdapter},
MessageBridge, ThisChainWithMessages, UnderlyingChainProvider,
},
messages_xcm_extension::{
SenderAndLane, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter,
XcmBlobMessageDispatch,
},
refund_relayer_extension::{
ActualFeeRefund, RefundBridgedParachainMessages, RefundSignedExtensionAdapter,
RefundableMessagesLane, RefundableParachain,
},
};
use codec::Encode;
use frame_support::{
parameter_types,
traits::{ConstU32, PalletInfoAccess},
};
use sp_runtime::RuntimeDebug;
use xcm::{
latest::prelude::*,
prelude::{InteriorMultiLocation, NetworkId},
};
use xcm_builder::{BridgeBlobDispatcher, HaulBlobExporter};
parameter_types! {
pub const RelayChainHeadersToKeep: u32 = 1024;
pub const ParachainHeadsToKeep: u32 = 64;
pub const RococoBridgeParachainPalletName: &'static str = "Paras";
pub const MaxRococoParaHeadDataSize: u32 = bp_rococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE;
pub const MaxUnrewardedRelayerEntriesAtInboundLane: bp_messages::MessageNonce =
bp_bridge_hub_westend::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
pub const MaxUnconfirmedMessagesAtInboundLane: bp_messages::MessageNonce =
bp_bridge_hub_westend::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
pub const BridgeHubRococoChainId: bp_runtime::ChainId = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID;
pub BridgeHubWestendUniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(Westend), Parachain(ParachainInfo::parachain_id().into()));
pub BridgeWestendToRococoMessagesPalletInstance: InteriorMultiLocation = X1(PalletInstance(<BridgeRococoMessages as PalletInfoAccess>::index() as u8));
pub RococoGlobalConsensusNetwork: NetworkId = NetworkId::Rococo;
pub ActiveOutboundLanesToBridgeHubRococo: &'static [bp_messages::LaneId] = &[XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO];
pub const AssetHubWestendToAssetHubRococoMessagesLane: bp_messages::LaneId = XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO;
// see the `FEE_BOOST_PER_MESSAGE` constant to get the meaning of this value
pub PriorityBoostPerMessage: u64 = 182_044_444_444_444;
pub AssetHubWestendParaId: cumulus_primitives_core::ParaId = bp_asset_hub_westend::ASSET_HUB_WESTEND_PARACHAIN_ID.into();
pub FromAssetHubWestendToAssetHubRococoRoute: SenderAndLane = SenderAndLane::new(
ParentThen(X1(Parachain(AssetHubWestendParaId::get().into()))).into(),
XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO,
);
pub CongestedMessage: Xcm<()> = build_congestion_message(true).into();
pub UncongestedMessage: Xcm<()> = build_congestion_message(false).into();
}
pub const XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO: LaneId = LaneId([0, 0, 0, 2]);
fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instruction<Call>> {
sp_std::vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_westend::Call::ToRococoXcmRouter(
bp_asset_hub_westend::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested,
}
)
.encode()
.into(),
}
]
}
/// Proof of messages, coming from Rococo.
pub type FromRococoBridgeHubMessagesProof =
FromBridgedChainMessagesProof<bp_bridge_hub_rococo::Hash>;
/// Messages delivery proof for Rococo Bridge Hub -> Westend Bridge Hub messages.
pub type ToRococoBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_rococo::Hash>;
/// Dispatches received XCM messages from other bridge
type FromRococoMessageBlobDispatcher = BridgeBlobDispatcher<
XcmRouter,
BridgeHubWestendUniversalLocation,
BridgeWestendToRococoMessagesPalletInstance,
>;
/// Export XCM messages to be relayed to the other side
pub type ToBridgeHubRococoHaulBlobExporter = HaulBlobExporter<
XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>,
RococoGlobalConsensusNetwork,
(),
>;
pub struct ToBridgeHubRococoXcmBlobHauler;
impl XcmBlobHauler for ToBridgeHubRococoXcmBlobHauler {
type Runtime = Runtime;
type MessagesInstance = WithBridgeHubRococoMessagesInstance;
type SenderAndLane = FromAssetHubWestendToAssetHubRococoRoute;
type ToSourceChainSender = XcmRouter;
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}
/// On messages delivered callback.
type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>;
/// Messaging Bridge configuration for BridgeHubWestend -> BridgeHubRococo
pub struct WithBridgeHubRococoMessageBridge;
impl MessageBridge for WithBridgeHubRococoMessageBridge {
const BRIDGED_MESSAGES_PALLET_NAME: &'static str =
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME;
type ThisChain = BridgeHubWestend;
type BridgedChain = BridgeHubRococo;
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
Runtime,
BridgeParachainRococoInstance,
bp_bridge_hub_rococo::BridgeHubRococo,
>;
}
/// Message verifier for BridgeHubRococo messages sent from BridgeHubWestend
type ToBridgeHubRococoMessageVerifier =
messages::source::FromThisChainMessageVerifier<WithBridgeHubRococoMessageBridge>;
/// Maximal outbound payload size of BridgeHubWestend -> BridgeHubRococo messages.
type ToBridgeHubRococoMaximalOutboundPayloadSize =
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubRococoMessageBridge>;
/// BridgeHubRococo chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
pub struct BridgeHubRococo;
impl UnderlyingChainProvider for BridgeHubRococo {
type Chain = bp_bridge_hub_rococo::BridgeHubRococo;
}
impl messages::BridgedChainWithMessages for BridgeHubRococo {}
/// BridgeHubWestend chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
pub struct BridgeHubWestend;
impl UnderlyingChainProvider for BridgeHubWestend {
type Chain = bp_bridge_hub_westend::BridgeHubWestend;
}
impl ThisChainWithMessages for BridgeHubWestend {
type RuntimeOrigin = RuntimeOrigin;
}
/// Signed extension that refunds relayers that are delivering messages from the Rococo parachain.
pub type OnBridgeHubWestendRefundBridgeHubRococoMessages = RefundSignedExtensionAdapter<
RefundBridgedParachainMessages<
Runtime,
RefundableParachain<BridgeParachainRococoInstance, bp_bridge_hub_rococo::BridgeHubRococo>,
RefundableMessagesLane<
WithBridgeHubRococoMessagesInstance,
AssetHubWestendToAssetHubRococoMessagesLane,
>,
ActualFeeRefund<Runtime>,
PriorityBoostPerMessage,
StrOnBridgeHubWestendRefundBridgeHubRococoMessages,
>,
>;
bp_runtime::generate_static_str_provider!(OnBridgeHubWestendRefundBridgeHubRococoMessages);
/// Add GRANDPA bridge pallet to track Rococo relay chain.
pub type BridgeGrandpaRococoInstance = pallet_bridge_grandpa::Instance1;
impl pallet_bridge_grandpa::Config<BridgeGrandpaRococoInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type BridgedChain = bp_rococo::Rococo;
type MaxFreeMandatoryHeadersPerBlock = ConstU32<4>;
type HeadersToKeep = RelayChainHeadersToKeep;
type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo<Runtime>;
}
/// Add parachain bridge pallet to track Rococo BridgeHub parachain
pub type BridgeParachainRococoInstance = pallet_bridge_parachains::Instance1;
impl pallet_bridge_parachains::Config<BridgeParachainRococoInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_bridge_parachains::WeightInfo<Runtime>;
type BridgesGrandpaPalletInstance = BridgeGrandpaRococoInstance;
type ParasPalletName = RococoBridgeParachainPalletName;
type ParaStoredHeaderDataBuilder =
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_rococo::BridgeHubRococo>;
type HeadsToKeep = ParachainHeadsToKeep;
type MaxParaHeadDataSize = MaxRococoParaHeadDataSize;
}
/// Add XCM messages support for BridgeHubWestend to support Westend->Rococo XCM messages
pub type WithBridgeHubRococoMessagesInstance = pallet_bridge_messages::Instance1;
impl pallet_bridge_messages::Config<WithBridgeHubRococoMessagesInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_bridge_messages::WeightInfo<Runtime>;
type BridgedChainId = BridgeHubRococoChainId;
type ActiveOutboundLanes = ActiveOutboundLanesToBridgeHubRococo;
type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
type MaxUnconfirmedMessagesAtInboundLane = MaxUnconfirmedMessagesAtInboundLane;
type MaximalOutboundPayloadSize = ToBridgeHubRococoMaximalOutboundPayloadSize;
type OutboundPayload = XcmAsPlainPayload;
type InboundPayload = XcmAsPlainPayload;
type InboundRelayer = AccountId;
type DeliveryPayments = ();
type TargetHeaderChain = TargetHeaderChainAdapter<WithBridgeHubRococoMessageBridge>;
type LaneMessageVerifier = ToBridgeHubRococoMessageVerifier;
type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
Runtime,
WithBridgeHubRococoMessagesInstance,
DeliveryRewardInBalance,
>;
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubRococoMessageBridge>;
type MessageDispatch = XcmBlobMessageDispatch<
FromRococoMessageBlobDispatcher,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutXcmpChannelStatusProvider<
AssetHubWestendParaId,
Runtime,
>,
>;
type OnMessagesDelivered = OnMessagesDelivered;
}
#[cfg(test)]
mod tests {
use super::*;
use bridge_runtime_common::{
assert_complete_bridge_types,
integrity::{
assert_complete_bridge_constants, check_message_lane_weights,
AssertBridgeMessagesPalletConstants, AssertBridgePalletNames, AssertChainConstants,
AssertCompleteBridgeConstants,
},
};
use parachains_common::{westend, Balance};
/// Every additional message in the message delivery transaction boosts its priority.
/// So the priority of transaction with `N+1` messages is larger than priority of
/// transaction with `N` messages by the `PriorityBoostPerMessage`.
///
/// Economically, it is an equivalent of adding tip to the transaction with `N` messages.
/// The `FEE_BOOST_PER_MESSAGE` constant is the value of this tip.
///
/// We want this tip to be large enough (delivery transactions with more messages = less
/// operational costs and a faster bridge), so this value should be significant.
const FEE_BOOST_PER_MESSAGE: Balance = 2 * westend::currency::UNITS;
#[test]
fn ensure_bridge_hub_westend_message_lane_weights_are_correct() {
check_message_lane_weights::<
bp_bridge_hub_westend::BridgeHubWestend,
Runtime,
WithBridgeHubRococoMessagesInstance,
>(
bp_bridge_hub_rococo::EXTRA_STORAGE_PROOF_SIZE,
bp_bridge_hub_westend::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
bp_bridge_hub_westend::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
true,
);
}
#[test]
fn ensure_bridge_integrity() {
assert_complete_bridge_types!(
runtime: Runtime,
with_bridged_chain_grandpa_instance: BridgeGrandpaRococoInstance,
with_bridged_chain_messages_instance: WithBridgeHubRococoMessagesInstance,
bridge: WithBridgeHubRococoMessageBridge,
this_chain: bp_westend::Westend,
bridged_chain: bp_rococo::Rococo,
);
assert_complete_bridge_constants::<
Runtime,
BridgeGrandpaRococoInstance,
WithBridgeHubRococoMessagesInstance,
WithBridgeHubRococoMessageBridge,
>(AssertCompleteBridgeConstants {
this_chain_constants: AssertChainConstants {
block_length: bp_bridge_hub_westend::BlockLength::get(),
block_weights: bp_bridge_hub_westend::BlockWeights::get(),
},
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
max_unrewarded_relayers_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_messages_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bridged_chain_id: bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID,
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name: bp_rococo::WITH_ROCOCO_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
},
});
bridge_runtime_common::priority_calculator::ensure_priority_boost_is_sane::<
Runtime,
WithBridgeHubRococoMessagesInstance,
PriorityBoostPerMessage,
>(FEE_BOOST_PER_MESSAGE);
assert_eq!(
BridgeWestendToRococoMessagesPalletInstance::get(),
X1(PalletInstance(
bp_bridge_hub_westend::WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX
))
);
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,53 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, Weight},
};
parameter_types! {
/// Importing a block with 0 Extrinsics.
pub const BlockExecutionWeight: Weight =
Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000), 0);
}
#[cfg(test)]
mod test_weights {
use frame_support::weights::constants;
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::constants::BlockExecutionWeight::get();
// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 50 ms."
);
}
}
}
@@ -0,0 +1,77 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `cumulus_pallet_xcmp_queue`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=cumulus_pallet_xcmp_queue
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `cumulus_pallet_xcmp_queue`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo<T> {
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:1)
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_config_with_u32() -> Weight {
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 4_930_000 picoseconds.
Weight::from_parts(5_292_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `XcmpQueue::QueueConfig` (r:1 w:1)
/// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_config_with_weight() -> Weight {
// Proof Size summary in bytes:
// Measured: `76`
// Estimated: `1561`
// Minimum execution time: 5_012_000 picoseconds.
Weight::from_parts(5_282_000, 0)
.saturating_add(Weight::from_parts(0, 1561))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,53 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, Weight},
};
parameter_types! {
/// Executing a NO-OP `System::remarks` Extrinsic.
pub const ExtrinsicBaseWeight: Weight =
Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0);
}
#[cfg(test)]
mod test_weights {
use frame_support::weights::constants;
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::constants::ExtrinsicBaseWeight::get();
// At least 10 µs.
assert!(
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
"Weight should be at least 10 µs."
);
// At most 1 ms.
assert!(
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Weight should be at most 1 ms."
);
}
}
}
@@ -0,0 +1,155 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=frame_system
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `frame_system`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
/// The range of component `b` is `[0, 3932160]`.
fn remark(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_956_000 picoseconds.
Weight::from_parts(2_974_450, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 0
.saturating_add(Weight::from_parts(388, 0).saturating_mul(b.into()))
}
/// The range of component `b` is `[0, 3932160]`.
fn remark_with_event(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_432_000 picoseconds.
Weight::from_parts(7_686_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 3
.saturating_add(Weight::from_parts(1_767, 0).saturating_mul(b.into()))
}
/// Storage: `System::Digest` (r:1 w:1)
/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
/// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1)
fn set_heap_pages() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1485`
// Minimum execution time: 3_715_000 picoseconds.
Weight::from_parts(3_983_000, 0)
.saturating_add(Weight::from_parts(0, 1485))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0)
/// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1)
/// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1)
/// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1)
/// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_code() -> Weight {
// Proof Size summary in bytes:
// Measured: `119`
// Estimated: `1604`
// Minimum execution time: 99_688_458_000 picoseconds.
Weight::from_parts(103_623_061_000, 0)
.saturating_add(Weight::from_parts(0, 1604))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[0, 1000]`.
fn set_storage(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_318_000 picoseconds.
Weight::from_parts(2_421_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 2_168
.saturating_add(Weight::from_parts(765_555, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[0, 1000]`.
fn kill_storage(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_162_000 picoseconds.
Weight::from_parts(2_228_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 951
.saturating_add(Weight::from_parts(569_773, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into())))
}
/// Storage: `Skipped::Metadata` (r:0 w:0)
/// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `p` is `[0, 1000]`.
fn kill_prefix(p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `68 + p * (69 ±0)`
// Estimated: `71 + p * (70 ±0)`
// Minimum execution time: 3_795_000 picoseconds.
Weight::from_parts(3_895_000, 0)
.saturating_add(Weight::from_parts(0, 71))
// Standard Error: 1_869
.saturating_add(Weight::from_parts(1_209_251, 0).saturating_mul(p.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into())))
.saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into()))
}
}
@@ -0,0 +1,72 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Expose the auto generated weight files.
use ::pallet_bridge_messages::WeightInfoExt as MessagesWeightInfoExt;
use ::pallet_bridge_parachains::WeightInfoExt as ParachainsWeightInfoExt;
pub mod block_weights;
pub mod cumulus_pallet_xcmp_queue;
pub mod extrinsic_weights;
pub mod frame_system;
pub mod pallet_balances;
pub mod pallet_bridge_grandpa;
pub mod pallet_bridge_messages;
pub mod pallet_bridge_parachains;
pub mod pallet_bridge_relayers;
pub mod pallet_collator_selection;
pub mod pallet_multisig;
pub mod pallet_session;
pub mod pallet_timestamp;
pub mod pallet_utility;
pub mod pallet_xcm;
pub mod paritydb_weights;
pub mod rocksdb_weights;
pub mod xcm;
pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
use crate::Runtime;
use frame_support::weights::Weight;
// import trait from dependency module
use ::pallet_bridge_relayers::WeightInfoExt as _;
impl MessagesWeightInfoExt for pallet_bridge_messages::WeightInfo<crate::Runtime> {
fn expected_extra_storage_proof_size() -> u32 {
bp_bridge_hub_rococo::EXTRA_STORAGE_PROOF_SIZE
}
fn receive_messages_proof_overhead_from_runtime() -> Weight {
pallet_bridge_relayers::WeightInfo::<Runtime>::receive_messages_proof_overhead_from_runtime(
)
}
fn receive_messages_delivery_proof_overhead_from_runtime() -> Weight {
pallet_bridge_relayers::WeightInfo::<Runtime>::receive_messages_delivery_proof_overhead_from_runtime()
}
}
impl ParachainsWeightInfoExt for pallet_bridge_parachains::WeightInfo<crate::Runtime> {
fn expected_extra_storage_proof_size() -> u32 {
bp_bridge_hub_rococo::EXTRA_STORAGE_PROOF_SIZE
}
}
@@ -0,0 +1,153 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_balances
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_balances`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn transfer_allow_death() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 56_219_000 picoseconds.
Weight::from_parts(56_763_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn transfer_keep_alive() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 41_515_000 picoseconds.
Weight::from_parts(42_186_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn force_set_balance_creating() -> Weight {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 16_274_000 picoseconds.
Weight::from_parts(16_898_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn force_set_balance_killing() -> Weight {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 23_847_000 picoseconds.
Weight::from_parts(24_343_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn force_transfer() -> Weight {
// Proof Size summary in bytes:
// Measured: `103`
// Estimated: `6196`
// Minimum execution time: 57_564_000 picoseconds.
Weight::from_parts(58_172_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn transfer_all() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `3593`
// Minimum execution time: 52_131_000 picoseconds.
Weight::from_parts(52_662_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn force_unreserve() -> Weight {
// Proof Size summary in bytes:
// Measured: `174`
// Estimated: `3593`
// Minimum execution time: 19_005_000 picoseconds.
Weight::from_parts(19_594_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `System::Account` (r:999 w:999)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// The range of component `u` is `[1, 1000]`.
fn upgrade_accounts(u: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + u * (136 ±0)`
// Estimated: `990 + u * (2603 ±0)`
// Minimum execution time: 17_275_000 picoseconds.
Weight::from_parts(17_901_000, 0)
.saturating_add(Weight::from_parts(0, 990))
// Standard Error: 15_775
.saturating_add(Weight::from_parts(15_448_147, 0).saturating_mul(u.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
}
}
@@ -0,0 +1,83 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_grandpa`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-27, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_grandpa
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_grandpa`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeRococoGrandpa::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoGrandpa::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::BestFinalized` (r:1 w:1)
/// Proof: `BridgeRococoGrandpa::BestFinalized` (`max_values`: Some(1), `max_size`: Some(36), added: 531, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::CurrentAuthoritySet` (r:1 w:0)
/// Proof: `BridgeRococoGrandpa::CurrentAuthoritySet` (`max_values`: Some(1), `max_size`: Some(50250), added: 50745, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHashesPointer` (r:1 w:1)
/// Proof: `BridgeRococoGrandpa::ImportedHashesPointer` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHashes` (r:1 w:1)
/// Proof: `BridgeRococoGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:0 w:2)
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
/// The range of component `p` is `[1, 838]`.
/// The range of component `v` is `[50, 100]`.
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `268 + p * (60 ±0)`
// Estimated: `51735`
// Minimum execution time: 304_726_000 picoseconds.
Weight::from_parts(16_868_060, 0)
.saturating_add(Weight::from_parts(0, 51735))
// Standard Error: 2_802
.saturating_add(Weight::from_parts(55_200_017, 0).saturating_mul(p.into()))
// Standard Error: 46_745
.saturating_add(Weight::from_parts(2_689_151, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(5))
}
}
@@ -0,0 +1,245 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_messages`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_messages
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_messages`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_messages::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `575`
// Estimated: `52645`
// Minimum execution time: 42_332_000 picoseconds.
Weight::from_parts(43_375_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_two_messages_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `575`
// Estimated: `52645`
// Minimum execution time: 53_139_000 picoseconds.
Weight::from_parts(54_236_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
/// Storage: `ParachainInfo::ParachainId` (r:1 w:0)
/// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn receive_single_message_proof_with_outbound_lane_state() -> Weight {
// Proof Size summary in bytes:
// Measured: `575`
// Estimated: `52645`
// Minimum execution time: 47_466_000 picoseconds.
Weight::from_parts(48_724_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_1_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `543`
// Estimated: `52645`
// Minimum execution time: 40_962_000 picoseconds.
Weight::from_parts(42_002_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, mode: `MaxEncodedLen`)
fn receive_single_message_proof_16_kb() -> Weight {
// Proof Size summary in bytes:
// Measured: `543`
// Estimated: `52645`
// Minimum execution time: 71_599_000 picoseconds.
Weight::from_parts(74_307_000, 0)
.saturating_add(Weight::from_parts(0, 52645))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_single_message() -> Weight {
// Proof Size summary in bytes:
// Measured: `414`
// Estimated: `3879`
// Minimum execution time: 31_206_000 picoseconds.
Weight::from_parts(32_045_000, 0)
.saturating_add(Weight::from_parts(0, 3879))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_single_relayer() -> Weight {
// Proof Size summary in bytes:
// Measured: `414`
// Estimated: `3879`
// Minimum execution time: 31_211_000 picoseconds.
Weight::from_parts(32_171_000, 0)
.saturating_add(Weight::from_parts(0, 3879))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::OutboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::OutboundLanes` (`max_values`: Some(1), `max_size`: Some(44), added: 539, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x6e0a18b62a1de81c5f519181cc611e18` (r:1 w:0)
/// Storage: `BridgeRelayers::RelayerRewards` (r:2 w:2)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn receive_delivery_proof_for_two_messages_by_two_relayers() -> Weight {
// Proof Size summary in bytes:
// Measured: `414`
// Estimated: `6086`
// Minimum execution time: 33_790_000 picoseconds.
Weight::from_parts(34_708_000, 0)
.saturating_add(Weight::from_parts(0, 6086))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeWestendToRococoMessages::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeWestendToRococoMessages::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`)
/// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1)
/// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:1 w:0)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// Storage: `BridgeWestendToRococoMessages::InboundLanes` (r:1 w:1)
/// Proof: `BridgeWestendToRococoMessages::InboundLanes` (`max_values`: None, `max_size`: Some(49180), added: 51655, 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: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0)
/// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0)
/// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1)
/// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
/// The range of component `i` is `[128, 2048]`.
fn receive_single_message_proof_with_dispatch(i: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `777`
// Estimated: `52645`
// Minimum execution time: 61_938_000 picoseconds.
Weight::from_parts(63_009_714, 0)
.saturating_add(Weight::from_parts(0, 52645))
// Standard Error: 23
.saturating_add(Weight::from_parts(6_677, 0).saturating_mul(i.into()))
.saturating_add(T::DbWeight::get().reads(10))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -0,0 +1,114 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_parachains`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_parachains
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_parachains`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_parachains::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeRococoParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
/// The range of component `p` is `[1, 2]`.
fn submit_parachain_heads_with_n_parachains(_p: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 31_241_000 picoseconds.
Weight::from_parts(32_488_584, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeRococoParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_1kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 32_962_000 picoseconds.
Weight::from_parts(33_658_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeRococoParachain::PalletOperatingMode` (r:1 w:0)
/// Proof: `BridgeRococoParachain::PalletOperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:1 w:0)
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ParasInfo` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ParasInfo` (`max_values`: Some(1), `max_size`: Some(60), added: 555, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHashes` (r:1 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHashes` (`max_values`: Some(64), `max_size`: Some(64), added: 1054, mode: `MaxEncodedLen`)
/// Storage: `BridgeRococoParachain::ImportedParaHeads` (r:0 w:1)
/// Proof: `BridgeRococoParachain::ImportedParaHeads` (`max_values`: Some(64), `max_size`: Some(196), added: 1186, mode: `MaxEncodedLen`)
fn submit_parachain_heads_with_16kb_proof() -> Weight {
// Proof Size summary in bytes:
// Measured: `367`
// Estimated: `2543`
// Minimum execution time: 62_685_000 picoseconds.
Weight::from_parts(64_589_000, 0)
.saturating_add(Weight::from_parts(0, 2543))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
}
}
@@ -0,0 +1,123 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_bridge_relayers`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-10-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-vmdtonbz-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// target/production/polkadot-parachain
// benchmark
// pallet
// --steps=50
// --repeat=20
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
// --pallet=pallet_bridge_relayers
// --chain=bridge-hub-rococo-dev
// --header=./cumulus/file_header.txt
// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_bridge_relayers`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_bridge_relayers::WeightInfo for WeightInfo<T> {
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn claim_rewards() -> Weight {
// Proof Size summary in bytes:
// Measured: `207`
// Estimated: `3593`
// Minimum execution time: 45_338_000 picoseconds.
Weight::from_parts(45_836_000, 0)
.saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1)
/// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
/// Storage: UNKNOWN KEY `0x1e8445dc201eeb8560e5579a5dd54655` (r:1 w:0)
/// Proof: UNKNOWN KEY `0x1e8445dc201eeb8560e5579a5dd54655` (r:1 w:0)
/// Storage: `Balances::Reserves` (r:1 w:1)
/// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`)
fn register() -> Weight {
// Proof Size summary in bytes:
// Measured: `61`
// Estimated: `4714`
// Minimum execution time: 23_561_000 picoseconds.
Weight::from_parts(24_012_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1)
/// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
/// Storage: `Balances::Reserves` (r:1 w:1)
/// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`)
fn deregister() -> Weight {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `4714`
// Minimum execution time: 25_133_000 picoseconds.
Weight::from_parts(25_728_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `BridgeRelayers::RegisteredRelayers` (r:1 w:1)
/// Proof: `BridgeRelayers::RegisteredRelayers` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`)
/// Storage: `Balances::Reserves` (r:1 w:1)
/// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn slash_and_deregister() -> Weight {
// Proof Size summary in bytes:
// Measured: `263`
// Estimated: `4714`
// Minimum execution time: 27_356_000 picoseconds.
Weight::from_parts(27_828_000, 0)
.saturating_add(Weight::from_parts(0, 4714))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `BridgeRelayers::RelayerRewards` (r:1 w:1)
/// Proof: `BridgeRelayers::RelayerRewards` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn register_relayer_reward() -> Weight {
// Proof Size summary in bytes:
// Measured: `6`
// Estimated: `3538`
// Minimum execution time: 2_955_000 picoseconds.
Weight::from_parts(3_084_000, 0)
.saturating_add(Weight::from_parts(0, 3538))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,225 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_collator_selection`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_collator_selection
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_collator_selection`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for WeightInfo<T> {
/// Storage: `Session::NextKeys` (r:20 w:0)
/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `CollatorSelection::Invulnerables` (r:0 w:1)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// The range of component `b` is `[1, 20]`.
fn set_invulnerables(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `196 + b * (79 ±0)`
// Estimated: `1187 + b * (2555 ±0)`
// Minimum execution time: 14_728_000 picoseconds.
Weight::from_parts(11_562_750, 0)
.saturating_add(Weight::from_parts(0, 1187))
// Standard Error: 7_121
.saturating_add(Weight::from_parts(3_300_884, 0).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into())))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 2555).saturating_mul(b.into()))
}
/// Storage: `Session::NextKeys` (r:1 w:0)
/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `CollatorSelection::Invulnerables` (r:1 w:1)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::Candidates` (r:1 w:1)
/// Proof: `CollatorSelection::Candidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// The range of component `b` is `[1, 19]`.
/// The range of component `c` is `[1, 99]`.
fn add_invulnerable(b: u32, c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `757 + b * (32 ±0) + c * (53 ±0)`
// Estimated: `6287 + b * (37 ±0) + c * (53 ±0)`
// Minimum execution time: 47_549_000 picoseconds.
Weight::from_parts(45_432_273, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 11_457
.saturating_add(Weight::from_parts(216_469, 0).saturating_mul(b.into()))
// Standard Error: 2_171
.saturating_add(Weight::from_parts(197_614, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3))
.saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into()))
.saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into()))
}
/// Storage: `CollatorSelection::Candidates` (r:1 w:0)
/// Proof: `CollatorSelection::Candidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::Invulnerables` (r:1 w:1)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// The range of component `b` is `[5, 20]`.
fn remove_invulnerable(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `82 + b * (32 ±0)`
// Estimated: `6287`
// Minimum execution time: 15_417_000 picoseconds.
Weight::from_parts(15_357_487, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 4_074
.saturating_add(Weight::from_parts(187_410, 0).saturating_mul(b.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `CollatorSelection::DesiredCandidates` (r:0 w:1)
/// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
fn set_desired_candidates() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_407_000 picoseconds.
Weight::from_parts(7_657_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `CollatorSelection::CandidacyBond` (r:0 w:1)
/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
fn set_candidacy_bond() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_514_000 picoseconds.
Weight::from_parts(7_695_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `CollatorSelection::Candidates` (r:1 w:1)
/// Proof: `CollatorSelection::Candidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::DesiredCandidates` (r:1 w:0)
/// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// Storage: `Session::NextKeys` (r:1 w:0)
/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0)
/// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
/// The range of component `c` is `[1, 99]`.
fn register_as_candidate(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `740 + c * (52 ±0)`
// Estimated: `6287 + c * (54 ±0)`
// Minimum execution time: 41_711_000 picoseconds.
Weight::from_parts(45_690_780, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 2_800
.saturating_add(Weight::from_parts(194_907, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
.saturating_add(Weight::from_parts(0, 54).saturating_mul(c.into()))
}
/// Storage: `CollatorSelection::Candidates` (r:1 w:1)
/// Proof: `CollatorSelection::Candidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
/// The range of component `c` is `[3, 100]`.
fn leave_intent(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `334 + c * (49 ±0)`
// Estimated: `6287`
// Minimum execution time: 33_901_000 picoseconds.
Weight::from_parts(35_875_905, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 1_968
.saturating_add(Weight::from_parts(200_283, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `System::BlockWeight` (r:1 w:1)
/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1)
/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
fn note_author() -> Weight {
// Proof Size summary in bytes:
// Measured: `155`
// Estimated: `6196`
// Minimum execution time: 47_475_000 picoseconds.
Weight::from_parts(48_265_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `CollatorSelection::Candidates` (r:1 w:0)
/// Proof: `CollatorSelection::Candidates` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::LastAuthoredBlock` (r:100 w:0)
/// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
/// Storage: `CollatorSelection::Invulnerables` (r:1 w:0)
/// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`)
/// Storage: `System::BlockWeight` (r:1 w:1)
/// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:97 w:97)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// The range of component `r` is `[1, 100]`.
/// The range of component `c` is `[1, 100]`.
fn new_session(r: u32, c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `2263 + c * (97 ±0) + r * (115 ±0)`
// Estimated: `6287 + c * (2519 ±0) + r * (2603 ±0)`
// Minimum execution time: 16_907_000 picoseconds.
Weight::from_parts(17_203_000, 0)
.saturating_add(Weight::from_parts(0, 6287))
// Standard Error: 354_098
.saturating_add(Weight::from_parts(15_341_462, 0).saturating_mul(c.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
.saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into()))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(r.into()))
}
}
@@ -0,0 +1,165 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_multisig`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_multisig
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_multisig`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
/// The range of component `z` is `[0, 10000]`.
fn as_multi_threshold_1(z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_958_000 picoseconds.
Weight::from_parts(14_501_711, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 4
.saturating_add(Weight::from_parts(626, 0).saturating_mul(z.into()))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_create(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `263 + s * (2 ±0)`
// Estimated: `6811`
// Minimum execution time: 44_067_000 picoseconds.
Weight::from_parts(33_432_998, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 1_250
.saturating_add(Weight::from_parts(131_851, 0).saturating_mul(s.into()))
// Standard Error: 12
.saturating_add(Weight::from_parts(1_459, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[3, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `282`
// Estimated: `6811`
// Minimum execution time: 29_373_000 picoseconds.
Weight::from_parts(19_409_201, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 725
.saturating_add(Weight::from_parts(110_824, 0).saturating_mul(s.into()))
// Standard Error: 7
.saturating_add(Weight::from_parts(1_502, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `388 + s * (33 ±0)`
// Estimated: `6811`
// Minimum execution time: 49_724_000 picoseconds.
Weight::from_parts(34_153_321, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 1_376
.saturating_add(Weight::from_parts(174_634, 0).saturating_mul(s.into()))
// Standard Error: 13
.saturating_add(Weight::from_parts(1_753, 0).saturating_mul(z.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_create(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `263 + s * (2 ±0)`
// Estimated: `6811`
// Minimum execution time: 31_081_000 picoseconds.
Weight::from_parts(31_552_702, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 1_066
.saturating_add(Weight::from_parts(135_081, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_approve(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `282`
// Estimated: `6811`
// Minimum execution time: 17_807_000 picoseconds.
Weight::from_parts(18_241_044, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 768
.saturating_add(Weight::from_parts(112_957, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Multisig::Multisigs` (r:1 w:1)
/// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`)
/// The range of component `s` is `[2, 100]`.
fn cancel_as_multi(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `454 + s * (1 ±0)`
// Estimated: `6811`
// Minimum execution time: 32_421_000 picoseconds.
Weight::from_parts(32_554_061, 0)
.saturating_add(Weight::from_parts(0, 6811))
// Standard Error: 1_157
.saturating_add(Weight::from_parts(141_221, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
}
@@ -0,0 +1,81 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_session`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_session
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_session`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_session::WeightInfo for WeightInfo<T> {
/// Storage: `Session::NextKeys` (r:1 w:1)
/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Session::KeyOwner` (r:1 w:1)
/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn set_keys() -> Weight {
// Proof Size summary in bytes:
// Measured: `297`
// Estimated: `3762`
// Minimum execution time: 16_965_000 picoseconds.
Weight::from_parts(17_384_000, 0)
.saturating_add(Weight::from_parts(0, 3762))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Session::NextKeys` (r:1 w:1)
/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Session::KeyOwner` (r:0 w:1)
/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn purge_keys() -> Weight {
// Proof Size summary in bytes:
// Measured: `279`
// Estimated: `3744`
// Minimum execution time: 12_444_000 picoseconds.
Weight::from_parts(12_832_000, 0)
.saturating_add(Weight::from_parts(0, 3744))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
}
@@ -0,0 +1,75 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_timestamp`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_timestamp
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_timestamp`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> {
/// Storage: `Timestamp::Now` (r:1 w:1)
/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
/// Storage: `Aura::CurrentSlot` (r:1 w:0)
/// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
fn set() -> Weight {
// Proof Size summary in bytes:
// Measured: `85`
// Estimated: `1493`
// Minimum execution time: 9_231_000 picoseconds.
Weight::from_parts(9_595_000, 0)
.saturating_add(Weight::from_parts(0, 1493))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
fn on_finalize() -> Weight {
// Proof Size summary in bytes:
// Measured: `94`
// Estimated: `0`
// Minimum execution time: 3_869_000 picoseconds.
Weight::from_parts(4_041_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
}
@@ -0,0 +1,102 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_utility`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_utility
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_utility`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_utility::WeightInfo for WeightInfo<T> {
/// The range of component `c` is `[0, 1000]`.
fn batch(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_831_000 picoseconds.
Weight::from_parts(12_945_569, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 1_949
.saturating_add(Weight::from_parts(5_125_189, 0).saturating_mul(c.into()))
}
fn as_derivative() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_790_000 picoseconds.
Weight::from_parts(5_063_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `c` is `[0, 1000]`.
fn batch_all(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_894_000 picoseconds.
Weight::from_parts(14_201_341, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 2_501
.saturating_add(Weight::from_parts(5_466_047, 0).saturating_mul(c.into()))
}
fn dispatch_as() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 8_624_000 picoseconds.
Weight::from_parts(9_064_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// The range of component `c` is `[0, 1000]`.
fn force_batch(c: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_912_000 picoseconds.
Weight::from_parts(9_228_121, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 1_601
.saturating_add(Weight::from_parts(5_138_293, 0).saturating_mul(c.into()))
}
}
@@ -0,0 +1,289 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-07-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-ynta1nyy-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot-parachain
// benchmark
// pallet
// --chain=bridge-hub-rococo-dev
// --wasm-execution=compiled
// --pallet=pallet_xcm
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
#![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 `pallet_xcm`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn send() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 29_724_000 picoseconds.
Weight::from_parts(30_440_000, 0)
.saturating_add(Weight::from_parts(0, 3540))
.saturating_add(T::DbWeight::get().reads(5))
.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`)
fn teleport_assets() -> Weight {
// Proof Size summary in bytes:
// Measured: `32`
// Estimated: `1489`
// Minimum execution time: 26_779_000 picoseconds.
Weight::from_parts(27_249_000, 0)
.saturating_add(Weight::from_parts(0, 1489))
.saturating_add(T::DbWeight::get().reads(1))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn reserve_transfer_assets() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight::from_parts(18_446_744_073_709_551_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn execute() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight::from_parts(18_446_744_073_709_551_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn force_xcm_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 9_170_000 picoseconds.
Weight::from_parts(9_629_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:0 w:1)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn force_default_xcm_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_769_000 picoseconds.
Weight::from_parts(2_933_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1)
/// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::Queries` (r:0 w:1)
/// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn force_subscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `75`
// Estimated: `3540`
// Minimum execution time: 34_547_000 picoseconds.
Weight::from_parts(35_653_000, 0)
.saturating_add(Weight::from_parts(0, 3540))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(5))
}
/// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::Queries` (r:0 w:1)
/// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn force_unsubscribe_version_notify() -> Weight {
// Proof Size summary in bytes:
// Measured: `292`
// Estimated: `3757`
// Minimum execution time: 36_274_000 picoseconds.
Weight::from_parts(37_281_000, 0)
.saturating_add(Weight::from_parts(0, 3757))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(4))
}
/// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1)
/// Proof: `PolkadotXcm::XcmExecutionSuspended` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn force_suspension() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_749_000 picoseconds.
Weight::from_parts(2_917_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:4 w:2)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_supported_version() -> Weight {
// Proof Size summary in bytes:
// Measured: `187`
// Estimated: `11077`
// Minimum execution time: 17_649_000 picoseconds.
Weight::from_parts(17_964_000, 0)
.saturating_add(Weight::from_parts(0, 11077))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifiers` (r:4 w:2)
/// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_version_notifiers() -> Weight {
// Proof Size summary in bytes:
// Measured: `191`
// Estimated: `11081`
// Minimum execution time: 17_551_000 picoseconds.
Weight::from_parts(18_176_000, 0)
.saturating_add(Weight::from_parts(0, 11081))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn already_notified_target() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `13563`
// Minimum execution time: 19_261_000 picoseconds.
Weight::from_parts(19_714_000, 0)
.saturating_add(Weight::from_parts(0, 13563))
.saturating_add(T::DbWeight::get().reads(5))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn notify_current_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `142`
// Estimated: `6082`
// Minimum execution time: 31_630_000 picoseconds.
Weight::from_parts(32_340_000, 0)
.saturating_add(Weight::from_parts(0, 6082))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:3 w:0)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn notify_target_migration_fail() -> Weight {
// Proof Size summary in bytes:
// Measured: `172`
// Estimated: `8587`
// Minimum execution time: 9_218_000 picoseconds.
Weight::from_parts(9_558_000, 0)
.saturating_add(Weight::from_parts(0, 8587))
.saturating_add(T::DbWeight::get().reads(3))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn migrate_version_notify_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `198`
// Estimated: `11088`
// Minimum execution time: 18_133_000 picoseconds.
Weight::from_parts(18_663_000, 0)
.saturating_add(Weight::from_parts(0, 11088))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:2)
/// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn migrate_and_notify_old_targets() -> Weight {
// Proof Size summary in bytes:
// Measured: `204`
// Estimated: `11094`
// Minimum execution time: 38_878_000 picoseconds.
Weight::from_parts(39_779_000, 0)
.saturating_add(Weight::from_parts(0, 11094))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(4))
}
}
@@ -0,0 +1,63 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, RuntimeDbWeight},
};
parameter_types! {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
};
}
#[cfg(test)]
mod test_db_weights {
use super::constants::ParityDbWeight as W;
use frame_support::weights::constants;
/// Checks that all weights exist and have sane values.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
}
}
@@ -0,0 +1,63 @@
// This file is part of Substrate.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, RuntimeDbWeight},
};
parameter_types! {
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
/// the runtime.
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS,
};
}
#[cfg(test)]
mod test_db_weights {
use super::constants::RocksDbWeight as W;
use frame_support::weights::constants;
/// Checks that all weights exist and have sane values.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
"Write weight should be at most 1 ms."
);
}
}
}
@@ -0,0 +1,247 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
mod pallet_xcm_benchmarks_fungible;
mod pallet_xcm_benchmarks_generic;
use crate::{xcm_config::MaxAssetsIntoHolding, Runtime};
use codec::Encode;
use frame_support::weights::Weight;
use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight;
use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric;
use sp_std::prelude::*;
use xcm::{latest::prelude::*, DoubleEncoded};
trait WeighMultiAssets {
fn weigh_multi_assets(&self, weight: Weight) -> Weight;
}
const MAX_ASSETS: u64 = 100;
impl WeighMultiAssets for MultiAssetFilter {
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
match self {
Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64),
Self::Wild(asset) => match asset {
All => weight.saturating_mul(MAX_ASSETS),
AllOf { fun, .. } => match fun {
WildFungibility::Fungible => weight,
// Magic number 2 has to do with the fact that we could have up to 2 times
// MaxAssetsIntoHolding in the worst-case scenario.
WildFungibility::NonFungible =>
weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64),
},
AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)),
AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)),
},
}
}
}
impl WeighMultiAssets for MultiAssets {
fn weigh_multi_assets(&self, weight: Weight) -> Weight {
weight.saturating_mul(self.inner().iter().count() as u64)
}
}
pub struct BridgeHubWestendXcmWeight<Call>(core::marker::PhantomData<Call>);
impl<Call> XcmWeightInfo<Call> for BridgeHubWestendXcmWeight<Call> {
fn withdraw_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::withdraw_asset())
}
fn reserve_asset_deposited(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::reserve_asset_deposited())
}
fn receive_teleported_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::receive_teleported_asset())
}
fn query_response(
_query_id: &u64,
_response: &Response,
_max_weight: &Weight,
_querier: &Option<MultiLocation>,
) -> Weight {
XcmGeneric::<Runtime>::query_response()
}
fn transfer_asset(assets: &MultiAssets, _dest: &MultiLocation) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::transfer_asset())
}
fn transfer_reserve_asset(
assets: &MultiAssets,
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::transfer_reserve_asset())
}
fn transact(
_origin_type: &OriginKind,
_require_weight_at_most: &Weight,
_call: &DoubleEncoded<Call>,
) -> Weight {
XcmGeneric::<Runtime>::transact()
}
fn hrmp_new_channel_open_request(
_sender: &u32,
_max_message_size: &u32,
_max_capacity: &u32,
) -> Weight {
// XCM Executor does not currently support HRMP channel operations
Weight::MAX
}
fn hrmp_channel_accepted(_recipient: &u32) -> Weight {
// XCM Executor does not currently support HRMP channel operations
Weight::MAX
}
fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight {
// XCM Executor does not currently support HRMP channel operations
Weight::MAX
}
fn clear_origin() -> Weight {
XcmGeneric::<Runtime>::clear_origin()
}
fn descend_origin(_who: &InteriorMultiLocation) -> Weight {
XcmGeneric::<Runtime>::descend_origin()
}
fn report_error(_query_response_info: &QueryResponseInfo) -> Weight {
XcmGeneric::<Runtime>::report_error()
}
fn deposit_asset(assets: &MultiAssetFilter, _dest: &MultiLocation) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_asset())
}
fn deposit_reserve_asset(
assets: &MultiAssetFilter,
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::deposit_reserve_asset())
}
fn exchange_asset(_give: &MultiAssetFilter, _receive: &MultiAssets, _maximal: &bool) -> Weight {
Weight::MAX
}
fn initiate_reserve_withdraw(
assets: &MultiAssetFilter,
_reserve: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_reserve_withdraw())
}
fn initiate_teleport(
assets: &MultiAssetFilter,
_dest: &MultiLocation,
_xcm: &Xcm<()>,
) -> Weight {
assets.weigh_multi_assets(XcmFungibleWeight::<Runtime>::initiate_teleport())
}
fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight {
XcmGeneric::<Runtime>::report_holding()
}
fn buy_execution(_fees: &MultiAsset, _weight_limit: &WeightLimit) -> Weight {
XcmGeneric::<Runtime>::buy_execution()
}
fn refund_surplus() -> Weight {
XcmGeneric::<Runtime>::refund_surplus()
}
fn set_error_handler(_xcm: &Xcm<Call>) -> Weight {
XcmGeneric::<Runtime>::set_error_handler()
}
fn set_appendix(_xcm: &Xcm<Call>) -> Weight {
XcmGeneric::<Runtime>::set_appendix()
}
fn clear_error() -> Weight {
XcmGeneric::<Runtime>::clear_error()
}
fn claim_asset(_assets: &MultiAssets, _ticket: &MultiLocation) -> Weight {
XcmGeneric::<Runtime>::claim_asset()
}
fn trap(_code: &u64) -> Weight {
XcmGeneric::<Runtime>::trap()
}
fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> Weight {
XcmGeneric::<Runtime>::subscribe_version()
}
fn unsubscribe_version() -> Weight {
XcmGeneric::<Runtime>::unsubscribe_version()
}
fn burn_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmGeneric::<Runtime>::burn_asset())
}
fn expect_asset(assets: &MultiAssets) -> Weight {
assets.weigh_multi_assets(XcmGeneric::<Runtime>::expect_asset())
}
fn expect_origin(_origin: &Option<MultiLocation>) -> Weight {
XcmGeneric::<Runtime>::expect_origin()
}
fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight {
XcmGeneric::<Runtime>::expect_error()
}
fn expect_transact_status(_transact_status: &MaybeErrorCode) -> Weight {
XcmGeneric::<Runtime>::expect_transact_status()
}
fn query_pallet(_module_name: &Vec<u8>, _response_info: &QueryResponseInfo) -> Weight {
XcmGeneric::<Runtime>::query_pallet()
}
fn expect_pallet(
_index: &u32,
_name: &Vec<u8>,
_module_name: &Vec<u8>,
_crate_major: &u32,
_min_crate_minor: &u32,
) -> Weight {
XcmGeneric::<Runtime>::expect_pallet()
}
fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight {
XcmGeneric::<Runtime>::report_transact_status()
}
fn clear_transact_status() -> Weight {
XcmGeneric::<Runtime>::clear_transact_status()
}
fn universal_origin(_: &Junction) -> Weight {
Weight::MAX
}
fn export_message(_: &NetworkId, _: &Junctions, inner: &Xcm<()>) -> Weight {
let inner_encoded_len = inner.encode().len() as u32;
XcmGeneric::<Runtime>::export_message(inner_encoded_len)
}
fn lock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight {
Weight::MAX
}
fn unlock_asset(_: &MultiAsset, _: &MultiLocation) -> Weight {
Weight::MAX
}
fn note_unlockable(_: &MultiAsset, _: &MultiLocation) -> Weight {
Weight::MAX
}
fn request_unlock(_: &MultiAsset, _: &MultiLocation) -> Weight {
Weight::MAX
}
fn set_fees_mode(_: &bool) -> Weight {
XcmGeneric::<Runtime>::set_fees_mode()
}
fn set_topic(_topic: &[u8; 32]) -> Weight {
XcmGeneric::<Runtime>::set_topic()
}
fn clear_topic() -> Weight {
XcmGeneric::<Runtime>::clear_topic()
}
fn alias_origin(_: &MultiLocation) -> Weight {
// XCM Executor does not currently support alias origin operations
Weight::MAX
}
fn unpaid_execution(_: &WeightLimit, _: &Option<MultiLocation>) -> Weight {
XcmGeneric::<Runtime>::unpaid_execution()
}
}

Some files were not shown because too many files have changed in this diff Show More