Skip to content

Commit

Permalink
separate inbound pallet index IDs for v1 and v2
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Dec 5, 2024
1 parent 02750d6 commit 40e85ea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/inbound-queue-v2/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ parameter_types! {
pub const EthereumNetwork: xcm::v5::NetworkId = xcm::v5::NetworkId::Ethereum { chain_id: 11155111 };
pub const GatewayAddress: H160 = H160(GATEWAY_ADDRESS);
pub const WethAddress: H160 = H160(WETH_ADDRESS);
pub const InboundQueuePalletInstance: u8 = 80;
pub const InboundQueuePalletInstance: u8 = 84;
pub AssetHubLocation: InteriorLocation = Parachain(1000).into();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ pub mod bridging {
use assets_common::matching::FromNetwork;
use sp_std::collections::btree_set::BTreeSet;
use testnet_parachains_constants::westend::snowbridge::{
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX,
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX_V1, INBOUND_QUEUE_PALLET_INDEX_V2
};

parameter_types! {
Expand All @@ -659,11 +659,18 @@ pub mod bridging {
/// Polkadot uses 10 decimals, Kusama,Rococo,Westend 12 decimals.
pub const DefaultBridgeHubEthereumBaseFee: Balance = 2_750_872_500_000;
pub storage BridgeHubEthereumBaseFee: Balance = DefaultBridgeHubEthereumBaseFee::get();
pub SiblingBridgeHubWithEthereumInboundQueueInstance: Location = Location::new(
pub SiblingBridgeHubWithEthereumInboundQueueV1Instance: Location = Location::new(
1,
[
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(INBOUND_QUEUE_PALLET_INDEX)
PalletInstance(INBOUND_QUEUE_PALLET_INDEX_V1)
]
);
pub SiblingBridgeHubWithEthereumInboundQueueV2Instance: Location = Location::new(
1,
[
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(INBOUND_QUEUE_PALLET_INDEX_V2)
]
);

Expand All @@ -684,7 +691,8 @@ pub mod bridging {
/// Universal aliases
pub UniversalAliases: BTreeSet<(Location, Junction)> = BTreeSet::from_iter(
sp_std::vec![
(SiblingBridgeHubWithEthereumInboundQueueInstance::get(), GlobalConsensus(EthereumNetwork::get().into())),
(SiblingBridgeHubWithEthereumInboundQueueV1Instance::get(), GlobalConsensus(EthereumNetwork::get().into())),
(SiblingBridgeHubWithEthereumInboundQueueV2Instance::get(), GlobalConsensus(EthereumNetwork::get().into())),
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sp_core::H160;
use testnet_parachains_constants::westend::{
currency::*,
fee::WeightToFee,
snowbridge::{EthereumLocation, EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX},
snowbridge::{EthereumLocation, EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX_V1, INBOUND_QUEUE_PALLET_INDEX_V2},
};

use crate::xcm_config::RelayNetwork;
Expand Down Expand Up @@ -89,7 +89,7 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime {
type MessageConverter = snowbridge_router_primitives::inbound::v1::MessageToXcm<
CreateAssetCall,
CreateAssetDeposit,
ConstU8<INBOUND_QUEUE_PALLET_INDEX>,
ConstU8<INBOUND_QUEUE_PALLET_INDEX_V1>,
AccountId,
Balance,
EthereumSystem,
Expand Down Expand Up @@ -121,7 +121,7 @@ impl snowbridge_pallet_inbound_queue_v2::Config for Runtime {
type Balance = Balance;
type MessageConverter = snowbridge_router_primitives::inbound::v2::MessageToXcm<
EthereumNetwork,
ConstU8<INBOUND_QUEUE_PALLET_INDEX>,
ConstU8<INBOUND_QUEUE_PALLET_INDEX_V2>,
EthereumSystem,
WethAddress,
EthereumGatewayAddress,
Expand Down
3 changes: 2 additions & 1 deletion cumulus/parachains/runtimes/constants/src/westend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ pub mod snowbridge {
use xcm::prelude::{Location, NetworkId};

/// The pallet index of the Ethereum inbound queue pallet in the bridge hub runtime.
pub const INBOUND_QUEUE_PALLET_INDEX: u8 = 80;
pub const INBOUND_QUEUE_PALLET_INDEX_V1: u8 = 80;
pub const INBOUND_QUEUE_PALLET_INDEX_V2: u8 = 84;

parameter_types! {
/// Network and location for the Ethereum chain. On Westend, the Ethereum chain bridged
Expand Down

0 comments on commit 40e85ea

Please sign in to comment.