Add intermittent Timestamping to Votes (#7233)

* Add intermittent timestamp to Vote

* Add timestamp to VoteState, add timestamp processing to program

* Print recent timestamp with solana show-vote-account

* Add offset of 1 to timestamp Vote interval to initialize at node boot (slot 1)

* Review comments

* Cache last_timestamp in Tower and use for interval check

* Move work into Tower method

* Clarify timestamping interval

* Replace tuple with struct
This commit is contained in:
Tyera Eulberg
2019-12-06 14:38:49 -07:00
committed by GitHub
parent b8008ae1e9
commit 3ab8185777
7 changed files with 164 additions and 23 deletions

View File

@ -637,6 +637,8 @@ fn process_balance(
use_lamports_unit: bool,
) -> ProcessResult {
let pubkey = pubkey.unwrap_or(config.keypair.pubkey());
let string = solana_stake_program::id().to_string();
println!("{:}", string);
let balance = rpc_client.retry_get_balance(&pubkey, 5)?;
match balance {
Some(lamports) => Ok(build_balance_message(lamports, use_lamports_unit, true)),

View File

@ -353,6 +353,7 @@ pub fn process_show_vote_account(
None => "~".to_string(),
}
);
println!("recent timestamp: {:?}", vote_state.last_timestamp);
if !vote_state.votes.is_empty() {
println!("recent votes:");
for vote in &vote_state.votes {