all back to the direct chain oracle when the Comet tip cache becomes stale #1772
Description
After the Comet tip cache receives its first header, Cache.Latest() continues returning that header regardless of its age.
The outer failover oracle treats this as a successful fresh read, does not query the direct chain oracle, and updates lastOK = true. As a result, Stale() reports false even though the cached tip has stopped advancing.
Hosts can therefore continue reporting a frozen height as SYNCED during a Comet WebSocket outage.
Affected code
Latestaccepts any cached header and skips the direct fallbackOracle.Staleuses the successful frozen read aslastOKCache.Latesthas no freshness checkCache.Stalealready knows when the last observation is too old
Expected behavior
Once the cached tip exceeds its staleness threshold, Latest() should query the configured direct chain oracle. A frozen cached header must not reset the outer oracle’s stale state.
Acceptance criteria
- A fresh cached tip remains preferred.
- A stale cached tip triggers a direct-chain lookup.
- The fresher direct-chain header is returned when available.
Stale()remains true when neither source provides a fresh header.- Add a regression test using a populated cache that stops receiving new blocks.
🔄 Auto-synced from Issue #1772 every hour.