Round 19 #10 telemetry extension. Live-verified against the corpus miners, this remodels the board temperature thresholds to item #10's target/hot/dangerous scheme and adds the LuxOS and Braiins backends. Supersedes the ePIC-only critical/shutdown model shipped in v0.72.0. Core (asic-rs-core): - MinerData: temp_critical/temp_shutdown -> temp_target/temp_hot/temp_dangerous. - parse_temperature_limits (defaulted on the existing GetFluidTemperature trait) now returns (target, hot, dangerous); parse_data wires all three fields. Backends (each reads an already-fetched or single command; live-verified): - LuxOS: new tempctrl RPC; ChipTarget/ChipHot/ChipDangerous (live 10.4.1.60 = 83/93/100). - Braiins v25_07 + v26_04: configuration/constraints cooling_constraints defaults (live 10.4.1.83 = 60/80/90); WEB_CONSTRAINTS already fetched for tuning caps. - ePIC remap: Shutdown Temp -> hot, Critical Temp -> dangerous, no target. - VNish (settings restart_temp/param) handled in a follow-up (needs settings auth); Antminer/WhatsMiner expose no thresholds -> (None,None,None). GUI: the two temp columns (Critical/Shutdown) become three (Target/Hot/Dangerous), right-aligned, Temperature category, auto-hidden when empty. MinerRow gains temp_target_c/temp_hot_c/temp_dangerous_c; to_row reads them. ALL_COLUMNS 70 -> 71. Fixtures captured from live: luxminer tempctrl.json, braiins configuration_constraints.json. Fixture tests for epic, luxminer, braiins v26_04 assert the parsed thresholds. Patch 0029. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
379 lines
17 KiB
Diff
379 lines
17 KiB
Diff
Subject: [PATCH 0029] telemetry: board temp thresholds -> target/hot/dangerous (LuxOS, Braiins; remap ePIC)
|
|
|
|
Round 19 #10, tier 3. Remodels the board temperature thresholds to the
|
|
target/hot/dangerous scheme from item #10 and adds the LuxOS and Braiins backends.
|
|
Supersedes the ePIC-only critical/shutdown model from patch 0028.
|
|
|
|
- MinerData: temp_critical/temp_shutdown -> temp_target/temp_hot/temp_dangerous.
|
|
parse_temperature_limits (on the existing GetFluidTemperature trait) now returns
|
|
(target, hot, dangerous).
|
|
- LuxOS: new tempctrl RPC command; ChipTarget/ChipHot/ChipDangerous
|
|
(live-verified 83/93/100, fixture tempctrl.json).
|
|
- Braiins v25_07 + v26_04: configuration/constraints cooling_constraints defaults
|
|
target/hot/dangerous (live-verified 60/80/90, fixture configuration_constraints.json;
|
|
WEB_CONSTRAINTS already fetched).
|
|
- ePIC remap: Shutdown Temp -> hot, Critical Temp -> dangerous, no target.
|
|
- Antminer/WhatsMiner expose no thresholds; VNish handled separately (settings auth).
|
|
|
|
Fixture tests for epic, luxminer, braiins v26_04 assert the parsed thresholds.
|
|
|
|
diff --git a/vendor/asic-rs-core/src/data/miner.rs b/vendor/asic-rs-core/src/data/miner.rs
|
|
index 08782856..9f74fc43 100644
|
|
--- a/vendor/asic-rs-core/src/data/miner.rs
|
|
+++ b/vendor/asic-rs-core/src/data/miner.rs
|
|
@@ -181,10 +181,12 @@ pub struct MinerData {
|
|
/// Miner-level fan duty cycle as a percentage (0-100), when reported. Firmware
|
|
/// exposes no maximum RPM, so this duty cycle is the normalized fan indicator.
|
|
pub fan_speed_percent: Option<f64>,
|
|
- /// Board critical temperature threshold in Celsius, when reported (round 19 #10).
|
|
- pub temp_critical: Option<f64>,
|
|
- /// Board shutdown temperature threshold in Celsius, when reported (round 19 #10).
|
|
- pub temp_shutdown: Option<f64>,
|
|
+ /// Board target temperature threshold in Celsius, when reported (round 19 #10).
|
|
+ pub temp_target: Option<f64>,
|
|
+ /// Board hot temperature threshold in Celsius, when reported (round 19 #10).
|
|
+ pub temp_hot: Option<f64>,
|
|
+ /// Board dangerous temperature threshold in Celsius, when reported (round 19 #10).
|
|
+ pub temp_dangerous: Option<f64>,
|
|
/// The current PDU fan information for the miner
|
|
pub psu_fans: Vec<FanData>,
|
|
/// The average temperature across all chips in the miner
|
|
diff --git a/vendor/asic-rs-core/src/traits/miner.rs b/vendor/asic-rs-core/src/traits/miner.rs
|
|
index 9de51761..25ea6168 100644
|
|
--- a/vendor/asic-rs-core/src/traits/miner.rs
|
|
+++ b/vendor/asic-rs-core/src/traits/miner.rs
|
|
@@ -282,7 +282,7 @@ impl<
|
|
let tuning_capabilities = self.parse_tuning_capabilities(&data);
|
|
let fluid_temperature = self.parse_fluid_temperature(&data);
|
|
let outlet_fluid_temperature = self.parse_outlet_fluid_temperature(&data);
|
|
- let (temp_critical, temp_shutdown) = self.parse_temperature_limits(&data);
|
|
+ let (temp_target, temp_hot, temp_dangerous) = self.parse_temperature_limits(&data);
|
|
let fans = self.parse_fans(&data);
|
|
let fan_speed_percent = self.parse_fan_speed_percent(&data);
|
|
let psu_fans = self.parse_psu_fans(&data);
|
|
@@ -369,8 +369,9 @@ impl<
|
|
expected_fans: device_info.hardware.fans,
|
|
fans,
|
|
fan_speed_percent,
|
|
- temp_critical,
|
|
- temp_shutdown,
|
|
+ temp_target,
|
|
+ temp_hot,
|
|
+ temp_dangerous,
|
|
psu_fans,
|
|
average_temperature,
|
|
fluid_temperature,
|
|
@@ -744,14 +745,14 @@ pub trait GetFluidTemperature: CollectData {
|
|
) -> Option<Temperature> {
|
|
None
|
|
}
|
|
- /// Board temperature safety thresholds as (critical, shutdown) in Celsius.
|
|
- /// Backends that expose them override this; others return (None, None).
|
|
+ /// Board temperature safety thresholds as (target, hot, dangerous) in Celsius.
|
|
+ /// Backends that expose them override this; others return (None, None, None).
|
|
#[allow(unused_variables)]
|
|
fn parse_temperature_limits(
|
|
&self,
|
|
data: &HashMap<DataField, Value>,
|
|
- ) -> (Option<f64>, Option<f64>) {
|
|
- (None, None)
|
|
+ ) -> (Option<f64>, Option<f64>, Option<f64>) {
|
|
+ (None, None, None)
|
|
}
|
|
}
|
|
|
|
diff --git a/vendor/asic-rs-firmwares-braiins/src/backends/v25_07/mod.rs b/vendor/asic-rs-firmwares-braiins/src/backends/v25_07/mod.rs
|
|
index 86e84d8c..0dec8d38 100644
|
|
--- a/vendor/asic-rs-firmwares-braiins/src/backends/v25_07/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-braiins/src/backends/v25_07/mod.rs
|
|
@@ -372,6 +372,16 @@ impl GetDataLocations for BraiinsV2507 {
|
|
tag: None,
|
|
},
|
|
)],
|
|
+ // Board temp thresholds (round 19 #10, T3): cooling_constraints defaults
|
|
+ // (target/hot/dangerous); WEB_CONSTRAINTS already fetched.
|
|
+ DataField::TemperatureLimits => vec![(
|
|
+ WEB_CONSTRAINTS,
|
|
+ DataExtractor {
|
|
+ func: get_by_pointer,
|
|
+ key: Some("/cooling_constraints"),
|
|
+ tag: None,
|
|
+ },
|
|
+ )],
|
|
_ => vec![],
|
|
}
|
|
}
|
|
@@ -725,7 +735,26 @@ impl GetScaledTuningTarget for BraiinsV2507 {
|
|
}
|
|
}
|
|
|
|
-impl GetFluidTemperature for BraiinsV2507 {}
|
|
+impl GetFluidTemperature for BraiinsV2507 {
|
|
+ fn parse_temperature_limits(
|
|
+ &self,
|
|
+ data: &HashMap<DataField, Value>,
|
|
+ ) -> (Option<f64>, Option<f64>, Option<f64>) {
|
|
+ // Braiins cooling_constraints target/hot/dangerous default thresholds in
|
|
+ // degree_c (round 19 #10, T3).
|
|
+ let d = data.get(&DataField::TemperatureLimits);
|
|
+ let f = |k: &str| {
|
|
+ d.and_then(|v| v.pointer(&format!("/{k}/default/degree_c")))
|
|
+ .and_then(|v| v.as_f64())
|
|
+ .filter(|v| v.is_finite() && *v > 0.0)
|
|
+ };
|
|
+ (
|
|
+ f("target_temperature"),
|
|
+ f("hot_temperature"),
|
|
+ f("dangerous_temperature"),
|
|
+ )
|
|
+ }
|
|
+}
|
|
impl GetTuningCapabilities for BraiinsV2507 {
|
|
fn parse_tuning_capabilities(
|
|
&self,
|
|
diff --git a/vendor/asic-rs-firmwares-braiins/src/backends/v26_04/mod.rs b/vendor/asic-rs-firmwares-braiins/src/backends/v26_04/mod.rs
|
|
index 303fca49..4e423e5b 100644
|
|
--- a/vendor/asic-rs-firmwares-braiins/src/backends/v26_04/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-braiins/src/backends/v26_04/mod.rs
|
|
@@ -393,6 +393,16 @@ impl GetDataLocations for BraiinsV2604 {
|
|
tag: None,
|
|
},
|
|
)],
|
|
+ // Board temp thresholds (round 19 #10, T3): cooling_constraints defaults
|
|
+ // (target/hot/dangerous); WEB_CONSTRAINTS already fetched.
|
|
+ DataField::TemperatureLimits => vec![(
|
|
+ WEB_CONSTRAINTS,
|
|
+ DataExtractor {
|
|
+ func: get_by_pointer,
|
|
+ key: Some("/cooling_constraints"),
|
|
+ tag: None,
|
|
+ },
|
|
+ )],
|
|
_ => vec![],
|
|
}
|
|
}
|
|
@@ -775,7 +785,26 @@ impl GetScaledTuningTarget for BraiinsV2604 {
|
|
}
|
|
}
|
|
|
|
-impl GetFluidTemperature for BraiinsV2604 {}
|
|
+impl GetFluidTemperature for BraiinsV2604 {
|
|
+ fn parse_temperature_limits(
|
|
+ &self,
|
|
+ data: &HashMap<DataField, Value>,
|
|
+ ) -> (Option<f64>, Option<f64>, Option<f64>) {
|
|
+ // Braiins cooling_constraints target/hot/dangerous default thresholds in
|
|
+ // degree_c (round 19 #10, T3).
|
|
+ let d = data.get(&DataField::TemperatureLimits);
|
|
+ let f = |k: &str| {
|
|
+ d.and_then(|v| v.pointer(&format!("/{k}/default/degree_c")))
|
|
+ .and_then(|v| v.as_f64())
|
|
+ .filter(|v| v.is_finite() && *v > 0.0)
|
|
+ };
|
|
+ (
|
|
+ f("target_temperature"),
|
|
+ f("hot_temperature"),
|
|
+ f("dangerous_temperature"),
|
|
+ )
|
|
+ }
|
|
+}
|
|
impl GetTuningCapabilities for BraiinsV2604 {
|
|
fn parse_tuning_capabilities(
|
|
&self,
|
|
@@ -1167,10 +1196,10 @@ mod tests {
|
|
|
|
use super::*;
|
|
use crate::test::json::v26_04::{
|
|
- WEB_COOLING_STATE_COMMAND, WEB_HASHBOARDS_COMMAND, WEB_LOCATE_COMMAND,
|
|
- WEB_MINER_CONFIGURATION_COMMAND, WEB_MINER_DETAILS_COMMAND, WEB_MINER_STATS_COMMAND,
|
|
- WEB_NETWORK_COMMAND, WEB_PERFORMANCE_TUNER_STATE_COMMAND, WEB_POOLS_COMMAND,
|
|
- WEB_VERSION_COMMAND,
|
|
+ WEB_CONSTRAINTS_COMMAND, WEB_COOLING_STATE_COMMAND, WEB_HASHBOARDS_COMMAND,
|
|
+ WEB_LOCATE_COMMAND, WEB_MINER_CONFIGURATION_COMMAND, WEB_MINER_DETAILS_COMMAND,
|
|
+ WEB_MINER_STATS_COMMAND, WEB_NETWORK_COMMAND, WEB_PERFORMANCE_TUNER_STATE_COMMAND,
|
|
+ WEB_POOLS_COMMAND, WEB_VERSION_COMMAND,
|
|
};
|
|
|
|
#[tokio::test]
|
|
@@ -1251,6 +1280,13 @@ mod tests {
|
|
},
|
|
Value::from_str(WEB_HASHBOARDS_COMMAND).unwrap(),
|
|
);
|
|
+ results.insert(
|
|
+ MinerCommand::WebAPI {
|
|
+ command: "configuration/constraints",
|
|
+ parameters: None,
|
|
+ },
|
|
+ Value::from_str(WEB_CONSTRAINTS_COMMAND).unwrap(),
|
|
+ );
|
|
results.insert(
|
|
MinerCommand::WebAPI {
|
|
command: "actions/locate",
|
|
@@ -1313,6 +1349,10 @@ mod tests {
|
|
// 19 #10, T3).
|
|
let fan_pct = miner_data.fan_speed_percent.expect("braiins fan duty");
|
|
assert!((fan_pct - 92.0).abs() < 1e-6);
|
|
+ // Board temp thresholds from cooling_constraints defaults (round 19 #10, T3).
|
|
+ assert_eq!(miner_data.temp_target, Some(60.0));
|
|
+ assert_eq!(miner_data.temp_hot, Some(80.0));
|
|
+ assert_eq!(miner_data.temp_dangerous, Some(90.0));
|
|
}
|
|
|
|
#[test]
|
|
diff --git a/vendor/asic-rs-firmwares-braiins/src/test/json/v26_04/mod.rs b/vendor/asic-rs-firmwares-braiins/src/test/json/v26_04/mod.rs
|
|
index 06b35fef..3904b012 100644
|
|
--- a/vendor/asic-rs-firmwares-braiins/src/test/json/v26_04/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-braiins/src/test/json/v26_04/mod.rs
|
|
@@ -12,3 +12,4 @@ pub(crate) const WEB_POOLS_COMMAND: &str = include_str!("pools.json");
|
|
pub(crate) const WEB_COOLING_STATE_COMMAND: &str = include_str!("cooling_state.json");
|
|
pub(crate) const WEB_HASHBOARDS_COMMAND: &str = include_str!("miner_hw_hashboards.json");
|
|
pub(crate) const WEB_LOCATE_COMMAND: &str = include_str!("actions_locate.json");
|
|
+pub(crate) const WEB_CONSTRAINTS_COMMAND: &str = include_str!("configuration_constraints.json");
|
|
diff --git a/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs b/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs
|
|
index 0c9a851b..2e12e07a 100644
|
|
--- a/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-epic/src/backends/v1/mod.rs
|
|
@@ -1153,15 +1153,16 @@ impl GetFluidTemperature for PowerPlayV1 {
|
|
fn parse_temperature_limits(
|
|
&self,
|
|
data: &HashMap<DataField, Value>,
|
|
- ) -> (Option<f64>, Option<f64>) {
|
|
- // ePIC summary /Misc: Critical Temp + Shutdown Temp (round 19 #10, T3).
|
|
+ ) -> (Option<f64>, Option<f64>, Option<f64>) {
|
|
+ // ePIC summary /Misc: Shutdown Temp (hot) + Critical Temp (dangerous); no
|
|
+ // target threshold reported (round 19 #10, T3).
|
|
let d = data.get(&DataField::TemperatureLimits);
|
|
let f = |k: &str| {
|
|
d.and_then(|v| v.pointer(k))
|
|
.and_then(|v| v.as_f64())
|
|
.filter(|v| v.is_finite() && *v > 0.0)
|
|
};
|
|
- (f("/Critical Temp"), f("/Shutdown Temp"))
|
|
+ (None, f("/Shutdown Temp"), f("/Critical Temp"))
|
|
}
|
|
}
|
|
|
|
@@ -2229,9 +2230,11 @@ mod tests {
|
|
assert_eq!(miner_data.wattage, Some(Power::from_watts(2166.6174)));
|
|
// Miner-level fan duty cycle from summary /Fans/Fans Speed (round 19 #10, T3).
|
|
assert_eq!(miner_data.fan_speed_percent, Some(100.0));
|
|
- // Board temp thresholds from summary /Misc (round 19 #10, T3).
|
|
- assert_eq!(miner_data.temp_critical, Some(100.0));
|
|
- assert_eq!(miner_data.temp_shutdown, Some(85.0));
|
|
+ // Board temp thresholds from summary /Misc (round 19 #10, T3): Shutdown->hot,
|
|
+ // Critical->dangerous, no target.
|
|
+ assert_eq!(miner_data.temp_target, None);
|
|
+ assert_eq!(miner_data.temp_hot, Some(85.0));
|
|
+ assert_eq!(miner_data.temp_dangerous, Some(100.0));
|
|
assert_eq!(miner_data.hashboards.len(), 3);
|
|
assert_eq!(miner_data.hashboards[0].active, Some(false));
|
|
assert_eq!(miner_data.hashboards[1].chips.len(), 110);
|
|
diff --git a/vendor/asic-rs-firmwares-luxminer/src/backends/v1/mod.rs b/vendor/asic-rs-firmwares-luxminer/src/backends/v1/mod.rs
|
|
index edab7c4c..de9c2d35 100644
|
|
--- a/vendor/asic-rs-firmwares-luxminer/src/backends/v1/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-luxminer/src/backends/v1/mod.rs
|
|
@@ -278,6 +278,11 @@ impl GetDataLocations for LuxMinerV1 {
|
|
parameters: None,
|
|
};
|
|
|
|
+ const RPC_TEMPCTRL: MinerCommand = MinerCommand::RPC {
|
|
+ command: "tempctrl",
|
|
+ parameters: None,
|
|
+ };
|
|
+
|
|
match data_field {
|
|
DataField::Mac => vec![(
|
|
RPC_CONFIG,
|
|
@@ -305,6 +310,16 @@ impl GetDataLocations for LuxMinerV1 {
|
|
tag: None,
|
|
},
|
|
)],
|
|
+ // Board temp thresholds (round 19 #10, T3): LuxOS tempctrl reports
|
|
+ // ChipTarget / ChipHot / ChipDangerous.
|
|
+ DataField::TemperatureLimits => vec![(
|
|
+ RPC_TEMPCTRL,
|
|
+ DataExtractor {
|
|
+ func: get_by_pointer,
|
|
+ key: Some("/TEMPCTRL/0"),
|
|
+ tag: None,
|
|
+ },
|
|
+ )],
|
|
DataField::ApiVersion => vec![(
|
|
RPC_VERSION,
|
|
DataExtractor {
|
|
@@ -690,6 +705,20 @@ impl GetFluidTemperature for LuxMinerV1 {
|
|
(None, None) => None,
|
|
}
|
|
}
|
|
+ fn parse_temperature_limits(
|
|
+ &self,
|
|
+ data: &HashMap<DataField, Value>,
|
|
+ ) -> (Option<f64>, Option<f64>, Option<f64>) {
|
|
+ // LuxOS tempctrl chip thresholds ChipTarget / ChipHot / ChipDangerous
|
|
+ // (round 19 #10, T3).
|
|
+ let d = data.get(&DataField::TemperatureLimits);
|
|
+ let f = |k: &str| {
|
|
+ d.and_then(|v| v.get(k))
|
|
+ .and_then(|v| v.as_f64())
|
|
+ .filter(|v| v.is_finite() && *v > 0.0)
|
|
+ };
|
|
+ (f("ChipTarget"), f("ChipHot"), f("ChipDangerous"))
|
|
+ }
|
|
}
|
|
|
|
impl GetFirmwareVersion for LuxMinerV1 {
|
|
@@ -1465,7 +1494,8 @@ mod tests {
|
|
use super::*;
|
|
use crate::test::json::v1::{
|
|
CONFIG, DEVS, EVENTS, FANS, HEALTHCHIPGET_0, HEALTHCHIPGET_1, HEALTHCHIPGET_2, POOLS,
|
|
- POWER, PROFILES, STATS, SUMMARY, TEMPS, VERSION, VOLTAGEGET_0, VOLTAGEGET_1, VOLTAGEGET_2,
|
|
+ POWER, PROFILES, STATS, SUMMARY, TEMPCTRL, TEMPS, VERSION, VOLTAGEGET_0, VOLTAGEGET_1,
|
|
+ VOLTAGEGET_2,
|
|
};
|
|
|
|
#[test]
|
|
@@ -1582,6 +1612,11 @@ mod tests {
|
|
parameters: None,
|
|
};
|
|
|
|
+ let tempctrl_cmd = MinerCommand::RPC {
|
|
+ command: "tempctrl",
|
|
+ parameters: None,
|
|
+ };
|
|
+
|
|
results.insert(version_cmd, Value::from_str(VERSION)?);
|
|
results.insert(stats_cmd, Value::from_str(STATS)?);
|
|
results.insert(summary_cmd, Value::from_str(SUMMARY)?);
|
|
@@ -1591,6 +1626,7 @@ mod tests {
|
|
results.insert(power_cmd, Value::from_str(POWER)?);
|
|
results.insert(profiles_cmd, Value::from_str(PROFILES)?);
|
|
results.insert(temps_cmd, Value::from_str(TEMPS)?);
|
|
+ results.insert(tempctrl_cmd, Value::from_str(TEMPCTRL)?);
|
|
results.insert(devs_cmd, Value::from_str(DEVS)?);
|
|
results.insert(
|
|
MinerCommand::RPC {
|
|
@@ -1704,6 +1740,11 @@ mod tests {
|
|
// Miner-level fan duty cycle = max of per-fan Speed (all 20 here); round 19
|
|
// #10, T3.
|
|
assert_eq!(miner_data.fan_speed_percent, Some(20.0));
|
|
+ // Board temp thresholds from tempctrl ChipTarget/ChipHot/ChipDangerous
|
|
+ // (round 19 #10, T3).
|
|
+ assert_eq!(miner_data.temp_target, Some(83.0));
|
|
+ assert_eq!(miner_data.temp_hot, Some(93.0));
|
|
+ assert_eq!(miner_data.temp_dangerous, Some(100.0));
|
|
assert_eq!(miner_data.hashboards[0].chips.len(), 77);
|
|
assert_eq!(miner_data.pools.len(), 2);
|
|
assert_eq!(miner_data.pools[0].len(), 2);
|
|
diff --git a/vendor/asic-rs-firmwares-luxminer/src/test/json/v1/mod.rs b/vendor/asic-rs-firmwares-luxminer/src/test/json/v1/mod.rs
|
|
index 7f328a47..02500ccb 100644
|
|
--- a/vendor/asic-rs-firmwares-luxminer/src/test/json/v1/mod.rs
|
|
+++ b/vendor/asic-rs-firmwares-luxminer/src/test/json/v1/mod.rs
|
|
@@ -10,6 +10,7 @@ pub(crate) const PROFILES: &str = include_str!("profiles.json");
|
|
pub(crate) const STATS: &str = include_str!("stats.json");
|
|
pub(crate) const SUMMARY: &str = include_str!("summary.json");
|
|
pub(crate) const TEMPS: &str = include_str!("temps.json");
|
|
+pub(crate) const TEMPCTRL: &str = include_str!("tempctrl.json");
|
|
pub(crate) const VERSION: &str = include_str!("version.json");
|
|
pub(crate) const EVENTS: &str = include_str!("events.json");
|
|
|