caches vote-state de-serialized from vote accounts (#13795)
Gossip and other places repeatedly de-serialize vote-state stored in vote accounts. Ideally the first de-serialization should cache the result. This commit adds new VoteAccount type which lazily de-serializes VoteState from Account data and caches the result internally. Serialize and Deserialize traits are manually implemented to match existing code. So, despite changes to frozen_abi, this commit should be backward compatible.
This commit is contained in:
@@ -188,6 +188,7 @@ example_impls! { f32, 0.0f32 }
|
||||
example_impls! { f64, 0.0f64 }
|
||||
example_impls! { String, String::new() }
|
||||
example_impls! { std::time::Duration, std::time::Duration::from_secs(0) }
|
||||
example_impls! { std::sync::Once, std::sync::Once::new() }
|
||||
|
||||
use std::sync::atomic::*;
|
||||
|
||||
|
Reference in New Issue
Block a user