Skip to content

Commit

Permalink
vochain: reduce log output
Browse files Browse the repository at this point in the history
Signed-off-by: p4u <[email protected]>
  • Loading branch information
p4u committed Nov 8, 2023
1 parent be52465 commit b676010
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions vochain/cometbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ func (app *BaseApplication) FinalizeBlock(_ context.Context,
Info: tx.Info,
}
}
log.Debugw("finalize block", "height", height,
"txs", len(req.Txs), "hash", hex.EncodeToString(root),
"blockSeconds", time.Since(req.GetTime()).Seconds(),
"elapsedSeconds", time.Since(start).Seconds(),
"proposer", hex.EncodeToString(req.GetProposerAddress()))
if len(req.Txs) > 0 {
log.Debugw("finalize block", "height", height,
"txs", len(req.Txs), "hash", hex.EncodeToString(root),
"blockSeconds", time.Since(req.GetTime()).Seconds(),
"elapsedSeconds", time.Since(start).Seconds(),
"proposer", hex.EncodeToString(req.GetProposerAddress()))
}

// update validator score as an IST action for the next block. Note that at this point,
// we cannot modify the state or we would break ProcessProposal optimistic execution
Expand Down Expand Up @@ -303,11 +305,10 @@ func (app *BaseApplication) Commit(_ context.Context, _ *abcitypes.RequestCommit
app.prepareProposalLock.Lock()
defer app.prepareProposalLock.Unlock()
// save state and get hash
h, err := app.CommitState()
_, err := app.CommitState()
if err != nil {
return nil, err
}
log.Debugw("commit block", "height", app.Height(), "hash", hex.EncodeToString(h))
return &abcitypes.ResponseCommit{
RetainHeight: 0, // When snapshot sync enabled, we can start to remove old blocks
}, nil
Expand Down

0 comments on commit b676010

Please sign in to comment.