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

fix: Document HeaderSync #10280

Merged
merged 7 commits into from
Dec 4, 2023
Merged

fix: Document HeaderSync #10280

merged 7 commits into from
Dec 4, 2023

Conversation

nikurt
Copy link
Contributor

@nikurt nikurt commented Dec 1, 2023

Made no functional changes except:

  • Replaced a tuple with a struct
  • Introduced a function made_enough_progress() to make the code much simpler to understand.
  • Renamed a ban reason

Nikolay Kurtov added 3 commits December 1, 2023 15:16
It solves the problem of nodes going into header sync or body sync for just a few seconds. It's not a problem for an rpc node, but for a validator that is enough to miss production of a chunk or a block.
Short syncs are not shown in prometheus due to the large poll interval.
@nikurt nikurt requested a review from a team as a code owner December 1, 2023 14:18
@nikurt nikurt requested a review from wacban December 1, 2023 14:18
Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

I love the comments and the new structure!
LGTM

SyncStatus::NoSync | SyncStatus::AwaitingPeers | SyncStatus::EpochSync { .. } => {
// TODO: How can it get to EpochSync if it's hardcoded to go from NoSync to HeaderSync?
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @posvyatokum I guess
some more epoch sync questions below too

Comment on lines +166 to +167
// TODO: This function should check the difference between the current header_head height and the highest height of the peers.
// TODO: Triggering header sync to get 1 header (or even 0 headers) makes little sense.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe ramp up for @telezhnaya ?

@@ -225,7 +225,7 @@ pub struct ClientConfig {
pub header_sync_progress_timeout: Duration,
/// How much time to wait before banning a peer in header sync if sync is too slow
pub header_sync_stall_ban_timeout: Duration,
/// Expected increase of header head weight per second during header sync
/// Expected increase of header head height per second during header sync
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

Nikolay Kurtov added 2 commits December 1, 2023 16:03
@nikurt nikurt enabled auto-merge December 1, 2023 15:12
@nikurt nikurt disabled auto-merge December 1, 2023 16:36
@nikurt nikurt force-pushed the nikurt-header-sync-doc branch from 97dc1f5 to 6299b01 Compare December 1, 2023 18:03
@nikurt nikurt enabled auto-merge December 4, 2023 12:58
@nikurt nikurt added this pull request to the merge queue Dec 4, 2023
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (81b7082) 71.78% compared to head (761030c) 71.78%.

Files Patch % Lines
chain/client/src/sync/header.rs 91.17% 4 Missing and 2 partials ⚠️
chain/client/src/client_actor.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10280      +/-   ##
==========================================
- Coverage   71.78%   71.78%   -0.01%     
==========================================
  Files         712      712              
  Lines      142858   142878      +20     
  Branches   142858   142878      +20     
==========================================
+ Hits       102553   102565      +12     
- Misses      35594    35607      +13     
+ Partials     4711     4706       -5     
Flag Coverage Δ
backward-compatibility 0.08% <0.00%> (-0.01%) ⬇️
db-migration 0.08% <0.00%> (-0.01%) ⬇️
genesis-check 1.25% <0.00%> (-0.01%) ⬇️
integration-tests 36.15% <52.77%> (-0.05%) ⬇️
linux 71.65% <86.11%> (-0.02%) ⬇️
linux-nightly 71.36% <86.11%> (+0.01%) ⬆️
macos 53.92% <87.50%> (-1.08%) ⬇️
pytests 1.48% <0.00%> (-0.01%) ⬇️
sanity-checks 1.28% <0.00%> (-0.01%) ⬇️
unittests 68.15% <87.50%> (+<0.01%) ⬆️
upgradability 0.13% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Merged via the queue into master with commit b9ae299 Dec 4, 2023
@nikurt nikurt deleted the nikurt-header-sync-doc branch December 4, 2023 13:41
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.

2 participants