@@ -236,12 +236,12 @@ impl<E: EthSpec> CachedHead<E> {
236
236
pub struct CanonicalHead < T : BeaconChainTypes > {
237
237
/// Provides an in-memory representation of the non-finalized block tree and is used to run the
238
238
/// fork choice algorithm and determine the canonical head.
239
- pub fork_choice : CanonicalHeadRwLock < BeaconForkChoice < T > > ,
239
+ fork_choice : CanonicalHeadRwLock < BeaconForkChoice < T > > ,
240
240
/// Provides values cached from a previous execution of `self.fork_choice.get_head`.
241
241
///
242
242
/// Although `self.fork_choice` might be slightly more advanced that this value, it is safe to
243
243
/// consider that these values represent the "canonical head" of the beacon chain.
244
- pub cached_head : CanonicalHeadRwLock < CachedHead < T :: EthSpec > > ,
244
+ cached_head : CanonicalHeadRwLock < CachedHead < T :: EthSpec > > ,
245
245
/// A lock used to prevent concurrent runs of `BeaconChain::recompute_head`.
246
246
///
247
247
/// This lock **should not be made public**, it should only be used inside this module.
@@ -383,11 +383,13 @@ impl<T: BeaconChainTypes> CanonicalHead<T> {
383
383
384
384
/// Access a read-lock for fork choice.
385
385
pub fn fork_choice_read_lock ( & self ) -> RwLockReadGuard < BeaconForkChoice < T > > {
386
+ let _timer = metrics:: start_timer ( & metrics:: FORK_CHOICE_READ_LOCK_AQUIRE_TIMES ) ;
386
387
self . fork_choice . read ( )
387
388
}
388
389
389
390
/// Access a write-lock for fork choice.
390
391
pub fn fork_choice_write_lock ( & self ) -> RwLockWriteGuard < BeaconForkChoice < T > > {
392
+ let _timer = metrics:: start_timer ( & metrics:: FORK_CHOICE_WRITE_LOCK_AQUIRE_TIMES ) ;
391
393
self . fork_choice . write ( )
392
394
}
393
395
}
0 commit comments