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

feat: add support for Etherscan's rate limit [APE-774] #77

Closed
wants to merge 1 commit into from

Conversation

fubuloubu
Copy link
Member

@fubuloubu fubuloubu commented Mar 31, 2023

What I did

Added a rate limit on the etherscan client that's config-driven, replicated some of the logic inside of estimate_query for more accurately depicting the rate limit

fixes: #76

How I did it

How to verify it

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

@NotPeopling2day NotPeopling2day changed the title feat: add support for Etherscan's rate limit feat: add support for Etherscan's rate limit [APE-774] Mar 31, 2023
@linear
Copy link

linear bot commented Mar 31, 2023

APE-774 "feat: add support for Etherscan's rate limit" (ApeWorX/ape-etherscan #77)

What I did

fixes: #

How I did it

How to verify it

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

ApeWorX/ape-etherscan #77 by fubuloubu on GitHub

via LinearSync

Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

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

this aint bad but we should catch the 429 error, wait , then try

import requests
import time

def make_request(url, retries=5, backoff_factor=2):
    for i in range(retries):
        response = requests.get(url)
        if response.status_code == 429:
            time.sleep(backoff_factor ** i)
        else:
            return response
    return None

@github-actions
Copy link

github-actions bot commented May 1, 2023

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions bot added the stale label May 1, 2023
@theref
Copy link
Contributor

theref commented May 1, 2023

What is the status of this? I've been running into some rate limit issues

@fubuloubu
Copy link
Member Author

What is the status of this? I've been running into some rate limit issues

Haven't had a chance to fix it up and incorporate @antazoey's feedback. If you copy my work into a new PR with those comments addressed, we can review and merge it

@antazoey
Copy link
Member

does anything differ from what was done here: #86 ?
if yes, let's rebase.
if no, let's close.

@theref
Copy link
Contributor

theref commented May 19, 2023

does anything differ from what was done here: #86 ? if yes, let's rebase. if no, let's close.

No, you can close 🚀

@fubuloubu fubuloubu closed this May 19, 2023
@NotPeopling2day NotPeopling2day deleted the feat/add-rate-limit branch April 16, 2024 02:39
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.

Integrate Rate Limit into Etherscan query engine .estimate_query method [APE-738]
3 participants