Skip to content

Commit

Permalink
logs: cleanup (#6198)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <marbar3778@yahoo.com>
  • Loading branch information
2 people authored and tnasu committed Dec 1, 2021
1 parent d95937a commit 10e1f57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
11 changes: 5 additions & 6 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ func (cs *State) defaultDecideProposal(height int64, round int32) {
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""})
}

cs.Logger.Info("signed proposal", "height", height, "round", round, "proposal", proposal)
cs.Logger.Debug("signed proposal block", "block", block)
cs.Logger.Debug("signed proposal", "height", height, "round", round, "proposal", proposal)
} else if !cs.replayMode {
cs.Logger.Error("propose step; failed signing proposal", "height", height, "round", round, "err", err)
}
Expand Down Expand Up @@ -1719,7 +1718,7 @@ func (cs *State) finalizeCommit(height int64) {
if err != nil {
logger.Error("failed to prune blocks", "retain_height", retainHeight, "err", err)
} else {
logger.Info("pruned blocks", "pruned", pruned, "retain_height", retainHeight)
logger.Debug("pruned blocks", "pruned", pruned, "retain_height", retainHeight)
}
}

Expand Down Expand Up @@ -2070,7 +2069,7 @@ func (cs *State) tryAddVote(vote *types.Vote, peerID p2p.ID) (bool, error) {

// report conflicting votes to the evidence pool
cs.evpool.ReportConflictingVotes(voteErr.VoteA, voteErr.VoteB)
cs.Logger.Info(
cs.Logger.Debug(
"found and sent conflicting votes to the evidence pool",
"vote_a", voteErr.VoteA,
"vote_b", voteErr.VoteB,
Expand Down Expand Up @@ -2235,7 +2234,7 @@ func (cs *State) addVote(vote *types.Vote, peerID p2p.ID) (added bool, err error

case tmproto.PrecommitType:
precommits := cs.Votes.Precommits(vote.Round)
cs.Logger.Info("added vote to precommit", "vote", vote, "precommits", precommits.StringShort())
cs.Logger.Debug("added vote to precommit", "vote", vote, "precommits", precommits.StringShort())

blockID, ok := precommits.TwoThirdsMajority()
if ok {
Expand Down Expand Up @@ -2339,7 +2338,7 @@ func (cs *State) signAddVote(msgType tmproto.SignedMsgType, hash []byte, header
vote, err := cs.signVote(msgType, hash, header)
if err == nil {
cs.sendInternalMessage(msgInfo{&VoteMessage{vote}, ""})
cs.Logger.Info("signed and pushed vote", "height", cs.Height, "round", cs.Round, "vote", vote)
cs.Logger.Debug("signed and pushed vote", "height", cs.Height, "round", cs.Round, "vote", vote)
return vote
}

Expand Down
12 changes: 3 additions & 9 deletions mempool/clist_mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (mem *CListMempool) resCbFirstTime(
}
memTx.senders.Store(peerID, true)
mem.addTx(memTx)
mem.logger.Info("Added good transaction",
mem.logger.Debug("added good transaction",
"tx", txID(tx),
"res", r,
"height", memTx.height,
Expand Down Expand Up @@ -545,7 +545,7 @@ func (mem *CListMempool) resCbRecheck(req *abci.Request, res *abci.Response) {
// Good, nothing to do.
} else {
// Tx became invalidated due to newly committed block.
mem.logger.Info("tx is no longer valid", "tx", txID(tx), "res", r)
mem.logger.Debug("tx is no longer valid", "tx", txID(tx), "res", r)
// NOTE: we remove tx from the cache because it might be good later
mem.removeTx(tx, celem, true)
}
Expand Down Expand Up @@ -713,10 +713,8 @@ func (mem *CListMempool) Update(
if err != nil {
mem.logger.Error("error in proxyAppConn.BeginRecheckTxSync", "err", err)
}

mem.logger.Info("recheck txs", "numtxs", mem.Size(), "height", block.Height)
mem.logger.Debug("recheck txs", "numtxs", mem.Size(), "height", block.Height)
mem.recheckTxs()

_, err = mem.proxyAppConn.EndRecheckTxSync(abci.RequestEndRecheckTx{Height: block.Height})
if err != nil {
mem.logger.Error("error in proxyAppConn.EndRecheckTxSync", "err", err)
Expand All @@ -726,10 +724,6 @@ func (mem *CListMempool) Update(

recheckTimeMs := float64(recheckEndTime-recheckStartTime) / 1000000
mem.metrics.RecheckTime.Set(recheckTimeMs)

// At this point, mem.txs are being rechecked.
// mem.recheckCursor re-scans mem.txs and possibly removes some txs.
// Before mem.Reap(), we should wait for mem.recheckCursor to be nil.
}

// notify there're some txs left.
Expand Down
2 changes: 1 addition & 1 deletion rpc/jsonrpc/server/http_json_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han
args = append(args, fnArgs...)
}
returns := rpcFunc.f.Call(args)
logger.Info("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns)
logger.Debug("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns)
result, err := unreflectResult(returns)
if err != nil {
responses = append(responses, types.RPCInternalError(request.ID, err))
Expand Down

0 comments on commit 10e1f57

Please sign in to comment.