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

Correct bank::unix_timestamp() drift #9874

Closed
mvines opened this issue May 4, 2020 · 0 comments · Fixed by #12737
Closed

Correct bank::unix_timestamp() drift #9874

mvines opened this issue May 4, 2020 · 0 comments · Fixed by #12737
Assignees
Milestone

Comments

@mvines
Copy link
Member

mvines commented May 4, 2020

The timestamp returned by bank::unix_timestamp() ends up in the clock sysvar and is used for time-based stake account lockouts. However it's based on a theoretical slots-per-second instead of reality, so it's very likely quite inaccurate already. This could post a problem for the month 9 stake unlocks scheduled for Jan 7, 2021.

Steps:

  1. Implement Can't tell what day the cluster thinks it is #9847 to gain visibility into how bad the drift currently is
  2. Consider recalibrating the clock every Epoch based on the vote timestamps?

Also note this comment that perhaps needs to be adjusted along the way:

solana/core/src/rpc.rs

Lines 416 to 420 in 6deaf64

// This calculation currently assumes that bank.slots_per_year will remain unchanged after
// genesis (ie. that this bank's slot_per_year will be applicable to any rooted slot being
// queried). If these values will be variable in the future, those timing parameters will
// need to be stored persistently, and the slot_duration calculation will likely need to be
// moved upstream into blockstore. Also, an explicit commitment level will need to be set.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants