Skip to content

fix(l2): remove fork as parameter in get_state_transitions function #2723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/l2/prover/bench/src/rpc/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ impl RpcDB {

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

let index: Vec<(Address, Vec<H256>)> = self
.cache
Expand Down
3 changes: 1 addition & 2 deletions crates/l2/prover/zkvm/interface/pico/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ pub fn main() {
let mut acc_account_updates: HashMap<Address, AccountUpdate> = HashMap::new();

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

// Execute block
let mut vm = Evm::from_execution_db(db.clone());
let result = vm.execute_block(&block).expect("failed to execute block");
let receipts = result.receipts;
let account_updates = vm.get_state_transitions(fork)?;
let account_updates = vm.get_state_transitions()?;

// Update db for the next block
db.apply_account_updates(&account_updates);
Expand Down
3 changes: 1 addition & 2 deletions crates/l2/prover/zkvm/interface/risc0/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ fn main() {
let mut cumulative_gas_used = 0;

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

Expand All @@ -48,7 +47,7 @@ fn main() {
let result = vm.execute_block(&block).expect("failed to execute block");
let receipts = result.receipts;
let account_updates = vm
.get_state_transitions(fork)
.get_state_transitions()
.expect("failed to get state transitions");

cumulative_gas_used += receipts
Expand Down
1 change: 0 additions & 1 deletion crates/l2/prover/zkvm/interface/sp1/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ pub fn main() {
let mut cumulative_gas_used = 0;

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

Expand Down
Loading