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 new ENABLE_ETHEREUM_RPC_RATE_LIMITING environment variable #584

merged 3 commits into from Dec 12, 2019


Copy link

albrow commented Dec 12, 2019

This new environment variable will allow users to completely disable Ethereum RPC rate limiting. Disabling the feature does come with some risks and can lead to abnormally high bills for services like Infura and Alchemy depending on network conditions. Still, some users, and in particular market makers, might prefer higher costs to the alternative of not receiving order updates quickly.

albrow added 2 commits Dec 12, 2019
return nil, err
var ethRPCRateLimiter ratelimit.RateLimiter
if config.EnableEthereumRPCRateLimiting == false {
ethRPCRateLimiter = ratelimit.NewUnlimited()

This comment has been minimized.

Copy link

albrow Dec 12, 2019

Author Member

@fabioberger I opted to re-use the existing fakeLimiter type and just renamed the constructor from NewFakeLimiter to NewUnlimited. This way we can still count and log the number of RPC requests that were allowed. It also required the fewest code changes. Let me know if there would be any issues with this approach.

@albrow albrow requested a review from fabioberger Dec 12, 2019
browser/ts/index.ts Outdated Show resolved Hide resolved
@albrow albrow merged commit 1c75a39 into development Dec 12, 2019
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
continuous-integration/drone/push Build is passing
@albrow albrow deleted the feature/env-var-enable-ethereum-rpc-rate-limiting branch Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.