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

Reduce JSON-RPC queries #6221

Merged
merged 8 commits into from Jun 12, 2020
Merged

Reduce JSON-RPC queries #6221

merged 8 commits into from Jun 12, 2020

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Jun 11, 2020

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This reduces the total 1 request per second call to ETH1 to ETH1 block seconds interval
Given that we only need to process logs after a new ETH1 follow distance voting around (1024 slots), these calls to ETH1 should be rather infrequent. Setting this to 5 minutes for now to relieve the immediate pressure on users. Set to ETH1 block time interval based on feedback.

Which issues(s) does this PR fix?

Fixes #6206

Other notes for review

Also deleted "client" field which was unused.

@prestonvanloon prestonvanloon requested a review from a team as a code owner June 11, 2020 22:23
@prestonvanloon prestonvanloon added the Ready For Review A pull request ready for code review label Jun 11, 2020
@@ -613,9 +606,13 @@ func (s *Service) run(done <-chan struct{}) {

s.initPOWService()

ticker := time.NewTicker(1 * time.Second)
ticker := time.NewTicker(5 * time.Minute)
Copy link
Member

@nisdas nisdas Jun 11, 2020

Choose a reason for hiding this comment

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

can we instead change this to the eth1 block time ?

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case, we don't need a second ticker. I've just combined this with the headTicker case in the select statement.

@codecov
Copy link

codecov bot commented Jun 12, 2020

Codecov Report

Merging #6221 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6221   +/-   ##
=======================================
  Coverage   59.90%   59.90%           
=======================================
  Files         322      322           
  Lines       27337    27337           
=======================================
  Hits        16375    16375           
  Misses       8730     8730           
  Partials     2232     2232           

@prylabs-bulldozer prylabs-bulldozer bot merged commit 8976249 into master Jun 12, 2020
@delete-merged-branch delete-merged-branch bot deleted the reduce-json-rpc-calls branch June 12, 2020 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rate limiting on infura eth1 node, no backoff of beacon-chain
3 participants