Skip to content

Commit

Permalink
fix(verifier): return evm compiler version actually used for successf…
Browse files Browse the repository at this point in the history
…ul verification
  • Loading branch information
rimrakhimov committed Oct 24, 2024
1 parent 9d1abbf commit 82e5441
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
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

0 comments on commit 82e5441

Please sign in to comment.