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

Improve tiered rate limit for dev tools #609

Closed
Nana-EC opened this issue Oct 10, 2022 · 1 comment · Fixed by #613
Closed

Improve tiered rate limit for dev tools #609

Nana-EC opened this issue Oct 10, 2022 · 1 comment · Fixed by #613
Assignees
Labels
enhancement New feature or request limechain P2
Milestone

Comments

@Nana-EC
Copy link
Collaborator

Nana-EC commented Oct 10, 2022

Problem

Through testing it was seen that both Truffle and he Graph make a large number of calls on known functions.
The relays default IP rate limiting does not allow for this large number and rate limits

Solution

Improve the rate limiting logic for dev tools

  • Increase TIER_2_RATE_LIMIT to something like 1000
  • Increase TIER_3_RATE_LIMIT to something like 2000
  • Verify truffle contract deployment and the graph operations work
    • if not bump eth_getBlockByNumber, eth_blockNumber and eth_getTransactionReceipt down to use TIER_3_RATE_LIMIT
  • Update defaults values in docs etc
  • Explore if caching should be reorganized or improved to reduce rate limit likeliness and improve dev tools experience

Alternatives

No response

@Nana-EC Nana-EC added enhancement New feature or request limechain P2 labels Oct 10, 2022
@Nana-EC Nana-EC added this to the 0.10 milestone Oct 10, 2022
@Nana-EC Nana-EC moved this to Sprint BackLog in Smart Contract Sprint Board Oct 10, 2022
@georgi-l95 georgi-l95 self-assigned this Oct 11, 2022
@georgi-l95
Copy link
Collaborator

After some research, I found that only truffle and the graph are hard on request from TIER_2. Truffle makes a lot request during deployment to eth_getBlockByNumber , eth_blockNumber, eth_chainId, eth_getTransactionReceipt. While The Graph is making a lot of requests to mainly, while catching up with consumption of blocks eth_getBlockByNumber and eth_getBlockByHash , afterwards only once for every new block. Good thing about The Graph is that, even if it gets rate limited, it continues again when the rate limit is renewed.

For deploying big contracts with truffle usually around 400-500 requests are enough, although I would suggest bumping this number with 50%, for example, just to be sure.

Caching of eth_chainId is possible, but for the other function would be tricky.

@georgi-l95 georgi-l95 linked a pull request Oct 12, 2022 that will close this issue
2 tasks
Repository owner moved this from Sprint BackLog to Done in Smart Contract Sprint Board Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request limechain P2
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants