From e8658ef82765a64010416945fa24b697d518ff1c Mon Sep 17 00:00:00 2001 From: Alex Kuzmin Date: Tue, 5 Dec 2023 14:34:55 +0800 Subject: [PATCH] Resolve TODO --- kzg_prover/src/circuits/solvency_v2.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kzg_prover/src/circuits/solvency_v2.rs b/kzg_prover/src/circuits/solvency_v2.rs index bff40272..71980d7b 100644 --- a/kzg_prover/src/circuits/solvency_v2.rs +++ b/kzg_prover/src/circuits/solvency_v2.rs @@ -50,9 +50,16 @@ where { pub fn configure(meta: &mut ConstraintSystem) -> Self { // We need 1 advice column for the username, N_ASSETS for the balances. The advice column for the balances is passed to the `range_check_chip` - //TODO: unblinded only for the balances, usernames can stay blinded - let advices: [Column; N_ASSETS + 1] = - std::array::from_fn(|_| meta.unblinded_advice_column()); + // The first advice column is used to store the username and should be a regular (blinded) advice column + // The remaining advice columns are used to store the balances and should be the unblinded advice columns + // This is necessary to correctly evaluate the grand sum of the balance polynomials + let advices: [Column; N_ASSETS + 1] = std::array::from_fn(|i| { + if i == 0 { + meta.advice_column() + } else { + meta.unblinded_advice_column() + } + }); // we need a fixed column for the range check let range = meta.fixed_column();