Skip to content
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

VC time updates #2052

Closed
paulhauner opened this issue Dec 5, 2020 · 0 comments
Closed

VC time updates #2052

paulhauner opened this issue Dec 5, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@paulhauner
Copy link
Member

Description

The DutiesService (and others) in the VC presently doing their polling by waiting until the beginning of a slot then starting a repeating 12s timer:

let mut interval = {
let slot_duration = Duration::from_millis(spec.milliseconds_per_slot);
// Note: `interval_at` panics if `slot_duration` is 0
interval_at(
Instant::now() + duration_to_next_slot + TIME_DELAY_FROM_SLOT,
slot_duration,
)
};

This generally works well, however it doesn't account for the scenario where the time is incorrect and changes during operation. E.g., if your VC is 5s slow when it starts, even if you change your clock the DutiesService will keep using that old time.

Steps to Resolve

Options:

  • Change to a mechanism that adjusts with the system clock.
  • Check against the slot clock when the services start and log an error if their out of sync (not ideal, but interesting stop-gap for the time being).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant