diff --git a/zk_prover/src/chips/merkle_sum_tree.rs b/zk_prover/src/chips/merkle_sum_tree.rs index ffca1a4a..10e31187 100644 --- a/zk_prover/src/chips/merkle_sum_tree.rs +++ b/zk_prover/src/chips/merkle_sum_tree.rs @@ -20,7 +20,7 @@ pub struct MerkleSumTreeConfig { /// Chip that performs various constraints related to a Merkle Sum Tree data structure such as: /// /// * `s * swap_bit * (1 - swap_bit) = 0` (if `bool_and_swap_selector` is toggled). It basically enforces that swap_bit is either a 0 or 1. -/// * `s * (swap_bit * 2 * (elelment_r_cur - elelment_l_cur) - (elelment_l_next - elelment_l_cur) - (elelment_r_cur - elelment_r_next)) = 0`. Enforces that if the swap_bit is equal to 1, the values will be swapped on the next row (if `bool_and_swap_selector` is toggled). +/// * `s * (swap_bit * 2 * (element_r_cur - element_l_cur) - (element_l_next - element_l_cur) - (element_r_cur - element_r_next)) = 0`. Enforces that if the swap_bit is equal to 1, the values will be swapped on the next row (if `bool_and_swap_selector` is toggled). /// If the swap_bit is equal to 0, the values will remain the same on the next row (if `bool_and_swap_selector` is toggled). /// * `s * (left_balance + right_balance - computed_sum)`. It constraints the computed sum to be equal to the sum of the left and right balances (if `sum_selector` is toggled). #[derive(Debug, Clone)] diff --git a/zk_prover/src/chips/range/range_check.rs b/zk_prover/src/chips/range/range_check.rs index 2d8bb7b7..ce6c0996 100644 --- a/zk_prover/src/chips/range/range_check.rs +++ b/zk_prover/src/chips/range/range_check.rs @@ -28,7 +28,7 @@ pub struct RangeCheckConfig { lookup_enable_selector: Selector, } -/// Helper chip that verfiies that the value witnessed in a given cell lies within a given range defined by N_BYTES. +/// Helper chip that verifies that the value witnessed in a given cell lies within a given range defined by N_BYTES. /// For example, Let's say we want to constraint 0x1f2f3f4f to be within the range N_BYTES=4. /// /// `z(0) = 0x1f2f3f4f` @@ -47,7 +47,7 @@ pub struct RangeCheckConfig { /// /// The column z contains the witnessed value to be checked at offset 0 /// At offset i, the column z contains the value z(i+1) = (z(i) - k(i)) / 2^8 (shift right by 8 bits) where k(i) is the i-th decomposition big-endian of `value` -/// The contraints that are enforced are: +/// The constraints that are enforced are: /// - z(i) - 2^8⋅z(i+1) ∈ lookup_u8 (enabled by lookup_enable_selector at offset [0, N_BYTES - 1]) /// - z(N_BYTES) == 0 #[derive(Debug, Clone)] diff --git a/zk_prover/src/circuits/utils.rs b/zk_prover/src/circuits/utils.rs index 7971a2e4..80525204 100644 --- a/zk_prover/src/circuits/utils.rs +++ b/zk_prover/src/circuits/utils.rs @@ -225,7 +225,7 @@ fn fix_verifier_sol(yul_code_path: PathBuf) -> Result()?; let transcript_addr = format!("{:#x}", addr_as_num); transcript_addrs.push(addr_as_num); line = line.replace( @@ -238,7 +238,7 @@ fn fix_verifier_sol(yul_code_path: PathBuf) -> Result()?; let transcript_addr = format!("{:#x}", addr_as_num); transcript_addrs.push(addr_as_num); line = line.replace( diff --git a/zk_prover/src/merkle_sum_tree/utils/csv_parser.rs b/zk_prover/src/merkle_sum_tree/utils/csv_parser.rs index bf77f0db..9df4100e 100644 --- a/zk_prover/src/merkle_sum_tree/utils/csv_parser.rs +++ b/zk_prover/src/merkle_sum_tree/utils/csv_parser.rs @@ -30,7 +30,7 @@ pub fn parse_csv_to_entries, const N_ASSETS: usize, const N_BYTES } let mut entries = Vec::new(); - let mut balances_acc: Vec = vec![BigUint::from(0 as usize); N_ASSETS]; + let mut balances_acc: Vec = vec![BigUint::from(0_usize); N_ASSETS]; for result in rdr.deserialize() { let record: HashMap = result?; @@ -63,7 +63,7 @@ pub fn parse_csv_to_entries, const N_ASSETS: usize, const N_BYTES // Iterate through the balance accumulator and throw error if any balance is not in range 0, 2 ^ (8 * N_BYTES): for balance in balances_acc { - if balance >= BigUint::from(2 as usize).pow(8 * N_BYTES as u32) { + if balance >= BigUint::from(2_usize).pow(8 * N_BYTES as u32) { return Err( "Accumulated balance is not in the expected range, proof generation will fail!" .into(),