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

Fast sync improvements #2796

Merged
merged 4 commits into from
May 28, 2024
Merged

Conversation

nazar-pc
Copy link
Member

This changes fast sync to no assume anything about block size and makes the workflow more closely follow the spec.

It has a few inline comments that together with code structure and spec should be sufficient for understanding what is happening and why. I also improved some other explanations in comments.

Code contributor checklist:

@nazar-pc nazar-pc requested a review from rg3l3dr as a code owner May 27, 2024 03:07
Base automatically changed from revert-dsn-sync-changes to add-fast-sync-algorithm May 28, 2024 10:03
)
.await?;
let mut blocks = VecDeque::from(blocks);
// Identify all segment headers that would need to be reconstructed in order to get first
Copy link
Member

Choose a reason for hiding this comment

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

It looks like overcomplicated code for the case when we need to get at most two segments. The previous version was much easier to follow.

@@ -167,75 +144,101 @@ where
}
}

// TODO: Fix this implementation to actually follow the spec
Copy link
Member

Choose a reason for hiding this comment

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

Please, provide a brief algorithm description (without steps' descriptions you provided in the method body) and restore both notes: "reputation note" and "segment-block relative sizes that differ from blockchain parameters".

@shamil-gadelshin
Copy link
Member

Ignore the comments. We discussed github glitches.

@nazar-pc nazar-pc merged commit 96c20cf into add-fast-sync-algorithm May 28, 2024
9 checks passed
@nazar-pc nazar-pc deleted the fast-sync-improvements branch May 28, 2024 13:36
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