From c8ead5cafaec7119676abaa0a06a892f7f5c4fa4 Mon Sep 17 00:00:00 2001 From: Wilfred Allyn Date: Sat, 14 Feb 2026 21:40:30 +0000 Subject: [PATCH] bug: skip chain_rate lifetime average for hashboard hashrate chain_rate from the stats API is a lifetime average (matches GHS av), not real-time hashrate. This causes MinerData.hashrate to report ~54 TH/s instead of ~87 TH/s when the miner recently changed presets, because the hashrate property sums hashboard values before falling back to raw_hashrate (GHS 5s from summary API, which is correct real-time data). Remove chain_rate assignment so total hashrate correctly uses GHS 5s. --- pyasic/miners/backends/luxminer.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyasic/miners/backends/luxminer.py b/pyasic/miners/backends/luxminer.py index 48dbc735..48d1aba8 100644 --- a/pyasic/miners/backends/luxminer.py +++ b/pyasic/miners/backends/luxminer.py @@ -280,12 +280,11 @@ async def _get_hashboards(self, rpc_stats: dict | None = None) -> list[HashBoard board_stats = rpc_stats["STATS"][1] for idx in range(3): board_n = idx + 1 - hashboards[idx].hashrate = self.algo.hashrate( - rate=float(board_stats[f"chain_rate{board_n}"]), - unit=self.algo.unit.GH, # type: ignore[attr-defined] - ).into( - self.algo.unit.default # type: ignore[attr-defined] - ) + # NOTE: chain_rate is NOT set here. The stats API's + # chain_rate{n} matches GHS av, not GHS 5s. Leaving + # hashboard.hashrate as None causes MinerData.hashrate + # to fall through to raw_hashrate, which is set by + # _get_hashrate() from the summary API's GHS 5s field. hashboards[idx].chips = int(board_stats[f"chain_acn{board_n}"]) chip_temp_data = list( filter(