diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 062494319d3e..2f6afe4f012e 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -97,15 +97,16 @@ pallet-bridge-relayers = { path = "../../../../../bridges/modules/relayers", def bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", default-features = false } # Ethereum Bridge (Snowbridge) -snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false } snowbridge-beacon-primitives = { path = "../../../../../../parachain/primitives/beacon", default-features = false } -snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false } +snowbridge-control = { path = "../../../../../../parachain/pallets/control", default-features = false } +snowbridge-control-runtime-api = { path = "../../../../../../parachain/pallets/control/runtime-api", default-features = false } +snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false } snowbridge-ethereum-beacon-client = { path = "../../../../../../parachain/pallets/ethereum-beacon-client", default-features = false } snowbridge-inbound-queue = { path = "../../../../../../parachain/pallets/inbound-queue", default-features = false } snowbridge-outbound-queue = { path = "../../../../../../parachain/pallets/outbound-queue", default-features = false } snowbridge-outbound-queue-runtime-api = { path = "../../../../../../parachain/pallets/outbound-queue/runtime-api", default-features = false } -snowbridge-control = { path = "../../../../../../parachain/pallets/control", default-features = false } -snowbridge-control-runtime-api = { path = "../../../../../../parachain/pallets/control/runtime-api", default-features = false } +snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false } +snowbridge-runtime-common = { path = "../../../../../../parachain/runtime/runtime-common", default-features = false } bridge-hub-common = { path = "../common", default-features = false } @@ -196,15 +197,16 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", - "snowbridge-core/std", - "snowbridge-router-primitives/std", "snowbridge-beacon-primitives/std", + "snowbridge-control-runtime-api/std", + "snowbridge-control/std", + "snowbridge-core/std", "snowbridge-ethereum-beacon-client/std", "snowbridge-inbound-queue/std", - "snowbridge-outbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-control/std", - "snowbridge-control-runtime-api/std", + "snowbridge-outbound-queue/std", + "snowbridge-router-primitives/std", + "snowbridge-runtime-common/std", "substrate-wasm-builder", ] @@ -239,11 +241,12 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", - "snowbridge-core/runtime-benchmarks", "snowbridge-control/runtime-benchmarks", + "snowbridge-core/runtime-benchmarks", + "snowbridge-ethereum-beacon-client/runtime-benchmarks", "snowbridge-inbound-queue/runtime-benchmarks", "snowbridge-outbound-queue/runtime-benchmarks", - "snowbridge-ethereum-beacon-client/runtime-benchmarks" + "snowbridge-runtime-common/runtime-benchmarks", ] try-runtime = [ diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 781ca45da039..633a58c07893 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -50,7 +50,7 @@ use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Keccak256}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, Keccak256}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -80,7 +80,7 @@ use pallet_xcm::EnsureXcm; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm::VersionedMultiLocation; -use xcm_config::{XcmOriginToTransactDispatchOrigin, XcmRouter}; +use xcm_config::{TreasuryAccount, XcmRouter, XcmOriginToTransactDispatchOrigin}; use bp_runtime::HeaderId; use bridge_hub_common::{ @@ -529,7 +529,8 @@ parameter_types! { pub const GatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39")); pub const CreateAssetCall: [u8;2] = [53, 0]; pub const CreateAssetExecutionFee: u128 = 2_000_000_000; - pub const SendTokenExecutionFee: u128 = 1_000_000_000; + pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT; + pub const SendTokenExecutionFee: u128 = 2_000_000_000; } #[cfg(feature = "runtime-benchmarks")] @@ -552,8 +553,14 @@ impl snowbridge_inbound_queue::Config for Runtime { type GatewayAddress = GatewayAddress; #[cfg(feature = "runtime-benchmarks")] type Helper = Runtime; - type MessageConverter = - MessageToXcm; + type MessageConverter = MessageToXcm< + CreateAssetCall, + CreateAssetExecutionFee, + CreateAssetDeposit, + SendTokenExecutionFee, + AccountId, + Balance, + >; type WeightToFee = WeightToFee; } @@ -630,10 +637,6 @@ parameter_types! { pub const RelayNetwork: NetworkId = Rococo; } -parameter_types! { - pub TreasuryAccount: AccountId = PalletId(*b"py/trsry").into_account_truncating(); -} - #[cfg(feature = "runtime-benchmarks")] impl snowbridge_control::BenchmarkHelper for () { fn make_xcm_origin(location: xcm::latest::MultiLocation) -> RuntimeOrigin { diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 9faedbb88f18..8e2ffbfeafa4 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -40,6 +40,7 @@ use parachains_common::{ use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::xcm_sender::ExponentialPrice; use rococo_runtime_constants::system_parachain::SystemParachains; +use snowbridge_runtime_common::XcmExportFeeToSibling; use sp_core::{Get, H256}; use sp_runtime::traits::AccountIdConversion; use sp_std::marker::PhantomData; @@ -317,6 +318,14 @@ impl xcm_executor::Config for XcmConfig { crate::bridge_to_rococo_config::BridgeHubRococoChainId, crate::bridge_to_rococo_config::AssetHubWococoToAssetHubRococoMessagesLane, >, + XcmExportFeeToSibling< + bp_rococo::Balance, + AccountId, + TokenLocation, + EthereumNetwork, + Self::AssetTransactor, + crate::EthereumOutboundQueue, + >, XcmFeeToAccount, ), >;