diff --git a/pallets/subtensor/src/subnets/subnet.rs b/pallets/subtensor/src/subnets/subnet.rs index fd8b61b5dc..a322ecf023 100644 --- a/pallets/subtensor/src/subnets/subnet.rs +++ b/pallets/subtensor/src/subnets/subnet.rs @@ -211,7 +211,6 @@ impl Pallet { TokenSymbol::::insert(netuid_to_register, symbol); // Keep the locked TAO in the pool instead of recycling the excess. - // Mint the owner alpha separately at the median subnet alpha price. // Size the pool alpha reserve from the total TAO reserve at that same price. let pool_initial_tao: TaoBalance = Self::get_network_min_lock(); let total_pool_tao: TaoBalance = if actual_tao_lock_amount >= pool_initial_tao { @@ -219,8 +218,6 @@ impl Pallet { } else { pool_initial_tao }; - let owner_alpha_tao_equivalent: TaoBalance = - total_pool_tao.saturating_sub(pool_initial_tao); let total_pool_alpha: AlphaBalance = U96F32::saturating_from_num(total_pool_tao.to_u64()) .safe_div(median_subnet_alpha_price) @@ -228,12 +225,7 @@ impl Pallet { .saturating_to_num::() .into(); - let owner_alpha_stake: AlphaBalance = - U96F32::saturating_from_num(owner_alpha_tao_equivalent.to_u64()) - .safe_div(median_subnet_alpha_price) - .saturating_floor() - .saturating_to_num::() - .into(); + let owner_alpha_stake = AlphaBalance::ZERO; // With the full lock retained in the reserve, this will normally be zero. let tao_recycled_for_registration = actual_tao_lock_amount.saturating_sub(total_pool_tao); @@ -250,15 +242,6 @@ impl Pallet { SubnetVolume::::insert(netuid_to_register, 0u128); RAORecycledForRegistration::::insert(netuid_to_register, tao_recycled_for_registration); - if !owner_alpha_stake.is_zero() { - Self::increase_stake_for_hotkey_and_coldkey_on_subnet( - hotkey, - &coldkey, - netuid_to_register, - owner_alpha_stake, - ); - } - if tao_recycled_for_registration > TaoBalance::ZERO { Self::recycle_tao(tao_recycled_for_registration); } diff --git a/pallets/subtensor/src/tests/subnet.rs b/pallets/subtensor/src/tests/subnet.rs index 9d734b992a..282505afa9 100644 --- a/pallets/subtensor/src/tests/subnet.rs +++ b/pallets/subtensor/src/tests/subnet.rs @@ -909,3 +909,40 @@ fn test_update_symbol_fails_if_symbol_already_in_use() { ); }); } + +#[test] +fn test_register_network_gives_owner_no_initial_alpha_distribution() { + new_test_ext(1).execute_with(|| { + let owner_coldkey = U256::from(5001); + let owner_hotkey = U256::from(5002); + let lock_cost = SubtensorModule::get_network_lock_cost(); + let netuids_before = SubtensorModule::get_all_subnet_netuids(); + + SubtensorModule::add_balance_to_coldkey_account( + &owner_coldkey, + ExistentialDeposit::get() + lock_cost.into(), + ); + + assert_ok!(SubtensorModule::register_network( + <::RuntimeOrigin>::signed(owner_coldkey), + owner_hotkey + )); + + let netuid = SubtensorModule::get_all_subnet_netuids() + .into_iter() + .find(|netuid| !netuids_before.contains(netuid)) + .unwrap(); + + assert_eq!(SubnetOwner::::get(netuid), owner_coldkey); + assert_eq!(SubnetOwnerHotkey::::get(netuid), owner_hotkey); + assert_eq!(SubnetAlphaOut::::get(netuid), AlphaBalance::ZERO); + assert_eq!( + SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet( + &owner_hotkey, + &owner_coldkey, + netuid + ), + AlphaBalance::ZERO + ); + }); +} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7c4112837d..0b8e3c982d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -272,7 +272,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: 401, + spec_version: 402, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,