subtensor icon indicating copy to clipboard operation
subtensor copied to clipboard

Add additional argument to `unstake_all` and `unstake_all` (or `remove_all`)

Open basfroman opened this issue 8 months ago • 2 comments

Issue: Inaccurate "Unstake All" Behavior in Dynamic Environments

We've observed that when users try to unstake their entire Alpha from a hotkey, a small residual stake sometimes remains. This happens because emissions accrue between the time the client queries the stake amount and when the unstake transaction executes. While we've implemented SDK-side adjustments, a truly robust solution requires chain-level changes.

We propose adding arguments to the remove_stake and remove_stake_limit functions in Subtensor. This would allow the chain to precisely understand the user's intent to unstake all Alpha, ensuring complete and accurate withdrawals even in dynamic network conditions.

Please read more about the issue from SDK side here.

basfroman avatar May 20 '25 21:05 basfroman

What if we modify unstake_all extrinsic instead by specifying optional subnet ID?

shamil-gadelshin avatar May 21 '25 09:05 shamil-gadelshin

What if we modify unstake_all extrinsic instead by specifying optional subnet ID?

Hey, as I mentioned in the description, any SDK modifications aren't ideal.

We can only be guaranteed to get the expected result if the chain performs the unataking operation for all staked Alpha on the hotkey. Possibly,In order not to create new function, it is worth accepting a new argument something like 'unstake_all: Bool'.

basfroman avatar May 21 '25 10:05 basfroman