fix(protocol): show one short unavailable message for DEX reference prices during security-update outages #1578

Open
opened 2026-10-29 00:22:31 +00:00 by PlasticDigits · 0 comments
Owner

Problem and scope

An anonymized report shows the /protocol DEX reference prices card rendering all four rows as —:

  • cUSTC / USD
  • cLUNC / USD
  • UST1 / USD
  • USTR / USD

The cUSTC and cLUNC wrap addresses are still visible, so this is not a token-label or address-lookup failure. The card is missing a truthful state, not a price value.

The report coincided with an outage caused by critical security updates to the deployment. That outage is not itself a defect and is not being challenged here. The page did not communicate the outage: it displayed four unexplained dashes with no message. A security-update outage should remain a security-update outage; this issue is only about telling the visitor that reference data is temporarily unavailable while that outage is in progress.

This issue is intentionally scoped to the existing page-level status, under the anti-cognitive-overload policy. It does not ask for per-row status badges, last-observed timestamps, new buttons, new banners, explanatory paragraphs, or technical quality/as_of vocabulary on the card. The card stays title + four values. The only new behavior is one short sentence when the whole hub snapshot is stale/unavailable, plus automatic clearing when the update finishes. The retail copy is fixed and small: Reference prices temporarily unavailable. No second line, no “security update”, no “maintenance”, no last-observed time, and no technical status vocabulary.

Live evidence and timeline

Bounded, anonymous, read-only public probes were made on 2026-10-29. No wallet, transaction, signing, private endpoint, or user data was used. The deployed liveness revision was b7b08736b3529af344a693ae6d16236a4f324c13.

Before the maintenance completed, the API stayed up while reference data was stale:

GET https://indexer.dex.cl8y.com/ready
HTTP 503
{"status":"halted","ready":false,"checkpoint_height":31039630,
 "latest_height":31039629,"pending_height":31039631,"reason":"leadership_lost"}
GET /api/v1/hub-prices
HTTP 200
prices:
  custc price_usd=null quality=stale as_of=2026-10-28T16:51:44.780757+00:00
  lunc  price_usd=null quality=stale as_of=2026-10-28T16:51:44.780784+00:00
  ust1  price_usd=null quality=stale as_of=2026-10-28T16:51:44.690032+00:00
  ustr  price_usd=null quality=stale as_of=2026-10-28T16:51:44.690032+00:00
GET /api/v1/oracle/price/lunc
HTTP 200
{"quality":"stale","as_of":"2026-10-28T16:51:54.781034+00:00",
 "age_seconds":26362,"source_count":0,"accepted_sources":[],"sources":[]}

GET /api/v1/overview likewise returned custc_price_usd: null and four stale hub_price_quality entries. The four cards therefore received a successful 200 response with stale rows and rendered exactly the reported state: four — values.

At approximately 00:18 UTC, after the security update completed, /ready returned status: "running" with reason: null; the hub endpoint returned fresh numeric values for all four tickers. The page recovered through its existing 30-second poll. The outage was therefore a security-update outage, and the page's silent stale state was the user-visible gap.

The observed halted status during the update is context, not a request to change the halt or the security procedure. The backend already returns quality and as_of so a client can decide whether the snapshot is usable; those fields stay internal and are not retail copy.

Current codebase and why a minimal implementation is needed

  • frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx renders only row?.price_usd. formatHubUsd maps null, empty, non-finite, and non-positive values to —. The component already receives quality, as_of, max_age_seconds, and metadata from IndexerHubPricesResponse, but it does not render or expose them. That is correct under the anti-cognitive-overload policy and should stay that way. This issue does not add per-row state, last-observed text, icons, badges, or buttons to this card.
  • frontend-dapp/src/pages/ProtocolPage.tsx already computes marketDataDown via detectMarketDataOutage(...) and renders the existing MarketDataServiceOutageBanner with PROTOCOL_MARKET_DATA_OUTAGE_LEAD when the indexer is unreachable. frontend-dapp/src/utils/marketDataOutage.ts currently returns true only for a query error recognized by isIndexerUnavailableError. A 200 response with four stale/null entries is therefore indistinguishable from a healthy response for banner purposes.
  • frontend-dapp/src/components/common/MarketDataServiceOutageBanner.tsx and frontend-dapp/src/utils/marketDataServiceCopy.ts provide the existing banner component and its current error copy. Do not add a second banner. The all-stale case reuses this component with one new one-sentence title and no onRetry; the existing 5xx path keeps its current behavior. Do not add a card-level action.
  • frontend-dapp/src/services/indexer/client.ts already exposes getHubPrices and the typed IndexerHubPriceEntry/IndexerHubPricesResponse structures in frontend-dapp/src/types/index.ts. No API-schema change is required.
  • indexer/src/api/hub_prices.rs::entry_for and indexer/src/db/queries/hub_prices.rs::row_usable already implement the fail-closed stale/null contract. This issue does not propose changing reference policy or fabricating a value during maintenance.
  • Existing tests assert that null hub prices render as — (ProtocolPage.test.tsx, test null hub prices render em-dash, not $0 or $1) and that a 502 shows the existing outage banner. There is no test that a 200 response with an all-stale hub snapshot shows the same single page-level message.
  • The page-level MarketDataServiceOutageBanner is accurate for an unreachable API, but not yet for a responsive indexer whose reference producers are paused by a security update. During the reported outage the API was reachable; the 200-stale path produced no message.

The smallest correct fix is a single all-stale signal feeding the existing banner. The card remains unchanged. The message is one new one-sentence constant: Reference prices temporarily unavailable. No second line or explanatory content is introduced. The existing 5xx/error path keeps PROTOCOL_MARKET_DATA_OUTAGE_LEAD. The page recovers via its existing poll; no new control is required.

Relevant files

  • frontend-dapp/src/pages/ProtocolPage.tsx — page-level banner composition; unchanged card.
  • frontend-dapp/src/utils/marketDataOutage.ts — extend the error-only decision to include an all-stale hub snapshot.
  • frontend-dapp/src/utils/marketDataServiceCopy.ts — add one one-sentence constant for the all-stale title; keep the existing error copy for the 5xx path. No second line.
  • frontend-dapp/src/components/common/MarketDataServiceOutageBanner.tsx — reuse the existing banner; the all-stale message has no Retry; the existing 5xx path keeps its current behavior.
  • frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx — intentionally unchanged; no per-row status or new controls.
  • frontend-dapp/src/types/index.ts — existing quality/as_of/max_age_seconds fields; read-only for the stale decision.
  • frontend-dapp/src/services/indexer/client.ts — existing getHubPrices typing.
  • frontend-dapp/src/pages/ProtocolPage.test.tsx — add the stale-200/recovery cases; keep the existing null and 502 expectations.
  • skills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md, skills/AGENTS_FRONTEND_PROTOCOL_HUB.md — copy/IA rules to follow and cross-link.
  • Verification entry points: make test-frontend, make verify-issue-556, make verify-issue-570, and the focused verifier added by this issue.
  1. Detect the full stale snapshot once. Extend the protocol outage decision so an all-stale/unavailable hub snapshot is treated as a status condition. Use quality and as_of internally; do not render them. A partial missing row stays a — in its cell with no extra message. A fresh qualified four-row snapshot shows values and no message.
  2. Reuse the existing page-level banner. Show MarketDataServiceOutageBanner once with exactly one short title: Reference prices temporarily unavailable. (add this single constant to marketDataServiceCopy.ts if needed) and no lead/second line. Do not add a second banner, a second status region, or a duplicate message in the card. If the existing banner is already visible for a transport/5xx failure, keep exactly one banner and use the existing error copy there.
  3. Do not add a new control. The all-stale case uses the existing banner without the Retry action; the existing 30-second poll recovers automatically. The existing transport/5xx path keeps its current error behavior. Add no new button, link, card-level retry, or dismiss action. The anti-cognitive budget is zero new buttons.
  4. Keep the card unchanged. The four cells, headings, wrap/source identity, numeric format, and — fallback remain as today. Do not add per-row Stale/Unavailable labels, icons, tooltips, last-updated lines, quality vocabulary, or explanatory text. The page-level message is the only new chrome.
  5. Recover automatically and silently. When the update completes and the hub response is fresh, the existing 30-second poll clears the banner and shows the values. Do not retain a stale banner, do not relabel as_of, and do not add a success toast.
  6. Keep the maintenance/security-update procedure untouched. This is a display/observability fix only. Do not keep a stopped service alive to hide maintenance and do not weaken the indexer's safety halts.
  7. Document and verify. Add the single-message/stale-all rule and the no-new-buttons budget to the protocol hub playbook. A focused verifier must assert the card's DOM is unchanged and the banner is rendered once.

Constraints and guardrails

  • Follow AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md and the design-system rule: labels ≤ ~5 words, blocking status ≤ 1 short sentence, no always-on educational/ops essays, no per-row technical status, no duplicate messages. The all-stale message is exactly Reference prices temporarily unavailable.; the existing PROTOCOL_MARKET_DATA_OUTAGE_LEAD remains for the existing 5xx/error banner. Do not show both.
  • Anti-cognitive budget: one new short page-level sentence max; zero new buttons/controls; zero new explanatory paragraphs; zero per-row status; zero new icons; no new role="status"/aria-live region beyond the existing banner's role="alert"; the four-card DOM stays materially unchanged. The all-stale message is exactly Reference prices temporarily unavailable. with no lead/paragraph and no Retry.
  • Preserve O1391, PR1464, H1–H16, Q1380, LF1453, LQ1452, DB1396 and NET1392. The $100 independently priced hub-leg depth floor, the $10 economic total-TVL floor, two-source quorum, 300-second freshness, no-future-timestamp rule, and no-quorum-no-price rule remain unchanged.
  • Never synthesize a reference: no UST1 = $1, no USTR = 2.5 × USTC, no cUSTC/LUNC fallback, no last-trade/candle substitution, no stale value relabeling, no source-pair substitution, and no fallback to a previous numeric.
  • A stale/missing row remains non-executable for valuation or signing. The UI may show — plus the single page-level unavailable message, but it must never use the value as a price or allow it to authorize a transaction.
  • The API request path must not trigger RPC, LCD, provider, database, or reference ingestion. The 30-second query interval is a read-only cache refresh; no request may force a producer, probe, recovery, or reference reset.
  • Do not change the security-update procedure, do not keep a service stopped for security updates alive to hide maintenance, and do not weaken the indexer's safety halts. This is a display/observability fix for a security-update outage.
  • Do not expose provider URLs, hostnames, ports, raw bodies, credentials, actor identifiers/digests, wallet data, or private endpoints in the DOM, API JSON, or logs. Use fixed text and existing safe address rendering.
  • /health liveness and /ready readiness remain distinct. The frontend must not infer readiness from liveness or call internal status endpoints that are not part of its contract. The existing 200 + quality contract is sufficient for the all-stale decision.
  • The page must remain usable with a keyboard, screen reader, reduced motion, and the existing responsive/compact display settings. The card stays readable; the banner is the only new live status.

Acceptance criteria

  • AC1: During a security-update outage with an all-stale hub snapshot, /protocol shows the existing page-level MarketDataServiceOutageBanner once with exactly Reference prices temporarily unavailable. (no lead, no second sentence) and the four DEX reference cells remain — with their existing headings and wrap/source identity. There are no per-row Stale/Unavailable labels, last-observed lines, tooltips, or explanatory paragraphs.
  • AC2: The change adds zero new buttons, links, or dismiss controls. The all-stale banner renders without onRetry; the 30-second poll is the only recovery. The existing 502/error path keeps its current behavior. The card has no new controls.
  • AC3: The card's DOM is otherwise unchanged: four cells, same order, same mixed-case headings, same numeric/— formatting, same address rows. No new status markup or live region is added inside the card.
  • AC4: A 200 all-stale hub response is treated as an unavailable snapshot and shows the single page-level message. A partial stale/missing row shows only — for that row and does not add a page-level message or extra text. A healthy four-row snapshot shows values and no message.
  • AC5: A transport failure or 5xx still uses the existing single outage banner and does not produce a duplicate banner or a second message when hub data is also stale.
  • AC6: When the security update completes and the API returns fresh values, the existing 30-second poll clears the banner and shows the four $ values without a page reload. No success toast, “recovered” message, or extra chrome is added.
  • AC7: Accessibility is inherited from the existing banner (role="alert"); no additional aria-live region is introduced. Keyboard, screen-reader, reduced-motion, mobile/desktop, light/dark, Compact/Full number display, and ticker-case behavior remain usable.
  • AC8: Fresh, stale, unavailable, partial, 502, retry, boundary timestamp, and recovery cases are covered. A stale value is never treated as executable; the existing reference policy tests continue to pass.
  • AC9: The protocol hub playbook documents the single-message/stale-all rule and the zero-new-button budget. The focused verifier and a read-only live receipt confirm the message and recovery; a one-time restart or the fact that security updates were applied is not sufficient evidence for the display fix.
  • AC10: The maintenance outage itself is not presented as a code regression. The issue is closed only when the page shows the single truthful message and recovers; no security-update procedure is changed.

Test plan: functional and all-path coverage

Scenario Required checks
Fresh indexer, all four anchors /hub-prices returns four numeric prices with fresh quality and current as_of; /protocol shows $ values and no banner. Card DOM unchanged.
Security-update maintenance (full outage) The API returns four stale/null entries; the page shows exactly one existing page-level banner containing only Reference prices temporarily unavailable.; the card keeps four — cells; no per-row status, no extra text, no button.
Partial outage One or more rows null/stale but not all; the affected cell shows —; no page-level message and no extra text. A healthy ticker still shows its value.
API 200 all-stale Mock quality: "stale"/old as_of for all four; assert exactly one banner containing only Reference prices temporarily unavailable., no Retry, four dashes, card DOM unchanged, zero new controls.
API 200 all-unavailable Mock quality: "unavailable", missing as_of; same single banner and four dashes; no $0/$1.
API 502 / timeout / offline The existing banner appears once; all four cards remain; no duplicate message if hub data is also stale.
Recovery With the page open, switch from all-stale to fresh mock (or use the real poll); assert the banner clears, values update without reload, and no success toast appears.
Boundary timestamps as_of just inside/at/just beyond max_age_seconds; future timestamp, missing timestamp, malformed string, and browser clock skew. The server policy remains authoritative; the UI must not add copy about it.
Accessibility and layout The existing banner is the only live status; keyboard focus, screen reader, reduced motion, mobile/desktop, light/dark, Compact/Full number display, ticker case, and the existing four-card order remain correct.
Existing safety paths Reference quorum, stale reserve/dust/same-asset/symbol-spoof rejection, and no-peg/fallback behavior still pass. A stale/missing reference cannot authorize a quote or a signed transaction.

Use deterministic mocked clocks/providers and disposable API mocks. The live security-update maintenance is not a test fixture; the card behavior must be tested with mocked all-stale responses. Integration tests must not point at the shared production database.

Test plan: attack, hack and abuse vectors

  • Stale/future/replayed data injection: mock or return old, future, duplicate, out-of-order, and replayed quality/as_of values. The server TTL/quorum remains authoritative; the UI must never label a stale/future value as fresh and must not add a second status. No stale value may be used as a current price or execution reference.
  • Hostile JSON/UI fields: send/return hostile ticker, quality, timestamp, symbol, source, and address strings. The UI must treat all API content as text (React escaping), use the existing address/explorer allowlist, never interpolate raw HTML/URLs, and never expose provider URLs or credentials.
  • State confusion / duplicate messaging: attempt to make the page show two banners, a per-row status, a $0/$1/2.5× fallback, a prior value, or a success message during recovery. Assert exactly one page-level message, unchanged card DOM, and no new controls.
  • Denial of service: flood /protocol or /hub-prices with requests, malformed ticker/query parameters, or rapid tab/amount changes. The page must not trigger ingestion or provider work; the existing 30-second poll must not be accelerated by user traffic; response sizes and logs stay bounded.
  • Spoofed identities: a malicious or malformed asset_address, source pair, or ticker must not be rendered as a trusted link; use the existing terra1 sanitization and explorer allowlist. Do not add a fallback that accepts a spoofed symbol.
  • Log/response leakage: assert that no raw database errors, hostnames, ports, usernames, wallets, transaction ids, provider bodies, or secrets appear in the DOM, API JSON, or logs. The single banner must not expose internals.
  • Maintenance bypass: no request, client flag, query parameter, or retry may bypass the security-update stop, force the indexer to resume, or revive a value during maintenance. The page only displays the state and waits for fresh data.

Verification criteria

  • Add focused frontend tests for fresh, all-stale, all-unavailable, partial, 502/timeout, one-banner/no-duplicate, zero-new-controls, boundary timestamps, accessibility, and recovery. The all-stale test asserts the exact single sentence, no Retry, no extra text, and must fail on the current implementation.
  • Add or update a documented focused verifier for this issue (for example make verify-issue-<new-id>) that runs the relevant frontend group and the hub/oracle source tests. It must not require production credentials or mutate production.
  • Run make test-frontend, make verify-issue-556, make verify-issue-570, and the relevant make verify-issue-1380/1391/1453/1464 regressions after implementation. Record invocation, revision, UTC and pass/fail counts. Existing executed failures stay FAIL; unavailable environmental checks are explicit SKIP, never PASS.
  • Deploy through the normal agent-owned release path and record a read-only live receipt: during a maintenance window or with a mocked stale API fixture, the page shows exactly one short banner and four unchanged cells; after fresh data returns, the page recovers without reload. A security-update restart or a one-time process bounce is not evidence for this display fix.
  • Re-run the existing safety verifiers for reference/oracle/quorum/hub floors. No policy or maintenance procedure is changed by this issue; the only intended behavior change is the single truthful all-stale message and recovery.
  • Update skills/AGENTS_FRONTEND_PROTOCOL_HUB.md and the relevant hub/oracle playbook text with the single-message/stale-all rule, the zero-new-control budget, and the no-per-row-status rule. Do not publish personal data, conversations, or screenshots in the issue or QA record.
## Problem and scope An anonymized report shows the `/protocol` **DEX reference prices** card rendering all four rows as `—`: - `cUSTC / USD` - `cLUNC / USD` - `UST1 / USD` - `USTR / USD` The cUSTC and cLUNC wrap addresses are still visible, so this is not a token-label or address-lookup failure. The card is missing a truthful state, not a price value. The report coincided with an outage caused by **critical security updates** to the deployment. That outage is not itself a defect and is not being challenged here. The page did not communicate the outage: it displayed four unexplained dashes with no message. A security-update outage should remain a security-update outage; this issue is only about telling the visitor that reference data is temporarily unavailable while that outage is in progress. This issue is intentionally scoped to the **existing page-level status**, under the anti-cognitive-overload policy. It does **not** ask for per-row status badges, last-observed timestamps, new buttons, new banners, explanatory paragraphs, or technical `quality`/`as_of` vocabulary on the card. The card stays title + four values. The only new behavior is one short sentence when the whole hub snapshot is stale/unavailable, plus automatic clearing when the update finishes. The retail copy is fixed and small: **Reference prices temporarily unavailable.** No second line, no “security update”, no “maintenance”, no last-observed time, and no technical status vocabulary. ## Live evidence and timeline Bounded, anonymous, read-only public probes were made on **2026-10-29**. No wallet, transaction, signing, private endpoint, or user data was used. The deployed liveness revision was `b7b08736b3529af344a693ae6d16236a4f324c13`. Before the maintenance completed, the API stayed up while reference data was stale: ```text GET https://indexer.dex.cl8y.com/ready HTTP 503 {"status":"halted","ready":false,"checkpoint_height":31039630, "latest_height":31039629,"pending_height":31039631,"reason":"leadership_lost"} ``` ```text GET /api/v1/hub-prices HTTP 200 prices: custc price_usd=null quality=stale as_of=2026-10-28T16:51:44.780757+00:00 lunc price_usd=null quality=stale as_of=2026-10-28T16:51:44.780784+00:00 ust1 price_usd=null quality=stale as_of=2026-10-28T16:51:44.690032+00:00 ustr price_usd=null quality=stale as_of=2026-10-28T16:51:44.690032+00:00 ``` ```text GET /api/v1/oracle/price/lunc HTTP 200 {"quality":"stale","as_of":"2026-10-28T16:51:54.781034+00:00", "age_seconds":26362,"source_count":0,"accepted_sources":[],"sources":[]} ``` `GET /api/v1/overview` likewise returned `custc_price_usd: null` and four stale `hub_price_quality` entries. The four cards therefore received a successful `200` response with stale rows and rendered exactly the reported state: four `—` values. At approximately **00:18 UTC**, after the security update completed, `/ready` returned `status: "running"` with `reason: null`; the hub endpoint returned fresh numeric values for all four tickers. The page recovered through its existing 30-second poll. The outage was therefore a security-update outage, and the page's silent stale state was the user-visible gap. The observed `halted` status during the update is context, not a request to change the halt or the security procedure. The backend already returns `quality` and `as_of` so a client can decide whether the snapshot is usable; those fields stay internal and are not retail copy. ## Current codebase and why a minimal implementation is needed - `frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx` renders only `row?.price_usd`. `formatHubUsd` maps null, empty, non-finite, and non-positive values to `—`. The component already receives `quality`, `as_of`, `max_age_seconds`, and `metadata` from `IndexerHubPricesResponse`, but it does not render or expose them. **That is correct under the anti-cognitive-overload policy and should stay that way.** This issue does not add per-row state, last-observed text, icons, badges, or buttons to this card. - `frontend-dapp/src/pages/ProtocolPage.tsx` already computes `marketDataDown` via `detectMarketDataOutage(...)` and renders the existing `MarketDataServiceOutageBanner` with `PROTOCOL_MARKET_DATA_OUTAGE_LEAD` when the indexer is unreachable. `frontend-dapp/src/utils/marketDataOutage.ts` currently returns true only for a query error recognized by `isIndexerUnavailableError`. A `200` response with four stale/null entries is therefore indistinguishable from a healthy response for banner purposes. - `frontend-dapp/src/components/common/MarketDataServiceOutageBanner.tsx` and `frontend-dapp/src/utils/marketDataServiceCopy.ts` provide the existing banner component and its current error copy. Do not add a second banner. The all-stale case reuses this component with one new one-sentence title and no `onRetry`; the existing 5xx path keeps its current behavior. Do not add a card-level action. - `frontend-dapp/src/services/indexer/client.ts` already exposes `getHubPrices` and the typed `IndexerHubPriceEntry`/`IndexerHubPricesResponse` structures in `frontend-dapp/src/types/index.ts`. No API-schema change is required. - `indexer/src/api/hub_prices.rs::entry_for` and `indexer/src/db/queries/hub_prices.rs::row_usable` already implement the fail-closed stale/null contract. This issue does not propose changing reference policy or fabricating a value during maintenance. - Existing tests assert that null hub prices render as `—` (`ProtocolPage.test.tsx`, test `null hub prices render em-dash, not $0 or $1`) and that a 502 shows the existing outage banner. There is no test that a `200` response with an all-stale hub snapshot shows the same single page-level message. - The page-level `MarketDataServiceOutageBanner` is accurate for an unreachable API, but not yet for a responsive indexer whose reference producers are paused by a security update. During the reported outage the API was reachable; the 200-stale path produced no message. The smallest correct fix is a **single all-stale signal feeding the existing banner**. The card remains unchanged. The message is one new one-sentence constant: **Reference prices temporarily unavailable.** No second line or explanatory content is introduced. The existing 5xx/error path keeps `PROTOCOL_MARKET_DATA_OUTAGE_LEAD`. The page recovers via its existing poll; no new control is required. ## Relevant files - `frontend-dapp/src/pages/ProtocolPage.tsx` — page-level banner composition; unchanged card. - `frontend-dapp/src/utils/marketDataOutage.ts` — extend the error-only decision to include an all-stale hub snapshot. - `frontend-dapp/src/utils/marketDataServiceCopy.ts` — add one one-sentence constant for the all-stale title; keep the existing error copy for the 5xx path. No second line. - `frontend-dapp/src/components/common/MarketDataServiceOutageBanner.tsx` — reuse the existing banner; the all-stale message has no Retry; the existing 5xx path keeps its current behavior. - `frontend-dapp/src/components/protocol/ProtocolDexHubPrices.tsx` — intentionally **unchanged**; no per-row status or new controls. - `frontend-dapp/src/types/index.ts` — existing `quality`/`as_of`/`max_age_seconds` fields; read-only for the stale decision. - `frontend-dapp/src/services/indexer/client.ts` — existing `getHubPrices` typing. - `frontend-dapp/src/pages/ProtocolPage.test.tsx` — add the stale-200/recovery cases; keep the existing null and 502 expectations. - `skills/AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md`, `skills/AGENTS_FRONTEND_PROTOCOL_HUB.md` — copy/IA rules to follow and cross-link. - Verification entry points: `make test-frontend`, `make verify-issue-556`, `make verify-issue-570`, and the focused verifier added by this issue. ## Recommended direction 1. **Detect the full stale snapshot once.** Extend the protocol outage decision so an all-stale/unavailable hub snapshot is treated as a status condition. Use `quality` and `as_of` internally; do not render them. A partial missing row stays a `—` in its cell with no extra message. A fresh qualified four-row snapshot shows values and no message. 2. **Reuse the existing page-level banner.** Show `MarketDataServiceOutageBanner` once with exactly one short title: **Reference prices temporarily unavailable.** (add this single constant to `marketDataServiceCopy.ts` if needed) and no `lead`/second line. Do not add a second banner, a second status region, or a duplicate message in the card. If the existing banner is already visible for a transport/5xx failure, keep exactly one banner and use the existing error copy there. 3. **Do not add a new control.** The all-stale case uses the existing banner **without** the Retry action; the existing 30-second poll recovers automatically. The existing transport/5xx path keeps its current error behavior. Add no new button, link, card-level retry, or dismiss action. The anti-cognitive budget is **zero new buttons**. 4. **Keep the card unchanged.** The four cells, headings, wrap/source identity, numeric format, and `—` fallback remain as today. Do not add per-row `Stale`/`Unavailable` labels, icons, tooltips, last-updated lines, quality vocabulary, or explanatory text. The page-level message is the only new chrome. 5. **Recover automatically and silently.** When the update completes and the hub response is fresh, the existing 30-second poll clears the banner and shows the values. Do not retain a stale banner, do not relabel `as_of`, and do not add a success toast. 6. **Keep the maintenance/security-update procedure untouched.** This is a display/observability fix only. Do not keep a stopped service alive to hide maintenance and do not weaken the indexer's safety halts. 7. **Document and verify.** Add the single-message/stale-all rule and the no-new-buttons budget to the protocol hub playbook. A focused verifier must assert the card's DOM is unchanged and the banner is rendered once. ## Constraints and guardrails - Follow **`AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.md`** and the design-system rule: labels ≤ ~5 words, blocking status ≤ 1 short sentence, no always-on educational/ops essays, no per-row technical status, no duplicate messages. The all-stale message is exactly **Reference prices temporarily unavailable.**; the existing `PROTOCOL_MARKET_DATA_OUTAGE_LEAD` remains for the existing 5xx/error banner. Do not show both. - **Anti-cognitive budget:** one new short page-level sentence max; zero new buttons/controls; zero new explanatory paragraphs; zero per-row status; zero new icons; no new `role="status"`/`aria-live` region beyond the existing banner's `role="alert"`; the four-card DOM stays materially unchanged. The all-stale message is exactly **Reference prices temporarily unavailable.** with no `lead`/paragraph and no Retry. - Preserve **O1391**, **PR1464**, **H1–H16**, **Q1380**, **LF1453**, **LQ1452**, **DB1396** and **NET1392**. The $100 independently priced hub-leg depth floor, the $10 economic total-TVL floor, two-source quorum, 300-second freshness, no-future-timestamp rule, and no-quorum-no-price rule remain unchanged. - Never synthesize a reference: no `UST1 = $1`, no `USTR = 2.5 × USTC`, no cUSTC/LUNC fallback, no last-trade/candle substitution, no stale value relabeling, no source-pair substitution, and no fallback to a previous numeric. - A stale/missing row remains non-executable for valuation or signing. The UI may show `—` plus the single page-level unavailable message, but it must never use the value as a price or allow it to authorize a transaction. - The API request path must not trigger RPC, LCD, provider, database, or reference ingestion. The 30-second query interval is a read-only cache refresh; no request may force a producer, probe, recovery, or reference reset. - Do not change the security-update procedure, do not keep a service stopped for security updates alive to hide maintenance, and do not weaken the indexer's safety halts. This is a display/observability fix for a security-update outage. - Do not expose provider URLs, hostnames, ports, raw bodies, credentials, actor identifiers/digests, wallet data, or private endpoints in the DOM, API JSON, or logs. Use fixed text and existing safe address rendering. - `/health` liveness and `/ready` readiness remain distinct. The frontend must not infer readiness from liveness or call internal status endpoints that are not part of its contract. The existing `200` + `quality` contract is sufficient for the all-stale decision. - The page must remain usable with a keyboard, screen reader, reduced motion, and the existing responsive/compact display settings. The card stays readable; the banner is the only new live status. ## Acceptance criteria - [ ] AC1: During a security-update outage with an all-stale hub snapshot, `/protocol` shows the existing page-level `MarketDataServiceOutageBanner` **once** with exactly **Reference prices temporarily unavailable.** (no `lead`, no second sentence) and the four DEX reference cells remain `—` with their existing headings and wrap/source identity. There are no per-row `Stale`/`Unavailable` labels, last-observed lines, tooltips, or explanatory paragraphs. - [ ] AC2: The change adds **zero new buttons, links, or dismiss controls**. The all-stale banner renders **without** `onRetry`; the 30-second poll is the only recovery. The existing 502/error path keeps its current behavior. The card has no new controls. - [ ] AC3: The card's DOM is otherwise unchanged: four cells, same order, same mixed-case headings, same numeric/`—` formatting, same address rows. No new status markup or live region is added inside the card. - [ ] AC4: A `200` all-stale hub response is treated as an unavailable snapshot and shows the single page-level message. A partial stale/missing row shows only `—` for that row and does not add a page-level message or extra text. A healthy four-row snapshot shows values and no message. - [ ] AC5: A transport failure or 5xx still uses the existing single outage banner and does not produce a duplicate banner or a second message when hub data is also stale. - [ ] AC6: When the security update completes and the API returns fresh values, the existing 30-second poll clears the banner and shows the four `$` values without a page reload. No success toast, “recovered” message, or extra chrome is added. - [ ] AC7: Accessibility is inherited from the existing banner (`role="alert"`); no additional `aria-live` region is introduced. Keyboard, screen-reader, reduced-motion, mobile/desktop, light/dark, Compact/Full number display, and ticker-case behavior remain usable. - [ ] AC8: Fresh, stale, unavailable, partial, 502, retry, boundary timestamp, and recovery cases are covered. A stale value is never treated as executable; the existing reference policy tests continue to pass. - [ ] AC9: The protocol hub playbook documents the single-message/stale-all rule and the zero-new-button budget. The focused verifier and a read-only live receipt confirm the message and recovery; a one-time restart or the fact that security updates were applied is not sufficient evidence for the display fix. - [ ] AC10: The maintenance outage itself is not presented as a code regression. The issue is closed only when the page shows the single truthful message and recovers; no security-update procedure is changed. ## Test plan: functional and all-path coverage | Scenario | Required checks | | --- | --- | | Fresh indexer, all four anchors | `/hub-prices` returns four numeric prices with fresh `quality` and current `as_of`; `/protocol` shows `$` values and no banner. Card DOM unchanged. | | Security-update maintenance (full outage) | The API returns four stale/null entries; the page shows exactly one existing page-level banner containing only **Reference prices temporarily unavailable.**; the card keeps four `—` cells; no per-row status, no extra text, no button. | | Partial outage | One or more rows null/stale but not all; the affected cell shows `—`; no page-level message and no extra text. A healthy ticker still shows its value. | | API 200 all-stale | Mock `quality: "stale"`/old `as_of` for all four; assert exactly one banner containing only **Reference prices temporarily unavailable.**, no Retry, four dashes, card DOM unchanged, zero new controls. | | API 200 all-unavailable | Mock `quality: "unavailable"`, missing `as_of`; same single banner and four dashes; no `$0`/`$1`. | | API 502 / timeout / offline | The existing banner appears once; all four cards remain; no duplicate message if hub data is also stale. | | Recovery | With the page open, switch from all-stale to fresh mock (or use the real poll); assert the banner clears, values update without reload, and no success toast appears. | | Boundary timestamps | `as_of` just inside/at/just beyond `max_age_seconds`; future timestamp, missing timestamp, malformed string, and browser clock skew. The server policy remains authoritative; the UI must not add copy about it. | | Accessibility and layout | The existing banner is the only live status; keyboard focus, screen reader, reduced motion, mobile/desktop, light/dark, Compact/Full number display, ticker case, and the existing four-card order remain correct. | | Existing safety paths | Reference quorum, stale reserve/dust/same-asset/symbol-spoof rejection, and no-peg/fallback behavior still pass. A stale/missing reference cannot authorize a quote or a signed transaction. | Use deterministic mocked clocks/providers and disposable API mocks. The live security-update maintenance is not a test fixture; the card behavior must be tested with mocked all-stale responses. Integration tests must not point at the shared production database. ## Test plan: attack, hack and abuse vectors - **Stale/future/replayed data injection:** mock or return old, future, duplicate, out-of-order, and replayed `quality`/`as_of` values. The server TTL/quorum remains authoritative; the UI must never label a stale/future value as fresh and must not add a second status. No stale value may be used as a current price or execution reference. - **Hostile JSON/UI fields:** send/return hostile ticker, quality, timestamp, symbol, source, and address strings. The UI must treat all API content as text (React escaping), use the existing address/explorer allowlist, never interpolate raw HTML/URLs, and never expose provider URLs or credentials. - **State confusion / duplicate messaging:** attempt to make the page show two banners, a per-row status, a `$0`/`$1`/`2.5×` fallback, a prior value, or a success message during recovery. Assert exactly one page-level message, unchanged card DOM, and no new controls. - **Denial of service:** flood `/protocol` or `/hub-prices` with requests, malformed ticker/query parameters, or rapid tab/amount changes. The page must not trigger ingestion or provider work; the existing 30-second poll must not be accelerated by user traffic; response sizes and logs stay bounded. - **Spoofed identities:** a malicious or malformed `asset_address`, source pair, or ticker must not be rendered as a trusted link; use the existing `terra1` sanitization and explorer allowlist. Do not add a fallback that accepts a spoofed symbol. - **Log/response leakage:** assert that no raw database errors, hostnames, ports, usernames, wallets, transaction ids, provider bodies, or secrets appear in the DOM, API JSON, or logs. The single banner must not expose internals. - **Maintenance bypass:** no request, client flag, query parameter, or retry may bypass the security-update stop, force the indexer to resume, or revive a value during maintenance. The page only displays the state and waits for fresh data. ## Verification criteria - [ ] Add focused frontend tests for fresh, all-stale, all-unavailable, partial, 502/timeout, one-banner/no-duplicate, zero-new-controls, boundary timestamps, accessibility, and recovery. The all-stale test asserts the exact single sentence, no Retry, no extra text, and must fail on the current implementation. - [ ] Add or update a documented focused verifier for this issue (for example `make verify-issue-<new-id>`) that runs the relevant frontend group and the hub/oracle source tests. It must not require production credentials or mutate production. - [ ] Run `make test-frontend`, `make verify-issue-556`, `make verify-issue-570`, and the relevant `make verify-issue-1380`/`1391`/`1453`/`1464` regressions after implementation. Record invocation, revision, UTC and pass/fail counts. Existing executed failures stay FAIL; unavailable environmental checks are explicit SKIP, never PASS. - [ ] Deploy through the normal agent-owned release path and record a read-only live receipt: during a maintenance window or with a mocked stale API fixture, the page shows exactly one short banner and four unchanged cells; after fresh data returns, the page recovers without reload. A security-update restart or a one-time process bounce is not evidence for this display fix. - [ ] Re-run the existing safety verifiers for reference/oracle/quorum/hub floors. No policy or maintenance procedure is changed by this issue; the only intended behavior change is the single truthful all-stale message and recovery. - [ ] Update `skills/AGENTS_FRONTEND_PROTOCOL_HUB.md` and the relevant hub/oracle playbook text with the single-message/stale-all rule, the zero-new-control budget, and the no-per-row-status rule. Do not publish personal data, conversations, or screenshots in the issue or QA record.
PlasticDigits changed title from fix(protocol): show maintenance and stale state for DEX reference prices during security-update outages to fix(protocol): show one short unavailable message for DEX reference prices during security-update outages 2026-10-29 00:29:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/cl8y-dex-terraclassic#1578
No description provided.