From b5f04587c5928154e9b9364d92c6c2db862cb542 Mon Sep 17 00:00:00 2001 From: Sander Bosma Date: Mon, 31 Jul 2023 13:30:33 +0200 Subject: [PATCH] feat: allow polkadotXcm.send --- parachain/runtime/interlay/src/lib.rs | 10 +++++++--- parachain/runtime/kintsugi/src/lib.rs | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index aa9ee24427..4267d35739 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -197,11 +197,15 @@ impl Contains for BaseCallFilter { ) { // always allow core calls true - } else if let RuntimeCall::PolkadotXcm(_) = call { - // For security reasons, disallow usage of the xcm package by users. Sudo and + } else if let RuntimeCall::PolkadotXcm(polkadot_xcm_call) = call { + // For security reasons, disallow most usage of the xcm package by users. Sudo and // governance are still able to call these (sudo is explicitly white-listed, while // governance bypasses this call filter). - false + + // We do allow PolkadotXcm.send - it's needed for e.g. wormhole interactions on + // moonbeam/moonriver. We could probably also allow other functions, but this way + // we don't need to worry about security implications of these functions + matches!(polkadot_xcm_call, pallet_xcm::Call::::send { .. }) } else if let RuntimeCall::EVM(_) = call { // disable non-root EVM access false diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index d5ed050368..c38af2bb91 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -196,11 +196,15 @@ impl Contains for BaseCallFilter { ) { // always allow core calls true - } else if let RuntimeCall::PolkadotXcm(_) = call { - // For security reasons, disallow usage of the xcm package by users. Sudo and + } else if let RuntimeCall::PolkadotXcm(polkadot_xcm_call) = call { + // For security reasons, disallow most usage of the xcm package by users. Sudo and // governance are still able to call these (sudo is explicitly white-listed, while // governance bypasses this call filter). - false + + // We do allow PolkadotXcm.send - it's needed for e.g. wormhole interactions on + // moonbeam/moonriver. We could probably also allow other functions, but this way + // we don't need to worry about security implications of these functions + matches!(polkadot_xcm_call, pallet_xcm::Call::::send { .. }) } else if let RuntimeCall::EVM(_) = call { // disable non-root EVM access false