Repository navigation
ethmonitor: detect stalled newHeads streams and fall back to polling - #226
ScreamingHawk wants to merge 1 commit into
Conversation
ddfd377 to
f89c4b1
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Findings from Ada's review of
Suggested fix: when the stream appears stale, fetch the node's latest block over HTTP and only drop the subscription if the node is ahead of the stream. This distinguishes an idle chain from a stalled subscription and follows the deleted TODO. The incident attribution also needs revisiting. In the 19:30–21:10 UTC window on Nov 5, the reviewed node-gateway logs showed no Base (8453) stream errors; the only ethmonitor stream errors were Before node-gateway adopts the release containing this change, either add the HTTP-head comparison or explicitly disable the check with Validation reported by Ada: |
Summary
A newHeads subscription can silently serve stale heads: no error arrives on the subscription, while the node's HTTP api keeps advancing. This is what left the node-gateway's Base head 23 minutes behind during INC-280 while every endpoint health probe stayed green.
In streaming mode, the listener now tracks the timestamp of the last received head and drops the subscription, counting it toward the existing switch to polling, when it is older than
StreamHealthCheckStaleness(default 60s). Seeded on connect so a stream that never delivers a head is caught too.NewMonitorrejectsStreamHealthCheckStaleness <= StreamHealthCheckInterval.Implements the streamHealthCheck TODO that was already in
listenNewHead.Test Plan
TestMonitorStreamHealthCheckFallsBackToPolling: stalled stream switches to polling, head keeps advancing, alert raisedTestMonitorStreamHealthCheckFreshStreamKeepsStreaming: control, no stall alerts on a live streamTestMonitorStreamHealthCheckRecoversToStreaming: after the stall clears, polling retries streaming and catches back up./ethmonitor/suite passes