From 12fdef12718eae8a9c16a4e2abf17b44416c5af1 Mon Sep 17 00:00:00 2001 From: Gianfranco Date: Tue, 16 Sep 2025 10:45:48 -0300 Subject: [PATCH 1/3] explicit condition to allow AH as DOT reserve --- runtime/pendulum/src/xcm_config.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/runtime/pendulum/src/xcm_config.rs b/runtime/pendulum/src/xcm_config.rs index e25f3d0b2..c5672bbe7 100644 --- a/runtime/pendulum/src/xcm_config.rs +++ b/runtime/pendulum/src/xcm_config.rs @@ -74,6 +74,20 @@ where ReserveProvider: Reserve, { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + // Explicit allow for DOT from Asset Hub + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!( + origin, + MultiLocation { parents: 1, interior: X1(Parachain(1000)) } + ) { + return true; + } + if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { return true; From 9739b41046ffad580f7d4825d4349ce6df04c581 Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Mon, 29 Sep 2025 11:24:21 +0200 Subject: [PATCH 2/3] Explicitly deny relay asset from relay chain to prepare for AH migration --- runtime/amplitude/src/xcm_config.rs | 24 ++++++++++++++++++++++ runtime/foucoco/src/xcm_config.rs | 24 ++++++++++++++++++++++ runtime/pendulum/src/xcm_config.rs | 32 +++++++++++++++++++---------- 3 files changed, 69 insertions(+), 11 deletions(-) diff --git a/runtime/amplitude/src/xcm_config.rs b/runtime/amplitude/src/xcm_config.rs index e456bc49d..5e1c0ab2d 100644 --- a/runtime/amplitude/src/xcm_config.rs +++ b/runtime/amplitude/src/xcm_config.rs @@ -69,6 +69,30 @@ where ReserveProvider: Reserve, { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + // Explicit allow for KSM from Asset Hub + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: X1(Parachain(1000)) }) + { + return true; + } + + // Explicit deny for KSM from Relay Chain + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: Here }) + { + return false; + } + if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { return true; diff --git a/runtime/foucoco/src/xcm_config.rs b/runtime/foucoco/src/xcm_config.rs index 7eebf0949..1abf4f885 100644 --- a/runtime/foucoco/src/xcm_config.rs +++ b/runtime/foucoco/src/xcm_config.rs @@ -64,6 +64,30 @@ where ReserveProvider: Reserve, { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { + // Explicit allow for KSM from Asset Hub + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: X1(Parachain(1000)) }) + { + return true; + } + + // Explicit deny for KSM from Relay Chain + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: Here }) + { + return false; + } + if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { return true; diff --git a/runtime/pendulum/src/xcm_config.rs b/runtime/pendulum/src/xcm_config.rs index c5672bbe7..2d94033ed 100644 --- a/runtime/pendulum/src/xcm_config.rs +++ b/runtime/pendulum/src/xcm_config.rs @@ -76,17 +76,27 @@ where fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { // Explicit allow for DOT from Asset Hub if matches!( - asset, - MultiAsset { - id: Concrete(MultiLocation { parents: 1, interior: Here }), - fun: Fungible(_), - } - ) && matches!( - origin, - MultiLocation { parents: 1, interior: X1(Parachain(1000)) } - ) { - return true; - } + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: X1(Parachain(1000)) }) + { + return true; + } + + // Explicit deny for DOT from Relay Chain + if matches!( + asset, + MultiAsset { + id: Concrete(MultiLocation { parents: 1, interior: Here }), + fun: Fungible(_), + } + ) && matches!(origin, MultiLocation { parents: 1, interior: Here }) + { + return false; + } if let Some(ref reserve) = ReserveProvider::reserve(asset) { if reserve == origin { From ce6f3f600aed0e80b9ed4abe7b8f96862dbc44cc Mon Sep 17 00:00:00 2001 From: Marcel Ebert Date: Mon, 29 Sep 2025 11:24:52 +0200 Subject: [PATCH 3/3] Change comment --- runtime/foucoco/src/xcm_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/foucoco/src/xcm_config.rs b/runtime/foucoco/src/xcm_config.rs index 1abf4f885..b22d84c1f 100644 --- a/runtime/foucoco/src/xcm_config.rs +++ b/runtime/foucoco/src/xcm_config.rs @@ -64,7 +64,7 @@ where ReserveProvider: Reserve, { fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { - // Explicit allow for KSM from Asset Hub + // Explicit allow for PAS from Asset Hub if matches!( asset, MultiAsset { @@ -76,7 +76,7 @@ where return true; } - // Explicit deny for KSM from Relay Chain + // Explicit deny for PAS from Relay Chain if matches!( asset, MultiAsset {