Skip to content

Commit

Permalink
Merge branch 'master' into better-cli-types
Browse files Browse the repository at this point in the history
* master:
  chore: remove usage of `Backend` trait (#2514)
  chore: delete `ProveAndVerifyCommand` (#2520)
  chore: Remove dead code from `acvm_backend_barretenberg` (#2512)
  chore: only install `tokio-util` dependency on windows (#2425)
  • Loading branch information
TomAFrench committed Sep 1, 2023
2 parents 868f8d8 + f1d09ca commit a144dbb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 87 deletions.
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/bb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
mod contract;
mod gates;
mod prove;
mod prove_and_verify;
mod verify;
mod write_vk;

Expand Down
67 changes: 0 additions & 67 deletions crates/acvm_backend_barretenberg/src/bb/prove_and_verify.rs

This file was deleted.

15 changes: 0 additions & 15 deletions crates/acvm_backend_barretenberg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
#![warn(unused_crate_dependencies, unused_extern_crates)]
#![warn(unreachable_pub)]

// `acvm-backend-barretenberg` can either interact with the Barretenberg backend through a static library
// or through an embedded wasm binary. It does not make sense to include both of these backends at the same time.
// We then throw a compilation error if both flags are set.
#[cfg(all(feature = "native", feature = "wasm"))]
compile_error!("feature \"native\" and feature \"wasm\" cannot be enabled at the same time");

#[cfg(all(feature = "native", target_arch = "wasm32"))]
compile_error!("feature \"native\" cannot be enabled for a \"wasm32\" target");

#[cfg(all(feature = "wasm", target_arch = "wasm32"))]
compile_error!("feature \"wasm\" cannot be enabled for a \"wasm32\" target");

mod bb;
mod proof_system;
mod smart_contract;

/// The number of bytes necessary to store a `FieldElement`.
const FIELD_BYTES: usize = 32;

#[derive(Debug, Default)]
pub struct Backend {}

Expand Down
4 changes: 2 additions & 2 deletions crates/acvm_backend_barretenberg/src/proof_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use acvm::Language;
use tempfile::tempdir;

use crate::bb::{GatesCommand, ProveCommand, VerifyCommand, WriteVkCommand};
use crate::{Backend, BackendError, FIELD_BYTES};
use crate::{Backend, BackendError};

impl Backend {
pub fn np_language(&self) -> Language {
Expand Down Expand Up @@ -191,7 +191,7 @@ pub(super) fn read_bytes_from_file(path: &Path) -> std::io::Result<Vec<u8>> {
fn remove_public_inputs(num_pub_inputs: usize, proof: &[u8]) -> Vec<u8> {
// Barretenberg prepends the public inputs onto the proof so we need to remove
// the first `num_pub_inputs` field elements.
let num_bytes_to_remove = num_pub_inputs * FIELD_BYTES;
let num_bytes_to_remove = num_pub_inputs * (FieldElement::max_num_bytes() as usize);
proof[num_bytes_to_remove..].to_vec()
}

Expand Down
4 changes: 3 additions & 1 deletion crates/nargo_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ hex = "0.4.2"
termcolor = "1.1.2"
color-eyre = "0.6.2"
tokio = { version = "1.0", features = ["io-std"] }
tokio-util = { version = "0.7.8", features = ["compat"] }

# Backends
acvm-backend-barretenberg = { path = "../acvm_backend_barretenberg" }

[target.'cfg(not(unix))'.dependencies]
tokio-util = { version = "0.7.8", features = ["compat"] }

[dev-dependencies]
tempdir = "0.3.7"
assert_cmd = "2.0.8"
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![forbid(unsafe_code)]
#![warn(unused_extern_crates)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

//! Nargo is the package manager for Noir
//! This name was used because it sounds like `cargo` and
Expand Down

0 comments on commit a144dbb

Please sign in to comment.