-
Notifications
You must be signed in to change notification settings - Fork 406
[v10] Subtensor improvement (and related logic) #3077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
…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.
Open
…ally correct place)
…w logic across the code
… + fixed unit tests
thewhaleking
requested changes
Oct 2, 2025
There was a problem hiding this 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.
Co-authored-by: BD Himes <[email protected]>
Co-authored-by: BD Himes <[email protected]>
ibraheem-abe
reviewed
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM 👍
ibraheem-abe
approved these changes
Oct 2, 2025
thewhaleking
reviewed
Oct 2, 2025
thewhaleking
approved these changes
Oct 2, 2025
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.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)get_metagraph_info
has renamed parameterfield_indices
toselected_indices
(to be consistent)get_stake_for_coldkey
has been removed, as it duplicatesget_stake_info_for_coldkey
get_subnets
renamed toget_all_subnets_netuid
(obvious name, consistent with existing names)blocks_since_last_update
improved. Currently it can be used to get historical data from archive nodeget_subnet_validator_permits
andget_subnet_owner_hotkey
improvedAsync/Subtensor
parameter_mock
renamed tomock
, also moved to last one in order. Community can use mockedAsync/Subtensor
in their tests in the same way as in we use it in the codebaseget_traansfer_fee
has renamed parametervalue
toamount
Mechid related changes:
bonds
get_metagraph_info
get_timelocked_weight_commits
metagraph
weights
commit_weights
reveal_weights
set_weights
bittensor.core.chain_data.metagraph_info.MetagraphInfo
got required attributemechid: int
.Balance (bittensor/utils/balance.py) and related changes
bittensor.core.errors.BalanceUnitMismatchError
bittensor.core.errors.BalanceTypeError
check_balance
renamed tocheck_balance_amount
check_and_convert_to_balance
renamed tocheck_balance_amount
check_balance_amount
raisedBalanceTypeError
error instead of deprecated warning message.bittensor.utils.balance._check_currencies
raisesBalanceUnitMismatchError
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):
async_subtensor
axon
(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 extrinsics
from bittenosor import mock
from bittenosor import get_async_subtensor
bittensor.mock
(available inbittensor.core.mock
or import via the package root as mentioned above)bittensor.extrinsics
(available inbittensor.core.extrinsics
or import via the package root as mentioned above)Other changes:
DelegateInfo/lite.total_daily_return
has been deleted (it is confirmed that we should not use it)BT_CHAIN_ENDPOINT
replaced withBT_SUBTENSOR_CHAIN_ENDPOINT
@MichaelTrestman this needs to be replaced in the SDKv10 docs.bittensor.utils.hex_to_ss58
added as alias toscalecodec.ss58_encode
(just obvious name)bittensor.utils.ss58_to_hex
added as alias toscalecodec.ss58_decode
(just obvious name)