-
Notifications
You must be signed in to change notification settings - Fork 285
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
Refactor CTL Handling #1629
base: main
Are you sure you want to change the base?
Refactor CTL Handling #1629
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking comments, though I'm not sure about the full removal of MultiProof
auxiliary_polys: &[&Option<Vec<F::Extension>>; N], | ||
auxiliary_polys_next: &[&Option<Vec<F::Extension>>; N], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these could share the same lifetimes as below
@@ -250,7 +250,8 @@ where | |||
|
|||
/// Outputs all the CTL data necessary to prove a multi-STARK system. | |||
pub fn get_ctl_vars_from_proofs<'a, F, C, const D: usize, const N: usize>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the name is slightly misleading now, as we're not passing the multi_proof
as arg anymore. What about get_ctl_vars_from_aux_polys
?
/// A combination of STARK proofs for independent statements operating on possibly shared variables, | ||
/// along with Cross-Table Lookup (CTL) challenges to assert consistency of common variables across tables. | ||
#[derive(Debug, Clone)] | ||
pub struct MultiProof< | ||
F: RichField + Extendable<D>, | ||
C: GenericConfig<D, F = F>, | ||
const D: usize, | ||
const N: usize, | ||
> { | ||
/// Proofs for all the different STARK modules. | ||
pub stark_proofs: [StarkProofWithMetadata<F, C, D>; N], | ||
/// Cross-table lookup challenges. | ||
pub ctl_challenges: GrandProductChallengeSet<F>, | ||
} | ||
|
||
impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize, const N: usize> | ||
MultiProof<F, C, D, N> | ||
{ | ||
/// Returns the degree (i.e. the trace length) of each STARK proof, | ||
/// from their common [`StarkConfig`]. | ||
pub fn recover_degree_bits(&self, config: &StarkConfig) -> [usize; N] { | ||
core::array::from_fn(|i| self.stark_proofs[i].proof.recover_degree_bits(config)) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure we want to remove this from the API? It's a relatively convenient struct to group the whole system together. I'd rather suggest expanding it by implementing some additional helpers if needed (like extracting the aux_polys needed for the new signature above).
This PR refactors the
get_ctl_vars_from_proofs
function to acceptauxiliary_polys
andauxiliary_polys_next
as explicit parameters rather than extracting them from the proofs. This change decouples the auxiliary polynomial data from the proof structure.