diff --git a/Cargo.lock b/Cargo.lock index 4f003a89e289..ce2c324ffe60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1952,9 +1952,9 @@ dependencies = [ "serde_json", "snowbridge-core", "snowbridge-inbound-queue-pallet", - "snowbridge-outbound-queue", + "snowbridge-outbound-queue-pallet", "snowbridge-router-primitives", - "snowbridge-system", + "snowbridge-system-pallet", "sp-core", "sp-runtime", ] @@ -1986,10 +1986,10 @@ dependencies = [ "scale-info", "snowbridge-core", "snowbridge-inbound-queue-pallet", - "snowbridge-outbound-queue", + "snowbridge-outbound-queue-pallet", "snowbridge-rococo-common", "snowbridge-router-primitives", - "snowbridge-system", + "snowbridge-system-pallet", "sp-core", "sp-runtime", "staging-xcm", @@ -2064,13 +2064,13 @@ dependencies = [ "snowbridge-core", "snowbridge-ethereum-client-pallet", "snowbridge-inbound-queue-pallet", - "snowbridge-outbound-queue", + "snowbridge-outbound-queue-pallet", "snowbridge-outbound-queue-runtime-api", "snowbridge-rococo-common", "snowbridge-router-primitives", "snowbridge-runtime-common", "snowbridge-runtime-test-common", - "snowbridge-system", + "snowbridge-system-pallet", "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", @@ -17373,7 +17373,17 @@ dependencies = [ ] [[package]] -name = "snowbridge-outbound-queue" +name = "snowbridge-outbound-queue-merkle-tree" +version = "0.9.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "snowbridge-outbound-queue-pallet" version = "0.9.0" dependencies = [ "bridge-hub-common", @@ -17395,16 +17405,6 @@ dependencies = [ "staging-xcm", ] -[[package]] -name = "snowbridge-outbound-queue-merkle-tree" -version = "0.9.0" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", -] - [[package]] name = "snowbridge-outbound-queue-runtime-api" version = "0.9.0" @@ -17512,10 +17512,10 @@ dependencies = [ "snowbridge-core", "snowbridge-ethereum-client-pallet", "snowbridge-inbound-queue-pallet", - "snowbridge-outbound-queue", + "snowbridge-outbound-queue-pallet", "snowbridge-outbound-queue-runtime-api", "snowbridge-router-primitives", - "snowbridge-system", + "snowbridge-system-pallet", "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", @@ -17538,7 +17538,7 @@ dependencies = [ ] [[package]] -name = "snowbridge-system" +name = "snowbridge-system-pallet" version = "0.9.0" dependencies = [ "ethabi-decode", diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo/Cargo.toml index 71fe136bb8bd..45ee95daa896 100644 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo/Cargo.toml @@ -30,6 +30,6 @@ bridge-hub-common = { path = "../../../../../../runtimes/bridge-hubs/common", de # Snowbridge snowbridge-core = { path = "../../../../../../../../../parachain/primitives/core", default-features = false } snowbridge-router-primitives = { path = "../../../../../../../../../parachain/primitives/router", default-features = false } -snowbridge-system = { path = "../../../../../../../../../parachain/pallets/system", default-features = false } +snowbridge-system-pallet = { path = "../../../../../../../../../parachain/pallets/system", default-features = false } snowbridge-inbound-queue-pallet = { path = "../../../../../../../../../parachain/pallets/inbound-queue", default-features = false } -snowbridge-outbound-queue = { path = "../../../../../../../../../parachain/pallets/outbound-queue", default-features = false } +snowbridge-outbound-queue-pallet = { path = "../../../../../../../../../parachain/pallets/outbound-queue", default-features = false } diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml index be09e8cbad37..06493cf28412 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml @@ -48,7 +48,7 @@ asset-hub-rococo-runtime = { path = "../../../../../runtimes/assets/asset-hub-ro # Snowbridge snowbridge-core = { path = "../../../../../../../../parachain/primitives/core", default-features = false } snowbridge-router-primitives = { path = "../../../../../../../../parachain/primitives/router", default-features = false } -snowbridge-system = { path = "../../../../../../../../parachain/pallets/system", default-features = false } +snowbridge-system-pallet = { path = "../../../../../../../../parachain/pallets/system", default-features = false } snowbridge-inbound-queue-pallet = { path = "../../../../../../../../parachain/pallets/inbound-queue", default-features = false } -snowbridge-outbound-queue = { path = "../../../../../../../../parachain/pallets/outbound-queue", default-features = false } +snowbridge-outbound-queue-pallet = { path = "../../../../../../../../parachain/pallets/outbound-queue", default-features = false } snowbridge-rococo-common = { path = "../../../../../../../../parachain/runtime/rococo-common", default-features = false } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs index ca581929c999..63adcaf5458b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs @@ -822,7 +822,7 @@ pub mod bridging { 1, X2( Parachain(SiblingBridgeHubParaId::get()), - PalletInstance(snowbridge_rococo_common::INBOUND_QUEUE_MESSAGES_PALLET_INDEX) + PalletInstance(snowbridge_rococo_common::INBOUND_QUEUE_PALLET_INDEX) ) ); 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 760fc4b91e32..48facefaa1a0 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -108,12 +108,12 @@ bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", de # Ethereum Bridge (Snowbridge) snowbridge-beacon-primitives = { path = "../../../../../../parachain/primitives/beacon", default-features = false } -snowbridge-system = { path = "../../../../../../parachain/pallets/system", default-features = false } +snowbridge-system-pallet = { path = "../../../../../../parachain/pallets/system", default-features = false } snowbridge-system-runtime-api = { path = "../../../../../../parachain/pallets/system/runtime-api", default-features = false } snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false } snowbridge-ethereum-client-pallet = { path = "../../../../../../parachain/pallets/ethereum-client", default-features = false } snowbridge-inbound-queue-pallet = { path = "../../../../../../parachain/pallets/inbound-queue", default-features = false } -snowbridge-outbound-queue = { path = "../../../../../../parachain/pallets/outbound-queue", default-features = false } +snowbridge-outbound-queue-pallet = { path = "../../../../../../parachain/pallets/outbound-queue", default-features = false } snowbridge-outbound-queue-runtime-api = { path = "../../../../../../parachain/pallets/outbound-queue/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 } @@ -196,12 +196,12 @@ std = [ "snowbridge-ethereum-client-pallet/std", "snowbridge-inbound-queue-pallet/std", "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-outbound-queue/std", + "snowbridge-outbound-queue-pallet/std", "snowbridge-rococo-common/std", "snowbridge-router-primitives/std", "snowbridge-runtime-common/std", "snowbridge-system-runtime-api/std", - "snowbridge-system/std", + "snowbridge-system-pallet/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -254,12 +254,12 @@ runtime-benchmarks = [ "snowbridge-core/runtime-benchmarks", "snowbridge-ethereum-client-pallet/runtime-benchmarks", "snowbridge-inbound-queue-pallet/runtime-benchmarks", - "snowbridge-outbound-queue/runtime-benchmarks", + "snowbridge-outbound-queue-pallet/runtime-benchmarks", "snowbridge-rococo-common/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "snowbridge-runtime-common/runtime-benchmarks", "snowbridge-runtime-test-common/runtime-benchmarks", - "snowbridge-system/runtime-benchmarks", + "snowbridge-system-pallet/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", @@ -294,8 +294,8 @@ try-runtime = [ "polkadot-runtime-common/try-runtime", "snowbridge-ethereum-client-pallet/try-runtime", "snowbridge-inbound-queue-pallet/try-runtime", - "snowbridge-outbound-queue/try-runtime", - "snowbridge-system/try-runtime", + "snowbridge-outbound-queue-pallet/try-runtime", + "snowbridge-system-pallet/try-runtime", "sp-runtime/try-runtime", ] diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index af2438efbcf4..9a8b20c7b834 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -22,6 +22,6 @@ use snowbridge_router_primitives::outbound::EthereumBlobExporter; pub type SnowbridgeExporter = EthereumBlobExporter< UniversalLocation, EthereumNetwork, - snowbridge_outbound_queue::Pallet, + snowbridge_outbound_queue_pallet::Pallet, snowbridge_core::AgentIdOf, >; 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 be9582ff97d3..0ab23edbbff6 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 @@ -144,7 +144,7 @@ pub type Migrations = ( InitStorageVersions, cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, // unreleased - snowbridge_system::migration::v0::InitializeOnUpgrade< + snowbridge_system_pallet::migration::v0::InitializeOnUpgrade< Runtime, ConstU32, ConstU32, @@ -502,7 +502,7 @@ parameter_types! { parameter_types! { pub const CreateAssetCall: [u8;2] = [53, 0]; pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT; - pub const InboundQueuePalletInstance: u8 = snowbridge_rococo_common::INBOUND_QUEUE_MESSAGES_PALLET_INDEX; + pub const InboundQueuePalletInstance: u8 = snowbridge_rococo_common::INBOUND_QUEUE_PALLET_INDEX; pub Parameters: PricingParameters = PricingParameters { exchange_rate: FixedU128::from_rational(1, 400), fee_per_gas: gwei(20), @@ -541,7 +541,7 @@ pub mod benchmark_helpers { } } - impl snowbridge_system::BenchmarkHelper for () { + impl snowbridge_system_pallet::BenchmarkHelper for () { fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { RuntimeOrigin::from(pallet_xcm::Origin::Xcm(location)) } @@ -575,7 +575,7 @@ impl snowbridge_inbound_queue_pallet::Config for Runtime { type AssetTransactor = ::AssetTransactor; } -impl snowbridge_outbound_queue::Config for Runtime { +impl snowbridge_outbound_queue_pallet::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Hashing = Keccak256; type MessageQueue = MessageQueue; @@ -585,7 +585,7 @@ impl snowbridge_outbound_queue::Config for Runtime { type GasMeter = snowbridge_core::outbound::ConstantGasMeter; type Balance = Balance; type WeightToFee = WeightToFee; - type WeightInfo = weights::snowbridge_outbound_queue::WeightInfo; + type WeightInfo = weights::snowbridge_outbound_queue_pallet::WeightInfo; type PricingParameters = EthereumSystem; type Channels = EthereumSystem; } @@ -645,14 +645,14 @@ impl snowbridge_ethereum_client_pallet::Config for Runtime { type WeightInfo = weights::snowbridge_ethereum_client_pallet::WeightInfo; } -impl snowbridge_system::Config for Runtime { +impl snowbridge_system_pallet::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OutboundQueue = EthereumOutboundQueue; type SiblingOrigin = EnsureXcm; type AgentIdOf = snowbridge_core::AgentIdOf; type TreasuryAccount = TreasuryAccount; type Token = Balances; - type WeightInfo = weights::snowbridge_system::WeightInfo; + type WeightInfo = weights::snowbridge_system_pallet::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type Helper = (); type DefaultPricingParameters = Parameters; @@ -719,9 +719,9 @@ construct_runtime!( XcmOverPolkadotBulletin: pallet_xcm_bridge_hub::::{Pallet} = 62, EthereumInboundQueue: snowbridge_inbound_queue_pallet::{Pallet, Call, Storage, Event} = 80, - EthereumOutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event} = 81, + EthereumOutboundQueue: snowbridge_outbound_queue_pallet::{Pallet, Call, Storage, Event} = 81, EthereumBeaconClient: snowbridge_ethereum_client_pallet::{Pallet, Call, Storage, Event} = 82, - EthereumSystem: snowbridge_system::{Pallet, Call, Storage, Config, Event} = 83, + EthereumSystem: snowbridge_system_pallet::{Pallet, Call, Storage, Config, Event} = 83, // Message Queue. Importantly, is registered last so that messages are processed after // the `on_initialize` hooks of bridging pallets. @@ -774,8 +774,8 @@ mod benches { [pallet_bridge_relayers, BridgeRelayersBench::] // Ethereum Bridge [snowbridge_inbound_queue_pallet, EthereumInboundQueue] - [snowbridge_outbound_queue, EthereumOutboundQueue] - [snowbridge_system, EthereumSystem] + [snowbridge_outbound_queue_pallet, EthereumOutboundQueue] + [snowbridge_system_pallet, EthereumSystem] [snowbridge_ethereum_client_pallet, EthereumBeaconClient] ); } @@ -1006,18 +1006,18 @@ impl_runtime_apis! { } impl snowbridge_outbound_queue_runtime_api::OutboundQueueApi for Runtime { - fn prove_message(leaf_index: u64) -> Option { - snowbridge_outbound_queue::api::prove_message::(leaf_index) + fn prove_message(leaf_index: u64) -> Option { + snowbridge_outbound_queue_pallet::api::prove_message::(leaf_index) } fn calculate_fee(message: Message) -> Option { - snowbridge_outbound_queue::api::calculate_fee::(message) + snowbridge_outbound_queue_pallet::api::calculate_fee::(message) } } impl snowbridge_system_runtime_api::ControlApi for Runtime { fn agent_id(location: VersionedMultiLocation) -> Option { - snowbridge_system::api::agent_id::(location) + snowbridge_system_pallet::api::agent_id::(location) } } diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index c344fe6cce64..8ecbe4d1016f 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -42,8 +42,8 @@ pub mod paritydb_weights; pub mod rocksdb_weights; pub mod snowbridge_ethereum_client_pallet; pub mod snowbridge_inbound_queue_pallet; -pub mod snowbridge_outbound_queue; -pub mod snowbridge_system; +pub mod snowbridge_outbound_queue_pallet; +pub mod snowbridge_system_pallet; pub mod xcm; pub use block_weights::constants::BlockExecutionWeight; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue_pallet.rs similarity index 97% rename from cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs rename to cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue_pallet.rs index 6cffbc5344a6..b0b8c4264715 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_outbound_queue_pallet.rs @@ -43,7 +43,7 @@ use core::marker::PhantomData; /// Weight functions for `snowbridge_outbound_queue`. pub struct WeightInfo(PhantomData); -impl snowbridge_outbound_queue::WeightInfo for WeightInfo { +impl snowbridge_outbound_queue_pallet::WeightInfo for WeightInfo { /// Storage: EthereumOutboundQueue MessageLeaves (r:1 w:1) /// Proof Skipped: EthereumOutboundQueue MessageLeaves (max_values: Some(1), max_size: None, mode: Measured) /// Storage: EthereumOutboundQueue PendingHighPriorityMessageCount (r:1 w:1) diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system_pallet.rs similarity index 98% rename from cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system.rs rename to cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system_pallet.rs index 88c6c669c880..08e144a24294 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system_pallet.rs @@ -27,12 +27,12 @@ // pallet // --chain // bridge-hub-rococo-dev -// --pallet=snowbridge_system +// --pallet=snowbridge_system_pallet // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --output -// parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system.rs +// parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_system_pallet.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,7 +44,7 @@ use core::marker::PhantomData; /// Weight functions for `snowbridge_system`. pub struct WeightInfo(PhantomData); -impl snowbridge_system::WeightInfo for WeightInfo { +impl snowbridge_system_pallet::WeightInfo for WeightInfo { /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) 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 7ca6c6728763..6cdd216304c0 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 @@ -226,7 +226,7 @@ impl Contains for SafeCallFilter { ) | RuntimeCall::EthereumInboundQueue( snowbridge_inbound_queue_pallet::Call::set_operating_mode { .. }, ) | RuntimeCall::EthereumOutboundQueue( - snowbridge_outbound_queue::Call::set_operating_mode { .. }, + snowbridge_outbound_queue_pallet::Call::set_operating_mode { .. }, ) | RuntimeCall::EthereumSystem(..) ) } diff --git a/cumulus/parachains/runtimes/bridge-hubs/common/src/message_queue.rs b/cumulus/parachains/runtimes/bridge-hubs/common/src/message_queue.rs index 5328858db8f0..3e821d455694 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/common/src/message_queue.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/common/src/message_queue.rs @@ -26,7 +26,7 @@ use sp_std::{marker::PhantomData, prelude::*}; use xcm::v3::{Junction, MultiLocation}; /// The aggregate origin of an inbound message. -/// This is specialized for BridgeHub, as the snowbridge-outbound-queue pallet is also using +/// This is specialized for BridgeHub, as the snowbridge-outbound-queue-pallet is also using /// the shared MessageQueue pallet. #[derive(Encode, Decode, Copy, MaxEncodedLen, Clone, Eq, PartialEq, TypeInfo, Debug)] pub enum AggregateMessageOrigin { @@ -41,7 +41,7 @@ pub enum AggregateMessageOrigin { /// This is used by the HRMP queue. Sibling(ParaId), /// The message came from a snowbridge channel. - /// + /// /// This is used by Snowbridge inbound queue. Snowbridge(ChannelId), }