Skip to main content

5.3 Weight Submission

Tempo-Aligned Cadence

# validator/weight_setter.py
TEMPO = subtensor.get_subnet_hyperparameters(netuid).tempo
WEIGHTS_RATE_LIMIT = subtensor.get_subnet_hyperparameters(netuid).weights_rate_limit

if (current_block - last_set_block >= TEMPO
and current_block - last_set_block >= WEIGHTS_RATE_LIMIT):
subtensor.set_weights(
netuid=netuid,
uids=miner_uids,
weights=normalised_weights,
wait_for_inclusion=False,
)
last_set_block = current_block

Async Query Loop

# validator/query_loop.py
QUERY_TIMEOUT_S = 9 # must be < 12 s (1 block)

async def query_miners(dendrite, axons, synapse, send_block):
responses = await dendrite.forward(
axons=axons, synapse=synapse, timeout=QUERY_TIMEOUT_S,
)
for r in responses:
r.send_block = send_block
return responses

send_block is stamped at dispatch time so scores are attributed to the correct task regardless of network delay.


← Previous5.2 Evaluation Pipeline
→ Next5.4 Benchmark Governance
IndexDocumentation Index