mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
core: nil-guard balTransitionStats in reportBALMetrics
Mirrors the nil-check already used in buildSlowBlockLog. The previous unguarded access was safe today only because parallel_state_processor short-circuits on error before the metrics path is reached, but the API contract was fragile — a future caller could reach reportBALMetrics without an established balTransitionStats and panic.
This commit is contained in:
parent
6b1ea9a498
commit
6951ad7c50
1 changed files with 7 additions and 5 deletions
|
|
@ -328,11 +328,13 @@ func (s *ExecuteStats) reportBALMetrics() {
|
|||
accountCommitTimer.Update(s.AccountCommits) // Account commits are complete, we can mark them
|
||||
storageCommitTimer.Update(s.StorageCommits) // Storage commits are complete, we can mark them
|
||||
|
||||
stateTriePrefetchTimer.Update(s.balTransitionStats.StatePrefetch)
|
||||
accountTriesUpdateTimer.Update(s.balTransitionStats.AccountUpdate)
|
||||
stateTrieUpdateTimer.Update(s.balTransitionStats.StateUpdate)
|
||||
stateTrieHashTimer.Update(s.balTransitionStats.StateHash)
|
||||
stateRootComputeTimer.Update(s.balTransitionStats.AccountUpdate + s.balTransitionStats.StateUpdate + s.balTransitionStats.StateHash)
|
||||
if m := s.balTransitionStats; m != nil {
|
||||
stateTriePrefetchTimer.Update(m.StatePrefetch)
|
||||
accountTriesUpdateTimer.Update(m.AccountUpdate)
|
||||
stateTrieUpdateTimer.Update(m.StateUpdate)
|
||||
stateTrieHashTimer.Update(m.StateHash)
|
||||
stateRootComputeTimer.Update(m.AccountUpdate + m.StateUpdate + m.StateHash)
|
||||
}
|
||||
|
||||
//blockExecutionTimer.Update(s.Execution) // The time spent on EVM processing
|
||||
// ^basically impossible to get this metric with parallel execution
|
||||
|
|
|
|||
Loading…
Reference in a new issue