-
Notifications
You must be signed in to change notification settings - Fork 63
chore: refactor redundant interval creation #694
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
chore: refactor redundant interval creation #694
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.
Looks good 👍
feel free to merge this when CI is fixed! |
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.
Overall this PR looks good just rebase and apply the few suggestions
let mut interval = interval_at( | ||
interval_start, | ||
Duration::from_secs(seconds_per_slot / INTERVALS_PER_SLOT), | ||
); | ||
interval.set_missed_tick_behavior(MissedTickBehavior::Burst); | ||
|
||
Ok(interval) |
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.
might as well inline all these into the ok
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't inline this because set missed tick behavior is called on the interval after creation
4b5b61a
to
ef51d13
Compare
* chore: refactor redundant interval creation * fix: imports * fix: import * fix: unhide error * fix: handle err * fix: pass up the err * fix: inline requested * fix: cleanup * fix: inline * fix: format
What was wrong?
Fixes: #683
How was it fixed?
Refactored the interval code by creating a function create_lean_clock_interval() which returns an interval to be used in both
ValidatorService
andLeanChainService
.To-Do