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

fix(verifier): return evm compiler version actually used for successful verification #1092

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
},
"expected_runtime_match_type": "full",
"expected_runtime_transformations": [],
"expected_runtime_values": {}
"expected_runtime_values": {},

"expected_evm_compiler_version": "v0.8.28+commit.acc7d8f9"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
},
"expected_runtime_match_type": "full",
"expected_runtime_transformations": [],
"expected_runtime_values": {}
"expected_runtime_values": {},

"expected_evm_compiler_version": "v0.8.17+commit.6c091780"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub struct StandardJson {
pub expected_runtime_match_type: Option<String>,
pub expected_runtime_transformations: Option<Value>,
pub expected_runtime_values: Option<Value>,
pub expected_evm_compiler_version: Option<String>,
}

impl TestCase for StandardJson {
Expand Down Expand Up @@ -87,9 +88,13 @@ impl TestCase for StandardJson {
success.evm_compiler.as_ref().unwrap().compiler,
"invalid evm-compiler"
);
let expected_evm_compiler_version = self
.expected_evm_compiler_version
.as_ref()
.unwrap_or(&self.evm_compiler_version);
assert_eq!(
self.evm_compiler_version,
success.evm_compiler.as_ref().unwrap().version,
expected_evm_compiler_version,
&success.evm_compiler.as_ref().unwrap().version,
"invalid evm-compiler version"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ pub async fn verify(

let mut successes = vec![];
let mut failures = vec![];
let mut used_version = evm_compilers.head.version.clone();
for evm_compiler in evm_compilers {
used_version = evm_compiler.version.clone();
let (zk_compiler_path, evm_compiler_path) = compilers
.fetch_compilers(&zk_compiler, &evm_compiler)
.await?;
Expand Down Expand Up @@ -136,7 +138,7 @@ pub async fn verify(
zk_compiler: "zksolc".to_string(),
zk_compiler_version,
evm_compiler: "solc".to_string(),
evm_compiler_version,
evm_compiler_version: used_version,
language: Language::Solidity,
compiler_settings: serde_json::to_value(compiler_input.settings)
.context("compiler settings serialization")?,
Expand Down
Loading