-
Couldn't load subscription status.
- Fork 244
Root claim #2053
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
base: devnet-ready
Are you sure you want to change the base?
Root claim #2053
Conversation
0143105
| PendingEmission::<T>::remove(netuid); | ||
| PendingRootDivs::<T>::remove(netuid); | ||
| PendingAlphaSwapped::<T>::remove(netuid); | ||
| PendingRootAlphaDivs::<T>::remove(netuid); |
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.
PendingRootAlphaDivs::<T>::remove(netuid) is called twice: line 318 & 351
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.
Pardon for the intrusion but I've heard this PR was close/ready to be merged yet after reading it I found a bunch of things that could be addressed 😬
| log::debug!("hotkey: {hotkey:?} tao_take: {tao_take:?}"); | ||
| let validator_stake = Self::increase_stake_for_hotkey_and_coldkey_on_subnet( | ||
| log::debug!("hotkey: {hotkey:?} alpha_take: {alpha_take:?}"); | ||
| let _validator_stake = Self::increase_stake_for_hotkey_and_coldkey_on_subnet( |
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.
| let _validator_stake = Self::increase_stake_for_hotkey_and_coldkey_on_subnet( | |
| Self::increase_stake_for_hotkey_and_coldkey_on_subnet( |
Is there a reason we keep the variable here?
| pub fn add_stake_adjust_root_claimed_for_hotkey_and_coldkey( | ||
| hotkey: &T::AccountId, | ||
| coldkey: &T::AccountId, | ||
| amount: u64, |
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.
Shouldn't this be AlphaCurrency, similarly to how it's done in remove_stake_adjust_root_claimed_for_hotkey_and_coldkey?
| #[pallet::storage] // --- MAP ( hot ) --> MAP(netuid ) --> claimable_dividends | Root claimable dividends. | ||
| pub type RootClaimable<T: Config> = StorageMap< | ||
| _, | ||
| Blake2_128Concat, | ||
| T::AccountId, | ||
| BTreeMap<NetUid, I96F32>, | ||
| ValueQuery, | ||
| DefaultRootClaimable<T>, | ||
| >; |
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.
Shouldn't this be renamed to RootClaimableRatio to reflect it better what this exactly is? This wording is already used elsewhere in the code
Thanks for the review. I addressed the majority of your comments. |
|
Per discussion on the Open Dev call and the overall initiative of improvement of bookkeeping in Bittensor, can we please implement proper bookkeeping from the start for root claim? Back when I was reviewing this PR I saw two possibilities:
Relevant discussion from CoR: https://discord.com/channels/1120750674595024897/1245487232928714863/1431026852008427572 |
Root Claim
This PR introduces a root claim mechanism. It replaces the automatic selling of root-alpha dividends with accumulation. Users can either:
New extrinsics
set_root_claim_type— Set root-claim mode:autoormanual.claim_root— Manually claim accumulated root dividends.Storage changes
PendingRootAlphaDivs— Tracks root-alpha dividends between epochs.RootClaimType— User’s preferred claim mode (autoormanual).RootClaimable— User’s claimable share of alpha dividends.RootClaimed— Accounting helper for alpha dividends (stake changes, claimed amounts).StakingColdkeysByIndex— Supports randomized distribution of auto-claims per block.StakingColdkeys— Supports root-dividends distribution.NumStakingColdkeys— Count to support randomized auto-claim distribution per block.NumRootClaim— Number of auto-claims to fulfill for a subnet in the current epoch.AlphaMapLastKey— Supports staking coldkey migration.Removed (obsolete storage maps)
TaoDividendsPerSubnetPendingAlphaSwappedOriginal PRs