core: move slowBlockBAL field docs onto the struct

Field semantics belong on the type so they survive future call sites and
show up in godoc; the per-line comments at the constructor in
buildSlowBlockLog were redundant with the struct definition.
This commit is contained in:
CPerezz 2026-05-01 14:40:07 +02:00
parent aa13b208b1
commit 563cf08147
No known key found for this signature in database
GPG key ID: 62045F34B97177DD

View file

@ -191,16 +191,27 @@ type slowBlockCodeCacheEntry struct {
// optional "bal" field of slowBlockLog. It carries timings that are // optional "bal" field of slowBlockLog. It carries timings that are
// well-defined under parallel execution but don't fit the sequential schema. // well-defined under parallel execution but don't fit the sequential schema.
type slowBlockBAL struct { type slowBlockBAL struct {
ExecWallMs float64 `json:"exec_wall_ms"` // ExecWallMs is wall-clock parallel transaction execution.
PostProcessMs float64 `json:"post_process_ms"` ExecWallMs float64 `json:"exec_wall_ms"`
PrefetchMs float64 `json:"prefetch_ms"` // PostProcessMs is post-tx system contracts (withdrawals, consolidations, finalize).
StatePrefetchMs float64 `json:"state_prefetch_ms"` PostProcessMs float64 `json:"post_process_ms"`
AccountUpdateMs float64 `json:"account_update_ms"` // PrefetchMs is the BAL state prefetcher (alias of state_prefetch_ms).
StateUpdateMs float64 `json:"state_update_ms"` PrefetchMs float64 `json:"prefetch_ms"`
StateHashMs float64 `json:"state_hash_ms"` // StatePrefetchMs is async state-load time during state-root computation.
AccountCommitMs float64 `json:"account_commit_ms"` StatePrefetchMs float64 `json:"state_prefetch_ms"`
StorageCommitMs float64 `json:"storage_commit_ms"` // AccountUpdateMs is the account trie update phase.
TrieDBCommitMs float64 `json:"triedb_commit_ms"` AccountUpdateMs float64 `json:"account_update_ms"`
// StateUpdateMs is the state trie update phase.
StateUpdateMs float64 `json:"state_update_ms"`
// StateHashMs is state-root hash computation.
StateHashMs float64 `json:"state_hash_ms"`
// AccountCommitMs is the account trie commit to disk.
AccountCommitMs float64 `json:"account_commit_ms"`
// StorageCommitMs is the storage trie commit to disk.
StorageCommitMs float64 `json:"storage_commit_ms"`
// TrieDBCommitMs is the trie database commit.
TrieDBCommitMs float64 `json:"triedb_commit_ms"`
// SnapshotCommitMs is the state snapshot commit.
SnapshotCommitMs float64 `json:"snapshot_commit_ms"` SnapshotCommitMs float64 `json:"snapshot_commit_ms"`
} }
@ -270,17 +281,17 @@ func buildSlowBlockLog(s *ExecuteStats, block *types.Block) slowBlockLog {
// Populate the parallel-execution extension only for BAL-processed blocks. // Populate the parallel-execution extension only for BAL-processed blocks.
if m := s.balTransitionStats; m != nil { if m := s.balTransitionStats; m != nil {
logEntry.BAL = &slowBlockBAL{ logEntry.BAL = &slowBlockBAL{
ExecWallMs: durationToMs(s.ExecWall), // wall-clock parallel transaction execution ExecWallMs: durationToMs(s.ExecWall),
PostProcessMs: durationToMs(s.PostProcess), // post-tx system contracts (withdrawals, consolidations, finalize) PostProcessMs: durationToMs(s.PostProcess),
PrefetchMs: durationToMs(s.Prefetch), // BAL state prefetcher (alias of state_prefetch_ms) PrefetchMs: durationToMs(s.Prefetch),
StatePrefetchMs: durationToMs(m.StatePrefetch), // async state-load time during state-root computation StatePrefetchMs: durationToMs(m.StatePrefetch),
AccountUpdateMs: durationToMs(m.AccountUpdate), // account trie update phase AccountUpdateMs: durationToMs(m.AccountUpdate),
StateUpdateMs: durationToMs(m.StateUpdate), // state trie update phase StateUpdateMs: durationToMs(m.StateUpdate),
StateHashMs: durationToMs(m.StateHash), // state-root hash computation StateHashMs: durationToMs(m.StateHash),
AccountCommitMs: durationToMs(m.AccountCommits), // account trie commit to disk AccountCommitMs: durationToMs(m.AccountCommits),
StorageCommitMs: durationToMs(m.StorageCommits), // storage trie commit to disk StorageCommitMs: durationToMs(m.StorageCommits),
TrieDBCommitMs: durationToMs(m.TrieDBCommits), // trie database commit TrieDBCommitMs: durationToMs(m.TrieDBCommits),
SnapshotCommitMs: durationToMs(m.SnapshotCommits), // state snapshot commit SnapshotCommitMs: durationToMs(m.SnapshotCommits),
} }
} }
return logEntry return logEntry