-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
// `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. |
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.
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).
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.
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.
StageHeaders | ||
StagePersistHeaders |
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.
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.
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 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.
@magik6k would you say this no longer makes sense given your work refactoring lotus/chain? |
Yeah, we can close this. |
Homogenize
Sync()
calls to better reflect the different states.Remove
StagePersistHeaders
, absorbed byStageHeaders
now (the first being local is of low complexity, execution time and possibilities of error compared to the second).Extract
syncMessagesAndCheckState
out ofcollectChain()
and into the mainSync()
call flow.