Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: update to ACVM 0.13.0 #1393

Merged
merged 33 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4f139ee
chore!: Update to ACVM 0.12.0
phated May 11, 2023
133e261
feat: adapted to heterogeneous bb calls
sirasistant May 10, 2023
57d1cbf
chore: update cargo tomls
sirasistant May 10, 2023
9375d3b
test: re enabled sort test
sirasistant May 10, 2023
2132c0a
fix: improve variable resolution
sirasistant May 10, 2023
d22be54
feat: use dummy constructor for bb call
sirasistant May 11, 2023
b71f690
updates for latest
phated May 15, 2023
e1f5b61
feat!: Move WitnessMap type into ACVM to avoid leaking BTreeMap type
phated May 1, 2023
fc9df35
Merge branch 'master' into phated/acvm-0.12.0
TomAFrench May 18, 2023
140587b
feat(nargo): Consume CommonReferenceString functions & manage caching…
phated May 22, 2023
3316fb9
Merge branch 'master' into phated/acvm-0.12.0
TomAFrench May 22, 2023
56a237d
switch to published acvm and backend
phated May 22, 2023
6a2330c
fix compilation issue
phated May 22, 2023
8ca4ec6
chore: Remove usage of `acvm::default_is_opcode_supported` (#1366)
vezenovm May 23, 2023
60ba165
add issue numbers to TODOs
phated May 23, 2023
29c6f66
chore: update to ACVM 0.13.0
TomAFrench May 24, 2023
d62cb23
chore: fix broken import
TomAFrench May 24, 2023
c8c91d7
chore: bump commit
TomAFrench May 24, 2023
b46bf1d
merge conflcits with master
vezenovm May 31, 2023
e0ecfb1
chore: Update Acvm 0.13.0 branch (#1465)
vezenovm Jun 1, 2023
fabc8b3
Update Cargo.toml
kevaundray Jun 1, 2023
e3aa026
Update Cargo.toml
kevaundray Jun 1, 2023
a2defce
update flake.lock
kevaundray Jun 1, 2023
9ed1068
feat!: var message size for keccak in stdlib (#1481)
guipublic Jun 1, 2023
6fa8e73
chore: update pedersen test case for domain separator (#1482)
guipublic Jun 1, 2023
cf50120
chore: add pedersen hash with domain separator in stdlib (#1483)
guipublic Jun 1, 2023
afd58af
update to acvm 0.13.0 and new acvm-backend-bberg
vezenovm Jun 1, 2023
f50d246
update cargo lock
vezenovm Jun 1, 2023
fa26a5b
update MockBackend in sort test
vezenovm Jun 1, 2023
944eba3
update merkle_insert and simple_shield for updated pedersen in bberg
vezenovm Jun 1, 2023
8b756d0
try ubuntu-large
kevaundray Jun 1, 2023
2e6d0fa
remove patch and update to acvm-backend-bberg 0.3.0
vezenovm Jun 1, 2023
4f7b1f4
cargo.lock
vezenovm Jun 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
946 changes: 537 additions & 409 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ toml = "0.7.2"
url = "2.2.0"
wasm-bindgen = { version = "0.2.83", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.33"

[patch.crates-io]
acvm = { git = "https://github.com/noir-lang/acvm", rev = "3c6740af75125afc8ebb4379f781f8274015e2e2" }
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
acvm-backend-barretenberg = { git = "https://github.com/noir-lang/acvm-backend-barretenberg", rev = "69cd578d0368c454010c7caf8fd4a00e69263e4a" }
kevaundray marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion crates/nargo/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use acvm::OpcodeResolutionError;
use acvm::pwg::OpcodeResolutionError;
use thiserror::Error;

#[derive(Debug, Error)]
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ mod tests {
let mut driver = Driver::new(
&acvm::Language::R1CS,
#[allow(deprecated)]
Box::new(acvm::default_is_opcode_supported(acvm::Language::R1CS)),
Box::new(acvm::pwg::default_is_opcode_supported(acvm::Language::R1CS)),
);
driver.create_local_crate(&root_file, CrateType::Binary);
crate::resolver::add_std_lib(&mut driver);
Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,6 @@ impl Driver {
impl Default for Driver {
fn default() -> Self {
#[allow(deprecated)]
Self::new(&Language::R1CS, Box::new(acvm::default_is_opcode_supported(Language::R1CS)))
Self::new(&Language::R1CS, Box::new(acvm::pwg::default_is_opcode_supported(Language::R1CS)))
}
}
2 changes: 1 addition & 1 deletion crates/noirc_driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
let mut driver = Driver::new(
&Language::R1CS,
#[allow(deprecated)]
Box::new(acvm::default_is_opcode_supported(Language::R1CS)),
Box::new(acvm::pwg::default_is_opcode_supported(Language::R1CS)),
);

// Add local crate to dep graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ pub(crate) fn evaluate(
}
BlackBoxFunc::SchnorrVerify
| BlackBoxFunc::EcdsaSecp256k1
| BlackBoxFunc::ComputeMerkleRoot
| BlackBoxFunc::HashToField128Security => {
prepare_outputs(&mut acir_gen.memory, instruction_id, 1, ctx, evaluator)
}
Expand Down Expand Up @@ -133,12 +132,6 @@ pub(crate) fn evaluate(
hashed_message: resolve_array(&args[3], acir_gen, ctx, evaluator),
output: outputs[0],
},
BlackBoxFunc::ComputeMerkleRoot => BlackBoxFuncCall::ComputeMerkleRoot {
leaf: resolve_variable(&args[0], acir_gen, ctx, evaluator).unwrap(),
index: resolve_variable(&args[1], acir_gen, ctx, evaluator).unwrap(),
hash_path: resolve_array(&args[2], acir_gen, ctx, evaluator),
output: outputs[0],
},
BlackBoxFunc::HashToField128Security => BlackBoxFuncCall::HashToField128Security {
inputs: resolve_array(&args[0], acir_gen, ctx, evaluator),
output: outputs[0],
Expand Down
85 changes: 5 additions & 80 deletions crates/noirc_evaluator/src/ssa/acir_gen/operations/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ fn permutation_layer(
mod test {
use acvm::{
acir::{circuit::opcodes::FunctionInput, native_types::Witness, native_types::WitnessMap},
pwg::{block::Blocks, solve, OpcodeResolution, PartialWitnessGeneratorStatus},
FieldElement, OpcodeResolutionError, PartialWitnessGenerator,
pwg::{
block::Blocks, solve, OpcodeResolution, OpcodeResolutionError,
PartialWitnessGeneratorStatus,
},
FieldElement, PartialWitnessGenerator,
};

use crate::{
Expand All @@ -135,57 +138,6 @@ mod test {
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn and(
&self,
_initial_witness: &mut WitnessMap,
_lhs: &FunctionInput,
_rhs: &FunctionInput,
_output: &Witness,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn xor(
&self,
_initial_witness: &mut WitnessMap,
_lhs: &FunctionInput,
_rhs: &FunctionInput,
_output: &Witness,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn range(
&self,
_initial_witness: &mut WitnessMap,
_input: &FunctionInput,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn sha256(
&self,
_initial_witness: &mut WitnessMap,
_inputs: &[FunctionInput],
_outputs: &[Witness],
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn blake2s(
&self,
_initial_witness: &mut WitnessMap,
_inputs: &[FunctionInput],
_outputs: &[Witness],
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn compute_merkle_root(
&self,
_initial_witness: &mut WitnessMap,
_leaf: &FunctionInput,
_index: &FunctionInput,
_hash_path: &[FunctionInput],
_output: &Witness,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn schnorr_verify(
&self,
_initial_witness: &mut WitnessMap,
Expand All @@ -205,25 +157,6 @@ mod test {
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn hash_to_field_128_security(
&self,
_initial_witness: &mut WitnessMap,
_inputs: &[FunctionInput],
_output: &Witness,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn ecdsa_secp256k1(
&self,
_initial_witness: &mut WitnessMap,
_public_key_x: &[FunctionInput],
_public_key_y: &[FunctionInput],
_signature: &[FunctionInput],
_message: &[FunctionInput],
_output: &Witness,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn fixed_base_scalar_mul(
&self,
_initial_witness: &mut WitnessMap,
Expand All @@ -232,14 +165,6 @@ mod test {
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
fn keccak256(
&self,
_initial_witness: &mut WitnessMap,
_inputs: &[FunctionInput],
_outputs: &[Witness],
) -> Result<OpcodeResolution, OpcodeResolutionError> {
panic!("Path not trodden by this test")
}
}

// Check that a random network constrains its output to be a permutation of any random input
Expand Down
8 changes: 2 additions & 6 deletions crates/noirc_evaluator/src/ssa/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ impl Opcode {
| BlackBoxFunc::FixedBaseScalarMul => BigUint::zero(),
// Verify returns zero or one
BlackBoxFunc::SchnorrVerify | BlackBoxFunc::EcdsaSecp256k1 => BigUint::one(),
BlackBoxFunc::ComputeMerkleRoot | BlackBoxFunc::HashToField128Security => {
ObjectType::native_field().max_size()
}
BlackBoxFunc::HashToField128Security => ObjectType::native_field().max_size(),
BlackBoxFunc::AES => {
todo!("ICE: AES is unimplemented")
}
Expand All @@ -106,9 +104,7 @@ impl Opcode {
BlackBoxFunc::SHA256 | BlackBoxFunc::Blake2s | BlackBoxFunc::Keccak256 => {
(32, ObjectType::unsigned_integer(8))
}
BlackBoxFunc::ComputeMerkleRoot | BlackBoxFunc::HashToField128Security => {
(1, ObjectType::native_field())
}
BlackBoxFunc::HashToField128Security => (1, ObjectType::native_field()),
// See issue #775 on changing this to return a boolean
BlackBoxFunc::SchnorrVerify | BlackBoxFunc::EcdsaSecp256k1 => {
(1, ObjectType::native_field())
Expand Down
2 changes: 1 addition & 1 deletion crates/wasm/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn compile(args: JsValue) -> JsValue {
let mut driver = noirc_driver::Driver::new(
&language,
#[allow(deprecated)]
Box::new(acvm::default_is_opcode_supported(language.clone())),
Box::new(acvm::pwg::default_is_opcode_supported(language.clone())),
);

let path = PathBuf::from(&options.entry_point);
Expand Down
2 changes: 1 addition & 1 deletion noir_stdlib/src/merkle.nr
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ fn compute_merkle_root(leaf: Field, index: Field, hash_path: [Field]) -> Field {
current = crate::hash::pedersen([hash_left, hash_right])[0];
};
current
}
}