PR: #31 (feat/06-chainprovider-ws)
File: crates/charon-scanner/src/provider.rs
Line: 36
Problem: ProviderBuilder::new().on_ws(ws).await has no deadline. If BSC node unreachable, TCP handshake or WS upgrade stalls indefinitely, blocking async runtime task and preventing process from starting or recovering.
Impact: Docker container on Hetzner CX22 (PR #55 compose stack) appears hung with no log output. Ops cannot distinguish slow node from crashed one. No restart logic fires because task never yields error.
Fix: Wrap with tokio::time::timeout:
use tokio::time::{timeout, Duration};
let provider = timeout(
Duration::from_secs(10),
ProviderBuilder::new().on_ws(ws),
)
.await
.with_context(|| format!("chain '{name}': ws connect timed out after 10s"))?
.with_context(|| format!("chain '{name}': ws connect failed"))?;
Expose timeout as configurable field in ChainConfig (default 10s).
PR: #31 (feat/06-chainprovider-ws)
File: crates/charon-scanner/src/provider.rs
Line: 36
Problem:
ProviderBuilder::new().on_ws(ws).awaithas no deadline. If BSC node unreachable, TCP handshake or WS upgrade stalls indefinitely, blocking async runtime task and preventing process from starting or recovering.Impact: Docker container on Hetzner CX22 (PR #55 compose stack) appears hung with no log output. Ops cannot distinguish slow node from crashed one. No restart logic fires because task never yields error.
Fix: Wrap with
tokio::time::timeout:Expose timeout as configurable field in
ChainConfig(default 10s).