50
50
snapshotCommitTimer = metrics .GetOrRegisterTimer ("chain/snapshot/commits" , nil )
51
51
52
52
blockInsertTimer = metrics .GetOrRegisterTimer ("chain/inserts" , nil )
53
- blockValidationTimer = metrics .GetOrRegisterTimer ("chain/validation" , nil )
54
53
blockExecutionTimer = metrics .GetOrRegisterTimer ("chain/execution" , nil )
55
54
blockWriteTimer = metrics .GetOrRegisterTimer ("chain/write" , nil )
56
-
57
- _ = metrics .GetOrRegisterMeter ("chain/reorg/executes" , nil )
58
- _ = metrics .GetOrRegisterMeter ("chain/reorg/add" , nil )
59
- _ = metrics .GetOrRegisterMeter ("chain/reorg/drop" , nil )
60
- _ = metrics .GetOrRegisterMeter ("chain/reorg/invalidTx" , nil )
61
55
)
62
56
63
57
type ExtendedTxPosition struct {
@@ -256,7 +250,7 @@ func consensusCallbackBeginBlockFn(
256
250
}
257
251
258
252
evmProcessor := blockProc .EVMModule .Start (blockCtx , statedb , evmStateReader , onNewLogAll , es .Rules , es .Rules .EvmChainConfig (store .GetUpgradeHeights ()))
259
- substart := time .Now ()
253
+ executionStart := time .Now ()
260
254
261
255
// Execute pre-internal transactions
262
256
preInternalTxs := blockProc .PreTxTransactor .PopInternalTxs (blockCtx , bs , es , sealing , statedb )
@@ -399,14 +393,13 @@ func consensusCallbackBeginBlockFn(
399
393
storageUpdateTimer .Update (statedb .StorageUpdates )
400
394
snapshotAccountReadTimer .Update (statedb .SnapshotAccountReads )
401
395
snapshotStorageReadTimer .Update (statedb .SnapshotStorageReads )
402
- triehash := statedb .AccountHashes + statedb .StorageHashes // save to not double count in validation
403
- trieproc := statedb .SnapshotAccountReads + statedb .AccountReads + statedb .AccountUpdates
404
- trieproc += statedb .SnapshotStorageReads + statedb .StorageReads + statedb .StorageUpdates
405
- blockExecutionTimer .Update (time .Since (substart ) - trieproc - triehash )
406
- // Update the metrics touched during block validation
407
396
accountHashTimer .Update (statedb .AccountHashes )
408
397
storageHashTimer .Update (statedb .StorageHashes )
409
- blockValidationTimer .Update (time .Since (substart ) - (statedb .AccountHashes + statedb .StorageHashes - triehash ))
398
+ triehash := statedb .AccountHashes + statedb .StorageHashes
399
+ trieproc := statedb .SnapshotAccountReads + statedb .AccountReads + statedb .AccountUpdates
400
+ trieproc += statedb .SnapshotStorageReads + statedb .StorageReads + statedb .StorageUpdates
401
+ blockExecutionTimer .Update (time .Since (executionStart ) - trieproc - triehash )
402
+
410
403
// Update the metrics touched by new block
411
404
headBlockGauge .Update (int64 (blockCtx .Idx ))
412
405
headHeaderGauge .Update (int64 (blockCtx .Idx ))
@@ -424,12 +417,14 @@ func consensusCallbackBeginBlockFn(
424
417
feed .newLogs .Send (logs )
425
418
}
426
419
420
+ commitStart := time .Now ()
427
421
store .commitEVM (false )
422
+
428
423
// Update the metrics touched during block commit
429
424
accountCommitTimer .Update (statedb .AccountCommits )
430
425
storageCommitTimer .Update (statedb .StorageCommits )
431
426
snapshotCommitTimer .Update (statedb .SnapshotCommits )
432
- blockWriteTimer .Update (time .Since (substart ) - statedb .AccountCommits - statedb .StorageCommits - statedb .SnapshotCommits )
427
+ blockWriteTimer .Update (time .Since (commitStart ) - statedb .AccountCommits - statedb .StorageCommits - statedb .SnapshotCommits )
433
428
blockInsertTimer .UpdateSince (start )
434
429
435
430
now := time .Now ()
0 commit comments