Current logic in main does not implement even basic blacklisting functionality, and we are getting warnings in the miner console that we are accepting requests from any neuron. There is a basic blacklist function in the template, but it is not implemented.
Solution
CLI Params
I was able to toggle on vpermit checks (i.e. enforcing only calls from validators, or neurons w/ a valid permit) by passing --blacklist.force_validator_permit to the miner run call:
this runs the check self.metagraph.validator_permit[uid] using the synapse requester's uid, and if false, blacklists the request (returns the synapse, without any response.)
Implementation
the last step is actually calling this function. in neurons/miner.py's forward function, adding the following implements the blacklist function already present in the template:
[blacklisted, reason] = await self.blacklist(synapse)
if blacklisted:
bt.logging.warning(f"Blacklisting un-registered hotkey for reason: {reason}")
return synapse
MVP Blacklist Implementation
Issue
Current logic in
main
does not implement even basic blacklisting functionality, and we are getting warnings in the miner console that we are accepting requests from any neuron. There is a basicblacklist
function in the template, but it is not implemented.Solution
CLI Params
I was able to toggle on
vpermit
checks (i.e. enforcing only calls from validators, or neurons w/ a valid permit) by passing--blacklist.force_validator_permit
to the miner run call:this runs the check
self.metagraph.validator_permit[uid]
using the synapse requester's uid, and if false, blacklists the request (returns the synapse, without anyresponse
.)Implementation
the last step is actually calling this function. in
neurons/miner.py
'sforward
function, adding the following implements theblacklist
function already present in the template: