Skip to content

Commit d48b627

Browse files
JereSalofmoletta
authored andcommitted
fix(l2): remove fork as parameter in get_state_transitions function (#2723)
In [this PR](a5da369) we forgot to remove fork from some places in which get_state_transitions was being used. We should try to find a way to fix rust-analyzer so that it detects those cases but I don't know how hard it is.
1 parent 9fa75a5 commit d48b627

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

crates/l2/prover/bench/src/rpc/db.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ impl RpcDB {
245245

246246
// pre-execute and get all state changes
247247
let result = LEVM::execute_block(block, &mut db).map_err(Box::new)?;
248-
let execution_updates =
249-
LEVM::get_state_transitions(&mut db, Fork::default()).map_err(Box::new)?;
248+
let execution_updates = LEVM::get_state_transitions(&mut db).map_err(Box::new)?;
250249

251250
let index: Vec<(Address, Vec<H256>)> = self
252251
.cache

crates/l2/prover/zkvm/interface/pico/src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ pub fn main() {
4040
let mut acc_account_updates: HashMap<Address, AccountUpdate> = HashMap::new();
4141

4242
for block in blocks {
43-
let fork = db.chain_config.fork(block.header.timestamp);
4443
// Validate the block
4544
validate_block(&block, &parent_header, &db.chain_config).expect("invalid block");
4645

4746
// Execute block
4847
let mut vm = Evm::from_execution_db(db.clone());
4948
let result = vm.execute_block(&block).expect("failed to execute block");
5049
let receipts = result.receipts;
51-
let account_updates = vm.get_state_transitions(fork)?;
50+
let account_updates = vm.get_state_transitions()?;
5251

5352
// Update db for the next block
5453
db.apply_account_updates(&account_updates);

crates/l2/prover/zkvm/interface/risc0/src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ fn main() {
3939
let mut cumulative_gas_used = 0;
4040

4141
for block in blocks {
42-
let fork = db.chain_config.fork(block.header.timestamp);
4342
// Validate the block
4443
validate_block(&block, &parent_header, &db.chain_config).expect("invalid block");
4544

@@ -48,7 +47,7 @@ fn main() {
4847
let result = vm.execute_block(&block).expect("failed to execute block");
4948
let receipts = result.receipts;
5049
let account_updates = vm
51-
.get_state_transitions(fork)
50+
.get_state_transitions()
5251
.expect("failed to get state transitions");
5352

5453
cumulative_gas_used += receipts

crates/l2/prover/zkvm/interface/sp1/src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pub fn main() {
4040
let mut cumulative_gas_used = 0;
4141

4242
for block in blocks {
43-
let fork = db.chain_config.fork(block.header.timestamp);
4443
// Validate the block
4544
validate_block(&block, &parent_header, &db.chain_config).expect("invalid block");
4645

0 commit comments

Comments
 (0)