What happened?
The optional eth_subscribe (newHeads) WebSocket has no ping/pong keepalive and no read deadline. A half-open connection (NAT timeout, silent drop) blocks the read loop forever, silently disabling fast wake-ups until process restart. Polling fallback preserves correctness, but the latency benefit is permanently lost.
Area
Backend
Expected behavior
Periodic ping with a read deadline; on timeout, close the connection and reconnect, with polling covering the gap in the meantime.
Steps to reproduce
- Run the indexer with a WS RPC URL so the newHeads subscription is active
- Sever the connection without FIN/RST (e.g. firewall packet drop)
- Observe no reconnect and no further head notifications; only polling continues
Additional context
Found during code review. Relevant code: indexer/internal/indexer/subscription.go (~91-147). Severity: low.
What happened?
The optional eth_subscribe (newHeads) WebSocket has no ping/pong keepalive and no read deadline. A half-open connection (NAT timeout, silent drop) blocks the read loop forever, silently disabling fast wake-ups until process restart. Polling fallback preserves correctness, but the latency benefit is permanently lost.
Area
Backend
Expected behavior
Periodic ping with a read deadline; on timeout, close the connection and reconnect, with polling covering the gap in the meantime.
Steps to reproduce
Additional context
Found during code review. Relevant code:
indexer/internal/indexer/subscription.go(~91-147). Severity: low.