Skip to content

[Bug]: newHeads subscription has no ping or read deadline; half-open WS silently disables fast wake-ups #67

Description

@flwrenn

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

  1. Run the indexer with a WS RPC URL so the newHeads subscription is active
  2. Sever the connection without FIN/RST (e.g. firewall packet drop)
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendGo indexerbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions