From 242dc7426a750012a4bff0ef85a2f9c48d8bc6ef Mon Sep 17 00:00:00 2001 From: unconst Date: Tue, 23 Jun 2026 09:52:00 -0600 Subject: [PATCH 1/2] Default subnet emission off on registration New subnets registered via do_register_network now start with SubnetEmissionEnabled set to false so emission must be explicitly enabled, rather than relying on the storage default of true. Update the two coinbase tests that registered a dynamic network and expected emission to be on by enabling it explicitly. Co-authored-by: Cursor --- pallets/subtensor/src/subnets/subnet.rs | 3 +++ pallets/subtensor/src/tests/coinbase.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/pallets/subtensor/src/subnets/subnet.rs b/pallets/subtensor/src/subnets/subnet.rs index 7121874400..10e67a051a 100644 --- a/pallets/subtensor/src/subnets/subnet.rs +++ b/pallets/subtensor/src/subnets/subnet.rs @@ -287,6 +287,9 @@ impl Pallet { log::info!("NetworkAdded( netuid:{netuid_to_register:?}, mechanism:{mechid:?} )"); Self::deposit_event(Event::NetworkAdded(netuid_to_register, mechid)); + // --- 20. Default emission off + SubnetEmissionEnabled::::insert(netuid_to_register, false); + // --- 20. Return success. Ok(()) } diff --git a/pallets/subtensor/src/tests/coinbase.rs b/pallets/subtensor/src/tests/coinbase.rs index 6b5857afcc..1425d836ce 100644 --- a/pallets/subtensor/src/tests/coinbase.rs +++ b/pallets/subtensor/src/tests/coinbase.rs @@ -83,6 +83,8 @@ fn test_coinbase_tao_issuance_base() { let subnet_owner_ck = U256::from(1001); let subnet_owner_hk = U256::from(1002); let netuid = add_dynamic_network(&subnet_owner_hk, &subnet_owner_ck); + // Dynamic subnets register with emission disabled by default. + SubnetEmissionEnabled::::insert(netuid, true); // Price-based emission shares require a non-zero moving price. SubnetMovingPrice::::insert(netuid, I96F32::from_num(1)); // Keep root_proportion ~1 so the injection cap does not bind. @@ -2955,6 +2957,8 @@ fn test_coinbase_v3_liquidity_update() { // Enable emissions and run coinbase (which will increase position liquidity) let emission: u64 = 1_234_567; let emission_credit = SubtensorModule::mint_tao(emission.into()); + // Dynamic subnets register with emission disabled by default. + SubnetEmissionEnabled::::insert(netuid, true); // Price-based emission shares require a non-zero moving price. SubnetMovingPrice::::insert(netuid, I96F32::from_num(1)); // Keep root_proportion ~1 so the injection cap does not bind. From 2756271d628a47dbf59502bf79c0823bbaa68f2b Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Tue, 23 Jun 2026 20:06:12 +0300 Subject: [PATCH 2/2] spec bump --- 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 935a364ad3..f20e21a0bb 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -277,7 +277,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: 421, + spec_version: 422, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,