-
Notifications
You must be signed in to change notification settings - Fork 238
Commit-Reveal Weight Inheritance #1789
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
Conversation
accounts for unrevealed commits by deregistered miners
let safe_epoch = | ||
reg_epoch.saturating_add(Self::get_reveal_period(netuid).saturating_mul(2)); | ||
|
||
Self::get_first_block_of_epoch(netuid, safe_epoch) |
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.
If the reveal period is not tied to the epoch timing, then the check here should be to get the next epoch from the block after the reveal period ends.
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.
So maybe last block of epoch +1, or next epoch, with just the reveal period end block
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.
the check here should be to get the next epoch from the block after the reveal period ends.
This is what the current implementation already does
safe_epoch = reg_epoch + (reveal_period * 2)
-> first block of that epoch is the block after the 2-period window.- The extra period shields against unrevealed commits made during the deregistration period that still target the vacated UID. Dropping it would remove that protection.
reveal_period
is in epochs.
Description
This upgrade makes the epoch ignore weights that point to a miner which registered during the current commit-reveal period when commit-reveal is enabled. The result is that only miners that were registered before the last reveal can receive incentive.
Also bounds
reveal_period
to [1, 100] to prevent owners from indefinitely excluding new miners via excessive values.Motivation
Bad actors could snipe a freshly-vacated UID because unrevealed weights still target that UID, instantly collecting rank & rewards for work they never did. Masking weights that reference de-registered miners closes this exploit and aligns rewards with actual effort.
Related Issue(s)
Type of Change