Skip to content
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

tests: add tests for costs using CircuitCost #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sebastiantf
Copy link
Collaborator

Description

  • Uses CircuitCost to generate cost reports for Range Check and MST Inclusion circuits
  • Used bn256::G1 as PrimeGroup for CircuitCost
  • Used K = 4 for Range Check and K = 11 for MST Inclusion
    • Not entirely sure what those values mean. But reached those numbers after trial and error on getting NotEnoughRowsAvailable errors
    • Feel free to comment and help learn the usage & meaning of those values
  • Not entirely sure how to interpret the output of the CircuitCost::proof_size() API either. Appreciate anyone who wants to help in on that
  • cost_model seems to give a more intuitive report on proof size and verification time.
    • It already seems to be adapted for PSE's fork. But Summa seem to use their own fork of halo2. So it needs to update with PSE's upstream before able to use it
    • Couldn't find a lot of diff bw PSE's fork and zcash for cost.rs though

Range Check:

ProofSize {
    instance: ProofContribution {
        commitments: 0,
        evaluations: 0,
    },
    advice: ProofContribution {
        commitments: 4,
        evaluations: 5,
    },
    fixed: ProofContribution {
        commitments: 0,
        evaluations: 4,
    },
    lookups: ProofContribution {
        commitments: 3,
        evaluations: 5,
    },
    equality: ProofContribution {
        commitments: 2,
        evaluations: 10,
    },
    vanishing: ProofContribution {
        commitments: 5,
        evaluations: 1,
    },
    multiopen: ProofContribution {
        commitments: 1,
        evaluations: 4,
    },
    polycomm: ProofContribution {
        commitments: 9,
        evaluations: 2,
    },
    _marker: PhantomData<halo2curves::bn256::curve::G1>,
}

MST Inclusion:

ProofSize {
    instance: ProofContribution {
        commitments: 0,
        evaluations: 1,
    },
    advice: ProofContribution {
        commitments: 3,
        evaluations: 7,
    },
    fixed: ProofContribution {
        commitments: 0,
        evaluations: 11,
    },
    lookups: ProofContribution {
        commitments: 3,
        evaluations: 5,
    },
    equality: ProofContribution {
        commitments: 2,
        evaluations: 11,
    },
    vanishing: ProofContribution {
        commitments: 6,
        evaluations: 1,
    },
    multiopen: ProofContribution {
        commitments: 1,
        evaluations: 5,
    },
    polycomm: ProofContribution {
        commitments: 23,
        evaluations: 2,
    },
    _marker: PhantomData<halo2curves::bn256::curve::G1>,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant