Repository navigation
Fix false lag banner, live-update request storm, and full-screen chunk errors - #32
Merged
Merged
Conversation
…ng up" banner /api/health took the tallest height any peer claimed as the network tip. Since 2026-09-24 (height 166299) a public peer (187.33.155.242) follows a separate, ~4x lower-difficulty PoS branch that is ~200 blocks taller than the heavier chain the explorer's node follows, so the endpoint reported "lagging" forever and the site showed the banner to every visitor. While the tip is fresh, lag now comes from the node's own most-work header (getblockchaininfo.headers); peer heights still count once the tip is cold, so a genuinely stuck node is still reported as stalled. Also make the cache serve its last value once when the RPC fails instead of retrying the same call (which doubled the wait to 20s+ per key and left pages empty), with /api/health opting out; and make cache freshness honour the reader's TTL when call sites share a key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A route chunk that failed to load (server restarting, flaky connection, or a deploy that replaced the hashed chunk names) propagated to the root error boundary and replaced the entire app with "Something went wrong / Failed to fetch dynamically imported module". - lazyWithRetry: retry chunk imports with backoff, then reload once (guarded by sessionStorage so it can never loop) to pick up a fresh build. - Wrap each content panel in Bloom's PanelErrorBoundary, reset on navigation, so any page failure stays inline with a retry while navigation keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wser If the startup getblockcount failed (node busy), the monitor kept its initial height of 0. The next successful poll saw ~241k "new" blocks and announced them one by one from height 1; every new-block event made each open tab refetch /api/stats and /api/peers. A single visitor with the home page open became ~60 req/s for hours, saturating the 1-vCPU host and starving faircoind (RPC timeouts, watchdog restarts every 30 min). - Treat an unestablished tip as a baseline to adopt, never a backlog. - Announce at most 10 blocks per poll; larger gaps get one block-count event. - Never start a poll while the previous one is still running. - Client: throttle live-event invalidations per query key (leading + trailing, 5s), so a burst of server events can never become a burst of HTTP requests from every tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Production incident from 2026-11-16. The explorer showed "This explorer's node is catching up" most of the time, pages sometimes didn't load, and a full-screen "Failed to fetch dynamically imported module" error replaced the app. There were three separate causes:
/api/healthused the tallest height any peer claimed as the network tip. A peer (fcnode2) has been on a separate, lower-difficulty PoS branch since height 166299 (2026-09-24), ~200 blocks taller. Lag now comes from the node's own most-work header (getblockchaininfo.headers) while the tip is fresh. Peer claims still count once the tip is cold, so a genuinely stuck node is still reportedstalled.getblockcountfailed, it kept height 0. The next poll then announced all ~241k blocks asnew-block, and every event made each open tab refetch/api/statsand/api/peers. One visitor ended up sending ~60 req/s for hours, which saturated the 1-vCPU host and starved faircoind. The fix:PanelErrorBoundary, so a failure stays inline.Also:
cache.getserves the last value once on RPC failure instead of retrying, which used to double the timeout./api/healthopts out of this.Test plan
tsc -b,tsc -p server/tsconfig.jsonvitest run: 142 tests, with new tests for health assessment, cache fallback/TTL, block announcement planning, throttled invalidation, and lazy import retryvite build/api/healthreportsok, no banner, request rate back to normal🤖 Generated with Claude Code