Skip to content

Commit

Permalink
update miner id in synapse.
Browse files Browse the repository at this point in the history
  • Loading branch information
acer-king committed Oct 14, 2024
1 parent 2f9b35d commit b043212
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ async def update_and_refresh(self):
async def query_miner(self, uid, query_syn: cortext.ALL_SYNAPSE_TYPE):
query_syn.validator_uid = self.my_uid
query_syn.block_num = self.current_block
query_syn.uid = uid
if query_syn.streaming:
if uid is None:
bt.logging.error("Can't create task.")
Expand Down Expand Up @@ -455,11 +456,12 @@ async def prompt(self, synapse: StreamPrompting) -> StreamingSynapse.BTStreaming
async def _prompt(query_synapse: StreamPrompting, send: Send):
bt.logging.info(f"Sending {synapse} request to uid: {synapse.uid}")

synapse.deserialize_flag = False
synapse.streaming = True
synapse.validator_uid = self.my_uid or 0
synapse.block_num = self.current_block or 0
query_synapse.deserialize_flag = False
query_synapse.streaming = True
query_synapse.validator_uid = self.my_uid or 0
query_synapse.block_num = self.current_block or 0
uid = self.task_mgr.assign_task(query_synapse)
query_synapse.uid = uid
if uid is None:
bt.logging.error("Can't create task. no available uids for now")
await send({"type": "http.response.body", "body": b'', "more_body": False})
Expand Down

0 comments on commit b043212

Please sign in to comment.