proof-systems icon indicating copy to clipboard operation
proof-systems copied to clipboard

ConstraintSystem and ProverIndex

Open mimoo opened this issue 3 years ago • 3 comments

The Prover index is split between a ProverIndex and a ConstraintSystem struct. These two structs should be merged into ProverIndex more cleanly.

mimoo avatar Mar 15 '22 17:03 mimoo

Stale issue message

github-actions[bot] avatar May 23 '22 07:05 github-actions[bot]

Stale issue message

github-actions[bot] avatar Jul 23 '22 07:07 github-actions[bot]

Stale issue message

github-actions[bot] avatar Sep 24 '22 07:09 github-actions[bot]

@mimoo Will take this issue! :smile:

duguorong009 avatar Dec 06 '22 02:12 duguorong009

One question, @mimoo I found that there exists ConstraintSystem & Circuit types.

Following the sub-tasks you created, I found that I should move all the fields of ConstraintSystem to the ProverIndex, except for the public(public_input_size) and gates.

Did I get it right? (Tbh, the move of such many fields seems GREAT challenge)

duguorong009 avatar Dec 06 '22 16:12 duguorong009

yeah, and that Circuit type can disappear after (because it has the same fields ConstraintSystem has)

mimoo avatar Dec 07 '22 19:12 mimoo

Stale issue message

github-actions[bot] avatar Feb 06 '23 07:02 github-actions[bot]

currently I think that these are the fields that should be moved to the prover index:

pub struct ConstraintSystem<F: PrimeField> {
    // good
    pub public: usize,
    // mmmm, that sounds like more of an index kind of thing
    pub prev_challenges: usize,
    // mmmm, I think a circuit can be instantiated on any domain as long as its bigger than the list of gates
    pub domain: EvaluationDomains<F>,
    // good
    pub gates: Vec<CircuitGate<F>>,
    // good
    pub feature_flags: FeatureFlags,
    // I don't remember what this one is about, do we even use this?
    pub sid: Vec<F>,
    // I believe this could be a constant and doesn't need to exist in the struct (could be implemented within KimchiCurve?)    pub shift: [F; PERMUTS],
    // can we delete this now that we have KimchiCurve::endo?
    pub endo: F,
    // good
    pub lookup_constraint_system: Option<LookupConstraintSystem<F>>,
    // should be moved to prover index
    precomputations: OnceCell<Arc<DomainConstantEvaluations<F>>>,
    // not sure where we use this, it seems like this should be behind a `#[cfg(test)]` if we can
    pub disable_gates_checks: bool,
}

any PR that removes one of these items would be nice!

mimoo avatar Feb 07 '23 01:02 mimoo

Stale issue message

github-actions[bot] avatar Apr 08 '23 07:04 github-actions[bot]