feat(stats): swap REST /sentrix_status_extended → pure gRPC v0.4#1
Merged
feat(stats): swap REST /sentrix_status_extended → pure gRPC v0.4#1
Conversation
The README's "zero JSON-RPC, zero JS glue" claim was aspirational — StatsDashboard's validator/mempool fields and SupplyBar's minted total were both bridged through REST `/sentrix_status_extended` because proto v0.1 didn't ship the corresponding RPCs. Chain v2.1.72 (sentrix-labs/sentrix#472) lands `GetValidatorSet`, `GetSupply`, `GetMempool` as pure-read gRPC methods. This commit swaps the explorer's stats hot path onto them — no more REST in StatsDashboard or StatsPanel. Block height + avg block time still ride EVM `eth_blockNumber` / `eth_getBlockByNumber`. Both are 100% in proto territory via `GetBlock(latest)` but the existing JSON-RPC path works and the follow-up to swap them is a separate commit (would touch `compute_avg_block_time_ms` + the EvmProvider trait). Proto in `proto/sentrix.proto` synced from chain. tonic-build regenerates `pb::{GetValidatorSet, GetSupply, GetMempool, ValidatorSet, Supply, Mempool, ValidatorEntry, MempoolEntry, ...}` — see grpc/client.rs for the new wrappers. Bundle size impact: marginal — same tonic infra, three more proto types. **Stays on a feature branch** until chain v2.1.72 ships to prod (grpc.sentrixchain.com:443). Merging earlier would 502 the stats cards because the gRPC endpoint would respond `unimplemented`.
CI flagged six `manual_is_multiple_of` lints in `format_unix_ts`'s hand-rolled leap-year calculation — `% N == 0` → `.is_multiple_of(N)` across the year/century/quad-century guards. Plus `cargo fmt` over the new MobileNavLink component signature wraps the args one per line.
satyakwok
added a commit
that referenced
this pull request
May 5, 2026
…blur, mobile clean Operator audit caught real UX bugs that needed fixing in one pass: 1. **REST regression revert.** PR #1 (pure-gRPC stats) merged before chain v2.1.72 shipped to prod, so the dashboard's gRPC calls 502'd the validator + mempool + supply cards (showed 0/0/0 instead of 4/4 + 64M minted). Reverted stats_dashboard's `fetch_sentrix_status` + the inline SupplyBar to REST `/sentrix_status_extended` until chain v2.1.72 lands. Will flip back to gRPC in a follow-up PR once the chain endpoints exist in prod. 2. **Color: amber → emerald (#10B981).** Brand primary is emerald per operator confirmation; gold was over-applied and reading "amber/ bronze" instead of editorial-luxury. Replaced `sentrix-gold` / `sentrix-bronze` token usage across navbar, footer, stats_dashboard, live_feed, block_detail. Tailwind's default `emerald-500` palette is canonical now (we removed the broken @theme override that was tinting `--color-emerald-500` with the gold value). Amber stays reserved for testnet badge + warnings. 3. **Trim dashboard 12 metrics → 4 + supply.** Dropped the entire StatsPanel (Tip Height was a Latest-Block dupe, Avg Finality stuck at 0.00s, two TPS variants of the same data, two empty spark-charts that read as broken). New layout = the 4-card hero (Latest Block / Avg Block Time / Active Validators / Pending Tx) + Minted/Cap progress bar inline. SupplyBar polling moved into stats_dashboard.rs; stats.rs deleted. 4. **Header overlap.** Sticky header was painting on a partial bg so content scrolled visibly behind it. Added `backdrop-blur-md` + `bg-zinc-950/85` (with `supports-[backdrop-filter]:bg-zinc-950/70` fallback) so the surface reads opaque while preserving subtle depth. 5. **Mobile cluttered → hamburger eats the right-side actions.** The desktop nav (Faucet/Wallet/CoinBlast + theme + EN + Switch-to-Testnet + MetaMask + ConnectionStatus + MAINNET pill) was 9 elements jammed onto a 375px viewport. Now: lg+ keeps the inline row; below lg only the brand mark + hamburger render. The menu drops down with the route links AND the external products AND the Switch-to-Testnet button. The standalone MAINNET pill was redundant with the toggle button copy — dropped entirely. 6. **Block tile reformat.** Random-color identicons that doubled as noise are gone; replaced with a small hex-block-number badge in emerald. Hash truncation: `0x3a93…874f` (4-4 with prefix). Raw unix `1777977194` swapped for relative "5 min ago" computed client-side from `js_sys::Date::now()`.
satyakwok
added a commit
that referenced
this pull request
May 5, 2026
…identicon
Three changes per operator brief:
- **Network switcher.** Static "Mainnet · chain · 7119" badge becomes
a clickable dropdown (◤ chevron) listing both networks with a
✓ next to the active one. Selecting a row navigates cross-subdomain
to the matching bundle (`scan.sentriscloud.com` ↔ `scan-testnet.
sentriscloud.com`). Each network ships its own bundle so a runtime
signal flip isn't enough — full page nav is the right primitive
here. `Network::explorer_url()` carries the destination.
- **Network-aware accent.** Mainnet keeps emerald (#10B981); testnet
picks up amber (#F59E0B) so the user feels which network they're
on without having to read labels. New helpers on `Network`:
`accent_text()` / `accent_bg()` / `accent_pill()`. Applied to the
hero pulse + "LATEST BLOCKS" live pill + Minted/Cap progress bar.
Components stay structurally identical; just the colour swaps.
- **Hero strips its leading identicon.** Operator wanted the hero
visually distinct from the row tiles — list rows keep the per-block
Identicon as their anchor visual, but the hero cleans up to:
LATEST BLOCK ● [▢]
#1,577,898
0x07ac…dd29
0 txs · Validator · just now
Same metadata as before (hash + proposer-label + tx_count + relative
timestamp), no identicon competing with the height for attention.
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.
Summary
Drops the REST
/sentrix_status_extendedbridge from StatsDashboard + SupplyBar. After chain v2.1.72 ships (sentrix-labs/sentrix#472), the explorer's stats hot path is pure gRPC:GetValidatorSet→ active/total validator countsGetMempool→ pending-tx sizeGetSupply→ minted_sentri (drives the Minted/Cap progress bar)Block height + avg block time still ride EVM JSON-RPC. They're swap-able to gRPC
GetBlock(latest)in a follow-up commit; this PR keeps the diff scoped to the previously-REST fields.Why DON'T merge yet
Chain v2.1.72 isn't live in prod (
grpc.sentrixchain.com:443) until sentrix-labs/sentrix#472 is merged + deployed. Merging this explorer PR before that would 502 the stats cards — the new gRPC methods would respondunimplemented.Order of operations:
grpcurl grpc.sentrixchain.com:443 sentrix.v1.Sentrix/GetValidatorSetreturns real dataTest plan
cargo check --features ssr— greencargo check --features hydrate --target wasm32-unknown-unknown— greengrpcurlsmoke test all three methodscargo leptos build --releasefor mainnet + testnet