Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl pallet_xcm_bridge::Config<XcmOverAssetHubWestendInstance> for Runtime {
type CongestionLimits = ();
}

/// XCM router instance to the local `pallet_xcm_bridge_hub::<XcmOverAssetHubWestendInstance>` with
/// XCM router instance to the local `pallet_xcm_bridge::<XcmOverAssetHubWestendInstance>` with
/// direct bridging capabilities for `Westend` global consensus with dynamic fees and back-pressure.
pub type ToWestendOverAssetHubWestendXcmRouterInstance = pallet_xcm_bridge_router::Instance4;
impl pallet_xcm_bridge_router::Config<ToWestendOverAssetHubWestendXcmRouterInstance> for Runtime {
Expand All @@ -232,7 +232,7 @@ impl pallet_xcm_bridge_router::Config<ToWestendOverAssetHubWestendXcmRouterInsta
LocalExporter<XcmOverAssetHubWestend, UniversalLocation>,
>;

// For congestion - resolves `BridgeId` using the same algorithm as `pallet_xcm_bridge_hub` on
// For congestion - resolves `BridgeId` using the same algorithm as `pallet_xcm_bridge` on
// the BH.
type BridgeIdResolver =
pallet_xcm_bridge_router::impls::EnsureIsRemoteBridgeIdResolver<UniversalLocation>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,12 @@ construct_runtime!(
}
);

bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! {
RuntimeCall, AccountId,
// Messages
BridgeWestendMessages
}

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block type as expected by this runtime.
Expand All @@ -1164,6 +1170,7 @@ pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
frame_system::CheckWeight<Runtime>,
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
BridgeRejectObsoleteHeadersAndMessages,
(bridge_to_westend_config::OnAssetHubRococoRefundAssetHubWestendMessages,),
),
>;
Expand Down
27 changes: 27 additions & 0 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,23 @@ bp-asset-hub-rococo = { workspace = true }
bp-asset-hub-westend = { workspace = true }
bp-bridge-hub-rococo = { workspace = true }
bp-bridge-hub-westend = { workspace = true }
bp-header-chain = { workspace = true }
bp-messages = { workspace = true }
bp-runtime = { workspace = true }
bridge-hub-common = { workspace = true }
bridge-runtime-common = { workspace = true }
pallet-bridge-messages = { workspace = true }
pallet-bridge-relayers = { workspace = true }
pallet-xcm-bridge = { workspace = true }
pallet-xcm-bridge-router = { workspace = true }
snowbridge-router-primitives = { workspace = true }

[dev-dependencies]
asset-test-utils = { workspace = true, default-features = true }
bp-xcm-bridge = { workspace = true }
bridge-hub-test-utils = { workspace = true, default-features = true }
bridge-runtime-common = { features = ["integrity-test"], workspace = true }
pallet-bridge-relayers = { features = ["integrity-test"], workspace = true }
parachains-runtimes-test-utils = { workspace = true, default-features = true }

[build-dependencies]
Expand All @@ -116,6 +127,8 @@ substrate-wasm-builder = { optional = true, workspace = true, default-features =
default = ["std"]
runtime-benchmarks = [
"assets-common/runtime-benchmarks",
"bridge-hub-common/runtime-benchmarks",
"bridge-runtime-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-weight-reclaim/runtime-benchmarks",
Expand All @@ -133,6 +146,8 @@ runtime-benchmarks = [
"pallet-assets-freezer/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-migrations/runtime-benchmarks",
Expand All @@ -148,6 +163,7 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm-bridge-router/runtime-benchmarks",
"pallet-xcm-bridge/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
Expand Down Expand Up @@ -178,6 +194,8 @@ try-runtime = [
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-bridge-messages/try-runtime",
"pallet-bridge-relayers/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-migrations/try-runtime",
Expand All @@ -193,6 +211,7 @@ try-runtime = [
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm-bridge-router/try-runtime",
"pallet-xcm-bridge/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polkadot-runtime-common/try-runtime",
Expand All @@ -204,7 +223,12 @@ std = [
"bp-asset-hub-westend/std",
"bp-bridge-hub-rococo/std",
"bp-bridge-hub-westend/std",
"bp-header-chain/std",
"bp-messages/std",
"bp-runtime/std",
"bp-xcm-bridge/std",
"bridge-hub-common/std",
"bridge-runtime-common/std",
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
Expand Down Expand Up @@ -233,6 +257,8 @@ std = [
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-bridge-messages/std",
"pallet-bridge-relayers/std",
"pallet-collator-selection/std",
"pallet-message-queue/std",
"pallet-migrations/std",
Expand All @@ -251,6 +277,7 @@ std = [
"pallet-utility/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm-bridge-router/std",
"pallet-xcm-bridge/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// This file is part of Cumulus.

// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

//! Bridge definitions that can be used by multiple bridges.
use super::{weights, AccountId, Balance, Balances, BlockNumber, Runtime, RuntimeEvent};

frame_support::parameter_types! {
pub storage RequiredStakeForStakeAndSlash: Balance = 1_000_000;
pub const RelayerStakeLease: u32 = 8;
pub const RelayerStakeReserveId: [u8; 8] = *b"brdgrlrs";
pub storage DeliveryRewardInBalance: u64 = 1_000_000;
}

/// Allows collect and claim rewards for the relayers
pub type BridgeRelayersInstance = pallet_bridge_relayers::Instance1;
impl pallet_bridge_relayers::Config<BridgeRelayersInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Reward = Balance;
type PaymentProcedure =
pallet_bridge_relayers::PayRewardFromAccount<Balances, AccountId, Self::LaneId>;
type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
AccountId,
BlockNumber,
Balances,
RelayerStakeReserveId,
RequiredStakeForStakeAndSlash,
RelayerStakeLease,
>;
type WeightInfo = weights::pallet_bridge_relayers::WeightInfo<Runtime>;
type LaneId = bp_messages::HashedLaneId;
}
Loading
Loading