Skip to content

feat(api): raise the default per-IP rate limit to 600/min (ledger-v9) - #74

Merged
acedward merged 1 commit into
ledger-v9from
00043-rate-limit-shared-bucket-ledger-v9
Sep 11, 2026
Merged

feat(api): raise the default per-IP rate limit to 600/min (ledger-v9)#74
acedward merged 1 commit into
ledger-v9from
00043-rate-limit-shared-bucket-ledger-v9

Conversation

@acedward

Copy link
Copy Markdown
Contributor

Same change as #73 on the ledger-v9 line: git cherry-pick -x 0cb2bc8 onto ledger-v9 @ 5d794f9, clean.

  • API_RATE_LIMIT_MAX default 60 → 600; deploy/ keeps 6000.
  • Docs describe the real 429 body and the x-ratelimit-* headers.

This line pins @effectstream/runtime 0.200.x, so the per-user half of the fix (Fastify trustProxy) arrives via effectstream #925 once published; bump the pin then.

Tests (space-free copy of this branch)

  • bun test packages/node/api-rate-limit.test.ts: 3 pass / 0 fail
  • bun run typecheck:backend: 0 diagnostics

The 60/min default was sized for one polite browser tab. Measured on
preprod: an idle SPA tab uses 3 counted requests/min and an active trader
10-15/min, but the solver console polls 4 counted routes every 4 s (60/min)
and the solver's settlement sweep plus a book page-through bursts to ~400/min,
so any co-located automated client hit 429 RATE_LIMITED on its own.

600/min covers a solver plus its console on one address with headroom; the
deploy scaffold keeps its explicit 6000. Docs now describe the real 429 body
(`{statusCode, error: RATE_LIMITED, reason}`) and the x-ratelimit-* headers
instead of a response shape the limiter never sent.

(cherry picked from commit 0cb2bc8)
@acedward
acedward marked this pull request as ready for review September 11, 2026 01:34
@acedward
acedward merged commit bd0cde7 into ledger-v9 Sep 11, 2026
6 checks passed
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