Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelis authored Apr 24, 2023
2 parents 8b2995f + 7670cb5 commit 09b11a7
Show file tree
Hide file tree
Showing 84 changed files with 2,986 additions and 1,540 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
# Release notes
## March 15, 2023 circom 2.1.5

#### Extensions
- Definition of signals and components can be done now inside if blocks IF the condition is known at compilation time. If the condition is unknown and depends on the value of signals, then the compiler throws an error.
- Improving the --inspect option. It now detects underconstrained signals and assignments using <-- in which <== could be used.
- Improving the efficiency of the compiler. It does not execute the inspect and constraint generation phase only if there are not the corresponding flags.
- Improving --O1 simplification: removing signals that do not appear in any constraint and avoiding unnecessary constraint normalizations.
- Improving parallel: array assignments of outputs and efficiency by updating numThread while waiting and setting maxThreads to 32.
- Handling better the parser errors and improving error messages to output more information. (parser, type checking and constraint generation errors).
- Showing warnings when errors are found.
- Reducing writing time for output files.
- Updating the documentation.

#### Fixed Bugs
- Fixing a problem with the memory release of the components (in C).
- Fixing a problem with the parallel execution during the witness generation (in C).
- Fixing a bug: functions are executed even if they output signals when they contain logs or asserts.
- Fixing a bug: During the witness generation, the computation of expressions like x**x was buggy (in wasm).

## February 10, 2023 circom 2.1.4

#### Extensions
- Improving the efficiency of the parser regarding the anonnymous components and tuples.
- Improving the substitution process: better compilation times for --O1 and --O2.
- Improving the handling of the underscore substitution.
- Extending the substitution to allow the inheritance of signal tags.
- Removing unused signal when applying --O1. (If a signal does not appear in any constraint, it is removed).

#### Fixed Bugs
- Solving bug in the release of the memory of the components.

## January 16, 2023 circom 2.1.3
#### Extensions
- Improving error messages: invalid access and invalid assignment.
- Avoiding side effects in out of bounds log operations.
- Adding check to detect components that are created but do not receive all their inputs.
- Fixing field size of goldilocks when writing r1cs file.

#### Fixed Bugs
- Fixing a problem with the use of integer division and ===, <== operators. If an integer division is involved in the expression of one of these operators, then we consider the expression as no quadratic.
- Fixing bug in code generation of constraint equalities with arrays


## November 7, 2022 circom 2.1.2

#### Fixed bugs
Expand Down
2 changes: 1 addition & 1 deletion circom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "circom"
version = "2.1.2"
version = "2.1.5"
authors = ["Costa Group UCM","iden3"]
edition = "2018"

Expand Down
117 changes: 61 additions & 56 deletions circom/src/compilation_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,70 +25,75 @@ pub struct CompilerConfig {
}

pub fn compile(config: CompilerConfig) -> Result<(), ()> {
let circuit = compiler_interface::run_compiler(
config.vcp,
Config { debug_output: config.debug_output, produce_input_log: config.produce_input_log, wat_flag: config.wat_flag },
VERSION
)?;

if config.c_flag {
compiler_interface::write_c(&circuit, &config.c_folder, &config.c_run_name, &config.c_file, &config.dat_file)?;
println!(
"{} {} and {}",
Colour::Green.paint("Written successfully:"),
config.c_file,
config.dat_file
);
println!(
"{} {}/{}, {}, {}, {}, {}, {}, {} and {}",
Colour::Green.paint("Written successfully:"),
&config.c_folder,
"main.cpp".to_string(),
"circom.hpp".to_string(),
"calcwit.hpp".to_string(),
"calcwit.cpp".to_string(),
"fr.hpp".to_string(),
"fr.cpp".to_string(),
"fr.asm".to_string(),
"Makefile".to_string()
);
}

match (config.wat_flag, config.wasm_flag) {
(true, true) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wat_file);
let result = wat_to_wasm(&config.wat_file, &config.wasm_file);
match result {
Result::Err(report) => {
Report::print_reports(&[report], &FileLibrary::new());
return Err(());
}
Result::Ok(()) => {
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wasm_file);
}
}
if config.c_flag || config.wat_flag || config.wasm_flag{
let circuit = compiler_interface::run_compiler(
config.vcp,
Config { debug_output: config.debug_output, produce_input_log: config.produce_input_log, wat_flag: config.wat_flag },
VERSION
)?;

if config.c_flag {
compiler_interface::write_c(&circuit, &config.c_folder, &config.c_run_name, &config.c_file, &config.dat_file)?;
println!(
"{} {} and {}",
Colour::Green.paint("Written successfully:"),
config.c_file,
config.dat_file
);
println!(
"{} {}/{}, {}, {}, {}, {}, {}, {} and {}",
Colour::Green.paint("Written successfully:"),
&config.c_folder,
"main.cpp".to_string(),
"circom.hpp".to_string(),
"calcwit.hpp".to_string(),
"calcwit.cpp".to_string(),
"fr.hpp".to_string(),
"fr.cpp".to_string(),
"fr.asm".to_string(),
"Makefile".to_string()
);
}
(false, true) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
let result = wat_to_wasm(&config.wat_file, &config.wasm_file);
std::fs::remove_file(&config.wat_file).unwrap();
match result {
Result::Err(report) => {
Report::print_reports(&[report], &FileLibrary::new());
return Err(());

match (config.wat_flag, config.wasm_flag) {
(true, true) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wat_file);
let result = wat_to_wasm(&config.wat_file, &config.wasm_file);
match result {
Result::Err(report) => {
Report::print_reports(&[report], &FileLibrary::new());
return Err(());
}
Result::Ok(()) => {
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wasm_file);
}
}
Result::Ok(()) => {
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wasm_file);
}
(false, true) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
let result = wat_to_wasm(&config.wat_file, &config.wasm_file);
std::fs::remove_file(&config.wat_file).unwrap();
match result {
Result::Err(report) => {
Report::print_reports(&[report], &FileLibrary::new());
return Err(());
}
Result::Ok(()) => {
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wasm_file);
}
}
}
(true, false) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wat_file);
}
(false, false) => {}
}
(true, false) => {
compiler_interface::write_wasm(&circuit, &config.js_folder, &config.wasm_name, &config.wat_file)?;
println!("{} {}", Colour::Green.paint("Written successfully:"), config.wat_file);
}
(false, false) => {}
}


Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion circom/src/input_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ mod input_processing {
if route.is_file() {
Result::Ok(route)
} else {
Result::Err(eprintln!("{}", Colour::Red.paint("invalid input file")))
let route = if route.to_str().is_some() { ": ".to_owned() + route.to_str().unwrap()} else { "".to_owned() };
Result::Err(eprintln!("{}", Colour::Red.paint("Input file does not exist".to_owned() + &route)))
}
}

Expand Down
2 changes: 1 addition & 1 deletion circom_algebra/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "circom_algebra"
version = "2.1.1"
version = "2.1.4"
authors = ["Costa Group UCM","iden3"]
edition = "2018"

Expand Down
Loading

0 comments on commit 09b11a7

Please sign in to comment.