Skip to content

Commit

Permalink
fix: test zksolc interface changes after unification (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 authored Oct 31, 2024
1 parent 5c4da35 commit 1939677
Show file tree
Hide file tree
Showing 25 changed files with 271 additions and 252 deletions.
143 changes: 75 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LLVM.lock
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
url = "https://github.com/matter-labs/era-compiler-llvm"
branch = "main"
branch = "kpv-eravm-fix-linker-duplicating-symbols"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ When testing is done, these tags should be removed.
- [0.4.10; latest] for compiling Solidity via EVM assembly
- [0.3.3, 0.3.9] for compiling Vyper via LLL IR

### Compiler pipelines
### Compiler codegens

Currently only relevant for the Solidity compiler, where you can choose the IR:

Expand Down
5 changes: 3 additions & 2 deletions compiler_tester/src/compilers/eravm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Compiler for EraVMCompiler {
&self,
_test_path: String,
sources: Vec<(String, String)>,
_libraries: BTreeMap<String, BTreeMap<String, String>>,
_libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
_mode: &Mode,
llvm_options: Vec<String>,
debug_config: Option<era_compiler_llvm_context::DebugConfig>,
Expand All @@ -54,6 +54,7 @@ impl Compiler for EraVMCompiler {
let build = project.compile_to_eravm(
&mut vec![],
true,
BTreeMap::new(),
era_compiler_common::HashType::Ipfs,
era_compiler_llvm_context::OptimizerSettings::none(),
llvm_options,
Expand All @@ -75,7 +76,7 @@ impl Compiler for EraVMCompiler {
&self,
_test_path: String,
_sources: Vec<(String, String)>,
_libraries: BTreeMap<String, BTreeMap<String, String>>,
_libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
_mode: &Mode,
_test_params: Option<&solidity_adapter::Params>,
_llvm_options: Vec<String>,
Expand Down
10 changes: 7 additions & 3 deletions compiler_tester/src/compilers/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
pub mod mode;

use std::collections::BTreeMap;
use std::collections::HashMap;

use era_compiler_solidity::CollectableError;
Expand Down Expand Up @@ -40,7 +39,7 @@ impl Compiler for LLVMCompiler {
&self,
_test_path: String,
sources: Vec<(String, String)>,
_libraries: BTreeMap<String, BTreeMap<String, String>>,
libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
mode: &Mode,
llvm_options: Vec<String>,
debug_config: Option<era_compiler_llvm_context::DebugConfig>,
Expand All @@ -53,6 +52,8 @@ impl Compiler for LLVMCompiler {
.0
.clone();

let linker_symbols = libraries.as_linker_symbols()?;

let project = era_compiler_solidity::Project::try_from_llvm_ir_sources(
sources
.into_iter()
Expand All @@ -63,12 +64,14 @@ impl Compiler for LLVMCompiler {
)
})
.collect(),
libraries,
None,
)?;

let build = project.compile_to_eravm(
&mut vec![],
true,
linker_symbols,
era_compiler_common::HashType::Ipfs,
mode.llvm_optimizer_settings.to_owned(),
llvm_options,
Expand All @@ -90,7 +93,7 @@ impl Compiler for LLVMCompiler {
&self,
_test_path: String,
sources: Vec<(String, String)>,
_libraries: BTreeMap<String, BTreeMap<String, String>>,
_libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
mode: &Mode,
_test_params: Option<&solidity_adapter::Params>,
llvm_options: Vec<String>,
Expand All @@ -114,6 +117,7 @@ impl Compiler for LLVMCompiler {
)
})
.collect(),
era_compiler_solidity::SolcStandardJsonInputSettingsLibraries::default(),
None,
)?;

Expand Down
6 changes: 2 additions & 4 deletions compiler_tester/src/compilers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ pub mod solidity;
pub mod vyper;
pub mod yul;

use std::collections::BTreeMap;

use crate::vm::eravm::input::Input as EraVMInput;
use crate::vm::evm::input::Input as EVMInput;

Expand All @@ -28,7 +26,7 @@ pub trait Compiler: Send + Sync + 'static {
&self,
test_path: String,
sources: Vec<(String, String)>,
libraries: BTreeMap<String, BTreeMap<String, String>>,
libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
mode: &Mode,
llvm_options: Vec<String>,
debug_config: Option<era_compiler_llvm_context::DebugConfig>,
Expand All @@ -41,7 +39,7 @@ pub trait Compiler: Send + Sync + 'static {
&self,
test_path: String,
sources: Vec<(String, String)>,
libraries: BTreeMap<String, BTreeMap<String, String>>,
libraries: era_compiler_solidity::SolcStandardJsonInputSettingsLibraries,
mode: &Mode,
test_params: Option<&solidity_adapter::Params>,
llvm_options: Vec<String>,
Expand Down
6 changes: 3 additions & 3 deletions compiler_tester/src/compilers/solidity/cache_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct CacheKey {
/// The Solidity compiler version.
pub version: semver::Version,
/// The Solidity compiler output type.
pub pipeline: era_compiler_solidity::SolcPipeline,
pub codegen: era_compiler_solidity::SolcStandardJsonInputSettingsCodegen,
/// Whether to enable the EVMLA codegen via Yul IR.
pub via_ir: bool,
/// Whether to run the Solidity compiler optimizer.
Expand All @@ -26,14 +26,14 @@ impl CacheKey {
pub fn new(
test_path: String,
version: semver::Version,
pipeline: era_compiler_solidity::SolcPipeline,
codegen: era_compiler_solidity::SolcStandardJsonInputSettingsCodegen,
via_ir: bool,
optimize: bool,
) -> Self {
Self {
test_path,
version,
pipeline,
codegen,
via_ir,
optimize,
}
Expand Down
Loading

0 comments on commit 1939677

Please sign in to comment.