Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
randyahx committed Sep 27, 2023
1 parent 49a7a2b commit f723386
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (e *Executor) GetBlockAndBlockResultAtHeight(height int64) (*tmtypes.Block,
}
blockResults, err := e.clients.GetClient().TmClient.BlockResults(context.Background(), &height)
if err != nil {
//logging.Logger.Errorf("executor failed to get block results at height %d, err=%+v", height, err.Error())
logging.Logger.Errorf("executor failed to get block results at height %d, err=%+v", height, err.Error())
return nil, nil, err
}
return block.Block, blockResults, nil
Expand All @@ -136,7 +136,7 @@ func (e *Executor) GetLatestBlockHeight() (uint64, error) {
res, err := client.GetLatestBlockHeight(context.Background())
latestHeight := uint64(res)
if err != nil {
//logging.Logger.Errorf("executor failed to get latest block height, err=%s", err.Error())
logging.Logger.Errorf("executor failed to get latest block height, err=%s", err.Error())
}

e.mtx.Lock()
Expand Down
6 changes: 1 addition & 5 deletions monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (m *Monitor) poll() error {
return err
}
if err = m.monitorChallengeEvents(block, blockResults); err != nil {
//logging.Logger.Errorf("encounter error when monitor challenge events at blockHeight=%d, err=%+v", nextHeight, err.Error())
logging.Logger.Errorf("encounter error when monitor challenge events at blockHeight=%d, err=%+v", nextHeight, err.Error())
return err
}
return nil
Expand Down Expand Up @@ -172,18 +172,15 @@ func (m *Monitor) monitorChallengeEvents(block *tmtypes.Block, blockResults *cty
func (m *Monitor) calNextHeight() (uint64, error) {
latestPolledBlock, err := m.dataProvider.GetLatestBlock()
if err != nil && err != gorm.ErrRecordNotFound {
//logging.Logger.Errorf("failed to get latest block from db, error: %s", err.Error())
latestHeight, err := m.executor.GetLatestBlockHeight()
if err != nil {
//logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error())
return 0, err
}
return latestHeight, err
}
if latestPolledBlock.Height == 0 { // a fresh database
latestHeight, err := m.executor.GetLatestBlockHeight()
if err != nil {
//logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error())
return m.executor.GetCachedBlockHeight(), err
}
return latestHeight, nil
Expand All @@ -192,7 +189,6 @@ func (m *Monitor) calNextHeight() (uint64, error) {

latestBlockHeight, err := m.executor.GetLatestBlockHeight()
if err != nil {
//logging.Logger.Errorf("failed to get latest block height, error: %s", err.Error())
return 0, err
}
// pauses challenger for a bit since it already caught the newest block
Expand Down

0 comments on commit f723386

Please sign in to comment.