Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
ERE_TAG: 0.0.11-8fe61ca
ERE_TAG: 0.0.12-f32de5f

jobs:
witness-generator:
Expand Down
57 changes: 31 additions & 26 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ zkevm-metrics = { path = "crates/metrics" }
benchmark-runner = { path = "crates/benchmark-runner" }
guest-libs = { path = "ere-guests/libs" }

zkvm-interface = { git = "https://github.com/eth-applied-research-group/ere", rev = "8fe61cad5b9cf67be4ce4cf91786d4ddd7c783f1", package = "zkvm-interface" }
ere-dockerized = { git = "https://github.com/eth-applied-research-group/ere", rev = "8fe61cad5b9cf67be4ce4cf91786d4ddd7c783f1", package = "ere-dockerized" }
zkvm-interface = { git = "https://github.com/eth-applied-research-group/ere", rev = "f32de5f647176d5b01475a2de69542c8490ed646", package = "zkvm-interface" }
ere-dockerized = { git = "https://github.com/eth-applied-research-group/ere", rev = "f32de5f647176d5b01475a2de69542c8490ed646", package = "ere-dockerized" }

# branch is kw/zkevm-benchmark-workload-repo
# NOTE: We are using a branch of a branch that has not yet been merged into master.
Expand Down Expand Up @@ -154,6 +154,7 @@ walkdir = "2.3.3"
rayon = "1.7"
hex = "0.4.3"
thiserror = "2"
sha2 = "0.10.9"
serde_json = "*"
serde_derive = "*"
serde_with = "3"
Expand Down
2 changes: 2 additions & 0 deletions crates/benchmark-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ ethrex-trie.workspace = true
rayon.workspace = true
tracing.workspace = true
walkdir.workspace = true
sha2.workspace = true
serde.workspace = true
serde_json.workspace = true
rkyv.workspace = true
bincode.workspace = true
bytes.workspace = true
strum.workspace = true
anyhow = "*"
Expand Down
60 changes: 37 additions & 23 deletions crates/benchmark-runner/src/stateless_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use rayon::iter::{IntoParallelIterator, ParallelIterator};
use reth_stateless::StatelessInput;
use rkyv::rancor::Error;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
use strum::{AsRefStr, EnumString};
use walkdir::WalkDir;
use witness_generator::BlockAndWitness;
Expand Down Expand Up @@ -103,37 +104,50 @@ pub struct ProgramOutputVerifier {

impl OutputVerifier for ProgramOutputVerifier {
fn check_serialized(&self, zkvm: ErezkVM, bytes: &[u8]) -> Result<bool> {
let (block_hash, parent_hash, success) = match zkvm {
match zkvm {
ErezkVM::SP1 | ErezkVM::Risc0 => {
let mut bytes: &[u8] = bytes;
let block_hash: [u8; 32] = zkvm.deserialize_from(&mut bytes)?;
let parent_hash: [u8; 32] = zkvm.deserialize_from(&mut bytes)?;
let success: bool = zkvm.deserialize_from(&mut bytes)?;
(block_hash, parent_hash, success)

if block_hash != self.block_hash {
anyhow::bail!(
"Block hash mismatch: expected {:?}, got {:?}",
self.block_hash,
block_hash
);
}
if parent_hash != self.parent_hash {
anyhow::bail!(
"Parent hash mismatch: expected {:?}, got {:?}",
self.parent_hash,
parent_hash
);
}
if success != self.success {
anyhow::bail!(
"Success mismatch: expected {:?}, got {:?}",
self.success,
success
);
}
}
ErezkVM::OpenVM => {
let public_inputs = (self.block_hash, self.parent_hash, self.success);
let public_inputs_hash =
Sha256::digest(bincode::serialize(&public_inputs).unwrap());

if public_inputs_hash.as_slice() != bytes {
anyhow::bail!(
"Public inputs hash mismatch: expected {:?}, got {:?}",
public_inputs_hash,
bytes
);
}
}
_ => unimplemented!(),
};
if block_hash != self.block_hash {
anyhow::bail!(
"Block hash mismatch: expected {:?}, got {:?}",
self.block_hash,
block_hash
);
}
if parent_hash != self.parent_hash {
anyhow::bail!(
"Parent hash mismatch: expected {:?}, got {:?}",
self.parent_hash,
parent_hash
);
}
if success != self.success {
anyhow::bail!(
"Success mismatch: expected {:?}, got {:?}",
self.success,
success
);
}

Ok(true)
}
Expand Down
Loading
Loading