You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P0] time_since_last_block never grows on chain halt when drift monitoring is enabled #34
When drift monitoring is enabled (--reference-node + --full-nodes), pkg/exporters/drift/drift.go:66 and :85 call m.UpdateLastBlockTime(chainID, time.Now()) on every successful poll, whether or not the height advanced.
If the chain halts, ev_metrics_time_since_last_block_seconds is reset to 0 every --polling-interval (default 10s), so a "no new block for N seconds" alert never fires. That alert is the main reason this metric exists.
Proposed fix
Keep lastHeight uint64 on the drift exporter.
Call UpdateLastBlockTime only when refHeight > lastHeight.
Remove the per-full-node UpdateLastBlockTime call. A full node catching up doesn't mean the chain produced a block.
New pkg/exporters/drift/drift_test.go: an httptest JSON-RPC server returns a constant eth_blockNumber, and the test asserts time_since_last_block_seconds keeps growing.
A height that goes backwards (reorg or endpoint switch) doesn't reset the gauge.
Activity