@@ -54,11 +54,12 @@ func NewStateProcessor(config *params.ChainConfig, chain *HeaderChain) *StatePro
54
54
}
55
55
56
56
type ProcessResultWithMetrics struct {
57
- ProcessResult * ProcessResult
58
- PreProcessTime time.Duration
59
- PostProcessTime time.Duration
60
- RootCalcTime time.Duration
61
- ExecTime time.Duration
57
+ ProcessResult * ProcessResult
58
+ PreProcessTime time.Duration
59
+ PreProcessLoadTime time.Duration
60
+ PostProcessTime time.Duration
61
+ RootCalcTime time.Duration
62
+ ExecTime time.Duration
62
63
63
64
StateDiffCalcTime time.Duration // time it took to convert BAL into a set of state diffs
64
65
TxStateDiffPrepTime time.Duration // time it took to convert state diffs into prestate statedbs for each tx
@@ -181,12 +182,13 @@ func (p *StateProcessor) ProcessWithAccessList(block *types.Block, statedb *stat
181
182
rootCalcErrCh := make (chan error ) // used for communicating if the state root calculation doesn't match the reported root
182
183
pStart := time .Now ()
183
184
var (
184
- tPreprocess time.Duration // time to create a set of prestates for parallel transaction execution
185
- tVerifyStart time.Time
186
- tVerify time.Duration // time to compute and verify the state root
187
- tExecStart time.Time
188
- tExec time.Duration // time to execute block transactions
189
- tPostprocess time.Duration // time to perform post-transaction execution system calls and withdrawals.
185
+ tPreprocess time.Duration // time to create a set of prestates for parallel transaction execution
186
+ tVerifyStart time.Time
187
+ tVerify time.Duration // time to compute and verify the state root
188
+ tExecStart time.Time
189
+ tExec time.Duration // time to execute block transactions
190
+ tPostprocess time.Duration // time to perform post-transaction execution system calls and withdrawals.
191
+ tPreprocessLoad time.Duration
190
192
)
191
193
192
194
// called by resultHandler when all transactions have successfully executed.
@@ -315,11 +317,12 @@ func (p *StateProcessor) ProcessWithAccessList(block *types.Block, statedb *stat
315
317
resCh <- & ProcessResultWithMetrics {ProcessResult : & ProcessResult {Error : err }}
316
318
} else {
317
319
resCh <- & ProcessResultWithMetrics {
318
- ProcessResult : execResults ,
319
- PreProcessTime : tPreprocess ,
320
- PostProcessTime : tPostprocess ,
321
- ExecTime : tExec ,
322
- RootCalcTime : tVerify ,
320
+ ProcessResult : execResults ,
321
+ PreProcessTime : tPreprocess ,
322
+ PreProcessLoadTime : tPreprocessLoad ,
323
+ PostProcessTime : tPostprocess ,
324
+ ExecTime : tExec ,
325
+ RootCalcTime : tVerify ,
323
326
}
324
327
}
325
328
}
@@ -422,7 +425,9 @@ func (p *StateProcessor) ProcessWithAccessList(block *types.Block, statedb *stat
422
425
}
423
426
424
427
// instantiate a set of StateDBs to be used for executing each transaction in parallel
428
+ tPreprocessLoadStart := time .Now ()
425
429
statedb .InstantiateWithStateDiffs (& totalDiff )
430
+ tPreprocessLoad = time .Since (tPreprocessLoadStart )
426
431
var txPrestates []* state.StateDB
427
432
for range block .Transactions () {
428
433
state := statedb .Copy ()
0 commit comments