Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions crates/prover/benches/pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use binius_prover::{
use binius_transcript::{ProverTranscript, VerifierTranscript};
use binius_verifier::{
config::{B1, B128, StdChallenger},
fri::FRIParams,
fri::{ConstantArityStrategy, FRIParams, calculate_n_test_queries},
hash::{StdCompression, StdDigest},
pcs,
};
Expand Down Expand Up @@ -46,12 +46,15 @@ fn bench_pcs(c: &mut Criterion) {
let log_num_shares = binius_utils::rayon::current_num_threads().ilog2() as usize;
let ntt = NeighborsLastMultiThread::new(domain_context, log_num_shares);

let fri_params = FRIParams::choose_with_constant_fold_arity(
let n_test_queries = calculate_n_test_queries(SECURITY_BITS, LOG_INV_RATE);
let fri_params = FRIParams::with_strategy(
&ntt,
merkle_prover.scheme(),
log_len,
SECURITY_BITS,
None,
LOG_INV_RATE,
ARITY,
n_test_queries,
&ConstantArityStrategy::new(ARITY),
)
.expect("Failed to create FRI params");

Expand Down
11 changes: 7 additions & 4 deletions crates/prover/src/protocols/basefold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod test {
use binius_transcript::ProverTranscript;
use binius_verifier::{
config::StdChallenger,
fri::FRIParams,
fri::{ConstantArityStrategy, FRIParams, calculate_n_test_queries},
hash::{StdCompression, StdDigest},
protocols::basefold,
};
Expand Down Expand Up @@ -206,12 +206,15 @@ mod test {
let domain_context = GenericOnTheFly::generate_from_subspace(&subspace);
let ntt = NeighborsLastSingleThread::new(domain_context);

let fri_params = FRIParams::choose_with_constant_fold_arity(
let n_test_queries = calculate_n_test_queries(SECURITY_BITS, LOG_INV_RATE);
let fri_params = FRIParams::with_strategy(
&ntt,
merkle_prover.scheme(),
multilinear.log_len(),
SECURITY_BITS,
None,
LOG_INV_RATE,
2,
n_test_queries,
&ConstantArityStrategy::new(2),
)?;

let CommitOutput {
Expand Down
11 changes: 7 additions & 4 deletions crates/spartan-prover/src/pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ mod tests {
};
use binius_transcript::ProverTranscript;
use binius_verifier::{
fri::FRIParams,
fri::{ConstantArityStrategy, FRIParams, calculate_n_test_queries},
hash::{StdCompression, StdDigest},
};
use rand::{SeedableRng, rngs::StdRng};
Expand All @@ -174,12 +174,15 @@ mod tests {
let domain_context = GenericOnTheFly::generate_from_subspace(&subspace);
let ntt = NeighborsLastSingleThread::new(domain_context);

let fri_params = FRIParams::choose_with_constant_fold_arity(
let n_test_queries = calculate_n_test_queries(SECURITY_BITS, LOG_INV_RATE);
let fri_params = FRIParams::with_strategy(
&ntt,
merkle_prover.scheme(),
multilinear.log_len(),
SECURITY_BITS,
None,
LOG_INV_RATE,
2,
n_test_queries,
&ConstantArityStrategy::new(2),
)?;

let pcs_prover = PCSProver::new(&ntt, &merkle_prover, &fri_params);
Expand Down
11 changes: 7 additions & 4 deletions crates/spartan-prover/src/wiring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ mod tests {
};
use binius_transcript::ProverTranscript;
use binius_verifier::{
fri::FRIParams,
fri::{ConstantArityStrategy, FRIParams, calculate_n_test_queries},
hash::{StdCompression, StdDigest},
};
use rand::{Rng, SeedableRng, rngs::StdRng};
Expand Down Expand Up @@ -513,12 +513,15 @@ mod tests {
let domain_context = GenericOnTheFly::generate_from_subspace(&subspace);
let ntt = NeighborsLastSingleThread::new(domain_context);

let fri_params = FRIParams::choose_with_constant_fold_arity(
let n_test_queries = calculate_n_test_queries(SECURITY_BITS, LOG_INV_RATE);
let fri_params = FRIParams::with_strategy(
&ntt,
merkle_prover.scheme(),
log_witness_size,
SECURITY_BITS,
None,
LOG_INV_RATE,
2,
n_test_queries,
&ConstantArityStrategy::new(2),
)
.expect("FRI params creation should succeed");

Expand Down
16 changes: 9 additions & 7 deletions crates/spartan-verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use binius_transcript::{
};
use binius_utils::{DeserializeBytes, checked_arithmetics::checked_log_2};
use binius_verifier::{
fri::{self, FRIParams, estimate_optimal_arity},
fri::{self, ConstantArityStrategy, FRIParams, calculate_n_test_queries},
hash::PseudoCompressionFunction,
merkle_tree::BinaryMerkleTreeScheme,
protocols::{mlecheck, sumcheck, sumcheck::SumcheckOutput},
Expand Down Expand Up @@ -54,22 +54,24 @@ where
) -> Result<Self, Error> {
let log_witness_len = constraint_system.log_size() as usize;
let log_code_len = log_witness_len + log_inv_rate;
let merkle_scheme = BinaryMerkleTreeScheme::new(compression);
let fri_arity =
estimate_optimal_arity(log_code_len, size_of::<Output<MerkleHash>>(), size_of::<F>());
ConstantArityStrategy::with_optimal_arity::<F, _>(&merkle_scheme, log_code_len).arity;

let subspace = BinarySubspace::with_dim(log_code_len)?;
let domain_context = GenericOnTheFly::generate_from_subspace(&subspace);
let ntt = NeighborsLastSingleThread::new(domain_context);
let fri_params = FRIParams::choose_with_constant_fold_arity(
let n_test_queries = calculate_n_test_queries(SECURITY_BITS, log_inv_rate);
let fri_params = FRIParams::with_strategy(
&ntt,
&merkle_scheme,
log_witness_len,
SECURITY_BITS,
None,
log_inv_rate,
fri_arity,
n_test_queries,
&ConstantArityStrategy::new(fri_arity),
)?;

let merkle_scheme = BinaryMerkleTreeScheme::new(compression);

Ok(Self {
constraint_system,
fri_params,
Expand Down
Loading