rename chain slug ton → gram + 301 redirects + Prom straddle - #705
Merged
Conversation
Follow-up to the TON → Gram display rebrand (#697). The 'Ton' label was still leaking into search results and the URL /chains/ton was visible to users. This PR renames the chain slug ton → gram with 301 redirects so inbound links + SEO rank signal consolidate onto the new canonical, and adds a Prom regex straddle so the existing harness keeps feeding live data through the transition. ## Slug rename (TS layer) - src/lib/chains.ts: slug 'ton' → 'gram' (label/description/native unchanged) - src/data/provider-registry.ts: rekey ton → gram - src/lib/logo-manifest.ts: gram → /logos/ton.svg (file kept, slug renamed) - src/lib/brand.ts: rekey color entry - src/lib/chain-kpis.ts: rekey to gram, DefiLlama API string stays 'TON' (verified live) - src/lib/providers.ts: - CANONICAL_NAMES: gram → 'Gram', tonapi → 'TonAPI' (was title-casing to 'Tonapi') - PRODUCT_ALIASES: ton → gram (stale inbound references resolve to canonical) ## Redirects (next.config.ts) - /chains/ton → /chains/gram (308 permanent) - /products/ton → /chains/gram (308 permanent) - /benchmarks/:slug/ton → /benchmarks/:slug/gram (308 permanent) - CHAIN_REDIRECT_SLUGS: ton → gram so /products/gram keeps redirecting to /chains/gram ## Bench YAMLs - per_chain_explainer.slug: ton → gram (matches the new /benchmarks/<bench>/gram URL) - provider entry slug: ton → gram (matches CHAINS new slug for surfaces that ref by slug) - Template refs {{p50:ton}} → {{p50:gram}} - Prom queries: chain="ton" → chain=~"ton|gram" (straddle during harness relabel window; the regex matches the current chain="ton" labels and the future chain="gram" labels, so the bench keeps rendering live data with no gap) - wallet-labels-coverage dimension value stays 'ton' (Prom label the harness emits at runtime; flip to 'gram' once the harness redeploys) ## Out of scope (separate harness PR) The harness Go code in harnesses/l1-finality/ and harnesses/network-fees/ emits chain="ton" labels. Updating those is a separate Railway redeploy. The straddle regex covers the transition with zero data gap. ## Test plan - [ ] Cmd+K, type 'gram' → top result reads 'Gram' chain (no more 'Ton'). - [ ] /chains/ton → 308 → /chains/gram (page renders with Gram badge, leader, p50). - [ ] /products/ton → 308 → /chains/gram. - [ ] /benchmarks/l1-finality/gram → renders per-chain explainer. - [ ] /benchmarks/l1-finality leaderboard row Gram still has live p50 (Prom straddle works). - [ ] No regression on other chains in same benches.
5 tasks
Flotapponnier
added a commit
that referenced
this pull request
Jun 25, 2026
Diagnostic: after PR #705 (chain slug ton → gram), /chains/gram 404s and /benchmarks/network-fees still renders 'TON' in chain headings. Two root causes: 1. getBenchmarksForChain('gram') filters results[].slug === 'gram', but the materialize worker's KV snapshots still hold the legacy results[].slug === 'ton' (worker on Railway runs from the private mobula-api repo; it hasn't redeployed with the renamed YAML yet). → 0 matches → notFound() at chains/[slug]/page.tsx:90. 2. ChainHeadingsSummary renders r.name verbatim. Stored snapshots still carry name='TON', so the heading reads 'TON native transfer fee usd' even though chains.ts now says label='Gram'. Fix: introduce a chain-slug alias system so the canonical layer absorbs the rebrand without waiting on the harness. - src/lib/chains.ts: - CHAIN_SLUG_ALIASES { ton: 'gram' } — single source of truth. - canonicalChainSlug(slug) and chainLabelForSlug(slug) helpers. - getBenchmarksForChain now matches on the canonical slug + any legacy alias, so /chains/gram surfaces benches whose stored results still carry slug='ton'. - src/lib/spec.ts: - overlayEditorial reconciles stale stored results against the current spec. For each result whose slug is a known legacy alias (e.g. 'ton'), look up the spec provider by canonical slug ('gram'), rewrite result.slug + result.name to match. Downstream surfaces (leaderboard table, search dialog, ChainHeadings) all see the canonical identity without any per-component patch. - Cache keys bumped bench-unfiltered v12 → v13 and all-benchmarks v16 → v17 so the unstable_cache regenerates through the new reconciliation path on deploy. - src/components/chain-headings-summary.tsx: - Anchor id, link URL, and explainer lookup go through canonicalChainSlug so a stale 'ton' result still hits the renamed 'gram' explainer + lands at /benchmarks/<bench>/gram. - Display name resolves through chainLabelForSlug, with the bench result name as a fallback. Renders 'Gram' the moment chains.ts is updated — no wait on the materialize worker. Test plan: - /chains/gram → 200 with l1-finality + network-fees in the list. - /benchmarks/network-fees → chain heading reads 'Gram transaction fee usd', anchor id='gram', link to /benchmarks/network-fees/gram. - /api/citable still returns rows for both old + new slug surfaces (no impact on machine-readable consumers). - Harness on Railway can stay on chain='ton' label; the existing Prom regex straddle (PR #705) keeps queries hitting both labels.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #697. The display rebrand landed but the slug 'ton' was still leaking into search results ('Ton' / 'Tonapi' title-case fallback) and into URLs (/chains/ton, /products/ton). This PR finishes the migration with full slug rename + 301 redirects + Prom regex straddle.
What lands
Slug rename (TS layer) —
ton→gramacross CHAINS, PROVIDER_REGISTRY, logo-manifest, brand, chain-kpis. CANONICAL_NAMES getsgram: 'Gram'+tonapi: 'TonAPI'so the title-case fallback never produces 'Ton' or 'Tonapi'. PRODUCT_ALIASES addston → gramso stale inbound references resolve to the canonical.Redirects (next.config.ts) —
/chains/ton→/chains/gram(308),/products/ton→/chains/gram,/benchmarks/:slug/ton→/benchmarks/:slug/gram. CHAIN_REDIRECT_SLUGS array updated.Bench YAMLs — per_chain_explainer.slug + provider entry slug renamed ton → gram. Template refs
{{p50:ton}}→{{p50:gram}}. Prom queries straddle:chain="ton"→chain=~"ton|gram"(the harness still emitston; the regex matches both during the transition window so there's zero data gap).wallet-labels-coveragedimension value kept astonfor now (Prom label injected at runtime — flip when the wallet-labels harness redeploys).Out of scope
Harness Go code in
harnesses/l1-finality+harnesses/network-feesstill emitschain="ton". Updating those = separate Railway redeploy PR. The straddle regex covers the gap.Rollback
gramslug stays as a recognised alias viaPRODUCT_ALIASES.ton = 'gram'.Test plan