-
Notifications
You must be signed in to change notification settings - Fork 182
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
Add is_syncing to /node/syncing #121
Conversation
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.
Big fan of this change (and the suggested change to make head slot mean the slot of the best block).
From the description in the related comment "I might only have a few blocks left to sync and I'm synced-enough, so lets turn on all the duties endpoints and health endpoint" this doesn't sound like it is an |
I see the appeal, but I feel like we'd end up just doing a The concept of a node being "in sync" is pretty complex; you can't say you're syncing just cause someone on the network says they have a block for you, you need to be doing some sort of majority-ish heuristics. This makes me feel that saying "I'm synced" when there's still a few blocks left isn't really a lie because "being synced" is already rather subjective. |
@paulhauner I see that you are calculating sync_distance as |
I agree that this would be nice, but consider the case where you're syncing two chains at once. There's nothing to say that your head is on the same chain as your peer best head. This makes the basic definition of
Since we have the Perhaps we can re-visit the rest of this struct in another issue/PR @mpetrunic? I agree it's not ideal at the moment. However, adding this |
Proposed Changes
Adds the
is_syncing: bool
field to the../node/syncing
endpoint as per the reasons documented here: #77 (comment)Additional Info
I would like to change
head_slot
to refer to the block at the head of the canonical chain,for consistency with the other uses of "head" in this API. I've left that out of this PR since that's a non-backwards-compatible change and I'd like to get this merged regardless of that change.