Skip to content

Conversation

@shamil-gadelshin
Copy link
Collaborator

Description

This PR adds a new remove_stake_full_limit extrinsic. The extrinsic uses the logic of remove_stake_limit but without partial and 'unstake_amount' parameters. It removes all stakes from the subnet.

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shamil-gadelshin shamil-gadelshin added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 13, 2025
@shamil-gadelshin shamil-gadelshin marked this pull request as ready for review June 13, 2025 14:44
gztensor
gztensor previously approved these changes Jun 13, 2025
Roman and others added 2 commits June 17, 2025 11:46
…move_stake_full_limit

# Conflicts:
#	pallets/subtensor/src/macros/dispatches.rs
@basfroman
Copy link
Collaborator

I prepared this PR for Bittensor SDK opentensor/bittensor#2897

As I mentioned in the description, my PR is based on both branches:

To make SDK PR workable, it is necessary to merge the 2 mentioned branches and the devnet-ready with the following changes:

  • the unstake_all function must accept 1 additional netuid parameter (as in the first branch)
  • the remove_stake_full_limit function works as expected (it needs to be tested deeply). But it accepts a u64 argument limit_price. The SDK itself recalculates rate_tolerance (float) of allowed changes into the limit_price number. This is not a big deal, but we have to do additional call to the chain before the calculation.

Otherwise looks good. Pls keep me updated with changes.

@shamil-gadelshin
Copy link
Collaborator Author

I updated the extrinsic after the offline conversation with @basfroman : I changed the price_limit parameter to optional.

@basfroman
Copy link
Collaborator

I updated the extrinsic after the offline conversation with @basfroman : I changed the price_limit parameter to optional.

PR opentensor/bittensor#2897 is ready. I'll wait until your PR is merged to devnet-ready.
SDK implementation works as expected. Thank you!
Testes locally with fast and non-fast-blocks.

basfroman
basfroman previously approved these changes Jun 23, 2025
Copy link
Collaborator

@basfroman basfroman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no objections from the SDK. Everything is working as discussed.

sam0x17
sam0x17 previously approved these changes Jun 24, 2025
@sam0x17 sam0x17 merged commit d9a93a5 into devnet-ready Jun 25, 2025
52 of 55 checks passed
@sam0x17 sam0x17 mentioned this pull request Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants