Repository navigation
Site sync: the explorer belongs to one chain and says so on every page - #3
Merged
Merged
Conversation
…chain 21 / ca76c276…, RANDSCAN_EXPECTED_CHAIN_ID / RANDSCAN_EXPECTED_GENESIS), ChainView, classify() into unreachable / wrong_chain / stalled / behind / live with STALL_MS 60 000 and MAX_LAG 10, unit tests on every boundary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_meta (adopts the indexed chain's id and block-0 hash, so the live chain-21 database carries on), the indexer checks rand_chainId + rand_getGenesisHash every pass and stops writing while the node reports another chain (re-indexing only when the node moves to the pinned chain), GET /api/v1/chain, and /health gains genesis_hash, head_timestamp_ms, stalled, wrong_chain The old behaviour — wipe and re-index whenever the node's chain id or genesis changed — is kept only for a database with no recorded chain. The mock hard-fork test now covers the three paths (cut to the pinned chain, an unpinned genesis that halts the indexer, a restart pinned to it), and tests/chain_sync.rs covers /chain live, behind, unreachable, stalled and a genesis switch that halts and then resumes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…enesis and head, unreachable then stalled once the node is killed, wrong_chain with nothing written when pointed at a second dev chain; the CI real-node job runs it beside the contract test The two real-node tests share the database, so they now take turns behind one lock, and the binary/env gate both use is one function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er on every page, from /api/v1/chain every 15 s, classified against the build's pin (src/lib/chainPin.ts) by a pure classifier with node:test coverage; the pin printed as <meta name="rand-genesis"> / <meta name="rand-chain-id"> in every page's HTML; Health typed with the new fields; 20 languages The pill has its own line under the top bar: the bar is already full at every width, and the pill in it widened a phone page to 436 px. The banner keeps the page's numbers visible and names the last good block and its age. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he configuration table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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
chain_meta: the database records the genesis it indexes. On first deploy it adopts block 0's hash (chain 21,ca76c276…), so live indexing carries on.wrong_chaininstead of wiping and re-indexing. At a chain cut, setRANDSCAN_EXPECTED_CHAIN_ID/RANDSCAN_EXPECTED_GENESISand restart.GET /api/v1/chain: chain id, genesis, head height and timestamp, node height, lag, state (live / behind / stalled / wrong_chain / unreachable). Cross-origin readable./api/v1/healthgainsgenesis_hash,head_timestamp_ms,stalledandwrong_chain, and reportsdegradedwhen either of the last two is true.role=alertbanner,<meta name=rand-genesis>/rand-chain-id; 20 languages.Tests
cargo test --workspace(local Postgres): 176 passed.npm test: 76 pass, 0 fail, 1 skipped (geoip).tsc, lint,next buildandcargo fmt --checkclean.Design: monorepo
docs/superpowers/specs/2026-10-27-site-sync-design.md(monorepo PR test/site-sync).🤖 Generated with Claude Code