senders logging (#1457)

This commit is contained in:
Alex Sharov 2021-01-27 20:10:21 +07:00 committed by GitHub
parent e943a73ceb
commit c35b07df3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,9 @@ func SpawnRecoverSendersStage(cfg Stage3Config, s *StageState, db ethdb.Database
logPrefix := s.state.LogPrefix()
log.Info(fmt.Sprintf("[%s] Started", logPrefix), "from", s.BlockNumber, "to", to)
logEvery := time.NewTicker(30 * time.Second)
defer logEvery.Stop()
canonical := make([]common.Hash, to-s.BlockNumber)
currentHeaderIdx := uint64(0)
@ -66,6 +69,13 @@ func SpawnRecoverSendersStage(cfg Stage3Config, s *StageState, db ethdb.Database
copy(canonical[currentHeaderIdx][:], v)
currentHeaderIdx++
select {
default:
case <-logEvery.C:
log.Info(fmt.Sprintf("[%s] Preload headedrs", logPrefix), "block_number", binary.BigEndian.Uint64(k))
}
return true, nil
}); err != nil {
return err
@ -85,9 +95,6 @@ func SpawnRecoverSendersStage(cfg Stage3Config, s *StageState, db ethdb.Database
}(i)
}
logEvery := time.NewTicker(30 * time.Second)
defer logEvery.Stop()
collectorSenders := etl.NewCollector(tmpdir, etl.NewSortableBuffer(etl.BufferOptimalSize))
errCh := make(chan error)