PalletId-based subnet account Ids maintain subnet TAO reserves#2524
Open
gztensor wants to merge 47 commits intodevnet-readyfrom
Open
PalletId-based subnet account Ids maintain subnet TAO reserves#2524gztensor wants to merge 47 commits intodevnet-readyfrom
gztensor wants to merge 47 commits intodevnet-readyfrom
Conversation
2 tasks
…oldkey_account - WIP
…ldkey_account and add_balance_to_coldkey_account methods to test-only code.
…bnet balance migration
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.
Description
TAO management for subnet registration
SubnetLockedmap for the newly registered netuid.SubnetLockedamount may be returned to the subnet owner. The owner emission TAO is excluded from the returned portion. If owner emission TAO is higher than lock cost, zero is returned for lock cost and the remainder is recycled.Checklist:
subnetInfoRuntimeApi::getSubnetAccountIdfor clients to read the subnet account IDsmint_tao,burn_tao,recycle_tao,transfer_tao.SubnetTAOinto subnet accounts. This will make balances palletTotalIssuancematch the subtensor palletTotalIssuance.remove_balance_from_coldkey_accountandadd_balance_to_coldkey_accountmethods to test-only code (tests+benchmarks). Convert original TAO moving logic intotransfer_taoand use it insidestake_into_subnetanduntake_from_subnet.mintinget_block_emission, make it return imbalance that is consumed later inrun_counbaserun_coinbase.TotalIssuancereduction), in the subsequent migrationmigrate_restore_subnet_lockedwe restored locks intoSubnetLocked, but did not increase theTotalIssuanceback. So, in this PR we will increase subtensor palletTotalIssuanceby total ofSubnetLockedupdate inmigrate_restore_subnet_locked.sudo_set_total_issuancein admin palletRelated Issue(s)
Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly