Conversation
RaoAsim
force-pushed
the
feature/validator-hardness
branch
from
May 18, 2026 11:57
b2c1605 to
abca25c
Compare
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
This PR reduces unnecessary validator-side attack surface and adds code-level access controls for the local
llm_endpoint.What changed
PERTURB_ENABLE_VALIDATOR_AXONto make the validator axon optional.tools/llm_endpoint_service.py.llm_endpointnow allows loopback by default and can be expanded explicitly with:LLM_ENDPOINT_ALLOWED_CIDRSLLM_ENDPOINT_ALLOW_PRIVATE_NETWORKSWhy
In the current subnet flow, the validator actively queries miners, but there is no obvious subnet-specific need for the validator to accept arbitrary inbound protocol traffic. Keeping the validator axon open without an explicit deny policy increases exposure unnecessarily.
The
llm_endpointwas also relying mostly on bind-host discipline for protection. This PR adds application-level client checks so it remains protected even if it is bound to a broader interface by mistake.Defaults after this change
PERTURB_ENABLE_VALIDATOR_AXON=falseis recommended invalidator.env.exampleLLM_ENDPOINT_ALLOWED_CIDRS=127.0.0.1/32,::1/128LLM_ENDPOINT_ALLOW_PRIVATE_NETWORKS=falseNotes
llm_endpointshould still be kept on loopback or a trusted private subnet in deployment.Files changed
neurons/validator.pytools/llm_endpoint_service.pyscripts/validator.env.examplescripts/llm_endpoint.env.exampleREADME.mdTesting
neurons/validator.pytools/llm_endpoint_service.py