From 0aa0cb07bc4b9457e3b8728b275874ba7764d7cd Mon Sep 17 00:00:00 2001 From: Moose Date: Thu, 14 Aug 2025 14:41:41 +0200 Subject: [PATCH] Ignore zero alpha stake in `clear_small_nomination_if_required` --- pallets/subtensor/src/staking/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/subtensor/src/staking/helpers.rs b/pallets/subtensor/src/staking/helpers.rs index 7b8d0ba1de..3f07115b7b 100644 --- a/pallets/subtensor/src/staking/helpers.rs +++ b/pallets/subtensor/src/staking/helpers.rs @@ -184,7 +184,7 @@ impl Pallet { ) { // Verify if the account is a nominator account by checking ownership of the hotkey by the coldkey. if !Self::coldkey_owns_hotkey(coldkey, hotkey) { - // If the stake is below the minimum required, it's considered a small nomination and needs to be cleared. + // If the stake is non-zero and below the minimum required, it's considered a small nomination and needs to be cleared. // Log if the stake is below the minimum required let alpha_stake = Self::get_stake_for_hotkey_and_coldkey_on_subnet(hotkey, coldkey, netuid); @@ -192,7 +192,7 @@ impl Pallet { U96F32::saturating_from_num(Self::get_nominator_min_required_stake()) .safe_div(T::SwapInterface::current_alpha_price(netuid)) .saturating_to_num::(); - if alpha_stake < min_alpha_stake.into() { + if alpha_stake > 0.into() && alpha_stake < min_alpha_stake.into() { // Log the clearing of a small nomination // Remove the stake from the nominator account. (this is a more forceful unstake operation which ) // Actually deletes the staking account.