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

headerCache miss in BlockByTimeStamp() #9609

Closed
Tracked by #9708
jmozah opened this issue Sep 16, 2021 · 1 comment
Closed
Tracked by #9708

headerCache miss in BlockByTimeStamp() #9609

jmozah opened this issue Sep 16, 2021 · 1 comment
Assignees

Comments

@jmozah
Copy link
Contributor

jmozah commented Sep 16, 2021

💎 Issue

Background

As part of debug session for the GetBlock() optimisation, this issue was found and needs to be looked in to.

Description

GetBlock() -> eth1DataMajorityVote() -> BlockByTimeStamp()

  • BlockByTimeStamp(): This is a search function which tries to minimize the access rate by using a header cache during normal operation. This function somehow misses the headerCache and proceeds to fetch the header from the eth1POW chain (external call) which is inside the search iteration. Even if the call takes 200ms every time, it adds up and crosses a second easily.
  • scenario 1
  • scenario 2
@jmozah jmozah added the Tracking Gotta Catch 'Em All label Sep 16, 2021
@jmozah jmozah mentioned this issue Sep 30, 2021
6 tasks
@jmozah jmozah removed the Tracking Gotta Catch 'Em All label Sep 30, 2021
@jmozah jmozah self-assigned this Oct 12, 2021
@jmozah
Copy link
Contributor Author

jmozah commented Oct 29, 2021

Summary: After running some experimentation i have come to a conclusion that this will not be a issue during normal block proposals. Spoke about this with @nisdas and he thinks the same too. Some explanations below

  • This version was modified such that GetBlock() will be called as soon the validator calls WaitForActivation. This is to monitor the performance of GetBlock() function as a whole and find issues.

  • During Start() of the POWService, Eth1BlockHeaders are loaded in the header cache from the previous Eth1 voting period start to the present. This is done in parallel while other services are running.

  • Because of how GetBlock() is called, sometimes BlockByTimeStamp() is called even before the cache is loaded. So we saw few header cache misses in the beginning. Also depending upon the machine spec, this initial duration would last few seconds (our setup shows 15 seconds).

  • Once the caches are hot, the misses are virtually not existant even in a longer duration test which spanned more than 3 Eth1VotingPeriod.

So i am in recommendation of closing this issue as we wiil have very few probability to propose blocks in the first few seconds of starting the beacon node.

@jmozah jmozah closed this as completed Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant