diff --git a/Cargo.toml b/Cargo.toml index 4e19ed0c..6371a68e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,15 +8,15 @@ authors = ["Leo Lara "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [patch.crates-io] -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", rev = "da4983e" } +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", default-features = false, rev = "da4983e" } [patch."https://github.com/scroll-tech/halo2.git"] -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", rev = "da4983e" } +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", default-features = false, rev = "da4983e" } [dependencies] pyo3 = { version = "0.19.1", features = ["extension-module"] } -halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", features = [ "circuit-params", "derive_serde"], rev = "da4983e"} +halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", default-features = false, features = [ "circuit-params", "derive_serde"], rev = "da4983e"} halo2_middleware = { git = "https://github.com/privacy-scaling-explorations/halo2.git", rev = "da4983e" } halo2_backend = { git = "https://github.com/privacy-scaling-explorations/halo2.git", features = ["derive_serde"], rev = "da4983e" } diff --git a/src/plonkish/backend/halo2.rs b/src/plonkish/backend/halo2.rs index 0c5d9d40..e73bccc8 100644 --- a/src/plonkish/backend/halo2.rs +++ b/src/plonkish/backend/halo2.rs @@ -207,14 +207,9 @@ impl + Hash> ChiquitoHalo2 { let halo2_column = meta.fixed_column(column); fixed_columns.insert(column.uuid(), halo2_column); } - Halo2Advice => { - let halo2_column = meta.advice_from_halo2(column); - advice_columns.insert(column.uuid(), halo2_column); - } - Halo2Fixed => { - let halo2_column = meta.fixed_from_halo2(column); - fixed_columns.insert(column.uuid(), halo2_column); - } + Halo2Advice | Halo2Fixed => panic!( + "Use src/plonkish/backend/halo2_legacy.rs to compile a circuit with imported Halo2 columns" + ), }); if !self.plonkish_ir.exposed.is_empty() { @@ -287,34 +282,40 @@ impl ConstraintSystemBuilder { column_type: Any::Fixed, rotation: Rotation(rotation), })), - Halo2Advice | Halo2Fixed => { - unreachable!("Halo2 columns should be converted within Halo2Expr") - } + Halo2Advice | Halo2Fixed => panic!( + "Use src/plonkish/backend/halo2_legacy.rs to compile a circuit with imported Halo2 columns" + ), } } fn convert_advice_column(&self, column: &cColumn) -> ColumnMid { match column.ctype { - cAdvice | Halo2Advice => ColumnMid { + cAdvice => ColumnMid { column_type: Columns::Advice, index: *self .advice_idx_map .get(&column.uuid()) .unwrap_or_else(|| panic!("column not found {}", column.annotation)), }, + Halo2Advice => panic!( + "Use src/plonkish/backend/halo2_legacy.rs to compile a circuit with imported Halo2 columns" + ), _ => panic!("wrong column type"), } } fn convert_fixed_column(&self, column: &cColumn) -> ColumnMid { match column.ctype { - cFixed | Halo2Fixed => ColumnMid { + cFixed => ColumnMid { column_type: Columns::Fixed, index: *self .fixed_idx_map .get(&column.uuid()) .unwrap_or_else(|| panic!("column not found {}", column.annotation)), }, + Halo2Fixed => panic!( + "Use src/plonkish/backend/halo2_legacy.rs to compile a circuit with imported Halo2 columns" + ), _ => panic!("wrong column type"), } } @@ -366,8 +367,11 @@ impl ConstraintSystemBuilder { .enumerate() .for_each(|(row, (column, offset))| { let col_type: Columns = match column.ctype { - cAdvice | Halo2Advice => Columns::Advice, - cFixed | Halo2Fixed => Columns::Fixed, + cAdvice => Columns::Advice, + cFixed => Columns::Fixed, + Halo2Advice | Halo2Fixed => panic!( + "Use src/plonkish/backend/halo2_legacy.rs to compile a circuit with imported Halo2 columns" + ), }; let index = if col_type == Columns::Advice { @@ -428,14 +432,6 @@ impl ConstraintSystemBuilder { self.allocate_advice(index, column) } - fn advice_from_halo2(&mut self, column: &cColumn) -> ColumnMid { - let halo2_column = column - .halo2_advice - .unwrap_or_else(|| panic!("halo2 advice column not found {}", column.annotation)) - .column; - self.allocate_advice(halo2_column.index, column) - } - fn fixed_column(&mut self, column: &cColumn) -> ColumnMid { let index = self.num_fixed_columns; self.allocate_fixed(index, column) @@ -462,14 +458,6 @@ impl ConstraintSystemBuilder { self.num_advice_columns += 1; column_mid } - - fn fixed_from_halo2(&mut self, column: &cColumn) -> ColumnMid { - let halo2_column = column - .halo2_fixed - .unwrap_or_else(|| panic!("halo2 advice column not found {}", column.annotation)) - .column; - self.allocate_fixed(halo2_column.index, column) - } } impl Halo2WitnessGenerator> for ChiquitoHalo2 {