Skip to content

Commit

Permalink
chore: improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jan 15, 2024
1 parent 894fa67 commit eeeb52c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,18 +723,18 @@ func (cs *State) handleTimeout(
ti timeoutInfo,
stateData *StateData,
) {
cs.logger.Trace("received tock", "timeout", ti.Duration, "height", ti.Height, "round", ti.Round, "step", ti.Step)

// timeouts must be for current height, round, step
if ti.Height != stateData.Height || ti.Round < stateData.Round || (ti.Round == stateData.Round && ti.Step < stateData.Step) {
cs.logger.Debug("ignoring tock because we are ahead",
"height", stateData.Height,
"round", stateData.Round,
"step", stateData.Step.String(),
cs.logger.Trace("ignoring tock because we are ahead",
"timeout", ti.Duration, "tock_height", ti.Height, "tock_round", ti.Round, "tock_step", ti.Step,
"height", stateData.Height, "round", stateData.Round, "step", stateData.Step.String(),
)
return
}

cs.logger.Trace("received tock", "timeout", ti.Duration, "height", ti.Height, "round", ti.Round, "step", ti.Step)

// the timeout will now cause a state transition
cs.mtx.Lock()
defer cs.mtx.Unlock()
Expand Down

0 comments on commit eeeb52c

Please sign in to comment.