-
Notifications
You must be signed in to change notification settings - Fork 700
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
Pure state sync refactoring (part-2) #6521
Pure state sync refactoring (part-2) #6521
Conversation
Co-authored-by: Bastian Köcher <[email protected]>
/// is ready to be imported. | ||
pub struct StateSync<B: BlockT, Client> { | ||
target_block: B::Hash, | ||
struct StateSyncMetadata<B: BlockT> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit; Would be useful to have some documatation on this struct and exposed methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a private struct and not publicly exposed. Feel free to add some docs if you think that's necessary :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks again for contributing 🙏
Co-authored-by: Alexandru Vasile <[email protected]>
07a5933
This PR is the second part of the pure state sync refactoring, encapsulating
StateSyncMetadata
as a separate entity. Now it's pretty straightforward what changes are needed for the persistent state sync as observed in the structStateSync
:state
: redirect directly to the DB layer instead of being accumulated in the memory.metadata
: handle the state sync metadata on disk whenever the state is forwarded to the DB, resume an ongoing state sync on a restart, etc.