Skip to content

Commit

Permalink
fix: removed leftover; proper variable name in benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
sifnoc committed Mar 15, 2024
1 parent c831f5d commit 6289153
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions kzg_prover/benches/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ fn bench_kzg<
let entries = generate_dummy_entries::<N_USERS, N_CURRENCIES>().unwrap();

// Calculate total for all entry columns
let mut csv_total: Vec<BigUint> = vec![BigUint::from(0u32); N_CURRENCIES];
let mut total_balances: Vec<BigUint> = vec![BigUint::from(0u32); N_CURRENCIES];

for entry in &entries {
for (i, balance) in entry.balances().iter().enumerate() {
csv_total[i] += balance;
total_balances[i] += balance;
}
}

Expand Down Expand Up @@ -90,7 +90,7 @@ fn bench_kzg<
&advice_polys.advice_blinds,
&params,
balance_column_range,
csv_total
total_balances
.iter()
.map(|x| big_uint_to_fp(&(x)) * Fp::from(poly_length).invert().unwrap())
.collect::<Vec<Fp>>()
Expand All @@ -110,7 +110,7 @@ fn bench_kzg<
&advice_polys.advice_blinds,
&params,
balance_column_range,
csv_total
total_balances
.iter()
.map(|x| big_uint_to_fp(&(x)) * Fp::from(poly_length).invert().unwrap())
.collect::<Vec<Fp>>()
Expand Down Expand Up @@ -187,7 +187,7 @@ fn bench_kzg<
&advice_polys.advice_blinds,
&params,
balance_column_range.clone(),
csv_total
total_balances
.iter()
.map(|x| big_uint_to_fp(&(x)) * Fp::from(poly_length).invert().unwrap())
.collect::<Vec<Fp>>()
Expand Down
3 changes: 1 addition & 2 deletions kzg_prover/src/utils/dummy_entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use std::error::Error;
use crate::entry::Entry;

// This is for testing purposes with a large dataset instead of using a CSV file
pub fn generate_dummy_entries<const N_USERS: usize, const N_CURRENCIES: usize>(// entries: &mut [Entry<N_CURRENCIES>],
// cryptocurrencies: &mut [Cryptocurrency],
pub fn generate_dummy_entries<const N_USERS: usize, const N_CURRENCIES: usize>(
) -> Result<Vec<Entry<N_CURRENCIES>>, Box<dyn Error>> {
// Ensure N_CURRENCIES is greater than 0.
if N_CURRENCIES == 0 {
Expand Down

0 comments on commit 6289153

Please sign in to comment.