Skip to content

feat(validator): configurable miner_pats.json path via env var#1561

Merged
LandynDev merged 3 commits into
testfrom
feat/configurable-pat-store-path
Jun 29, 2026
Merged

feat(validator): configurable miner_pats.json path via env var#1561
LandynDev merged 3 commits into
testfrom
feat/configurable-pat-store-path

Conversation

@LandynDev

Copy link
Copy Markdown
Collaborator

What

Adds an optional GITTENSOR_MINER_PATS_FILE env var that lets validators store the miner PAT file outside the repo.

  • Unset / empty → defaults to data/miner_pats.json at the project root (current behavior, no change for existing deployments).
  • Set → uses the exact file path provided.

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 — resolve PATS_FILE from GITTENSOR_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.

LandynDev and others added 3 commits June 29, 2026 11:46
…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.
@LandynDev LandynDev merged commit fdee353 into test Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant