From 147519f21a88eb6ff23a83f891f29974bbea24a5 Mon Sep 17 00:00:00 2001 From: catoneone <198435866+catoneone@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:29:43 +0000 Subject: [PATCH] Zero out weights when champion's chute is cold Skip weight set when the active champion's chute_status is 'cold' so the validator doesn't reward an offline model. Looks up the champion hotkey in MinersDAO after scoring; if cold, zeroes final_weights and each miner's normalized_weight, which makes weight_setter return an empty payload and skip the on-chain set this round. --- affine/src/scorer/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/affine/src/scorer/main.py b/affine/src/scorer/main.py index 45c78d98..ef0e745e 100644 --- a/affine/src/scorer/main.py +++ b/affine/src/scorer/main.py @@ -16,6 +16,7 @@ from affine.database.dao.scores import ScoresDAO from affine.database.dao.anti_copy import AntiCopyDAO from affine.database.dao.miner_stats import MinerStatsDAO +from affine.database.dao.miners import MinersDAO from affine.database.dao.system_config import SystemConfigDAO from affine.src.scorer.scorer import Scorer from affine.src.scorer.config import ScorerConfig @@ -198,6 +199,23 @@ async def run_scoring_once(save_to_db: bool, range_type: str = "scoring"): print_summary=True, ) + # If champion's chute is cold, zero out weights this round. + # Champion is the sole weight recipient, so zeroing them = no weights set. + if champion_state and champion_state.get('hotkey') and result.final_weights: + miners_dao = MinersDAO() + champion_record = await miners_dao.get_miner_by_hotkey( + champion_state['hotkey'] + ) + if champion_record and champion_record.get('chute_status') == 'cold': + logger.warning( + f"Champion {champion_state['hotkey'][:8]}... chute is cold; " + "zeroing all weights this round" + ) + for uid in result.final_weights: + result.final_weights[uid] = 0.0 + for miner in result.miners.values(): + miner.normalized_weight = 0.0 + # Save to database if requested if save_to_db: logger.info("Saving results to database...")