feat(validator): configurable miner_pats.json path via env var#1561
Merged
Conversation
…R_PATS_FILE Validators who keep subnet data outside the repo can now set GITTENSOR_MINER_PATS_FILE to an exact file path. When unset (or empty) it defaults to data/miner_pats.json at the project root, so existing deployments are unaffected.
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.
What
Adds an optional
GITTENSOR_MINER_PATS_FILEenv var that lets validators store the miner PAT file outside the repo.data/miner_pats.jsonat the project root (current behavior, no change for existing deployments).Why
Validators (e.g. Yuma) keep subnet data in a separate folder to keep the subnet repo clean. There was no way to relocate
miner_pats.json, so they were resorting to symlinks. This also reduces the risk of the PAT store being disturbed on validator updates — a suspected cause of PATs getting wiped and miners having to re-broadcast (low vtrust symptom reported in Discord).Changes
gittensor/validator/pat_storage.py— resolvePATS_FILEfromGITTENSOR_MINER_PATS_FILE, falling back to the existing default..env.example— document the new optional var.tests/validator/test_pat_storage.py— cover default, exact-path override, and empty-string fallback.Test
pytest tests/validator/test_pat_storage.py→ 17 passed.