Skip to content

Commit ea0edba

Browse files
committed
Simplify state root calculation by removing unnecessary ExecutionOutcome wrapper
1 parent 8d8422f commit ea0edba

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

crates/metering/src/meter.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use reth_evm::execute::BlockBuilder;
77
use reth_evm::ConfigureEvm;
88
use reth_optimism_chainspec::OpChainSpec;
99
use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
10-
use reth_optimism_primitives::OpPrimitives;
11-
use reth_provider::ExecutionOutcome;
1210
use std::sync::Arc;
1311
use std::time::Instant;
1412

@@ -123,18 +121,10 @@ where
123121
}
124122

125123
// Calculate state root and measure its calculation time
126-
let block_number = header.number() + 1;
127124
let bundle = db.take_bundle();
128-
let execution_outcome: ExecutionOutcome<OpPrimitives> = ExecutionOutcome::new(
129-
bundle,
130-
Vec::new().into(),
131-
block_number,
132-
Vec::new(),
133-
);
134-
135125
let state_provider = db.database.as_ref();
136126
let state_root_start = Instant::now();
137-
let hashed_state = state_provider.hashed_post_state(execution_outcome.state());
127+
let hashed_state = state_provider.hashed_post_state(&bundle);
138128
let _ = state_provider.state_root_with_updates(hashed_state);
139129
let state_root_time = state_root_start.elapsed().as_micros();
140130

0 commit comments

Comments
 (0)