mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-09 09:13:09 +00:00
PR feedback
This commit is contained in:
parent
56336e396d
commit
67cb5dfd58
@ -35,6 +35,7 @@ impl FriConfig {
|
|||||||
let reduction_arity_bits = self.reduction_strategy.reduction_arity_bits(
|
let reduction_arity_bits = self.reduction_strategy.reduction_arity_bits(
|
||||||
degree_bits,
|
degree_bits,
|
||||||
self.rate_bits,
|
self.rate_bits,
|
||||||
|
self.cap_height,
|
||||||
self.num_query_rounds,
|
self.num_query_rounds,
|
||||||
);
|
);
|
||||||
FriParams {
|
FriParams {
|
||||||
|
|||||||
@ -8,12 +8,12 @@ pub enum FriReductionStrategy {
|
|||||||
/// Specifies the exact sequence of arities (expressed in bits) to use.
|
/// Specifies the exact sequence of arities (expressed in bits) to use.
|
||||||
Fixed(Vec<usize>),
|
Fixed(Vec<usize>),
|
||||||
|
|
||||||
/// `ConstantArityBits(arity_bits, final_poly_bits, cap_height)` applies reductions of arity `2^arity_bits`
|
/// `ConstantArityBits(arity_bits, final_poly_bits)` applies reductions of arity `2^arity_bits`
|
||||||
/// until the polynomial degree is less than or equal to `2^final_poly_bits` or until any further
|
/// until the polynomial degree is less than or equal to `2^final_poly_bits` or until any further
|
||||||
/// `arity_bits`-reduction makes the last FRI tree have height less than `cap_height`.
|
/// `arity_bits`-reduction makes the last FRI tree have height less than `cap_height`.
|
||||||
/// This tends to work well in the recursive setting, as it avoids needing multiple configurations
|
/// This tends to work well in the recursive setting, as it avoids needing multiple configurations
|
||||||
/// of gates used in FRI verification, such as `InterpolationGate`.
|
/// of gates used in FRI verification, such as `InterpolationGate`.
|
||||||
ConstantArityBits(usize, usize, usize),
|
ConstantArityBits(usize, usize),
|
||||||
|
|
||||||
/// `MinSize(opt_max_arity_bits)` searches for an optimal sequence of reduction arities, with an
|
/// `MinSize(opt_max_arity_bits)` searches for an optimal sequence of reduction arities, with an
|
||||||
/// optional max `arity_bits`. If this proof will have recursive proofs on top of it, a max
|
/// optional max `arity_bits`. If this proof will have recursive proofs on top of it, a max
|
||||||
@ -27,12 +27,13 @@ impl FriReductionStrategy {
|
|||||||
&self,
|
&self,
|
||||||
mut degree_bits: usize,
|
mut degree_bits: usize,
|
||||||
rate_bits: usize,
|
rate_bits: usize,
|
||||||
|
cap_height: usize,
|
||||||
num_queries: usize,
|
num_queries: usize,
|
||||||
) -> Vec<usize> {
|
) -> Vec<usize> {
|
||||||
match self {
|
match self {
|
||||||
FriReductionStrategy::Fixed(reduction_arity_bits) => reduction_arity_bits.to_vec(),
|
FriReductionStrategy::Fixed(reduction_arity_bits) => reduction_arity_bits.to_vec(),
|
||||||
|
|
||||||
&FriReductionStrategy::ConstantArityBits(arity_bits, final_poly_bits, cap_height) => {
|
&FriReductionStrategy::ConstantArityBits(arity_bits, final_poly_bits) => {
|
||||||
let mut result = Vec::new();
|
let mut result = Vec::new();
|
||||||
while degree_bits > final_poly_bits
|
while degree_bits > final_poly_bits
|
||||||
&& degree_bits + rate_bits - arity_bits >= cap_height
|
&& degree_bits + rate_bits - arity_bits >= cap_height
|
||||||
|
|||||||
@ -73,7 +73,7 @@ impl CircuitConfig {
|
|||||||
rate_bits: 3,
|
rate_bits: 3,
|
||||||
cap_height: 4,
|
cap_height: 4,
|
||||||
proof_of_work_bits: 16,
|
proof_of_work_bits: 16,
|
||||||
reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5, 4),
|
reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5),
|
||||||
num_query_rounds: 28,
|
num_query_rounds: 28,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ impl StarkConfig {
|
|||||||
rate_bits: 1,
|
rate_bits: 1,
|
||||||
cap_height: 4,
|
cap_height: 4,
|
||||||
proof_of_work_bits: 10,
|
proof_of_work_bits: 10,
|
||||||
reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5, 4),
|
reduction_strategy: FriReductionStrategy::ConstantArityBits(4, 5),
|
||||||
num_query_rounds: 90,
|
num_query_rounds: 90,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user