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 Sync top level functions #5328

Closed
wants to merge 4 commits into from

Conversation

schomatis
Copy link
Contributor

Homogenize Sync() calls to better reflect the different states.

Remove StagePersistHeaders, absorbed by StageHeaders now (the first being local is of low complexity, execution time and possibilities of error compared to the second).

Extract syncMessagesAndCheckState out of collectChain() and into the main Sync() call flow.

@schomatis schomatis mentioned this pull request Jan 12, 2021
// `iterFullTipsets`). We should extract it out and probably request
// *both* block headers and messages together through the corresponding
// chain exchange interface. We can do very little validation without the
// messages so it shouldn't have much impact.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fetching messages has quite an impact on sync speed. We should not be doing it eagerly.
One of the most important parts of validation is not syncing headers we already failed to sync (and not fetching messages for them because we did not persist them).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. We probably shouldn't request as much messages as chain we are fetching but it still seems to me we could benefit from eagerly requesting some amount of messages in advance for upcoming blocks. We are currently at the other extreme of only requesting at the same moment of validation stalling the pipeline. Anyway, just a note, not going to change any of that here.

@schomatis schomatis requested a review from raulk February 1, 2021 13:29
StageHeaders
StagePersistHeaders
Copy link
Contributor

Choose a reason for hiding this comment

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

We should leave it here, for now, removing it will re-number the enum resulting in incompatibility.
We should open an issue for API breaking changes we want to do, mention this renumbering and link to the issue from here.

Copy link
Contributor

@Kubuxu Kubuxu left a comment

Choose a reason for hiding this comment

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

It removes a constant from one of the few packages I would consider exported interface and also re-numbers the enum.
Let's avoid that for now.

@schomatis schomatis requested a review from arajasek as a code owner May 7, 2021 01:26
@ZenGround0
Copy link
Contributor

@magik6k would you say this no longer makes sense given your work refactoring lotus/chain?

@schomatis
Copy link
Contributor Author

Yeah, we can close this.

@schomatis schomatis closed this Jul 29, 2021
@Kubuxu Kubuxu deleted the schomatis/refactor/sync/top-level-functions branch November 25, 2021 19:19
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