diff --git a/.gitignore b/.gitignore index c684360b..b79c463a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ # The debug, trace, benchmark artifacts /debug/ /trace/ +/**/*.json +/**/*.txt # The dependency locks # /Cargo.lock diff --git a/.gitmodules b/.gitmodules index ecd25dfb..ecd35e88 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ [submodule "era-contracts"] path = era-contracts url = https://github.com/matter-labs/era-contracts - branch = sb-1-5-0-evm-eq-integration + branch = evm-equivalence-yul diff --git a/benchmark_analyzer/src/benchmark/mod.rs b/benchmark_analyzer/src/benchmark/mod.rs index c5d7967c..a3eed1ab 100644 --- a/benchmark_analyzer/src/benchmark/mod.rs +++ b/benchmark_analyzer/src/benchmark/mod.rs @@ -30,7 +30,7 @@ impl Benchmark { pub const EVM_INTERPRETER_GROUP_PREFIX: &'static str = "EVMInterpreter M3B3"; /// The EVM opcodes to test. - pub const EVM_OPCODES: [&'static str; 58] = [ + pub const EVM_OPCODES: [&'static str; 119] = [ "ADD", "MUL", "SUB", @@ -84,11 +84,72 @@ impl Benchmark { "MSIZE", "GAS", "JUMPDEST", + "PUSH0", "PUSH1", + "PUSH2", + "PUSH4", + "PUSH5", + "PUSH6", + "PUSH7", + "PUSH8", + "PUSH9", + "PUSH10", + "PUSH11", + "PUSH12", + "PUSH13", + "PUSH14", + "PUSH15", + "PUSH16", + "PUSH17", + "PUSH18", + "PUSH19", + "PUSH20", + "PUSH21", + "PUSH22", + "PUSH23", + "PUSH24", + "PUSH25", + "PUSH26", + "PUSH27", + "PUSH28", + "PUSH29", + "PUSH30", + "PUSH31", + "PUSH32", + "DUP1", + "DUP2", + "DUP3", + "DUP4", + "DUP5", + "DUP6", + "DUP7", + "DUP8", + "DUP9", + "DUP10", + "DUP11", + "DUP12", + "DUP13", + "DUP14", + "DUP15", + "DUP16", + "SWAP1", + "SWAP2", + "SWAP3", + "SWAP4", + "SWAP5", + "SWAP6", + "SWAP7", + "SWAP8", + "SWAP9", + "SWAP10", + "SWAP11", + "SWAP12", + "SWAP13", + "SWAP14", + "SWAP15", + "SWAP16", "RETURN", "REVERT", - "INVALID", - "SELFDESTRUCT", ]; /// diff --git a/compiler_tester/src/vm/eravm/system_contracts.rs b/compiler_tester/src/vm/eravm/system_contracts.rs index 17847cf5..0e00d25a 100644 --- a/compiler_tester/src/vm/eravm/system_contracts.rs +++ b/compiler_tester/src/vm/eravm/system_contracts.rs @@ -43,7 +43,7 @@ impl SystemContracts { /// The EVM interpreter system contract implementation path. const PATH_EVM_INTERPRETER: &'static str = - "era-contracts/system-contracts/contracts/EvmInterpreter.sol:EvmInterpreter"; + "era-contracts/system-contracts/contracts/EvmInterpreterPreprocessed.yul"; /// The `keccak256` system contract implementation path. const PATH_KECCAK256: &'static str = @@ -252,10 +252,10 @@ impl SystemContracts { ]; let mut yul_file_paths = Vec::with_capacity(yul_system_contracts.len() + 1); - for (_, path) in yul_system_contracts.iter() { - let file_path = path.split(':').next().expect("Always valid"); - yul_file_paths.push(file_path.to_owned()); + for (_, path) in yul_system_contracts.into_iter() { + yul_file_paths.push(path.to_owned()); } + yul_file_paths.push(Self::PATH_EVM_INTERPRETER.to_owned()); let yul_optimizer_settings = era_compiler_llvm_context::OptimizerSettings::evm_interpreter(); let yul_mode = YulMode::new(yul_optimizer_settings, true).into(); @@ -263,10 +263,6 @@ impl SystemContracts { Self::compile(YulCompiler, &yul_mode, yul_file_paths, debug_config.clone())?; let mut solidity_file_paths = Vec::with_capacity(solidity_system_contracts.len() + 1); - for (_, path) in solidity_system_contracts.iter() { - let file_path = path.split(':').next().expect("Always valid"); - solidity_file_paths.push(file_path.to_owned()); - } for pattern in [ "era-contracts/system-contracts/**/*.sol", "tests/solidity/complex/interpreter/*.sol", @@ -298,6 +294,13 @@ impl SystemContracts { debug_config, )?); + let default_aa = builds.remove(Self::PATH_DEFAULT_AA).ok_or_else(|| { + anyhow::anyhow!("The default AA code not found in the compiler build artifacts") + })?; + let evm_interpreter = builds.remove(Self::PATH_EVM_INTERPRETER).ok_or_else(|| { + anyhow::anyhow!("The EVM interpreter code not found in the compiler build artifacts") + })?; + let mut system_contracts = Vec::with_capacity(solidity_system_contracts.len() + yul_system_contracts.len()); system_contracts.extend(solidity_system_contracts); @@ -311,13 +314,6 @@ impl SystemContracts { deployed_contracts.push((address, build)); } - let default_aa = builds.remove(Self::PATH_DEFAULT_AA).ok_or_else(|| { - anyhow::anyhow!("The default AA code not found in the compiler build artifacts") - })?; - let evm_interpreter = builds.remove(Self::PATH_EVM_INTERPRETER).ok_or_else(|| { - anyhow::anyhow!("The EVM interpreter code not found in the compiler build artifacts") - })?; - println!( " {} building system contracts in {}.{:03}s", "Finished".bright_green().bold(), diff --git a/era-contracts b/era-contracts index a961d57c..2b3e3fb8 160000 --- a/era-contracts +++ b/era-contracts @@ -1 +1 @@ -Subproject commit a961d57cb9f782b3b844c282df669024daa28a68 +Subproject commit 2b3e3fb80ead04b7c69073b28e731e44e83f4bfa diff --git a/system-contracts-stable-build b/system-contracts-stable-build index efaedc08..9e1dd433 100644 Binary files a/system-contracts-stable-build and b/system-contracts-stable-build differ