-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hacky integration of new ACVM solver
- Loading branch information
1 parent
0543a30
commit 8579f35
Showing
3 changed files
with
18 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
use acvm::pwg::{solve, Blocks, PartialWitnessGeneratorStatus}; | ||
use acvm::pwg::{PartialWitnessGeneratorStatus, ACVM}; | ||
use acvm::PartialWitnessGenerator; | ||
use acvm::{acir::circuit::Circuit, acir::native_types::WitnessMap}; | ||
|
||
use crate::NargoError; | ||
|
||
pub fn execute_circuit( | ||
backend: &impl PartialWitnessGenerator, | ||
pub fn execute_circuit<B: PartialWitnessGenerator + Default>( | ||
_backend: &B, | ||
circuit: Circuit, | ||
mut initial_witness: WitnessMap, | ||
initial_witness: WitnessMap, | ||
) -> Result<WitnessMap, NargoError> { | ||
let mut blocks = Blocks::default(); | ||
let solver_status = solve(backend, &mut initial_witness, &mut blocks, circuit.opcodes)?; | ||
let mut acvm = ACVM::new(B::default(), circuit.opcodes, initial_witness); | ||
let solver_status = acvm.solve()?; | ||
if matches!(solver_status, PartialWitnessGeneratorStatus::RequiresOracleData { .. }) { | ||
todo!("Add oracle support to nargo execute") | ||
} | ||
|
||
Ok(initial_witness) | ||
Ok(acvm.finalize()) | ||
} |