diff --git a/Cargo.lock b/Cargo.lock index 979e935a0..a7d87a2ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4938,7 +4938,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "258.0.0" +version = "259.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -11931,7 +11931,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.23.5" +version = "1.23.6" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 797aef4af..fdafaaffb 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.23.5" +version = "1.23.6" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/integration-tests/src/call_filter.rs b/integration-tests/src/call_filter.rs index 419a6353d..b3d8b27d6 100644 --- a/integration-tests/src/call_filter.rs +++ b/integration-tests/src/call_filter.rs @@ -5,7 +5,6 @@ use frame_support::{ assert_ok, sp_runtime::{FixedU128, Permill}, traits::Contains, - weights::Weight, }; use polkadot_xcm::v3::prelude::*; use polkadot_xcm::VersionedXcm; @@ -238,21 +237,6 @@ fn calling_pallet_xcm_send_extrinsic_should_not_be_filtered_by_call_filter() { }); } -#[test] -fn calling_pallet_xcm_extrinsic_should_be_filtered_by_call_filter() { - TestNet::reset(); - - Hydra::execute_with(|| { - // the values here don't need to make sense, all we need is a valid Call - let call = hydradx_runtime::RuntimeCall::PolkadotXcm(pallet_xcm::Call::execute { - message: Box::new(VersionedXcm::from(Xcm(vec![]))), - max_weight: Weight::zero(), - }); - - assert!(!hydradx_runtime::CallFilter::contains(&call)); - }); -} - #[test] fn calling_orml_xcm_extrinsic_should_be_filtered_by_call_filter() { TestNet::reset(); diff --git a/integration-tests/src/omnipool_liquidity_mining.rs b/integration-tests/src/omnipool_liquidity_mining.rs index 3a68f404c..7d16d5c3d 100644 --- a/integration-tests/src/omnipool_liquidity_mining.rs +++ b/integration-tests/src/omnipool_liquidity_mining.rs @@ -1295,7 +1295,7 @@ fn claim_rewards_should_work_when_farm_is_updated() { 10_000 * UNITS as i128, )); - let position_id = omnipool_add_liquidity(CHARLIE.into(), DOT, 1 * UNITS); + let position_id = omnipool_add_liquidity(CHARLIE.into(), DOT, UNITS); assert_nft_owner!( hydradx_runtime::OmnipoolCollectionId::get(), position_id, diff --git a/integration-tests/src/router.rs b/integration-tests/src/router.rs index b69445dc2..e68797d06 100644 --- a/integration-tests/src/router.rs +++ b/integration-tests/src/router.rs @@ -1352,7 +1352,6 @@ mod omnipool_router_tests { let extra_ed_charge = UNITS / 10; assert_balance!(ALICE.into(), HDX, 1000 * UNITS - ed); - let amount_to_sell = amount_to_sell; assert_ok!(Router::sell( hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), insufficient_asset_1, @@ -5408,7 +5407,6 @@ mod sell_all { assert_balance!(ALICE.into(), pool_id, 0); //Act - let amount_to_sell = 3000 * UNITS; assert_ok!(Router::sell_all( hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), stable_asset_1, diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 8cef497de..3b22d18f6 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "258.0.0" +version = "259.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 30afa06ce..9390c087e 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -113,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 258, + spec_version: 259, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/hydradx/src/system.rs b/runtime/hydradx/src/system.rs index 80fd81696..cf815c6b7 100644 --- a/runtime/hydradx/src/system.rs +++ b/runtime/hydradx/src/system.rs @@ -95,11 +95,9 @@ impl Contains for CallFilter { } match call { - RuntimeCall::PolkadotXcm(pallet_xcm::Call::send { .. }) => true, // create and create2 are only allowed through RPC or Runtime API RuntimeCall::EVM(pallet_evm::Call::create { .. }) => false, RuntimeCall::EVM(pallet_evm::Call::create2 { .. }) => false, - RuntimeCall::PolkadotXcm(_) => false, RuntimeCall::OrmlXcm(_) => false, _ => true, } diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index 57713434a..853841cd2 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -185,7 +185,7 @@ impl Config for XcmConfig { type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; - type SafeCallFilter = SafeCallFilter; + type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = xcm_builder::FrameTransactionalProcessor; } @@ -436,93 +436,3 @@ pub type LocalAssetTransactor = ReroutingMultiCurrencyAdapter< OmnipoolProtocolAccount, TreasuryAccount, >; - -/// 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 for SafeCallFilter { - fn contains(call: &RuntimeCall) -> bool { - #[cfg(feature = "runtime-benchmarks")] - { - if matches!(call, RuntimeCall::System(frame_system::Call::remark_with_event { .. })) { - return true; - } - } - - // check the runtime call filter - if !CallFilter::contains(call) { - return false; - } - - matches!( - call, - RuntimeCall::System(frame_system::Call::kill_prefix { .. } | frame_system::Call::set_heap_pages { .. }) - | RuntimeCall::Timestamp(..) - | RuntimeCall::Balances(..) - | RuntimeCall::Treasury(..) - | RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) - | RuntimeCall::Vesting(..) - | RuntimeCall::Proxy(..) - | 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 { .. }, - ) | RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) - | RuntimeCall::Uniques( - pallet_uniques::Call::create { .. } - | pallet_uniques::Call::force_create { .. } - | 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_price { .. } - | pallet_uniques::Call::buy_item { .. }, - ) | RuntimeCall::Identity( - pallet_identity::Call::add_registrar { .. } - | pallet_identity::Call::set_identity { .. } - | pallet_identity::Call::clear_identity { .. } - | pallet_identity::Call::request_judgement { .. } - | pallet_identity::Call::cancel_request { .. } - | pallet_identity::Call::set_fee { .. } - | pallet_identity::Call::set_account_id { .. } - | pallet_identity::Call::set_fields { .. } - | pallet_identity::Call::provide_judgement { .. } - | pallet_identity::Call::kill_identity { .. } - | pallet_identity::Call::add_sub { .. } - | pallet_identity::Call::rename_sub { .. } - | pallet_identity::Call::remove_sub { .. } - | pallet_identity::Call::quit_sub { .. }, - ) | RuntimeCall::Omnipool(..) - | RuntimeCall::OmnipoolLiquidityMining(..) - | RuntimeCall::OTC(..) - | RuntimeCall::CircuitBreaker(..) - | RuntimeCall::Router(..) - | RuntimeCall::DCA(..) - | RuntimeCall::MultiTransactionPayment(..) - | RuntimeCall::Currencies(..) - | RuntimeCall::Tokens(..) - | RuntimeCall::OrmlXcm(..) - ) - } -}