fix(abuse+dashboard): crawler block + real-time metrics#127
Merged
Conversation
…metrics Abuse tier (free_tier_gate.js): - IPs making >5000 calls/day now get 429 Retry-After instead of 402 - Crawlers that ignore 402 and retry are blocked without wasting Redis quota - Real customers (501-5000/day) still get 402 with payment instructions - ABUSE_THRESHOLD configurable via env var (default 5000) Dashboard fixes (app_factory.mjs /api/status): - total_requests_24h now reads Redis free-tier counters (getFreeTierStats), the same source /stats/free-tier uses; was counting only billed revenue_events_v2 rows and undercounting real volume ~30x - current_epoch now reads epoch_ledger (source of /api/settlement/history), was reading the lagging `epochs` table (~383 epochs stale) - PR #2824 Chainlist status updated from "Pending maintainer" to "Closed — validation failed, needs reopen" Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Abuse tier (free-tier middleware)
Top 2 IPs consume ~58% of daily Redis quota (86K + 71K calls/day). They ignore the 402 and retry, starving real users.
New 3-tier behavior in
free_tier_gate.js:Retry-After: <until midnight UTC>(automated scraper, hard-blocked)ABUSE_THRESHOLDis configurable via env (default 5000).Dashboard metric fixes (
/api/status)total_requests_24h: now reads Redis free-tier counters viagetFreeTierStats()(same source as/stats/free-tier). Was counting only billedrevenue_events_v2rows — undercounted real volume ~30x (7,918 vs ~270,202).current_epoch: now readsepoch_ledger(source of/api/settlement/history). Was reading the laggingepochstable (~383 epochs stale: 5,210 vs 5,593).Syntax-checked both
.js/.mjsfiles withnode --check. Verification (after Railway deploy):total_requests_24hshould jump from ~7,918 to ~270,202current_epochshould jump from ~5,210 to ~5,593🤖 Generated with Claude Code