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

Timestamp first vote #11856

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Conversation

CriesofCarrots
Copy link
Contributor

Problem

As of #10630, validators are not timestamping their first vote because last_timestamp is initialized at 0 and current_slot == 0. This means that getBlockTime fails for slot 1, since there are no timestamps before and referring to slot 1.

Summary of Changes

  • Reinstate check for self.last_timestamp.slot == 0

Fixes #11849

cc @jstarry

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Aug 26, 2020
@jstarry
Copy link
Member

jstarry commented Aug 26, 2020

Thank you!

@mergify mergify bot removed the automerge Merge this Pull Request automatically once CI passes label Aug 26, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 26, 2020

automerge label removed due to a CI failure

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Aug 26, 2020
@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #11856 into master will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           master   #11856     +/-   ##
=========================================
- Coverage    82.0%    82.0%   -0.1%     
=========================================
  Files         330      330             
  Lines       77588    77589      +1     
=========================================
- Hits        63688    63687      -1     
- Misses      13900    13902      +2     

@mergify mergify bot merged commit 5c7d743 into solana-labs:master Aug 26, 2020
@CriesofCarrots CriesofCarrots deleted the timestamp-first-slot branch September 1, 2020 19:57
CriesofCarrots added a commit to CriesofCarrots/solana that referenced this pull request Sep 23, 2020
CriesofCarrots added a commit that referenced this pull request Sep 23, 2020
* Submit a vote timestamp every vote (#10630)

* Submit a timestamp for every vote

* Submit at most one vote timestamp per second

* Submit a timestamp for every new vote

Co-authored-by: Tyera Eulberg <[email protected]>

* Timestamp first vote (#11856)

* Cache block time in Blockstore (#11955)

* Add blockstore column to cache block times

* Add method to cache block time

* Add service to cache block time

* Update rpc getBlockTime to use new method, and refactor blockstore slightly

* Return block_time with confirmed block, if available

* Add measure and warning to cache-block-time

Co-authored-by: Michael Vines <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block time is not always set for first few blocks
2 participants