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 custom list and backoff factor to http_retry_middleware #3120

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Oct 9, 2023

What was wrong?

closes #958
closes #1911

How was it fixed?

  • Add kwarg for importing custom list of RPC methods to retry on
  • Add kwarg, as in the async version, for a backoff factor to prevent timeout issues and provide flexibility

Todo:

Cute Animal Picture

20231006_081808

- Internal terminology change `whitelist` -> `allow_list`
- Add a custom allow_list kwarg to allow passing in a custom list of RPC endpoints for retrying; closes ethereum#958
- Add a backoff factor to the sync version of retry middleware; closes ethereum#1911
@fselmo fselmo force-pushed the exception-retry-middleware-updates branch from 19f37fc to 7079eda Compare October 9, 2023 19:00
@fselmo fselmo marked this pull request as ready for review October 9, 2023 19:02
@fselmo fselmo requested review from reedsa and wolovim October 9, 2023 19:07
Copy link
Contributor

@reedsa reedsa left a comment

Choose a reason for hiding this comment

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

lgtm, curious to hear about further validating the allow_list param.

root = method.split("_")[0]
if root in whitelist:
if root in allow_list:
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

web3/middleware/exception_retry_request.py Show resolved Hide resolved
@fselmo fselmo merged commit c41377a into ethereum:main Oct 10, 2023
84 checks passed
@fselmo fselmo deleted the exception-retry-middleware-updates branch October 10, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants