Skip to content

all back to the direct chain oracle when the Comet tip cache becomes stale #1772

Open @anatoly-kuz-mntn opened 2026-09-15 02:01 UTC 0 comments Updated 2026-09-15 02:01 UTC

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

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.