Skip to content
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

refactor(l2): use levm for sp1 prover using a trait #2250

Merged
merged 25 commits into from
Mar 26, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix cargo.lock
tomip01 committed Mar 18, 2025

Verified

This commit was signed with the committer’s verified signature.
tomip01 Tomás Paradelo
commit 083f684a9b08b28af1665a56d1c2c47196b0506f
12 changes: 0 additions & 12 deletions crates/l2/prover/zkvm/interface/sp1/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions crates/l2/prover/zkvm/interface/sp1/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#![no_main]

use ethrex_blockchain::{validate_block, validate_gas_used};
use ethrex_vm::{backends::revm::db::EvmState, backends::revm::REVM};
// use ethrex_vm::{backends::revm::db::EvmState, backends::revm::REVM};
use ethrex_vm::backends::levm::LEVM;
use zkvm_interface::{
io::{ProgramInput, ProgramOutput},
trie::{update_tries, verify_db},
@@ -15,10 +16,11 @@ pub fn main() {
parent_block_header,
db,
} = sp1_zkvm::io::read::<ProgramInput>();
let mut state = EvmState::from(db.clone());
let chain_config = state
.chain_config()
.expect("Failed to get chain config from state");
// let mut state = EvmState::from(db.clone());
// let chain_config = state
// .chain_config()
// .expect("Failed to get chain config from state");
let chain_config = db.get_chain_config();

// Validate the block
validate_block(&block, &parent_block_header, &chain_config).expect("invalid block");
@@ -37,7 +39,8 @@ pub fn main() {
panic!("invalid database")
};

let result = REVM::execute_block(&block, &mut state).expect("failed to execute block");
// let result = REVM::execute_block(&block, &mut state).expect("failed to execute block");
let result = LEVM::execute_block(&block, db).expect("failed to execute block");
let receipts = result.receipts;
let account_updates = result.account_updates;
validate_gas_used(&receipts, &block.header).expect("invalid gas used");