Skip to content

Commit

Permalink
chore: remarks DK
Browse files Browse the repository at this point in the history
  • Loading branch information
0xThemis authored and dkales committed Nov 22, 2024
1 parent dadf0fa commit 963f15e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"co-circom/co-plonk": "0.4.0",
"co-noir/co-acvm": "0.3.0",
"co-noir/co-builder": "0.1.0",
"co-noir/co-brillig": "0.1.0",
"co-noir/co-brillig": "0.0.1",
"co-noir/co-noir": "0.3.0",
"co-noir/co-ultrahonk": "0.2.0",
"co-noir/ultrahonk": "0.2.0",
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ bytemuck = { version = "1.15", features = ["derive"] }
byteorder = "1.5.0"
bytes = "1.5.0"
clap = { version = "4.4.8", features = ["derive"] }
co-brillig = { version = "0.1.0", path = "co-noir/co-brillig" }
color-eyre = "0.6.3"
criterion = { version = "0.5", features = ["async_tokio"] }
eyre = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion co-noir/co-acvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ acir.workspace = true
acvm.workspace = true
ark-bn254.workspace = true
ark-ff.workspace = true
co-brillig.workspace = true
co-brillig= { version = "0.1.0", path = "../co-brillig" }
eyre.workspace = true
intmap.workspace = true
itertools.workspace = true
Expand Down
12 changes: 7 additions & 5 deletions co-noir/co-brillig/src/brillig_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ where
}

fn run_inner(&mut self, id: &BrilligFunctionId) -> eyre::Result<CoBrilligResult> {
// TODO remove clone
let opcodes = self.unconstrained_functions[id.as_usize()].bytecode.clone();
loop {
let opcodes = std::mem::take(&mut self.unconstrained_functions[id.as_usize()].bytecode);
let result = loop {
let opcode = &opcodes[self.ip];
tracing::debug!("running opcode: {:?}", opcode);
match opcode {
Expand Down Expand Up @@ -139,10 +138,13 @@ where
BrilligOpcode::BlackBox(blackbox_op) => self.handle_blackbox(*blackbox_op)?,
BrilligOpcode::Trap { revert_data: _ } => todo!(),
BrilligOpcode::Stop { return_data } => {
return self.handle_stop(*return_data);
break self.handle_stop(*return_data);
}
}
}
};
// move the opcodes back in
self.unconstrained_functions[id.as_usize()].bytecode = opcodes;
result
}

/// Creates a new instance of the coBrillig-VM from the provided
Expand Down
6 changes: 0 additions & 6 deletions co-noir/co-brillig/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ use brillig::{IntegerBitSize, MemoryAddress};

use crate::mpc::BrilligDriver;

/**
* Copied form https://github.com/noir-lang/noir/blob/68c32b4ffd9b069fe4b119327dbf4018c17ab9d4/acvm-repo/brillig_vm/src/memory.rs
*
* We cannot use the implementation because it is bound to [AcirField]
**/

pub(super) struct Memory<T, F>
where
T: BrilligDriver<F>,
Expand Down

0 comments on commit 963f15e

Please sign in to comment.