-
Notifications
You must be signed in to change notification settings - Fork 989
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
[DNM] introduce new sync_head for tracking header chain during sync #410
Conversation
Testing locally now under various scenarios - looks like it is working as expected so far. |
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 okay as a start, should hopefully get everyone past these looping issues we're having. Sync_head is definitely better than header_head everywhere.
I hadn't considered keeping the sync_head in the store as opposed to just in-memory, but I guess it makes sense in an environment with more reliable blockchain states as opposed to the sea of special snowflakes we have now (i.e., on restart in the real world you'll be likely to attach to another peer with the mostly the same chain when syncing, so it makes sense)
In don't think you should completely to get rid of the header head here. I think you still want to track the currently most worked head somewhere. Here is a scenario:
|
We still maintain Oh - are you saying this is problematic because Do we want to update |
pass in sync and head contexts to pipe
@ignopeverell pushed some more changes to keep |
I think you need to reset the sync head to the header head each time we restart sync (in the adapter). Or am I missing something? |
Yeah I think you're right - I don't think its absolutely necessary but there's a lot of wasted effort if we don't do this. |
Replaced by #425 (porting the changes back from testnet1). |
#413 was just merged onto testnet1 branch and contains some additional changes.
I'll port these across, either here or on another PR to replace this one.
process_block_header
tosync_block_header
(more explicit that this is sync only)sync
usesync_header
to track the header chain that we are syncing tosync_head
as we process headers during the syncheader_head
during sync when processing headers if new header is now the one with most worksync_block_header
to maintain both head statesResolves #402.