Skip to content

Conversation

basfroman
Copy link
Collaborator

@basfroman basfroman commented Sep 30, 2025

Subtensor related:

  • subtensor.extras subpackage has been created. Not this contains:
    • bittensor.extras.subtensor_api (available for import with the same API as before)
    • bittensor.extras.timelock (available for import with the same API as before)
  • Subtenor's methods:
    • removed unused arguments in many methods
    • method get_metagraph_info has renamed parameter field_indices to selected_indices (to be consistent)
    • method get_stake_for_coldkey has been removed, as it duplicates get_stake_info_for_coldkey
    • method get_subnets renamed to get_all_subnets_netuid (obvious name, consistent with existing names)
    • method blocks_since_last_update improved. Currently it can be used to get historical data from archive node
    • async methods get_subnet_validator_permits and get_subnet_owner_hotkey improved
    • Async/Subtensor parameter _mock renamed to mock, also moved to last one in order. Community can use mocked Async/Subtensor in their tests in the same way as in we use it in the codebase
    • method get_traansfer_fee has renamed parameter value to amount

Mechid related changes:

  • In the next subtensor methods got updated the parameters order:
    • bonds
    • get_metagraph_info
    • get_timelocked_weight_commits
    • metagraph
    • weights
    • commit_weights
    • reveal_weights
    • set_weights
  • Additional:
    • bittensor.core.chain_data.metagraph_info.MetagraphInfo got required attribute mechid: int.

Balance (bittensor/utils/balance.py) and related changes

  • Added 2 custom errors:
    • bittensor.core.errors.BalanceUnitMismatchError
    • bittensor.core.errors.BalanceTypeError
  • check_balance renamed to check_balance_amount
  • check_and_convert_to_balance renamed to check_balance_amount
  • check_balance_amount raised BalanceTypeError error instead of deprecated warning message.
  • private function bittensor.utils.balance._check_currencies raises BalanceUnitMismatchError error instead of deprecated warning message. This function is used inside the Balance class to check if units match during various mathematical and logical operations.

easy_import.py changes (imports impact):

  • The following aliases for class names have been removed:
    • async_subtensor
    • axon (now it's bittensor.Axon)
    • config (now it's bittensor.Config)
    • dendrite (now it's bittensor.Dendrite)
    • keyfile (now it's bittensor.Keyfile)
    • metagraph (now it's bittensor.Metagraph)
    • wallet (now it's bittensor.Wallet)
    • subtensor (now it's bittensor.Subtensor)
    • synapse (now it's bittensor.Synapse)
  • Added new objects for imoport:
    • from bittenosor import extrinsics
    • from bittenosor import mock
    • from bittenosor import get_async_subtensor
  • Links to subpackages removed:
    • bittensor.mock (available in bittensor.core.mock or import via the package root as mentioned above)
    • bittensor.extrinsics (available in bittensor.core.extrinsics or import via the package root as mentioned above)

Other changes:

  • attribute DelegateInfo/lite.total_daily_return has been deleted (it is confirmed that we should not use it)
  • BT_CHAIN_ENDPOINT replaced with BT_SUBTENSOR_CHAIN_ENDPOINT @MichaelTrestman this needs to be replaced in the SDKv10 docs.
  • bittensor.utils.hex_to_ss58 added as alias to scalecodec.ss58_encode (just obvious name)
  • bittensor.utils.ss58_to_hex added as alias to scalecodec.ss58_decode (just obvious name)

… to `mock`, also moved to last one in order. Community can use mocked `Async/Subtensor` in their tests in the same way as in we use it in the codebase.
@basfroman basfroman self-assigned this Sep 30, 2025
@basfroman basfroman mentioned this pull request Sep 30, 2025
@basfroman basfroman requested a review from a team September 30, 2025 05:21
@basfroman basfroman changed the title [v10] Subtensor improvement (part1) [v10] Subtensor improvement (and related logic) Sep 30, 2025
Copy link
Contributor

@thewhaleking thewhaleking left a comment

Choose a reason for hiding this comment

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

Overall good. Few changes need to be made, but not every comment I've left is a requested change. Most are questions or nits.

@basfroman basfroman requested a review from thewhaleking October 2, 2025 18:03
Copy link
Contributor

@ibraheem-abe ibraheem-abe left a comment

Choose a reason for hiding this comment

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

Overall LGTM 👍

@basfroman basfroman requested a review from ibraheem-abe October 2, 2025 18:14
@basfroman basfroman requested a review from thewhaleking October 2, 2025 19:21
@basfroman basfroman merged commit 610045f into SDKv10 Oct 2, 2025
327 checks passed
@basfroman basfroman deleted the feat/roman/subtensor-changes-part-1 branch October 2, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants