-
Notifications
You must be signed in to change notification settings - Fork 291
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 ThrottleLayer
to Transport layers
#2154
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Can we put this behind a feature flag since it adds a new dependency?
A test would be great as well, you can put it inprovider/trait.rs
@yash-atreya Ive updated the PR to put the Throttle logic behind a feature flag as well as added tests. Note that I changed the Lmk if you would like any other updates. |
Closes #1636
This PR adds a
ThrottleLayer
for alloy providers to throttle outbound rpc requests. While theRetryLayer
works great for for retrying requests that exceed RPC provider limits, theThrottleLayer
reduces the frequency that requests need to be retried.