2022-05-04 20:57:07 +02:00
|
|
|
use plonky2::fri::reduction_strategies::FriReductionStrategy;
|
|
|
|
|
use plonky2::fri::{FriConfig, FriParams};
|
|
|
|
|
|
|
|
|
|
pub struct StarkConfig {
|
|
|
|
|
pub security_bits: usize,
|
|
|
|
|
|
|
|
|
|
/// The number of challenge points to generate, for IOPs that have soundness errors of (roughly)
|
|
|
|
|
/// `degree / |F|`.
|
|
|
|
|
pub num_challenges: usize,
|
|
|
|
|
|
|
|
|
|
pub fri_config: FriConfig,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl StarkConfig {
|
|
|
|
|
/// A typical configuration with a rate of 2, resulting in fast but large proofs.
|
|
|
|
|
/// Targets ~100 bit conjectured security.
|
|
|
|
|
pub fn standard_fast_config() -> Self {
|
|
|
|
|
Self {
|
|
|
|
|
security_bits: 100,
|
2022-05-12 22:29:10 +02:00
|
|
|
num_challenges: 2,
|
2022-05-04 20:57:07 +02:00
|
|
|
fri_config: FriConfig {
|
|
|
|
|
rate_bits: 1,
|
|
|
|
|
cap_height: 4,
|
2022-09-23 10:54:17 -07:00
|
|
|
proof_of_work_bits: 16,
|
2022-05-04 20:57:07 +02:00
|
|
|
reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5),
|
2022-09-23 10:54:17 -07:00
|
|
|
num_query_rounds: 84,
|
2022-05-04 20:57:07 +02:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn fri_params(&self, degree_bits: usize) -> FriParams {
|
|
|
|
|
self.fri_config.fri_params(degree_bits, false)
|
|
|
|
|
}
|
|
|
|
|
}
|