feat(scoring): gate PR scoring by PAT first-registration date - #1001
Closed
HadesHappy wants to merge 4 commits into
Closed
feat(scoring): gate PR scoring by PAT first-registration date#1001HadesHappy wants to merge 4 commits into
HadesHappy wants to merge 4 commits into
Conversation
…coring-window # Conflicts: # gittensor/validator/oss_contributions/reward.py
Contributor
Author
|
Hi @anderdc |
Collaborator
|
Closing alongside #1000 — see the issue thread. |
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.
Summary
Closes #1000
Skip merged/closed PRs that predate a miner's first PAT registration on this validator (minus a 7-day grace window). Closes the aged-account-purchase vector - registering a GitHub account that already has merged PRs to whitelisted repos no longer earns emissions for that pre-existing work.
Changes
pat_storage: stampfirst_registered_aton first save; preserve it across re-broadcasts of the same hotkey; reset it on hotkey change. Legacy entries that lack the field stay grandfathered (no gate). Newget_registration_cutoff(uid, hotkey)helper.github_api_tools(legacy path):should_skip_merged_prandtry_add_open_or_closed_pracceptregistration_cutoffand skip whenmerged_at/closed_atfalls before it.mirror/load.py(mirror path): same gate at load time on bothmerged_atandclosed_at.reward.py: looks up the cutoff per UID and threads it into both load paths.constants:REGISTRATION_GRACE_DAYS = 7.Migration
Existing PAT entries without
first_registered_atare grandfathered - the gate stays disabled for them indefinitely, even on re-broadcast. No score regressions for current miners.Test plan
pytest- 748 passedruff check+ruff format --check- cleanpyrighton touched files - 0 errors