Add method for dropping pubkey cache. Add bench.

This commit is contained in:
Paul Hauner
2019-03-13 16:49:32 +11:00
parent 6cd3c4bd1a
commit 587be831b5
2 changed files with 22 additions and 0 deletions

View File

@@ -322,6 +322,11 @@ impl BeaconState {
Ok(())
}
/// Completely drops the `pubkey_cache`, replacing it with a new, empty cache.
pub fn drop_pubkey_cache(&mut self) {
self.pubkey_cache = PubkeyCache::empty()
}
/// If a validator pubkey exists in the validator registry, returns `Some(i)`, otherwise
/// returns `None`.
///