-
Notifications
You must be signed in to change notification settings - 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
.checked_div(total) | ||
.unwrap_or(I96F32::saturating_from_num(0.0)); | ||
|
||
if u64::from(amount) > total.saturating_to_num::<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.
While I think this should never happen we should probably add it to their alpha stake or something.
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.
Correct me if I'm wrong, but it will be the same, as we'll give everything to the validator owner.
I introduced this check during the testing. Incorrect test setup produced unexpected results. It's unlikely that we have this on mainnet. And if we do have this condition - we chose a safe route.
I'm open to suggestions here.
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.
Like the remainder goes to the vali owner? That sounds right
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.
Here is the fix: Handle case for stake mismatch.
Co-authored-by: Cameron Fairchild <[email protected]>
Making a note from OpenDev - to assure this handles dereg liquidation scenarios. |
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.
we need to handle subnet de-reg as well. We should just claim the whole pool when the de-reg happens
continue; | ||
} | ||
|
||
weight |
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.
maybe we should try to grab more if some don't meet the claim threshold
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.
It introduces a rather awkward interface. I increased the auto-key claims instead. We had roughly a day previously, a week after a conversation with Const. I doubled the value.
Note from nucleus call:
|
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.
make sure auto claim threshold is per-subnet. Don't claim tiny amounts of any subnet automatically
We have one threshold for all operations. Is there a reason to introduce a map of thresholds?
UPDATE: I implemented the per-subnet threshold anyway.
continue; | ||
} | ||
|
||
weight |
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.
It introduces a rather awkward interface. I increased the auto-key claims instead. We had roughly a day previously, a week after a conversation with Const. I doubled the value.
weight | ||
} | ||
|
||
pub fn change_root_claim_type(coldkey: &T::AccountId, new_type: RootClaimTypeEnum) { |
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.
We could reindex these maps each 6-12month.
looks like some CI failures tho |
Has someone communicated with the Bittensor SDK v10 devs to account for any changes (for the auto/manual setting and the storage map adds & removals)? May be nothing, but I was not sure offhand if directly handled since no mention in the v10 migration guide. |
@opentensor/cerebrum / @opentensor/gyrus / @opentensor/cortex breaking change detected! Please prepare accordingly! |
Yes. The SDK team was going to work on the required changes after the merge. cc @basfroman |
Root Claim / Airdrop
This PR introduces a root claim (airdrop) 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:auto
ormanual
.claim_root
— Manually claim accumulated root dividends.Storage changes
PendingRootAlphaDivs
— Tracks root-alpha dividends between epochs.RootClaimType
— User’s preferred claim mode (auto
ormanual
).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)
TaoDividendsPerSubnet
PendingAlphaSwapped
Original PRs