[v10] Subtensor improvement (and related logic)#3077
Merged
Conversation
…take_info_for_coldkey`
…istent with other sync methods.
…eter: `hotkey` -> `hotkey_ss58`
… fixed unit tests
…to get historical data from archive node.
…to get historical data from archive node.
…ne confirmed that we shouldn't use it)
… 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.
Closed
…ally correct place)
…w logic across the code
… + fixed unit tests
thewhaleking
requested changes
Oct 2, 2025
Contributor
thewhaleking
left a comment
There was a problem hiding this comment.
Overall good. Few changes need to be made, but not every comment I've left is a requested change. Most are questions or nits.
Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
Co-authored-by: BD Himes <37844818+thewhaleking@users.noreply.github.com>
ibraheem-abe
approved these changes
Oct 2, 2025
thewhaleking
reviewed
Oct 2, 2025
thewhaleking
approved these changes
Oct 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subtensor related:
subtensor.extrassubpackage 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)get_metagraph_infohas renamed parameterfield_indicestoselected_indices(to be consistent)get_stake_for_coldkeyhas been removed, as it duplicatesget_stake_info_for_coldkeyget_subnetsrenamed toget_all_subnets_netuid(obvious name, consistent with existing names)blocks_since_last_updateimproved. Currently it can be used to get historical data from archive nodeget_subnet_validator_permitsandget_subnet_owner_hotkeyimprovedAsync/Subtensorparameter_mockrenamed tomock, also moved to last one in order. Community can use mockedAsync/Subtensorin their tests in the same way as in we use it in the codebaseget_traansfer_feehas renamed parametervaluetoamountMechid related changes:
bondsget_metagraph_infoget_timelocked_weight_commitsmetagraphweightscommit_weightsreveal_weightsset_weightsbittensor.core.chain_data.metagraph_info.MetagraphInfogot required attributemechid: int.Balance (bittensor/utils/balance.py) and related changes
bittensor.core.errors.BalanceUnitMismatchErrorbittensor.core.errors.BalanceTypeErrorcheck_balancerenamed tocheck_balance_amountcheck_and_convert_to_balancerenamed tocheck_balance_amountcheck_balance_amountraisedBalanceTypeErrorerror instead of deprecated warning message.bittensor.utils.balance._check_currenciesraisesBalanceUnitMismatchErrorerror 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):
async_subtensoraxon(now it'sbittensor.Axon)config(now it'sbittensor.Config)dendrite(now it'sbittensor.Dendrite)keyfile(now it'sbittensor.Keyfile)metagraph(now it'sbittensor.Metagraph)wallet(now it'sbittensor.Wallet)subtensor(now it'sbittensor.Subtensor)synapse(now it'sbittensor.Synapse)from bittenosor import extrinsicsfrom bittenosor import mockfrom bittenosor import get_async_subtensorbittensor.mock(available inbittensor.core.mockor import via the package root as mentioned above)bittensor.extrinsics(available inbittensor.core.extrinsicsor import via the package root as mentioned above)Other changes:
DelegateInfo/lite.total_daily_returnhas been deleted (it is confirmed that we should not use it)BT_CHAIN_ENDPOINTreplaced withBT_SUBTENSOR_CHAIN_ENDPOINT@MichaelTrestman this needs to be replaced in the SDKv10 docs.bittensor.utils.hex_to_ss58added as alias toscalecodec.ss58_encode(just obvious name)bittensor.utils.ss58_to_hexadded as alias toscalecodec.ss58_decode(just obvious name)