Skip to content

Conversation

@rajranjan0608
Copy link
Collaborator

This pull request introduces changes to the CouponService, rate limiter logic, and configuration files to enhance coupon functionality and streamline rate-limiting behavior. Key updates include adding new coupon properties, modifying rate limiter logic to consider coupon-based rate limit exemptions, and updating the configuration to support these changes.

CouponService Enhancements

Rate Limiter Updates

  • Updated the RateLimiter class to accept a CouponService instance and a type parameter (ip, wallet, or global). Added logic to skip rate limits based on the new coupon properties. (middlewares/rateLimiter.ts, [1] [2]
  • Integrated CouponService into the rate limiter initialization in server.ts, enabling coupon-based rate limit exemptions for IP and wallet rate limiters. (server.ts, server.tsL48-L69)

Configuration Changes

  • Increased the global rate limit MAX_LIMIT from 40 to 200 and reduced DRIP_AMOUNT from 2 to 0.01. (config.json, [1] [2]
  • Removed several testnet configurations (e.g., WAGMI, NMAC, MASA, LT0, etc.) to simplify the configuration file. (config.json, [1] [2] [3] [4] [5]

Logging Enhancements

  • Added logging of skippedIpRateLimit and skippedWalletRateLimit flags in the /sendToken endpoint for better observability. (server.ts, [1] [2]

@rajranjan0608 rajranjan0608 merged commit bcc6636 into main May 16, 2025
1 check 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.

2 participants