@@ -43,8 +43,8 @@ impl EvmExecutor<'_> {
43
43
44
44
/// Handle a block.
45
45
pub fn handle_block < T : Block > ( & mut self , l2_trace : & T ) -> Result < ( ) , VerificationError > {
46
- measure_duration_histogram ! (
47
- handle_block_duration_microseconds ,
46
+ measure_duration_millis ! (
47
+ handle_block_duration_milliseconds ,
48
48
self . handle_block_inner( l2_trace)
49
49
) ?;
50
50
@@ -139,13 +139,15 @@ impl EvmExecutor<'_> {
139
139
140
140
dev_trace ! ( "handler cfg: {:?}" , revm. handler. cfg) ;
141
141
142
- let _result =
142
+ let _result = measure_duration_millis ! (
143
+ transact_commit_duration_milliseconds,
143
144
cycle_track!( revm. transact_commit( ) , "transact_commit" ) . map_err( |e| {
144
145
VerificationError :: EvmExecution {
145
146
tx_hash: * tx. tx_hash( ) ,
146
147
source: e,
147
148
}
148
- } ) ?;
149
+ } ) ?
150
+ ) ;
149
151
150
152
dev_trace ! ( "{_result:#?}" ) ;
151
153
}
@@ -159,8 +161,8 @@ impl EvmExecutor<'_> {
159
161
160
162
/// Commit pending changes in cache db to zktrie
161
163
pub fn commit_changes ( & mut self , zktrie_db : & Rc < ZkMemoryDb > ) -> B256 {
162
- measure_duration_histogram ! (
163
- commit_changes_duration_microseconds ,
164
+ measure_duration_millis ! (
165
+ commit_changes_duration_milliseconds ,
164
166
cycle_track!( self . commit_changes_inner( zktrie_db) , "commit_changes" )
165
167
)
166
168
}
@@ -203,26 +205,35 @@ impl EvmExecutor<'_> {
203
205
. expect ( "unable to get storage trie" ) ;
204
206
for ( key, value) in db_acc. storage . iter ( ) {
205
207
if !value. is_zero ( ) {
206
- cycle_track ! (
207
- storage_trie
208
- . update_store( & key. to_be_bytes:: <32 >( ) , & value. to_be_bytes( ) )
209
- . expect( "failed to update storage" ) ,
210
- "Zktrie::update_store"
208
+ measure_duration_micros ! (
209
+ zktrie_update_duration_microseconds,
210
+ cycle_track!(
211
+ storage_trie
212
+ . update_store( & key. to_be_bytes:: <32 >( ) , & value. to_be_bytes( ) )
213
+ . expect( "failed to update storage" ) ,
214
+ "Zktrie::update_store"
215
+ )
211
216
) ;
212
217
} else {
213
- cycle_track ! (
214
- storage_trie. delete( & key. to_be_bytes:: <32 >( ) ) ,
215
- "Zktrie::delete"
218
+ measure_duration_micros ! (
219
+ zktrie_delete_duration_microseconds,
220
+ cycle_track!(
221
+ storage_trie. delete( & key. to_be_bytes:: <32 >( ) ) ,
222
+ "Zktrie::delete"
223
+ )
216
224
) ;
217
225
}
218
226
219
227
#[ cfg( feature = "debug-storage" ) ]
220
228
debug_recorder. record_storage ( * addr, * key, * value) ;
221
229
}
222
230
223
- if storage_trie. is_trie_dirty ( ) {
224
- storage_trie. prepare_root ( ) ;
225
- }
231
+ measure_duration_micros ! (
232
+ zktrie_commit_duration_microseconds,
233
+ if storage_trie. is_trie_dirty( ) {
234
+ storage_trie. prepare_root( ) ;
235
+ }
236
+ ) ;
226
237
227
238
cycle_tracker_end ! ( "update storage_tire" ) ;
228
239
storage_root = storage_trie. root ( ) . into ( ) ;
@@ -268,19 +279,25 @@ impl EvmExecutor<'_> {
268
279
code_hash. 0 ,
269
280
poseidon_code_hash. 0 ,
270
281
] ;
271
- cycle_track ! (
272
- zktrie
273
- . update_account( addr. as_slice( ) , & acc_data)
274
- . expect( "failed to update account" ) ,
275
- "Zktrie::update_account"
282
+ measure_duration_micros ! (
283
+ zktrie_update_duration_microseconds,
284
+ cycle_track!(
285
+ zktrie
286
+ . update_account( addr. as_slice( ) , & acc_data)
287
+ . expect( "failed to update account" ) ,
288
+ "Zktrie::update_account"
289
+ )
276
290
) ;
277
291
278
292
cycle_tracker_end ! ( "commit account {}" , addr) ;
279
293
}
280
294
281
- if zktrie. is_trie_dirty ( ) {
282
- zktrie. prepare_root ( ) ;
283
- }
295
+ measure_duration_micros ! (
296
+ zktrie_commit_duration_microseconds,
297
+ if zktrie. is_trie_dirty( ) {
298
+ zktrie. prepare_root( ) ;
299
+ }
300
+ ) ;
284
301
285
302
let root_after = zktrie. root ( ) ;
286
303
0 commit comments