Arc-ify immutable Validator fields

This commit is contained in:
Michael Sproul
2022-03-07 17:33:59 +11:00
parent 73af0b6282
commit f93dfd0c28
9 changed files with 80 additions and 188 deletions

View File

@@ -297,10 +297,10 @@ impl<T: EthSpec> ValidatorMonitor<T> {
.skip(self.indices.len())
.for_each(|(i, validator)| {
let i = i as u64;
if let Some(validator) = self.validators.get_mut(&validator.pubkey) {
if let Some(validator) = self.validators.get_mut(validator.pubkey()) {
validator.set_index(i)
}
self.indices.insert(i, validator.pubkey);
self.indices.insert(i, *validator.pubkey());
});
// Update metrics for individual validators.

View File

@@ -116,7 +116,7 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
.validators()
.iter_from(self.pubkeys.len())
.unwrap() // FIXME(sproul)
.map(|v| v.pubkey),
.map(|v| *v.pubkey()),
)
} else {
Ok(())