Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rate limits #33

Open
whymarrh opened this issue Sep 7, 2020 · 1 comment
Open

Add support for rate limits #33

whymarrh opened this issue Sep 7, 2020 · 1 comment

Comments

@whymarrh
Copy link
Contributor

whymarrh commented Sep 7, 2020

Per Infura Documentation § Rate Limits:

Infura accounts will be subject to rate limits after exceeding their daily request limit. We will also rate limit projects that send too many JSONRPC requests during a short time window. These rate limits are in place to ensure the reliability of our service for everyone using it.

If you are rate limited, your JSONRPC responses will have HTTP Status code 429 and contain a JSONRPC error response [...]

The "data" section contains 3 fields about your rate limit:

  • current_rps: The current rate per second determined by Infura
  • allowed_rps: The current allowed rate which you should stay under.
  • backoff_seconds: The suggested amount of time to wait before sending more requests.

This module currently supports the idea of requests that can be retried, and could also support the idea of rate limits:

  1. Hitting the rate limit should wait backoff_seconds before retrying a request; and
  2. Once an allowed_rps is received the request rate should be adjusted to stay under that value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants