feat(api): raise the default per-IP rate limit to 600/min (ledger-v9) - #74
Merged
Merged
Conversation
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)
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.
Same change as #73 on the
ledger-v9line:git cherry-pick -x 0cb2bc8ontoledger-v9@5d794f9, clean.API_RATE_LIMIT_MAXdefault 60 → 600;deploy/keeps 6000.x-ratelimit-*headers.This line pins
@effectstream/runtime0.200.x, so the per-user half of the fix (FastifytrustProxy) 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 failbun run typecheck:backend: 0 diagnostics