From 86b6f0c1d862134456945dd003c9facbeb3965a4 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 24 Feb 2026 19:15:57 +0300 Subject: [PATCH 1/5] Revert "Update base call filter" This reverts commit 138e8924195640f4916d83534b79313cbc1a3be6. --- runtime/src/base_call_filter.rs | 96 --------------------------------- runtime/src/lib.rs | 50 +++++++++++++++-- 2 files changed, 45 insertions(+), 101 deletions(-) delete mode 100644 runtime/src/base_call_filter.rs diff --git a/runtime/src/base_call_filter.rs b/runtime/src/base_call_filter.rs deleted file mode 100644 index 8d76c422c1..0000000000 --- a/runtime/src/base_call_filter.rs +++ /dev/null @@ -1,96 +0,0 @@ -use crate::RuntimeCall; -use crate::Vec; -use crate::pallet_proxy; -use crate::pallet_utility; -use frame_support::traits::Contains; -use sp_std::boxed::Box; -use sp_std::vec; -pub struct NoNestingCallFilter; - -impl Contains for NoNestingCallFilter { - fn contains(call: &RuntimeCall) -> bool { - let calls = match call { - RuntimeCall::Utility(inner) => { - let calls = match inner { - pallet_utility::Call::force_batch { calls } => calls, - pallet_utility::Call::batch { calls } => calls, - pallet_utility::Call::batch_all { calls } => calls, - _ => return true, - }; - - calls - .iter() - .map(|call| Box::new(call.clone())) - .collect::>() - } - RuntimeCall::Proxy(inner) => { - let call = match inner { - pallet_proxy::Call::proxy { call, .. } => call, - pallet_proxy::Call::proxy_announced { call, .. } => call, - _ => return true, - }; - - vec![call.clone()] - } - RuntimeCall::Multisig(inner) => { - let call = match inner { - pallet_multisig::Call::as_multi { call, .. } => call, - pallet_multisig::Call::as_multi_threshold_1 { call, .. } => call, - _ => return true, - }; - - vec![call.clone()] - } - RuntimeCall::Crowdloan(inner) => { - let call = match inner { - pallet_crowdloan::Call::create { - call: Some(call), .. - } => call, - _ => return true, - }; - - vec![call.clone()] - } - RuntimeCall::Scheduler(inner) => { - let call = match inner { - pallet_scheduler::Call::schedule { call, .. } => call, - pallet_scheduler::Call::schedule_after { call, .. } => call, - pallet_scheduler::Call::schedule_named { call, .. } => call, - pallet_scheduler::Call::schedule_named_after { call, .. } => call, - _ => return true, - }; - - vec![call.clone()] - } - _ => return true, - }; - - !calls.iter().any(|call| { - matches!(&**call, RuntimeCall::Utility(inner) if matches!(inner, pallet_utility::Call::force_batch { .. } | pallet_utility::Call::batch_all { .. } | pallet_utility::Call::batch { .. })) || - matches!(&**call, RuntimeCall::Proxy(inner) if matches!(inner, pallet_proxy::Call::proxy { .. } | pallet_proxy::Call::proxy_announced { .. })) || - matches!(&**call, RuntimeCall::Multisig(inner) if matches!(inner, pallet_multisig::Call::as_multi { .. } | pallet_multisig::Call::as_multi_threshold_1 { .. })) || - matches!(&**call, RuntimeCall::Crowdloan(inner) if matches!(inner, pallet_crowdloan::Call::create { .. } )) || - matches!(&**call, RuntimeCall::Scheduler(inner) if matches!(inner, pallet_scheduler::Call::schedule {..} | pallet_scheduler::Call::schedule_after { .. } | pallet_scheduler::Call::schedule_named {.. } | pallet_scheduler::Call::schedule_named_after { .. } )) || - matches!(&**call, RuntimeCall::Sudo(inner) if matches!(inner, pallet_sudo::Call::sudo {..} | pallet_sudo::Call::sudo_as { .. } | pallet_sudo::Call::sudo_unchecked_weight { .. } )) - }) - } -} - -pub struct SafeModeWhitelistedCalls; -impl Contains for SafeModeWhitelistedCalls { - fn contains(call: &RuntimeCall) -> bool { - matches!( - call, - RuntimeCall::Sudo(_) - | RuntimeCall::Multisig(_) - | RuntimeCall::System(_) - | RuntimeCall::SafeMode(_) - | RuntimeCall::Timestamp(_) - | RuntimeCall::SubtensorModule( - pallet_subtensor::Call::set_weights { .. } - | pallet_subtensor::Call::serve_axon { .. } - ) - | RuntimeCall::Commitments(pallet_commitments::Call::set_commitment { .. }) - ) - } -} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 460a84e049..2c6729067d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -10,7 +10,6 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use core::num::NonZeroU64; -mod base_call_filter; pub mod check_nonce; mod migrations; pub mod sudo_wrapper; @@ -78,9 +77,6 @@ use subtensor_runtime_common::{AlphaCurrency, AuthorshipInfo, TaoCurrency, time: use subtensor_swap_interface::{Order, SwapHandler}; // A few exports that help ease life for downstream crates. -use crate::base_call_filter::NoNestingCallFilter; -use crate::base_call_filter::SafeModeWhitelistedCalls; -use core::marker::PhantomData; pub use frame_support::{ StorageValue, construct_runtime, parameter_types, traits::{ @@ -100,12 +96,15 @@ pub use pallet_balances::Call as BalancesCall; use pallet_commitments::GetCommitments; pub use pallet_timestamp::Call as TimestampCall; use pallet_transaction_payment::{ConstFeeMultiplier, Multiplier}; -use scale_info::TypeInfo; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; use subtensor_transaction_fee::{SubtensorTxFeeHandler, TransactionFeeHandler}; +use core::marker::PhantomData; + +use scale_info::TypeInfo; + // Frontier use fp_rpc::TransactionStatus; use pallet_ethereum::{Call::transact, PostLogContent, Transaction as EthereumTransaction}; @@ -278,6 +277,28 @@ parameter_types! { pub const SS58Prefix: u8 = 42; } +pub struct NoNestingCallFilter; + +impl Contains for NoNestingCallFilter { + fn contains(call: &RuntimeCall) -> bool { + match call { + RuntimeCall::Utility(inner) => { + let calls = match inner { + pallet_utility::Call::force_batch { calls } => calls, + pallet_utility::Call::batch { calls } => calls, + pallet_utility::Call::batch_all { calls } => calls, + _ => &Vec::new(), + }; + + !calls.iter().any(|call| { + matches!(call, RuntimeCall::Utility(inner) if matches!(inner, pallet_utility::Call::force_batch { .. } | pallet_utility::Call::batch_all { .. } | pallet_utility::Call::batch { .. })) + }) + } + _ => true, + } + } +} + // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { @@ -411,6 +432,25 @@ parameter_types! { pub const DisallowPermissionlessRelease: Option = None; } +pub struct SafeModeWhitelistedCalls; +impl Contains for SafeModeWhitelistedCalls { + fn contains(call: &RuntimeCall) -> bool { + matches!( + call, + RuntimeCall::Sudo(_) + | RuntimeCall::Multisig(_) + | RuntimeCall::System(_) + | RuntimeCall::SafeMode(_) + | RuntimeCall::Timestamp(_) + | RuntimeCall::SubtensorModule( + pallet_subtensor::Call::set_weights { .. } + | pallet_subtensor::Call::serve_axon { .. } + ) + | RuntimeCall::Commitments(pallet_commitments::Call::set_commitment { .. }) + ) + } +} + impl pallet_safe_mode::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; From 7d5626d9757124d699472ba8878eaa0615e19ca0 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 24 Feb 2026 19:47:40 +0300 Subject: [PATCH 2/5] Bump spec version. --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2c6729067d..453472a6a7 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -242,7 +242,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 380, + spec_version: 381, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 969a245579cb54af00f175489553e071a41330ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Feb 2026 18:24:38 +0000 Subject: [PATCH 3/5] auto-update benchmark weights --- pallets/subtensor/src/macros/dispatches.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index 6330e07d1c..902dd5f43a 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -1070,8 +1070,8 @@ mod dispatches { /// Only callable by root as it doesn't require an announcement and can be used to swap any coldkey. #[pallet::call_index(71)] #[pallet::weight(Weight::from_parts(161_700_000, 0) - .saturating_add(T::DbWeight::get().reads(16_u64)) - .saturating_add(T::DbWeight::get().writes(11_u64)))] + .saturating_add(T::DbWeight::get().reads(17_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)))] pub fn swap_coldkey( origin: OriginFor, old_coldkey: T::AccountId, From 685049998df7ecff673403c2542d4ec9940517f1 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Thu, 26 Feb 2026 13:42:44 -0500 Subject: [PATCH 4/5] commit Cargo.lock changes --- Cargo.lock | 81 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71fe31e5f4..8d579fe469 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4121,6 +4121,16 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "endian-cast" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f7a506e5de77a3db9e56fdbed17fa6f3b8d27ede81545dde96107c3d6a1d2" +dependencies = [ + "generic-array 1.3.5", + "typenum", +] + [[package]] name = "enum-as-inner" version = "0.6.1" @@ -5560,6 +5570,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "generic-array" +version = "1.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf57c49a95fd1fe24b90b3033bee6dc7e8f1288d51494cb44e627c295e38542" +dependencies = [ + "rustversion", + "typenum", +] + [[package]] name = "gethostname" version = "0.2.3" @@ -6921,6 +6941,33 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "lencode" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83dc280ed78264020f986b2539e6a44e0720f98f66c99a48a2f52e4a441e99d8" +dependencies = [ + "endian-cast", + "generic-array 1.3.5", + "hashbrown 0.12.3", + "lencode-macros", + "newt-hype", + "ruint", + "zstd-safe 7.2.4", +] + +[[package]] +name = "lencode-macros" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c57df14b9005d1e4e8e56436e922e2c046ad0be55d7cfb062a303714857508" +dependencies = [ + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "libc" version = "0.2.176" @@ -8222,6 +8269,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "newt-hype" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8b7b69b0eafaa88ec8dc9fe7c3860af0a147517e5207cfbd0ecd21cd7cde18" + [[package]] name = "nix" version = "0.26.4" @@ -8654,7 +8707,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.106", @@ -14051,9 +14104,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.45" +version = "0.7.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" dependencies = [ "bitvec", "bytecheck", @@ -14069,9 +14122,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.45" +version = "0.7.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" dependencies = [ "proc-macro2", "quote", @@ -14315,9 +14368,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rust_decimal" -version = "1.39.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35affe401787a9bd846712274d97654355d21b2a2c092a3139aabe31e9022282" +checksum = "61f703d19852dbf87cbc513643fa81428361eb6940f1ac14fd58155d295a3eb0" dependencies = [ "arrayvec 0.7.6", "borsh", @@ -14586,9 +14639,10 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "safe-bigmath" -version = "0.3.0" -source = "git+https://github.com/sam0x17/safe-bigmath#1da0a09c5bcf143fa7c464b431bfaeff5476b080" +version = "0.4.1" +source = "git+https://github.com/sam0x17/safe-bigmath#013c49984910e1c9a23289e8c85e7a856e263a02" dependencies = [ + "lencode", "num-bigint", "num-integer", "num-traits", @@ -21117,6 +21171,15 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.16+zstd.1.5.7" From f67ae8464c195ca066196a3ac6abfd664c74f8c4 Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Thu, 26 Feb 2026 14:00:39 -0500 Subject: [PATCH 5/5] bump CI