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

Add bank-timestamp design proposal #12712

Conversation

CriesofCarrots
Copy link
Contributor

Problem

Bank::unix_timestamps() are drifting further and further from real-world time.

Summary of Changes

Propose a method for correcting this drift using the validator-timestamp oracle

@CriesofCarrots CriesofCarrots requested a review from mvines October 7, 2020 22:24
in the epoch. So there doesn't appear to be much benefit to the additional
complexity.

### Correction Math
Copy link
Member

@mvines mvines Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the major part that we're missing here is how the drift is actually corrected:

  1. If the bank clock is ahead of wallclock, then at the end of the epoch the bank clock is perhaps incremented by 1 (the smallest amount larger than 0)
  2. If the bank clock is behind of wallclock (like it is currently), how quickly do we warp ahead? I feel like we probably shouldn't warp ahead too much. In the case of a cabal of validators attempting influence over the clock, the only way to reduce their impact will be to delegate stake away from them. This will take days/weeks. So perhaps we only warp head by at most 1 epoch of wallclock? But if we limit to this, will we reach close to realtime by the end of the year?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a section on this.

  1. I was thinking we wouldn't ever correct the bank clock backwards, so if the bank clock is ahead of wallclock, it isn't adjusted at all.
  2. Assuming that the real average slot duration remains similar to that over the past 40M blocks, one additional epoch's-worth of correction will not be enough to get us synced by the end of the year. According to my math, we'll need to correct approximately 2.5 additional epochs of wallclock each epoch to reach real time by the end of the year.

@CriesofCarrots
Copy link
Contributor Author

Closing in lieu of a simpler approach: #12737
Will re-open if needed

@CriesofCarrots CriesofCarrots deleted the bank-timestamp-proposal branch October 21, 2020 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants