cli: filter low-stake validators from PAT broadcast/check - #906
Merged
Conversation
`gitt miner post` and `gitt miner check` previously broadcast PATs to any validator with vtrust > 0.1 and a serving axon. Low-stake weight-copiers satisfy that filter and end up receiving real GitHub credentials they have no operational need for, expanding the credential surface. Tighten the filter to require: - validator_trust > min_vtrust (default 0.25, was 0.1) - axon.is_serving - stake >= min_stake (default 15,000 alpha, was unbounded) Both thresholds are configurable per miner via `--min-vtrust` / `--min-stake` flags or `min_validator_vtrust` / `min_validator_stake` keys in ~/.gittensor/config.json (resolution order: flag > config > default). The historical `--blacklist.min_stake=30000` precedent from the original miner template informed the default. A new "Skipped Validators" table surfaces high-vtrust UIDs filtered by the stake or serving check, with per-UID reasons, so miners can see why a known validator did not receive a broadcast. JSON output gains a matching `skipped` field. Filter logic and resolution moved into shared helpers consumed by both post and check to avoid duplication.
Resolution is now CLI flag → built-in default. Removes `_resolve_validator_filters` and the matching config keys; click's `default=` plus `show_default=True` handles both the value and the help text. The flag lets miners override; everyone else gets the default. The config-file path was unnecessary surface area for a knob most miners won't touch.
LandynDev
approved these changes
Apr 30, 2026
statxc
added a commit
to statxc/gittensor
that referenced
this pull request
May 5, 2026
When --min-stake / --min-vtrust eliminate every high-vtrust candidate, _require_validator_axons discarded the `excluded` payload that the success path already exposes and emitted only the generic "No reachable validator axons found on the network." message. Operators hitting this case are exactly the ones who need the diagnostic. Branch on whether `excluded` is non-empty: TTY renders the existing Skipped Validators table before the error, JSON includes the `skipped` array on the error envelope, and the error message names the active thresholds. The original generic message is preserved when the metagraph carries no candidates at all (n=0 or every UID below min_vtrust). entrius#906 introduced the filtering knobs and `excluded` list and wired them into the success path; the error path was missed in the same change.
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
gitt miner post/gitt miner checknow require a validator to have vtrust > 0.25 (was 0.1), be serving an axon, and hold ≥ 15,000 α stake before being targeted with a PAT broadcast or probe.--min-vtrust/--min-stakeCLI flags let a miner override the defaults; no config-file knob.skippedfield.Why
Low-stake weight-copiers can clear
vtrust > 0.1and a serving axon yet have no operational need for miners' GitHub credentials. Receiving them just expands the credential blast radius. On netuid 74 today there is one such UID (147: vtrust 0.997, stake ~1,630 α). The new defaults cleanly exclude it without affecting any honest validator (the next-lowest serving validator sits at ~43k α, a ~26× headroom).A miner running
gitt miner poston finney now broadcasts to 7 validators (was 8) and sees an explanatory table for the 5 high-vtrust UIDs that get skipped (UID 147 by stake; UIDs 102/173/174/195 because they don't advertise an axon — pre-existing structural gap, now visible).Test plan
ruff check/ruff format --checkclean on changed files (one pre-existing import-order issue inneurons/validator.pyleft alone)pyrightclean (0 errors / 0 warnings)pytest tests/cli/test_miner_commands.py— 15 pass (6 new inTestValidatorAxonFilter: pass-all, silent sub-vtrust drop, not-serving, stake-below, multi-reason combo)pytest— 701 pass; one unrelated failure (test_register_exits_non_zero_when_contract_metadata_missing) reproduces ontestwith this branch stashedgitt miner post --json-output --network finneyand verify theskippedarray matches expectations