-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Problems
Currently, if the circuit size is too large, it will suffer from errors in different aspects. These circuits can often be processed correctly using CLI, but cannot be set up properly with noir-rs.
Details
Known issues of the SRS setup for large circuits:
get_circuit_sizesthrows afatal runtime error: Rust cannot catch foreign exceptions, aborting. This indicates that a foreign exception (likely from C/C++ code) cannot be caught by Rust, resulting in program termination.- this error can be reproduced using a circuit size of 2^26+1
noir-rs/bb/src/barretenberg_api/acir.rs
Lines 48 to 63 in 234fefb
pub unsafe fn get_circuit_sizes(constraint_system_buf: &[u8], recursive: bool) -> CircuitSizes { let mut total = 0; let mut subgroup = 0; let honk_recursion = true; bindgen::acir_get_circuit_sizes( constraint_system_buf.to_buffer().as_slice().as_ptr(), &recursive, &honk_recursion, &mut total, &mut subgroup, ); CircuitSizes { total: total.to_be(), subgroup: subgroup.to_be(), } }
- this error can be reproduced using a circuit size of 2^26+1
download_g1_dataoccasionally encounters timeout errors when handling large circuit sizes- this error can be reliably reproduced using circuit sizes exceeding 2^23
- these functions are used in
get_srs()
noir-rs/noir/src/backends/barretenberg/srs/netsrs.rs
Lines 29 to 47 in 234fefb
fn download_g1_data(num_points: u32) -> Vec<u8> { let g1_end: u32 = num_points * 64 - 1; let mut headers = HeaderMap::new(); headers.insert( RANGE, format!("bytes={}-{}", 0, g1_end).parse().unwrap(), ); let response = Client::new() .get( "https://crs.aztec.network/g1.dat", ) .headers(headers) .send() .unwrap(); response.bytes().unwrap().to_vec() }
Acceptance Requirements
- Identify the root cause and implement proper handling of unsafe C/C++ code calls
- Determine the appropriate APIs for g1 data download or relax the timeout constraints for https://crs.aztec.network/g1.dat
- Support setup, proving, and verification operations for circuits larger than 2^26
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Backlog