Skip to content

Commit

Permalink
Merge branch 'main' into vv-optional-evm-emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Jan 2, 2025
2 parents e4389de + 8d2673a commit 45de85f
Show file tree
Hide file tree
Showing 8 changed files with 403 additions and 191 deletions.
556 changes: 380 additions & 176 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion compiler_tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ solidity-adapter = { path = "../solidity_adapter" }
benchmark-analyzer = { path = "../benchmark_analyzer" }

[dependencies.web3]
version = "=0.19.0"
git = "https://github.com/jacques-kigo/rust-web3"
branch = "master"
default-features = false
features = ["http-rustls-tls", "test", "signing"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
//!
//! Output format for benchmark data.
//!
///
/// Output format for benchmark data.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
///
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub enum BenchmarkFormat {
#[default]
/// JSON format.
Json,
/// CSV format.
Csv,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
use std::path::PathBuf;

use benchmark_format::BenchmarkFormat;
use clap::Parser;

pub mod benchmark_format;

///
/// The compiler tester arguments.
///
Expand Down Expand Up @@ -44,8 +41,8 @@ pub struct Arguments {
pub benchmark: Option<PathBuf>,

/// The benchmark output format.
#[structopt(long = "benchmark-format", default_value_t = BenchmarkFormat::Json)]
pub benchmark_format: BenchmarkFormat,
#[structopt(long = "benchmark-format", default_value_t = compiler_tester::BenchmarkFormat::Json)]
pub benchmark_format: compiler_tester::BenchmarkFormat,

/// Sets the number of threads, which execute the tests concurrently.
#[structopt(short, long)]
Expand Down
9 changes: 4 additions & 5 deletions compiler_tester/src/compiler_tester/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Instant;

use arguments::benchmark_format::BenchmarkFormat;
use clap::Parser;
use colored::Colorize;

Expand Down Expand Up @@ -224,10 +223,10 @@ fn main_inner(arguments: Arguments) -> anyhow::Result<()> {
if let Some(path) = arguments.benchmark {
let benchmark = summary.benchmark(toolchain)?;
match arguments.benchmark_format {
BenchmarkFormat::Json => {
compiler_tester::BenchmarkFormat::Json => {
benchmark.write_to_file(path, benchmark_analyzer::JsonSerializer)?
}
BenchmarkFormat::Csv => {
compiler_tester::BenchmarkFormat::Csv => {
benchmark.write_to_file(path, benchmark_analyzer::CsvSerializer)?
}
}
Expand All @@ -244,7 +243,7 @@ fn main_inner(arguments: Arguments) -> anyhow::Result<()> {
mod tests {
use std::path::PathBuf;

use crate::arguments::{benchmark_format::BenchmarkFormat, Arguments};
use crate::arguments::Arguments;

#[test]
fn test_manually() {
Expand All @@ -258,7 +257,7 @@ mod tests {
path: vec!["tests/solidity/simple/default.sol".to_owned()],
group: vec![],
benchmark: None,
benchmark_format: BenchmarkFormat::Json,
benchmark_format: compiler_tester::BenchmarkFormat::Json,
threads: Some(1),
dump_system: false,
disable_deployer: false,
Expand Down
4 changes: 2 additions & 2 deletions compiler_tester/src/compilers/vyper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ impl VyperCompiler {
&mode.vyper_version,
paths,
&[
era_compiler_vyper::VyperSelection::IRJson,
era_compiler_vyper::VyperSelection::EraVMAssembly,
era_compiler_vyper::VyperSelector::IRJson,
era_compiler_vyper::VyperSelector::EraVMAssembly,
],
evm_version,
true,
Expand Down
2 changes: 2 additions & 0 deletions compiler_tester/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)]

pub(crate) mod benchmark_format;
pub(crate) mod compilers;
pub(crate) mod directories;
pub(crate) mod environment;
Expand All @@ -26,6 +27,7 @@ use itertools::Itertools;
use rayon::iter::IntoParallelIterator;
use rayon::iter::ParallelIterator;

pub use crate::benchmark_format::BenchmarkFormat;
pub use crate::compilers::eravm::EraVMCompiler;
pub use crate::compilers::llvm::LLVMCompiler;
pub use crate::compilers::mode::llvm_options::LLVMOptions;
Expand Down
3 changes: 2 additions & 1 deletion solidity_adapter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ md5 = "=0.7.0"
era-compiler-common = { git = "https://github.com/matter-labs/era-compiler-common", branch = "main" }

[dependencies.web3]
version = "=0.19.0"
git = "https://github.com/jacques-kigo/rust-web3"
branch = "master"
default-features = false
features = ["http-rustls-tls", "test", "signing"]

0 comments on commit 45de85f

Please sign in to comment.