Skip to content

Commit

Permalink
refine block elapsed time details (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongqiuwood committed Sep 28, 2021
1 parent aa56303 commit 93829d4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ func (blockExec *BlockExecutor) ApplyBlock(
blockExec.metrics.lastBlockTime = now
}()

trc.pin("validateBlock")
trc.pin("abci")
if err := blockExec.ValidateBlock(state, block); err != nil {
return state, 0, ErrInvalidBlock(err)
}

trc.pin("abci")
startTime := time.Now().UnixNano()
abciResponses, err := execBlockOnProxyApp(blockExec.logger, blockExec.proxyApp, block, blockExec.db)
if err != nil {
Expand All @@ -165,8 +164,6 @@ func (blockExec *BlockExecutor) ApplyBlock(
blockExec.metrics.BlockProcessingTime.Observe(float64(endTime-startTime) / 1e6)
blockExec.metrics.AbciTime.Set(float64(endTime-startTime) / 1e6)

trc.pin("validate")

// validate the validator updates and convert to tendermint types
abciValUpdates := abciResponses.EndBlock.ValidatorUpdates
err = validateValidatorUpdates(abciValUpdates, state.ConsensusParams.Validator)
Expand All @@ -181,8 +178,6 @@ func (blockExec *BlockExecutor) ApplyBlock(
blockExec.logger.Info("Updates to validators", "updates", types.ValidatorListString(validatorUpdates))
}

trc.pin("updateState")

// Update the state with the block and responses.
state, err = updateState(state, blockID, &block.Header, abciResponses, validatorUpdates)
if err != nil {
Expand All @@ -200,8 +195,6 @@ func (blockExec *BlockExecutor) ApplyBlock(
return state, 0, fmt.Errorf("commit failed for application: %v", err)
}

trc.pin("evpool")

// Update evpool with the block and state.
blockExec.evpool.Update(block, state)

Expand Down

0 comments on commit 93829d4

Please sign in to comment.