Skip to content

fix: raise /api/lumens rate limit to 1000/15min - #359

Merged
marcelosalloum merged 3 commits into
masterfrom
increase-lumens-rate-limit
Jul 22, 2026
Merged

fix: raise /api/lumens rate limit to 1000/15min#359
marcelosalloum merged 3 commits into
masterfrom
increase-lumens-rate-limit

Conversation

@marcelosalloum

Copy link
Copy Markdown
Contributor

What

  • Give GET /api/lumens its own rate limit of 1000 requests / 15 minutes per IP (was 100 via the general API limiter)
  • Exclude /api/lumens from the global and general limiters so other traffic from the same IP doesn't eat into its budget; all other endpoints keep their existing limits
  • Add integration tests asserting the RateLimit-Limit header is 1000 on /api/lumens and still 100 on other API routes

Why

  • Consumers of /api/lumens are hitting the 100 req / 15 min general API limit
  • The endpoint serves straight from the Redis cache, so a 10x higher limit adds no meaningful load

@marcelosalloum marcelosalloum self-assigned this Jul 22, 2026
@marcelosalloum
marcelosalloum marked this pull request as ready for review July 22, 2026 18:53
Copilot AI review requested due to automatic review settings July 22, 2026 18:53
@stellar-jenkins-ci

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an independent 1000-request/15-minute limit for GET /api/lumens.

Changes:

  • Adds and applies the dedicated limiter.
  • Excludes the endpoint from global/general limiters.
  • Adds rate-limit header integration tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
backend/routes.ts Configures the new limiter and exemptions.
test/tests/integration/backend.ts Tests rate-limit headers and reformats assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/routes.ts Outdated
Comment thread backend/routes.ts Outdated
Comment thread test/tests/integration/backend.ts
@stellar-jenkins-ci

Copy link
Copy Markdown

Comment thread backend/routes.ts
@marcelosalloum
marcelosalloum merged commit 39c4dda into master Jul 22, 2026
6 checks passed
@marcelosalloum
marcelosalloum deleted the increase-lumens-rate-limit branch July 22, 2026 20:11
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.

3 participants