Commit-Reveal Weight Inheritance#1789
Merged
sam0x17 merged 35 commits intodevnet-readyfrom Jul 16, 2025
Merged
Conversation
accounts for unrevealed commits by deregistered miners
sam0x17
approved these changes
Jul 15, 2025
camfairchild
suggested changes
Jul 15, 2025
| let safe_epoch = | ||
| reg_epoch.saturating_add(Self::get_reveal_period(netuid).saturating_mul(2)); | ||
|
|
||
| Self::get_first_block_of_epoch(netuid, safe_epoch) |
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
So maybe last block of epoch +1, or next epoch, with just the reveal period end block
Contributor
Author
There was a problem hiding this comment.
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_periodis in epochs.
This was referenced Jul 16, 2025
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
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_periodto [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