Flip T3 to substrate-initiated actuator commands

This commit is contained in:
Valère Plantevin
2026-05-13 15:03:23 -04:00
parent 272d3b3c59
commit baa075fe0f
22 changed files with 1003 additions and 749 deletions

View File

@@ -25,6 +25,13 @@ pub struct QuicConfig {
pub t1_capacity: usize,
pub t2_capacity: usize,
pub t3_capacity: usize,
/// Bench-only knob. When > 0, the substrate spawns a synthetic T3
/// driver that issues toggling Relay commands to every connected device
/// at the configured rate, exercising the real outbound code path.
/// Off by default (0.0) in production. Override via env:
/// `APP_NETWORK__SYNTHETIC_T3_RATE_HZ=100`.
#[serde(default)]
pub synthetic_t3_rate_hz: f64,
}
#[derive(Debug, Serialize, Deserialize)]
@@ -47,6 +54,7 @@ impl Default for AppConfig {
t1_capacity: 1024,
t2_capacity: 512,
t3_capacity: 256,
synthetic_t3_rate_hz: 0.0,
},
simulation: SimulationConfig {
tick_rate_hz: 60,
@@ -65,7 +73,9 @@ impl AppConfig {
Figment::new()
.merge(Serialized::defaults(Self::default())) // compiled-in defaults
.merge(Toml::file(config_file)) // config file
.merge(Env::prefixed("APP_")) // env overrides, e.g. APP_NETWORK__PORT=9000
// env overrides — `__` is the nesting separator so
// `APP_NETWORK__SERVER_PORT=9001` overrides `network.server_port`.
.merge(Env::prefixed("APP_").split("__"))
.extract()
}
}