mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 03:11:01 +00:00
[testnets] remove XCM SafeCallFilter for chains using Weights::v3 (#4199)
Weights::v3 also accounts for PoV weight so we no longer need the SafeCallFilter. All calls are allowed as long as they "fit in the block".
This commit is contained in:
@@ -61,7 +61,7 @@ use xcm_builder::{
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const TokenLocation: Location = Location::parent();
|
||||
@@ -263,223 +263,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// Allow to change dedicated storage items (called by governance-like)
|
||||
match call {
|
||||
RuntimeCall::System(frame_system::Call::set_storage { items })
|
||||
if items.iter().all(|(k, _)| {
|
||||
k.eq(&bridging::XcmBridgeHubRouterByteFee::key()) ||
|
||||
k.eq(&bridging::XcmBridgeHubRouterBaseFee::key()) ||
|
||||
k.eq(&bridging::to_ethereum::BridgeHubEthereumBaseFee::key())
|
||||
}) =>
|
||||
return true,
|
||||
_ => (),
|
||||
};
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::PoolAssets(
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::AssetConversion(
|
||||
pallet_asset_conversion::Call::create_pool { .. } |
|
||||
pallet_asset_conversion::Call::add_liquidity { .. } |
|
||||
pallet_asset_conversion::Call::remove_liquidity { .. } |
|
||||
pallet_asset_conversion::Call::swap_tokens_for_exact_tokens { .. } |
|
||||
pallet_asset_conversion::Call::swap_exact_tokens_for_tokens { .. },
|
||||
) | RuntimeCall::NftFractionalization(
|
||||
pallet_nft_fractionalization::Call::fractionalize { .. } |
|
||||
pallet_nft_fractionalization::Call::unify { .. },
|
||||
) | RuntimeCall::Nfts(
|
||||
pallet_nfts::Call::create { .. } |
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) | RuntimeCall::Uniques(
|
||||
pallet_uniques::Call::create { .. } |
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. }
|
||||
) | RuntimeCall::ToWestendXcmRouter(
|
||||
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -632,8 +415,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases =
|
||||
(bridging::to_westend::UniversalAliases, bridging::to_ethereum::UniversalAliases);
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -57,7 +57,7 @@ use xcm_builder::{
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const WestendLocation: Location = Location::parent();
|
||||
@@ -275,228 +275,6 @@ impl Contains<Location> for AmbassadorEntities {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// Allow to change dedicated storage items (called by governance-like)
|
||||
match call {
|
||||
RuntimeCall::System(frame_system::Call::set_storage { items })
|
||||
if items.iter().all(|(k, _)| k.eq(&bridging::XcmBridgeHubRouterByteFee::key())) ||
|
||||
items
|
||||
.iter()
|
||||
.all(|(k, _)| k.eq(&bridging::XcmBridgeHubRouterBaseFee::key())) =>
|
||||
return true,
|
||||
_ => (),
|
||||
};
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::Assets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::ForeignAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::PoolAssets(
|
||||
pallet_assets::Call::create { .. } |
|
||||
pallet_assets::Call::force_create { .. } |
|
||||
pallet_assets::Call::start_destroy { .. } |
|
||||
pallet_assets::Call::destroy_accounts { .. } |
|
||||
pallet_assets::Call::destroy_approvals { .. } |
|
||||
pallet_assets::Call::finish_destroy { .. } |
|
||||
pallet_assets::Call::block { .. } |
|
||||
pallet_assets::Call::mint { .. } |
|
||||
pallet_assets::Call::burn { .. } |
|
||||
pallet_assets::Call::transfer { .. } |
|
||||
pallet_assets::Call::transfer_keep_alive { .. } |
|
||||
pallet_assets::Call::force_transfer { .. } |
|
||||
pallet_assets::Call::freeze { .. } |
|
||||
pallet_assets::Call::thaw { .. } |
|
||||
pallet_assets::Call::freeze_asset { .. } |
|
||||
pallet_assets::Call::thaw_asset { .. } |
|
||||
pallet_assets::Call::transfer_ownership { .. } |
|
||||
pallet_assets::Call::set_team { .. } |
|
||||
pallet_assets::Call::set_metadata { .. } |
|
||||
pallet_assets::Call::clear_metadata { .. } |
|
||||
pallet_assets::Call::force_set_metadata { .. } |
|
||||
pallet_assets::Call::force_clear_metadata { .. } |
|
||||
pallet_assets::Call::force_asset_status { .. } |
|
||||
pallet_assets::Call::approve_transfer { .. } |
|
||||
pallet_assets::Call::cancel_approval { .. } |
|
||||
pallet_assets::Call::force_cancel_approval { .. } |
|
||||
pallet_assets::Call::transfer_approved { .. } |
|
||||
pallet_assets::Call::touch { .. } |
|
||||
pallet_assets::Call::touch_other { .. } |
|
||||
pallet_assets::Call::refund { .. } |
|
||||
pallet_assets::Call::refund_other { .. },
|
||||
) | RuntimeCall::AssetConversion(
|
||||
pallet_asset_conversion::Call::create_pool { .. } |
|
||||
pallet_asset_conversion::Call::add_liquidity { .. } |
|
||||
pallet_asset_conversion::Call::remove_liquidity { .. } |
|
||||
pallet_asset_conversion::Call::swap_tokens_for_exact_tokens { .. } |
|
||||
pallet_asset_conversion::Call::swap_exact_tokens_for_tokens { .. },
|
||||
) | RuntimeCall::NftFractionalization(
|
||||
pallet_nft_fractionalization::Call::fractionalize { .. } |
|
||||
pallet_nft_fractionalization::Call::unify { .. },
|
||||
) | RuntimeCall::Nfts(
|
||||
pallet_nfts::Call::create { .. } |
|
||||
pallet_nfts::Call::force_create { .. } |
|
||||
pallet_nfts::Call::destroy { .. } |
|
||||
pallet_nfts::Call::mint { .. } |
|
||||
pallet_nfts::Call::force_mint { .. } |
|
||||
pallet_nfts::Call::burn { .. } |
|
||||
pallet_nfts::Call::transfer { .. } |
|
||||
pallet_nfts::Call::lock_item_transfer { .. } |
|
||||
pallet_nfts::Call::unlock_item_transfer { .. } |
|
||||
pallet_nfts::Call::lock_collection { .. } |
|
||||
pallet_nfts::Call::transfer_ownership { .. } |
|
||||
pallet_nfts::Call::set_team { .. } |
|
||||
pallet_nfts::Call::force_collection_owner { .. } |
|
||||
pallet_nfts::Call::force_collection_config { .. } |
|
||||
pallet_nfts::Call::approve_transfer { .. } |
|
||||
pallet_nfts::Call::cancel_approval { .. } |
|
||||
pallet_nfts::Call::clear_all_transfer_approvals { .. } |
|
||||
pallet_nfts::Call::lock_item_properties { .. } |
|
||||
pallet_nfts::Call::set_attribute { .. } |
|
||||
pallet_nfts::Call::force_set_attribute { .. } |
|
||||
pallet_nfts::Call::clear_attribute { .. } |
|
||||
pallet_nfts::Call::approve_item_attributes { .. } |
|
||||
pallet_nfts::Call::cancel_item_attributes_approval { .. } |
|
||||
pallet_nfts::Call::set_metadata { .. } |
|
||||
pallet_nfts::Call::clear_metadata { .. } |
|
||||
pallet_nfts::Call::set_collection_metadata { .. } |
|
||||
pallet_nfts::Call::clear_collection_metadata { .. } |
|
||||
pallet_nfts::Call::set_accept_ownership { .. } |
|
||||
pallet_nfts::Call::set_collection_max_supply { .. } |
|
||||
pallet_nfts::Call::update_mint_settings { .. } |
|
||||
pallet_nfts::Call::set_price { .. } |
|
||||
pallet_nfts::Call::buy_item { .. } |
|
||||
pallet_nfts::Call::pay_tips { .. } |
|
||||
pallet_nfts::Call::create_swap { .. } |
|
||||
pallet_nfts::Call::cancel_swap { .. } |
|
||||
pallet_nfts::Call::claim_swap { .. },
|
||||
) | RuntimeCall::Uniques(
|
||||
pallet_uniques::Call::create { .. } |
|
||||
pallet_uniques::Call::force_create { .. } |
|
||||
pallet_uniques::Call::destroy { .. } |
|
||||
pallet_uniques::Call::mint { .. } |
|
||||
pallet_uniques::Call::burn { .. } |
|
||||
pallet_uniques::Call::transfer { .. } |
|
||||
pallet_uniques::Call::freeze { .. } |
|
||||
pallet_uniques::Call::thaw { .. } |
|
||||
pallet_uniques::Call::freeze_collection { .. } |
|
||||
pallet_uniques::Call::thaw_collection { .. } |
|
||||
pallet_uniques::Call::transfer_ownership { .. } |
|
||||
pallet_uniques::Call::set_team { .. } |
|
||||
pallet_uniques::Call::approve_transfer { .. } |
|
||||
pallet_uniques::Call::cancel_approval { .. } |
|
||||
pallet_uniques::Call::force_item_status { .. } |
|
||||
pallet_uniques::Call::set_attribute { .. } |
|
||||
pallet_uniques::Call::clear_attribute { .. } |
|
||||
pallet_uniques::Call::set_metadata { .. } |
|
||||
pallet_uniques::Call::clear_metadata { .. } |
|
||||
pallet_uniques::Call::set_collection_metadata { .. } |
|
||||
pallet_uniques::Call::clear_collection_metadata { .. } |
|
||||
pallet_uniques::Call::set_accept_ownership { .. } |
|
||||
pallet_uniques::Call::set_collection_max_supply { .. } |
|
||||
pallet_uniques::Call::set_price { .. } |
|
||||
pallet_uniques::Call::buy_item { .. }
|
||||
) | RuntimeCall::ToRococoXcmRouter(
|
||||
pallet_xcm_bridge_hub_router::Call::report_bridge_status { .. }
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -653,8 +431,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = (bridging::to_rococo::UniversalAliases,);
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -19,22 +19,12 @@ use super::{
|
||||
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin,
|
||||
TransactionByteFee, WeightToFee, XcmpQueue,
|
||||
};
|
||||
use crate::{
|
||||
bridge_common_config::{
|
||||
BridgeGrandpaRococoBulletinInstance, BridgeGrandpaWestendInstance,
|
||||
BridgeParachainWestendInstance, DeliveryRewardInBalance, RequiredStakeForStakeAndSlash,
|
||||
},
|
||||
bridge_to_bulletin_config::WithRococoBulletinMessagesInstance,
|
||||
bridge_to_westend_config::WithBridgeHubWestendMessagesInstance,
|
||||
EthereumGatewayAddress,
|
||||
};
|
||||
use bp_messages::LaneId;
|
||||
use bp_relayers::{PayRewardFromAccount, RewardsAccountOwner, RewardsAccountParams};
|
||||
use bp_runtime::ChainId;
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
StoragePrefixedMap,
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_collator_selection::StakingPotAccountId;
|
||||
@@ -64,7 +54,7 @@ use xcm_builder::{
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{
|
||||
traits::{FeeManager, FeeReason, FeeReason::Export, TransactAsset, WithOriginFilter},
|
||||
traits::{FeeManager, FeeReason, FeeReason::Export, TransactAsset},
|
||||
XcmExecutor,
|
||||
};
|
||||
|
||||
@@ -138,104 +128,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// Allow to change dedicated storage items (called by governance-like)
|
||||
match call {
|
||||
RuntimeCall::System(frame_system::Call::set_storage { items })
|
||||
if items.iter().all(|(k, _)| {
|
||||
k.eq(&DeliveryRewardInBalance::key()) ||
|
||||
k.eq(&RequiredStakeForStakeAndSlash::key()) ||
|
||||
k.eq(&EthereumGatewayAddress::key()) ||
|
||||
// Allow resetting of Ethereum nonces in Rococo only.
|
||||
k.starts_with(&snowbridge_pallet_inbound_queue::Nonce::<Runtime>::final_prefix()) ||
|
||||
k.starts_with(&snowbridge_pallet_outbound_queue::Nonce::<Runtime>::final_prefix())
|
||||
}) =>
|
||||
return true,
|
||||
_ => (),
|
||||
};
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::BridgeWestendGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaWestendInstance,
|
||||
>::initialize { .. }) |
|
||||
RuntimeCall::BridgeWestendGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaWestendInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgeWestendParachains(pallet_bridge_parachains::Call::<
|
||||
Runtime,
|
||||
BridgeParachainWestendInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgeWestendMessages(pallet_bridge_messages::Call::<
|
||||
Runtime,
|
||||
WithBridgeHubWestendMessagesInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgePolkadotBulletinGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaRococoBulletinInstance,
|
||||
>::initialize { .. }) |
|
||||
RuntimeCall::BridgePolkadotBulletinGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
BridgeGrandpaRococoBulletinInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgePolkadotBulletinMessages(pallet_bridge_messages::Call::<
|
||||
Runtime,
|
||||
WithRococoBulletinMessagesInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::EthereumBeaconClient(
|
||||
snowbridge_pallet_ethereum_client::Call::force_checkpoint { .. } |
|
||||
snowbridge_pallet_ethereum_client::Call::set_operating_mode { .. },
|
||||
) | RuntimeCall::EthereumInboundQueue(
|
||||
snowbridge_pallet_inbound_queue::Call::set_operating_mode { .. },
|
||||
) | RuntimeCall::EthereumOutboundQueue(
|
||||
snowbridge_pallet_outbound_queue::Call::set_operating_mode { .. },
|
||||
) | RuntimeCall::EthereumSystem(
|
||||
snowbridge_pallet_system::Call::upgrade { .. } |
|
||||
snowbridge_pallet_system::Call::set_operating_mode { .. } |
|
||||
snowbridge_pallet_system::Call::set_pricing_parameters { .. } |
|
||||
snowbridge_pallet_system::Call::force_update_channel { .. } |
|
||||
snowbridge_pallet_system::Call::force_transfer_native_from_agent { .. } |
|
||||
snowbridge_pallet_system::Call::set_token_transfer_fees { .. },
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -337,8 +229,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
crate::bridge_to_ethereum_config::SnowbridgeExporter,
|
||||
);
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -19,7 +19,6 @@ use super::{
|
||||
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin,
|
||||
TransactionByteFee, WeightToFee, XcmpQueue,
|
||||
};
|
||||
use crate::bridge_common_config::{DeliveryRewardInBalance, RequiredStakeForStakeAndSlash};
|
||||
use frame_support::{
|
||||
parameter_types,
|
||||
traits::{tokens::imbalance::ResolveTo, ConstU32, Contains, Equals, Everything, Nothing},
|
||||
@@ -48,7 +47,7 @@ use xcm_builder::{
|
||||
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents,
|
||||
XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const WestendLocation: Location = Location::parent();
|
||||
@@ -119,73 +118,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// Allow to change dedicated storage items (called by governance-like)
|
||||
match call {
|
||||
RuntimeCall::System(frame_system::Call::set_storage { items })
|
||||
if items.iter().all(|(k, _)| {
|
||||
k.eq(&DeliveryRewardInBalance::key()) |
|
||||
k.eq(&RequiredStakeForStakeAndSlash::key())
|
||||
}) =>
|
||||
return true,
|
||||
_ => (),
|
||||
};
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::BridgeRococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
crate::bridge_to_rococo_config::BridgeGrandpaRococoInstance,
|
||||
>::initialize { .. }) |
|
||||
RuntimeCall::BridgeRococoGrandpa(pallet_bridge_grandpa::Call::<
|
||||
Runtime,
|
||||
crate::bridge_to_rococo_config::BridgeGrandpaRococoInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgeRococoParachains(pallet_bridge_parachains::Call::<
|
||||
Runtime,
|
||||
crate::bridge_to_rococo_config::BridgeParachainRococoInstance,
|
||||
>::set_operating_mode { .. }) |
|
||||
RuntimeCall::BridgeRococoMessages(pallet_bridge_messages::Call::<
|
||||
Runtime,
|
||||
crate::bridge_to_rococo_config::WithBridgeHubRococoMessagesInstance,
|
||||
>::set_operating_mode { .. })
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -265,8 +197,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = (crate::bridge_to_rococo_config::ToBridgeHubRococoHaulBlobExporter,);
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -44,7 +44,7 @@ use xcm_builder::{
|
||||
TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const WndLocation: Location = Location::parent();
|
||||
@@ -138,83 +138,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::Alliance(
|
||||
// `init_members` accepts unbounded vecs as arguments,
|
||||
// but the call can be initiated only by root origin.
|
||||
pallet_alliance::Call::init_members { .. } |
|
||||
pallet_alliance::Call::vote { .. } |
|
||||
pallet_alliance::Call::disband { .. } |
|
||||
pallet_alliance::Call::set_rule { .. } |
|
||||
pallet_alliance::Call::announce { .. } |
|
||||
pallet_alliance::Call::remove_announcement { .. } |
|
||||
pallet_alliance::Call::join_alliance { .. } |
|
||||
pallet_alliance::Call::nominate_ally { .. } |
|
||||
pallet_alliance::Call::elevate_ally { .. } |
|
||||
pallet_alliance::Call::give_retirement_notice { .. } |
|
||||
pallet_alliance::Call::retire { .. } |
|
||||
pallet_alliance::Call::kick_member { .. } |
|
||||
pallet_alliance::Call::close { .. } |
|
||||
pallet_alliance::Call::abdicate_fellow_status { .. },
|
||||
) | RuntimeCall::AllianceMotion(
|
||||
pallet_collective::Call::vote { .. } |
|
||||
pallet_collective::Call::disapprove_proposal { .. } |
|
||||
pallet_collective::Call::close { .. },
|
||||
) | RuntimeCall::FellowshipCollective(
|
||||
pallet_ranked_collective::Call::add_member { .. } |
|
||||
pallet_ranked_collective::Call::promote_member { .. } |
|
||||
pallet_ranked_collective::Call::demote_member { .. } |
|
||||
pallet_ranked_collective::Call::remove_member { .. },
|
||||
) | RuntimeCall::FellowshipCore(
|
||||
pallet_core_fellowship::Call::bump { .. } |
|
||||
pallet_core_fellowship::Call::set_params { .. } |
|
||||
pallet_core_fellowship::Call::set_active { .. } |
|
||||
pallet_core_fellowship::Call::approve { .. } |
|
||||
pallet_core_fellowship::Call::induct { .. } |
|
||||
pallet_core_fellowship::Call::promote { .. } |
|
||||
pallet_core_fellowship::Call::offboard { .. } |
|
||||
pallet_core_fellowship::Call::submit_evidence { .. } |
|
||||
pallet_core_fellowship::Call::import { .. },
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -287,8 +210,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -48,7 +48,7 @@ use xcm_builder::{
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const RocRelayLocation: Location = Location::parent();
|
||||
@@ -139,49 +139,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. } |
|
||||
// Should not be in Polkadot/Kusama. Here in order to speed up testing.
|
||||
frame_system::Call::set_storage { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::Sudo(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::Broker(..)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -258,8 +215,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -48,7 +48,7 @@ use xcm_builder::{
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const TokenRelayLocation: Location = Location::parent();
|
||||
@@ -146,48 +146,6 @@ impl Contains<Location> for FellowsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. } |
|
||||
// Should not be in Polkadot/Kusama. Here in order to speed up testing.
|
||||
frame_system::Call::set_storage { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(..) |
|
||||
RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::Broker(..)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -265,8 +223,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -45,7 +45,7 @@ use xcm_builder::{
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const RootLocation: Location = Location::here();
|
||||
@@ -148,55 +148,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. } |
|
||||
pallet_collator_selection::Call::set_invulnerables { .. } |
|
||||
pallet_collator_selection::Call::add_invulnerable { .. } |
|
||||
pallet_collator_selection::Call::remove_invulnerable { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::Identity(..) |
|
||||
RuntimeCall::IdentityMigrator(..)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -270,8 +221,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -45,7 +45,7 @@ use xcm_builder::{
|
||||
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
|
||||
XcmFeeManagerFromComponents, XcmFeeToAccount,
|
||||
};
|
||||
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
parameter_types! {
|
||||
pub const RootLocation: Location = Location::here();
|
||||
@@ -155,55 +155,6 @@ impl Contains<Location> for FellowsPlurality {
|
||||
}
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
/// account for proof size weights.
|
||||
///
|
||||
/// Calls that are allowed through this filter must:
|
||||
/// 1. Have a fixed weight;
|
||||
/// 2. Cannot lead to another call being made;
|
||||
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
|
||||
pub struct SafeCallFilter;
|
||||
impl Contains<RuntimeCall> for SafeCallFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
{
|
||||
if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
matches!(
|
||||
call,
|
||||
RuntimeCall::PolkadotXcm(
|
||||
pallet_xcm::Call::force_xcm_version { .. } |
|
||||
pallet_xcm::Call::force_default_xcm_version { .. }
|
||||
) | RuntimeCall::System(
|
||||
frame_system::Call::set_heap_pages { .. } |
|
||||
frame_system::Call::set_code { .. } |
|
||||
frame_system::Call::set_code_without_checks { .. } |
|
||||
frame_system::Call::authorize_upgrade { .. } |
|
||||
frame_system::Call::authorize_upgrade_without_checks { .. } |
|
||||
frame_system::Call::kill_prefix { .. },
|
||||
) | RuntimeCall::ParachainSystem(..) |
|
||||
RuntimeCall::Timestamp(..) |
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { .. } |
|
||||
pallet_collator_selection::Call::set_candidacy_bond { .. } |
|
||||
pallet_collator_selection::Call::register_as_candidate { .. } |
|
||||
pallet_collator_selection::Call::leave_intent { .. } |
|
||||
pallet_collator_selection::Call::set_invulnerables { .. } |
|
||||
pallet_collator_selection::Call::add_invulnerable { .. } |
|
||||
pallet_collator_selection::Call::remove_invulnerable { .. },
|
||||
) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) |
|
||||
RuntimeCall::XcmpQueue(..) |
|
||||
RuntimeCall::MessageQueue(..) |
|
||||
RuntimeCall::Identity(..) |
|
||||
RuntimeCall::IdentityMigrator(..)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub type Barrier = TrailingSetTopicAsId<
|
||||
DenyThenTry<
|
||||
DenyReserveTransferToRelayChain,
|
||||
@@ -278,8 +229,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
|
||||
type SafeCallFilter = SafeCallFilter;
|
||||
type CallDispatcher = RuntimeCall;
|
||||
type SafeCallFilter = Everything;
|
||||
type Aliasers = Nothing;
|
||||
type TransactionalProcessor = FrameTransactionalProcessor;
|
||||
type HrmpNewChannelOpenRequestHandler = ();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
title: "Remove XCM SafeCallFilter for chains using Weights::v3"
|
||||
|
||||
doc:
|
||||
- audience: Runtime User
|
||||
description: |
|
||||
`SafeCallFilter` was removed from Rococo and Westend relay and system chains as they
|
||||
all now use Weights::v3 which already accounts for call PoV size.
|
||||
This effectively removes artificial limitations on what users can `XCM::Transact` on
|
||||
these chains (blockspace limitations are still upheld).
|
||||
|
||||
crates:
|
||||
- name: asset-hub-rococo-runtime
|
||||
bump: minor
|
||||
- name: asset-hub-westend-runtime
|
||||
bump: minor
|
||||
- name: bridge-hub-rococo-runtime
|
||||
bump: minor
|
||||
- name: bridge-hub-westend-runtime
|
||||
bump: minor
|
||||
- name: collectives-westend-runtime
|
||||
bump: minor
|
||||
- name: coretime-rococo-runtime
|
||||
bump: minor
|
||||
- name: coretime-westend-runtime
|
||||
bump: minor
|
||||
- name: people-rococo-runtime
|
||||
bump: minor
|
||||
- name: people-westend-runtime
|
||||
bump: minor
|
||||
Reference in New Issue
Block a user