Skip to content

Commit

Permalink
feat: hacky integration of new ACVM solver
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 16, 2023
1 parent 0543a30 commit 8579f35
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
18 changes: 6 additions & 12 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ toml = "0.7.2"
tower = "0.4"
url = "2.2.0"
wasm-bindgen = { version = "0.2.83", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.33"
wasm-bindgen-test = "0.3.33"

[patch.crates-io]
acvm = { git = "https://github.com/noir-lang/acvm", rev = "6ed14c7a080dacd953bc4f36d3a03975b7c347f9" }
acvm-backend-barretenberg = { git = "https://github.com/noir-lang/acvm-backend-barretenberg", rev = "e8482990fbb3637863723560851181d48e779fac" }
14 changes: 7 additions & 7 deletions crates/nargo/src/ops/execute.rs
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())
}

0 comments on commit 8579f35

Please sign in to comment.