generated from opentensor/bittensor-subnet-template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from neuralinternet/dev
fix: address security vulnerability
- Loading branch information
Showing
3 changed files
with
80 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ | |
from compute.wandb.wandb import ComputeWandb | ||
from neurons.Miner.allocate import check_allocation, register_allocation | ||
from neurons.Miner.pow import check_cuda_availability, run_miner_pow | ||
from neurons.Miner.specs import RequestSpecsProcessor | ||
# from neurons.Miner.specs import RequestSpecsProcessor | ||
from neurons.Validator.script import check_docker_availability | ||
|
||
|
||
|
@@ -181,7 +181,8 @@ def __init__(self): | |
self.wandb.update_allocated(None) | ||
bt.logging.info("Container is already running without allocated. Killing the container.") | ||
|
||
self.request_specs_processor = RequestSpecsProcessor() | ||
# Disable the Spec request and replaced with WanDB | ||
# self.request_specs_processor = RequestSpecsProcessor() | ||
|
||
self.last_updated_block = self.current_block - (self.current_block % 100) | ||
|
||
|
@@ -198,10 +199,11 @@ def init_axon(self): | |
forward_fn=self.challenge, | ||
blacklist_fn=self.blacklist_challenge, | ||
priority_fn=self.priority_challenge, | ||
).attach( | ||
forward_fn=self.specs, | ||
blacklist_fn=self.blacklist_specs, | ||
priority_fn=self.priority_specs, | ||
# Disable the spec query and replaced with WanDB | ||
# ).attach( | ||
# forward_fn=self.specs, | ||
# blacklist_fn=self.blacklist_specs, | ||
# priority_fn=self.priority_specs, | ||
) | ||
|
||
# Serve passes the axon information to the network + netuid we are hosting on. | ||
|
@@ -326,19 +328,19 @@ def base_priority(self, synapse: typing.Union[Specs, Allocate, Challenge]) -> fl | |
return priority | ||
|
||
# The blacklist function decides if a request should be ignored. | ||
def blacklist_specs(self, synapse: Specs) -> typing.Tuple[bool, str]: | ||
return self.base_blacklist(synapse) | ||
# def blacklist_specs(self, synapse: Specs) -> typing.Tuple[bool, str]: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
thomas-chu123
Collaborator
|
||
# return self.base_blacklist(synapse) | ||
|
||
# The priority function determines the order in which requests are handled. | ||
# More valuable or higher-priority requests are processed before others. | ||
def priority_specs(self, synapse: Specs) -> float: | ||
return self.base_priority(synapse) + miner_priority_specs | ||
# def priority_specs(self, synapse: Specs) -> float: | ||
# return self.base_priority(synapse) + miner_priority_specs | ||
|
||
# This is the PerfInfo function, which decides the miner's response to a valid, high-priority request. | ||
def specs(self, synapse: Specs) -> Specs: | ||
app_data = synapse.specs_input | ||
synapse.specs_output = self.request_specs_processor.get_respond(app_data) | ||
return synapse | ||
# def specs(self, synapse: Specs) -> Specs: | ||
# app_data = synapse.specs_input | ||
# synapse.specs_output = self.request_specs_processor.get_respond(app_data) | ||
# return synapse | ||
|
||
# The blacklist function decides if a request should be ignored. | ||
def blacklist_allocate(self, synapse: Allocate) -> typing.Tuple[bool, str]: | ||
|
Are u sure about that ? @thomas-chu123