Skip to content

fix(abuse+dashboard): crawler block + real-time metrics#127

Merged
Satelink-Protocol merged 1 commit into
mainfrom
worktree-abuse-tier-dashboard-fix
Jun 14, 2026
Merged

fix(abuse+dashboard): crawler block + real-time metrics#127
Satelink-Protocol merged 1 commit into
mainfrom
worktree-abuse-tier-dashboard-fix

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Owner

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:

  • 0–500 calls/day → serve normally
  • 501–5000 calls/day → 402 with payment instructions (prospective customers)
  • >5000 calls/day → 429 Retry-After: <until midnight UTC> (automated scraper, hard-blocked)

ABUSE_THRESHOLD is configurable via env (default 5000).

Dashboard metric fixes (/api/status)

  • total_requests_24h: now reads Redis free-tier counters via getFreeTierStats() (same source as /stats/free-tier). Was counting only billed revenue_events_v2 rows — undercounted real volume ~30x (7,918 vs ~270,202).
  • current_epoch: now reads epoch_ledger (source of /api/settlement/history). Was reading the lagging epochs table (~383 epochs stale: 5,210 vs 5,593).
  • PR #2824 Chainlist widget: "Pending maintainer" → "Closed — validation failed, needs reopen".

Syntax-checked both .js/.mjs files with node --check. Verification (after Railway deploy):

  • total_requests_24h should jump from ~7,918 to ~270,202
  • current_epoch should jump from ~5,210 to ~5,593

🤖 Generated with Claude Code

…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>
@mintlify

mintlify Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Satelink 🟢 Ready View Preview Jun 14, 2026, 5:35 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 14, 2026 5:34am

@Satelink-Protocol Satelink-Protocol merged commit d1509c5 into main Jun 14, 2026
10 of 11 checks passed
@Satelink-Protocol Satelink-Protocol deleted the worktree-abuse-tier-dashboard-fix branch June 15, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant