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 getBlockTime RPC API #7115

Closed
mvines opened this issue Nov 25, 2019 · 2 comments · Fixed by #7476
Closed

Add getBlockTime RPC API #7115

mvines opened this issue Nov 25, 2019 · 2 comments · Fixed by #7476
Assignees

Comments

@mvines
Copy link
Member

mvines commented Nov 25, 2019

It's strongly desired by some users to have a network-controlled best effort timestamp associated with the production time of each block. One such example is https://en.bitcoin.it/wiki/Block_timestamp

Some important properties of this timestamp are:

  1. Drift of no worse than a couple hours from the actual block production time
  2. Replaying the ledger at a later time results in the same block production time
  3. The block production time is not controlled by a single centralized oracle, but ideally is a function that uses inputs from all validators

A rough proposal would be to require validators to submit their current UTC time every N minutes. A median time is then constructed from the latest submission and block times are then computed as last_median_time + slot_offset * 400ms until the next median time is constructed.

This issue can be broken up into:

  1. The definition/implementation of the getBlockTime RPC API
  2. Initial stub implementation where last_median_time is fixed to 0.
  3. Adding time submission to all validators and producing a real last_median_time

1 and 2 are important to implement quickly to unblock some users

@CriesofCarrots
Copy link
Contributor

CriesofCarrots commented Dec 3, 2019

Remaining steps after #7233 :

@CriesofCarrots
Copy link
Contributor

CriesofCarrots commented Dec 14, 2019

Added new issue for unfinished item above: #7485

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 a pull request may close this issue.

2 participants