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

Move latest block fetch out of store callback #1253

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

omerfirmak
Copy link
Contributor

store callback is on the hot path of sync process, a network request is not suitable to be here since it blocks the entire sync process for arbitrarily long

@omerfirmak omerfirmak requested review from a team and IronGauntlets and removed request for a team September 19, 2023 09:56
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch coverage: 79.06% and project coverage change: -0.01% ⚠️

Comparison is base (80eea85) 73.79% compared to head (3b6b771) 73.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1253      +/-   ##
==========================================
- Coverage   73.79%   73.78%   -0.01%     
==========================================
  Files          70       70              
  Lines        7608     7633      +25     
==========================================
+ Hits         5614     5632      +18     
- Misses       1535     1540       +5     
- Partials      459      461       +2     
Files Changed Coverage Δ
sync/sync.go 83.17% <79.06%> (-0.99%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@omerfirmak omerfirmak force-pushed the omerfirmak/latest-poll branch from 7ddb89b to f9b6ff9 Compare September 19, 2023 10:25
sync/sync.go Show resolved Hide resolved
sync/sync.go Show resolved Hide resolved
store callback is on the hot path of sync process, a network
request is not suitable to be here since it blocks the entire sync
process for arbitrarily long
@omerfirmak omerfirmak force-pushed the omerfirmak/latest-poll branch from f9b6ff9 to 3b6b771 Compare September 19, 2023 13:50
@IronGauntlets
Copy link
Contributor

IronGauntlets commented Sep 19, 2023

This is a general comment about s.highestBlockHeader and may be out of the scope of this PR. All of the usage of s.highestBlockHeader is of its number. So instead of storing the whole header we could just store the Number instead.

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

Successfully merging this pull request may close these issues.

3 participants