@@ -57,11 +57,11 @@ func (s *Antiquary) loopStates(ctx context.Context) {
5757 // Execute this each second
5858 reqRetryTimer := time .NewTicker (100 * time .Millisecond )
5959 defer reqRetryTimer .Stop ()
60+
6061 if ! initial_state .IsGenesisStateSupported (clparams .NetworkType (s .cfg .DepositNetworkID )) {
6162 s .logger .Warn ("Genesis state is not supported for this network, no historical states data will be available" )
6263 return
6364 }
64-
6565 _ , beforeFinalized , err := s .readHistoricalProcessingProgress (ctx )
6666 if err != nil {
6767 s .logger .Error ("Failed to read historical processing progress" , "err" , err )
@@ -81,14 +81,16 @@ func (s *Antiquary) loopStates(ctx context.Context) {
8181 s .logger .Error ("Failed to read historical processing progress" , "err" , err )
8282 continue
8383 }
84+ if s .sn == nil || s .syncedData .Syncing () {
85+ continue
86+ }
87+
8488 // We wait for updated finality.
8589 if finalized == beforeFinalized {
8690 continue
8791 }
8892 beforeFinalized = finalized
89- if s .sn == nil || s .syncedData .Syncing () {
90- continue
91- }
93+
9294 if err := s .IncrementBeaconState (ctx , finalized ); err != nil {
9395 if s .currentState != nil {
9496 s .logger .Warn ("Could not to increment beacon state, trying again later" , "err" , err , "slot" , s .currentState .Slot ())
@@ -140,9 +142,16 @@ func FillStaticValidatorsTableIfNeeded(ctx context.Context, logger log.Logger, s
140142 blocksAvaiable := stateSn .BlocksAvailable ()
141143 stateSnRoTx := stateSn .View ()
142144 defer stateSnRoTx .Close ()
143-
145+ log .Info ("[Caplin-Archive] filling validators table" , "from" , 0 , "to" , stateSn .BlocksAvailable ())
146+ logTicker := time .NewTicker (10 * time .Second )
147+ defer logTicker .Stop ()
144148 start := time .Now ()
145149 for slot := uint64 (0 ); slot <= stateSn .BlocksAvailable (); slot ++ {
150+ select {
151+ case <- logTicker .C :
152+ log .Info ("[Caplin-Archive] Filled validators table" , "progress" , fmt .Sprintf ("%d/%d" , slot , stateSn .BlocksAvailable ()))
153+ default :
154+ }
146155 seg , ok := stateSnRoTx .VisibleSegment (slot , kv .StateEvents )
147156 if ! ok {
148157 return false , fmt .Errorf ("segment not found for slot %d" , slot )
@@ -437,7 +446,7 @@ func (s *Antiquary) IncrementBeaconState(ctx context.Context, to uint64) error {
437446 // We now do some post-processing on the state.
438447 select {
439448 case <- progressTimer .C :
440- log .Log (logLvl , "State processing progress " , "slot" , slot , "blk/sec" , fmt .Sprintf ("%.2f" , float64 (slot - prevSlot )/ 60 ))
449+ log .Log (logLvl , "[Caplin-Archive] Historical States reconstruction " , "slot" , slot , "blk/sec" , fmt .Sprintf ("%.2f" , float64 (slot - prevSlot )/ 60 ))
441450 prevSlot = slot
442451 default :
443452 }
@@ -491,7 +500,7 @@ func (s *Antiquary) IncrementBeaconState(ctx context.Context, to uint64) error {
491500 return err
492501 }
493502
494- log .Info ("Historical states antiquated" , "slot" , s .currentState .Slot (), "root" , libcommon .Hash (stateRoot ), "latency" , endTime )
503+ log .Info ("[Caplin-Archive] Historical states antiquated" , "slot" , s .currentState .Slot (), "root" , libcommon .Hash (stateRoot ), "latency" , endTime )
495504 if s .stateSn != nil {
496505 if err := s .stateSn .OpenFolder (); err != nil {
497506 return err
0 commit comments