mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
minimize the number of places we are calling update_pubkey_cache (#1626)
## Issue Addressed - Resolves #1080 ## Proposed Changes - Call `update_pubkey_cache` only in the `build_all_caches` method and `get_validator_index` method. ## Additional Info This does reduce the number of places the cache is updated, making it simpler. But the `get_validator_index` method is used a couple times when we are iterating through the entire validator registry (or set of active validators). Before, we would only call `update_pubkey_cache` once before iterating through all validators. So I'm not _totally_ sure this change is worth it.
This commit is contained in:
@@ -92,10 +92,6 @@ pub fn post_individual_votes<T: BeaconChainTypes>(
|
||||
let mut validator_statuses = ValidatorStatuses::new(&state, spec)?;
|
||||
validator_statuses.process_attestations(&state, spec)?;
|
||||
|
||||
state.update_pubkey_cache().map_err(|e| {
|
||||
ApiError::ServerError(format!("Unable to build pubkey cache: {:?}", e))
|
||||
})?;
|
||||
|
||||
body.pubkeys
|
||||
.into_iter()
|
||||
.map(|pubkey| {
|
||||
|
||||
Reference in New Issue
Block a user