decipherhub / decipherhub/cipherbft
Metrics registration can panic at startup
- Dominant language
- Rust
- Stars
- 9
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
RPC metrics in `crates/rpc/src/metrics.rs` use `expect()` during lazy static initialization, which will panic if metric registration fails.
## Details
```rust
static ref RPC_REQUESTS_TOTAL: IntCounterVec = IntCounterVec::new(...)
.expect("Failed to register rpc_requests_total metric")
```
All metric registrations follow this pattern:
- `RPC_REQUESTS_TOTAL`
- `RPC_REQUEST_DURATION`
- `RPC_ACTIVE_CONNECTIONS`
- `RPC_WS_SUBSCRIPTIONS`
- `RPC_RATE_LIMIT_REJECTIONS`
## Impact
- If Prometheus registry has naming conflicts or is exhausted, node crashes at startup
- No graceful degradation to running without metrics
Contributor guide
Assessment
This issue has not been assessed yet.