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

refactor: Rename BodySync to BlockSync for consistency #10293

Merged
merged 16 commits into from
Dec 5, 2023
Merged

Conversation

nikurt
Copy link
Contributor

@nikurt nikurt commented Dec 4, 2023

And a bit of documentation for header sync.
And a bit of documentation of block sync.
And a bit of refactoring of block sync.
And a tiny refactoring related to state sync.
And a lot of TODOs.

@nikurt nikurt requested a review from a team as a code owner December 4, 2023 18:03
Copy link

codecov bot commented Dec 4, 2023

Codecov Report

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

Comparison is base (6ce6eb2) 71.82% compared to head (c4ef2d8) 71.81%.

Files Patch % Lines
chain/client/src/sync/block.rs 68.93% 21 Missing and 11 partials ⚠️
chain/client/src/client_actor.rs 18.51% 21 Missing and 1 partial ⚠️
chain/chain/src/chain.rs 67.74% 2 Missing and 8 partials ⚠️
chain/client-primitives/src/types.rs 16.66% 5 Missing ⚠️
chain/client/src/info.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10293      +/-   ##
==========================================
- Coverage   71.82%   71.81%   -0.02%     
==========================================
  Files         712      712              
  Lines      143055   143097      +42     
  Branches   143055   143097      +42     
==========================================
+ Hits       102754   102763       +9     
- Misses      35585    35630      +45     
+ Partials     4716     4704      -12     
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.14% <27.21%> (-0.07%) ⬇️
linux 71.68% <58.57%> (-0.01%) ⬇️
linux-nightly 71.40% <57.98%> (-0.02%) ⬇️
macos 55.44% <52.66%> (+1.57%) ⬆️
pytests 1.48% <0.00%> (-0.01%) ⬇️
sanity-checks 1.28% <0.00%> (-0.01%) ⬇️
unittests 68.19% <56.21%> (+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.

@dsuggs-near
Copy link
Contributor

I've turned off automatic merging altogether until I understand this problem.

@dsuggs-near dsuggs-near closed this Dec 4, 2023
@dsuggs-near dsuggs-near deleted the nikurt-block-sync branch December 4, 2023 20:32
@dsuggs-near dsuggs-near restored the nikurt-block-sync branch December 4, 2023 20:47
@dsuggs-near dsuggs-near reopened this Dec 4, 2023
Copy link
Contributor

@telezhnaya telezhnaya left a comment

Choose a reason for hiding this comment

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

It's much easier to read with your comments and cleanup, thank you for this work

chain/chain/src/chain.rs Outdated Show resolved Hide resolved
chain/client/src/client_actor.rs Outdated Show resolved Hide resolved
chain/client/src/client_actor.rs Outdated Show resolved Hide resolved
fn get_last_processed_block(
&self,
chain: &Chain,
last_block_hash: &CryptoHash,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do I need to pass last_block_hash here? When I look at the signature, I don't expect to pass last_block_hash, I intend to receive it as the result

About implementation: why can't I just ask chain.store().get_latest_known?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a TODO about get_latest_known().

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.

LGTM, thanks!

chain/chain/src/chain.rs Outdated Show resolved Hide resolved
chain/chain/src/chain.rs Outdated Show resolved Hide resolved
chain/chain/src/chain.rs Show resolved Hide resolved
chain/client-primitives/src/types.rs Outdated Show resolved Hide resolved
}
return;
}
// This is a very sneaky piece of logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

That is good to know :)

chain/client/src/client_actor.rs Outdated Show resolved Hide resolved
chain/client-primitives/src/types.rs Outdated Show resolved Hide resolved
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.
A refactoring of receiving blocks for StateSync.
Logging is now more friendly to the traces format.
@nikurt nikurt enabled auto-merge December 5, 2023 12:18
@nikurt nikurt added this pull request to the merge queue Dec 5, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2023
@nikurt nikurt added this pull request to the merge queue Dec 5, 2023
Merged via the queue into master with commit 345e8e0 Dec 5, 2023
19 of 21 checks passed
@nikurt nikurt deleted the nikurt-block-sync branch December 5, 2023 13:32
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.

5 participants