fix(protocol): show one short unavailable message for DEX reference prices during security-update outages #1578
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/cl8y-dex-terraclassic#1578
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and scope
An anonymized report shows the
/protocolDEX reference prices card rendering all four rows as—:cUSTC / USDcLUNC / USDUST1 / USDUSTR / USDThe 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_ofvocabulary 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 /api/v1/overviewlikewise returnedcustc_price_usd: nulland four stalehub_price_qualityentries. The four cards therefore received a successful200response with stale rows and rendered exactly the reported state: four—values.At approximately 00:18 UTC, after the security update completed,
/readyreturnedstatus: "running"withreason: 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
haltedstatus during the update is context, not a request to change the halt or the security procedure. The backend already returnsqualityandas_ofso 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.tsxrenders onlyrow?.price_usd.formatHubUsdmaps null, empty, non-finite, and non-positive values to—. The component already receivesquality,as_of,max_age_seconds, andmetadatafromIndexerHubPricesResponse, 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.tsxalready computesmarketDataDownviadetectMarketDataOutage(...)and renders the existingMarketDataServiceOutageBannerwithPROTOCOL_MARKET_DATA_OUTAGE_LEADwhen the indexer is unreachable.frontend-dapp/src/utils/marketDataOutage.tscurrently returns true only for a query error recognized byisIndexerUnavailableError. A200response with four stale/null entries is therefore indistinguishable from a healthy response for banner purposes.frontend-dapp/src/components/common/MarketDataServiceOutageBanner.tsxandfrontend-dapp/src/utils/marketDataServiceCopy.tsprovide 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 noonRetry; the existing 5xx path keeps its current behavior. Do not add a card-level action.frontend-dapp/src/services/indexer/client.tsalready exposesgetHubPricesand the typedIndexerHubPriceEntry/IndexerHubPricesResponsestructures infrontend-dapp/src/types/index.ts. No API-schema change is required.indexer/src/api/hub_prices.rs::entry_forandindexer/src/db/queries/hub_prices.rs::row_usablealready implement the fail-closed stale/null contract. This issue does not propose changing reference policy or fabricating a value during maintenance.—(ProtocolPage.test.tsx, testnull hub prices render em-dash, not $0 or $1) and that a 502 shows the existing outage banner. There is no test that a200response with an all-stale hub snapshot shows the same single page-level message.MarketDataServiceOutageBanneris 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— existingquality/as_of/max_age_secondsfields; read-only for the stale decision.frontend-dapp/src/services/indexer/client.ts— existinggetHubPricestyping.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.make test-frontend,make verify-issue-556,make verify-issue-570, and the focused verifier added by this issue.Recommended direction
qualityandas_ofinternally; 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.MarketDataServiceOutageBanneronce with exactly one short title: Reference prices temporarily unavailable. (add this single constant tomarketDataServiceCopy.tsif needed) and nolead/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.—fallback remain as today. Do not add per-rowStale/Unavailablelabels, icons, tooltips, last-updated lines, quality vocabulary, or explanatory text. The page-level message is the only new chrome.as_of, and do not add a success toast.Constraints and guardrails
AGENTS_FRONTEND_COPY_COGNITIVE_LOAD.mdand 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 existingPROTOCOL_MARKET_DATA_OUTAGE_LEADremains for the existing 5xx/error banner. Do not show both.role="status"/aria-liveregion beyond the existing banner'srole="alert"; the four-card DOM stays materially unchanged. The all-stale message is exactly Reference prices temporarily unavailable. with nolead/paragraph and no Retry.UST1 = $1, noUSTR = 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.—plus the single page-level unavailable message, but it must never use the value as a price or allow it to authorize a transaction./healthliveness and/readyreadiness remain distinct. The frontend must not infer readiness from liveness or call internal status endpoints that are not part of its contract. The existing200+qualitycontract is sufficient for the all-stale decision.Acceptance criteria
/protocolshows the existing page-levelMarketDataServiceOutageBanneronce with exactly Reference prices temporarily unavailable. (nolead, no second sentence) and the four DEX reference cells remain—with their existing headings and wrap/source identity. There are no per-rowStale/Unavailablelabels, last-observed lines, tooltips, or explanatory paragraphs.onRetry; the 30-second poll is the only recovery. The existing 502/error path keeps its current behavior. The card has no new controls.—formatting, same address rows. No new status markup or live region is added inside the card.200all-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.$values without a page reload. No success toast, “recovered” message, or extra chrome is added.role="alert"); no additionalaria-liveregion is introduced. Keyboard, screen-reader, reduced-motion, mobile/desktop, light/dark, Compact/Full number display, and ticker-case behavior remain usable.Test plan: functional and all-path coverage
/hub-pricesreturns four numeric prices with freshqualityand currentas_of;/protocolshows$values and no banner. Card DOM unchanged.—cells; no per-row status, no extra text, no button.—; no page-level message and no extra text. A healthy ticker still shows its value.quality: "stale"/oldas_offor all four; assert exactly one banner containing only Reference prices temporarily unavailable., no Retry, four dashes, card DOM unchanged, zero new controls.quality: "unavailable", missingas_of; same single banner and four dashes; no$0/$1.as_ofjust inside/at/just beyondmax_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.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
quality/as_ofvalues. 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.$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./protocolor/hub-priceswith 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.asset_address, source pair, or ticker must not be rendered as a trusted link; use the existingterra1sanitization and explorer allowlist. Do not add a fallback that accepts a spoofed symbol.Verification criteria
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.make test-frontend,make verify-issue-556,make verify-issue-570, and the relevantmake verify-issue-1380/1391/1453/1464regressions after implementation. Record invocation, revision, UTC and pass/fail counts. Existing executed failures stay FAIL; unavailable environmental checks are explicit SKIP, never PASS.skills/AGENTS_FRONTEND_PROTOCOL_HUB.mdand 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.fix(protocol): show maintenance and stale state for DEX reference prices during security-update outagesto fix(protocol): show one short unavailable message for DEX reference prices during security-update outages