-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Sync Checker #13580
Add Sync Checker #13580
Conversation
type SyncChecker struct { | ||
Svc *Service | ||
} |
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.
The checker having the full service as a dependency doesn't look right to me... It seems like the initial sync service already implements the SyncChecker
interface, you can use it as the blockchain's service dependency. One service depending on another is more natural.
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.
The main reason you cant do it is because initial sync has a dependency on the blockchain service. It is the reason the checker has been implemented
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.
I am approving it but with the worry that if we are not setting and unsetting correctly the synced bool when we fall back or when we are actually synced to head, this may cause a lot of pain
if s.Svc == nil { | ||
return false | ||
} |
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.
Can we add a warning here? Seems like this should never be desired at runtime.
* fix it * add it in * typo * fix tests * fix tests * export and add test * preston's review
What type of PR is this?
Cleanup
What does this PR do? Why is it needed?
To allow the blockchain service to be aware of the current node's sync status, the sync checker object is shared between both services to allow this status to be determined and disseminated across them.
Which issues(s) does this PR fix?
N.A
Other notes for review