Skip to content

Commit

Permalink
Reduce noisy tendermint logs (#163)
Browse files Browse the repository at this point in the history
* Reduce noisy tendermint logs

* Suppress logs for all entering
  • Loading branch information
yzang2019 authored Oct 12, 2023
1 parent cc6c850 commit 962ce07
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ func (cs *State) enterPrevote(ctx context.Context, height int64, round int32, en
logger := cs.logger.With("height", height, "round", round)

if cs.roundState.Height() != height || round < cs.roundState.Round() || (cs.roundState.Round() == round && cstypes.RoundStepPrevote <= cs.roundState.Step()) {
logger.Info(
logger.Debug(
"entering prevote step with invalid args",
"current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()),
"time", time.Now().UnixMilli(),
Expand All @@ -1613,7 +1613,7 @@ func (cs *State) enterPrevote(ctx context.Context, height int64, round int32, en
cs.newStep()
}()

logger.Info("entering prevote step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())
logger.Debug("entering prevote step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())

// Sign and broadcast vote as necessary
cs.doPrevote(ctx, height, round)
Expand Down Expand Up @@ -1804,7 +1804,7 @@ func (cs *State) enterPrevoteWait(height int64, round int32) {
logger := cs.logger.With("height", height, "round", round)

if cs.roundState.Height() != height || round < cs.roundState.Round() || (cs.roundState.Round() == round && cstypes.RoundStepPrevoteWait <= cs.roundState.Step()) {
logger.Info(
logger.Debug(
"entering prevote wait step with invalid args",
"current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()),
"time", time.Now().UnixMilli(),
Expand All @@ -1819,7 +1819,7 @@ func (cs *State) enterPrevoteWait(height int64, round int32) {
))
}

logger.Info("entering prevote wait step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())
logger.Debug("entering prevote wait step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())

defer func() {
// Done enterPrevoteWait:
Expand All @@ -1845,7 +1845,7 @@ func (cs *State) enterPrecommit(ctx context.Context, height int64, round int32,
logger := cs.logger.With("height", height, "round", round)

if cs.roundState.Height() != height || round < cs.roundState.Round() || (cs.roundState.Round() == round && cstypes.RoundStepPrecommit <= cs.roundState.Step()) {
logger.Info(
logger.Debug(
"entering precommit step with invalid args",
"current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()),
"time", time.Now().UnixMilli(),
Expand All @@ -1855,7 +1855,7 @@ func (cs *State) enterPrecommit(ctx context.Context, height int64, round int32,
return
}

logger.Info("entering precommit step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())
logger.Debug("entering precommit step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())

defer func() {
// Done enterPrecommit:
Expand Down Expand Up @@ -1965,7 +1965,7 @@ func (cs *State) enterPrecommitWait(height int64, round int32) {
logger := cs.logger.With("height", height, "round", round)

if cs.roundState.Height() != height || round < cs.roundState.Round() || (cs.roundState.Round() == round && cs.roundState.TriggeredTimeoutPrecommit()) {
logger.Info(
logger.Debug(
"entering precommit wait step with invalid args",
"triggered_timeout", cs.roundState.TriggeredTimeoutPrecommit(),
"current", fmt.Sprintf("%v/%v", cs.roundState.Height(), cs.roundState.Round()),
Expand All @@ -1981,7 +1981,7 @@ func (cs *State) enterPrecommitWait(height int64, round int32) {
))
}

logger.Info("entering precommit wait step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())
logger.Debug("entering precommit wait step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())

defer func() {
// Done enterPrecommitWait:
Expand All @@ -2003,15 +2003,15 @@ func (cs *State) enterCommit(ctx context.Context, height int64, commitRound int3
logger := cs.logger.With("height", height, "commit_round", commitRound)

if cs.roundState.Height() != height || cstypes.RoundStepCommit <= cs.roundState.Step() {
logger.Info(
logger.Debug(
"entering commit step with invalid args",
"current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()),
"time", time.Now().UnixMilli(),
)
return
}

logger.Info("entering commit step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())
logger.Debug("entering commit step", "current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()), "time", time.Now().UnixMilli())

defer func() {
// Done enterCommit:
Expand Down Expand Up @@ -2100,7 +2100,7 @@ func (cs *State) finalizeCommit(ctx context.Context, height int64) {
logger := cs.logger.With("height", height)

if cs.roundState.Height() != height || cs.roundState.Step() != cstypes.RoundStepCommit {
logger.Info(
logger.Debug(
"entering finalize commit step",
"current", fmt.Sprintf("%v/%v/%v", cs.roundState.Height(), cs.roundState.Round(), cs.roundState.Step()),
"time", time.Now().UnixMilli(),
Expand Down

0 comments on commit 962ce07

Please sign in to comment.