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 a 2 second timeout to fetching eth1data #5583

Merged
merged 10 commits into from Apr 23, 2020

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Apr 22, 2020

This PR returns a random eth1data vote if the node has an issue retrieving data from eth1 in a timely manner.

Resolves #5521

@prestonvanloon prestonvanloon added the Ready For Review A pull request ready for code review label Apr 22, 2020
@prestonvanloon prestonvanloon requested a review from a team as a code owner April 22, 2020 21:26
@prestonvanloon
Copy link
Member Author

Fixing tests now

@codecov
Copy link

codecov bot commented Apr 23, 2020

Codecov Report

Merging #5583 into master will decrease coverage by 22.44%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #5583       +/-   ##
==========================================
- Coverage   27.46%   5.02%   -22.45%     
==========================================
  Files         239     239               
  Lines       20771   20655      -116     
==========================================
- Hits         5705    1038     -4667     
- Misses      14070   19466     +5396     
+ Partials      996     151      -845     

@@ -169,11 +175,13 @@ func (vs *Server) eth1Data(ctx context.Context, slot uint64) (*ethpb.Eth1Data, e
// Look up most recent block up to timestamp
blockNumber, err := vs.Eth1BlockFetcher.BlockNumberByTimestamp(ctx, eth1VotingPeriodStartTime)
if err != nil {
return nil, errors.Wrap(err, "could not get block number from timestamp")
log.WithError(err).Error("Failed to get block number from timestamp")
Copy link
Member

Choose a reason for hiding this comment

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

We also could consider warning for these, i dont feel strongly for either, up to you!

Copy link
Member Author

Choose a reason for hiding this comment

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

Its an error that should be monitored

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.

Handle poor performing eth1 data retrieval
5 participants