[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
@@ -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,