@@ -6,7 +6,6 @@ use super::{
66 tipset_tracker:: TipsetTracker ,
77 Error ,
88} ;
9- use crate :: db:: { EthMappingsStore , EthMappingsStoreExt } ;
109use crate :: fil_cns;
1110use crate :: interpreter:: { BlockMessages , VMEvent , VMTrace } ;
1211use crate :: libp2p_bitswap:: { BitswapStoreRead , BitswapStoreReadWrite } ;
@@ -24,6 +23,10 @@ use crate::{
2423 blocks:: { CachingBlockHeader , Tipset , TipsetKey , TxMeta } ,
2524 db:: HeaviestTipsetKeyProvider ,
2625} ;
26+ use crate :: {
27+ chain_sync:: metrics,
28+ db:: { EthMappingsStore , EthMappingsStoreExt } ,
29+ } ;
2730use ahash:: { HashMap , HashMapExt , HashSet } ;
2831use anyhow:: Context as _;
2932use cid:: Cid ;
@@ -36,7 +39,7 @@ use parking_lot::{Mutex, RwLock};
3639use serde:: { de:: DeserializeOwned , Serialize } ;
3740use std:: { num:: NonZeroUsize , sync:: Arc } ;
3841use tokio:: sync:: broadcast:: { self , Sender as Publisher } ;
39- use tracing:: { debug, info , trace, warn} ;
42+ use tracing:: { debug, trace, warn} ;
4043
4144// A cap on the size of the future_sink
4245const SINK_CAP : usize = 200 ;
@@ -139,6 +142,7 @@ where
139142
140143 /// Sets heaviest tipset
141144 pub fn set_heaviest_tipset ( & self , ts : Arc < Tipset > ) -> Result < ( ) , Error > {
145+ metrics:: HEAD_EPOCH . set ( ts. epoch ( ) ) ;
142146 self . heaviest_tipset_key_provider
143147 . set_heaviest_tipset_key ( ts. key ( ) ) ?;
144148 if self . publisher . send ( HeadChange :: Apply ( ts) ) . is_err ( ) {
@@ -255,7 +259,6 @@ where
255259 let curr_weight = heaviest_weight;
256260
257261 if new_weight > curr_weight {
258- info ! ( "New heaviest tipset! {} (EPOCH = {})" , ts. key( ) , ts. epoch( ) ) ;
259262 self . set_heaviest_tipset ( ts) ?;
260263 }
261264 Ok ( ( ) )
0 commit comments