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

feat: eccvm translator zk sumcheck #9199

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

iakovenkos
Copy link
Contributor

@iakovenkos iakovenkos commented Oct 11, 2024

Turned on ZK Sumcheck in ECCVM and Translator Flavors.

Benching ClientIvc with ZK sumcheck turned on in ECCVM and Translator:

Benchmark without ZK with ZK (best result) with ZK with ZK (worst result) Overhead of Worst zk over non-ZK
ClientIVCBench/Full/2 12,039 ms 12,512 ms 12,658 ms 12,778 ms 6.14%
ClientIVCBench/Full/6 33,258 ms 34,830 ms 35,038 ms 35,452 ms 6.60%

*Using non-optimized ZK Sumcheck

@iakovenkos iakovenkos marked this pull request as draft October 11, 2024 16:30
@iakovenkos iakovenkos changed the title draft: eccvm translator zk sumcheck feat: eccvm translator zk sumcheck Oct 16, 2024
@iakovenkos iakovenkos marked this pull request as ready for review October 16, 2024 15:57
@@ -65,8 +65,8 @@ void eccvm_prove(State& state) noexcept
};
}

BENCHMARK(eccvm_generate_prover)->Unit(kMillisecond)->DenseRange(10, 20);
BENCHMARK(eccvm_prove)->Unit(kMillisecond)->DenseRange(10, 20);
BENCHMARK(eccvm_generate_prover)->Unit(kMillisecond)->DenseRange(12, 18);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proving is quite slow and the time grows somewhat predictably.

std::get<0>(accumulator) +=
((z_perm + lagrange_first) * numerator_evaluation - (z_perm_shift + lagrange_last) * denominator_evaluation) *
scaling_factor;

// Contribution (2)
std::get<1>(accumulator) += (lagrange_last * z_perm_shift) * scaling_factor;
std::get<1>(accumulator) += lagrange_last_short * z_perm_shift_short * scaling_factor;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small optimization: taken into account the fact that the second component of the accumulator is actually of a much smaller degree ( 2 )

@@ -70,7 +70,7 @@ template <typename Flavor> void ECCVMRecursiveVerifier_<Flavor>::verify_proof(co
gate_challenges[idx] = transcript->template get_challenge<FF>("Sumcheck:gate_challenge_" + std::to_string(idx));
}

auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] =
auto [multivariate_challenge, claimed_evaluations, libra_evaluations, sumcheck_verified] =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here, the sumcheck verifier is getting evaluations of univariates that are used to mask sumcheck round univariates

transcript->send_to_verifier("Libra:evaluations", zk_sumcheck_data.libra_evaluations);
for (size_t idx = 0; idx < multivariate_d; idx++) {
const FF& libra_evaluation = zk_sumcheck_data.libra_evaluations[idx];
std::string libra_evaluation_label = "Libra:evaluation_" + std::to_string(idx);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a discrepancy in the way the prover and the verifer send/receive these evals

@iakovenkos iakovenkos removed the request for review from ledwards2225 October 16, 2024 17:02
@iakovenkos iakovenkos marked this pull request as draft October 18, 2024 23:10
…tocol/aztec-packages into si/eccvm-translator-zk-sumcheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant