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 validator timestamp oracle proposal #7159

Merged

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented Nov 27, 2019

Problem

Users have no way to know when a Solana block was produced in real-world time.

We have some rough ideas about each validator submitting its UTC time to the ledger in order to identify a median time to use to compute subsequent block times, but no concrete plan.

Summary of Changes

  • Add a proposal for a timestamp oracle that would be maintained by each validator in the cluster

Toward #7115

@CriesofCarrots
Copy link
Contributor Author

I've been thinking it's a little unfortunate to make validators maintain another rent-exempt account. Would it be totally crazy to roll this into the vote account? Timestamp could be an additional instruction on intermittent votes.

@garious
Copy link
Contributor

garious commented Nov 27, 2019

Yeah, different vote instruction is fine. I just didn't want the extra 8 bytes on the wire every 400ms.

@CriesofCarrots
Copy link
Contributor Author

@garious , I've updated this with a write-up of the Vote account/instruction approach. Do you have any concerns?

garious
garious previously approved these changes Dec 2, 2019
Copy link
Contributor

@garious garious left a comment

Choose a reason for hiding this comment

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

Just looking for the one clarification. This looks great!


- At regular intervals, each validator records its observed time for a known slot
on-chain (via a Timestamp added to a slot Vote)
- A client can request a block time using the `getBlockTime` RPC method. When a
Copy link
Contributor

Choose a reason for hiding this comment

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

This can use more definition. It's not clear to me if this is returning the latest block's timestamp, the rooted timestamp, or an estimate of the latest timestamp using the rooted timestamp and number of slots since the latest. And if there are forks, is that the latest latest? If returning the rooted timestamp is sufficient, that's certainly simplest.

@mergify mergify bot dismissed garious’s stale review December 3, 2019 00:26

Pull request has been modified.

@CriesofCarrots
Copy link
Contributor Author

@mvines , I'm merging on Greg's approval, but happy to make follow-up adjustments, if anything looks amiss to you.

@CriesofCarrots CriesofCarrots merged commit 757425a into solana-labs:master Dec 3, 2019
@CriesofCarrots CriesofCarrots deleted the timestamp-proposal branch January 15, 2020 01:00
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.

3 participants