feat(validator): load repo hyperparameters from the das API#1511
Open
anderdc wants to merge 1 commit into
Open
feat(validator): load repo hyperparameters from the das API#1511anderdc wants to merge 1 commit into
anderdc wants to merge 1 commit into
Conversation
Flip load_master_repo_weights() to fetch the repository registry from the das-gittensor API (GET api.gittensor.io/repos), the new source of truth for repository hyperparameters (maintainer/admin edits land there). - Extract parse+validate into _parse_registry(); add _fetch_registry_from_api() (requests + retry/backoff) and _load_registry_from_file(). - API-first with a bundled master_repositories.json fallback: a transient API outage or a contract-violating push falls back to the seed instead of bricking scoring. A broken bundled seed still raises. - Tests default to the seed via an autouse fixture (offline/deterministic); added explicit API-path + fallback tests. master_repositories.json is retained only as the fallback seed.
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.
Flips the validator's source of truth for repository hyperparameters from the bundled
master_repositories.jsonto the das-gittensor API. Part of the coordinated hyperparameter-API migration:GET /reposregistryrepository_config_editsaudit/cooldown tablefeat/hyperparam-api) — stop clobbering the API-authoritativerepositoriestableChange
load_master_repo_weights()now:GET https://api.gittensor.io/repos(requests + retry/backoff), parses + validates.master_repositories.jsonseed — a transient outage or a bad push can't brick scoring.{}only if both the API and the seed are unavailable. A broken seed still raises (real bug).Parsing/validation was extracted into
_parse_registry()and is shared by both paths, so the contract is identical regardless of source. Return type (Dict[str, RepositoryConfig]) is unchanged — no call site or downstream consumer moves.master_repositories.jsonis retained only as the fallback seed (regenerate from the DB via gt-utilsfetch_master_data.py).Tests
ruff check/ruff formatclean;pyright0 errors; CLIminer scoretests pass.Notes for review
GET /reposis@NoCacheon the API so edits propagate immediately. Consider signing/versioning the payload later (a central live source is weaker than git-pinned commits) — fallback seed mitigates availability, not authenticity.