[DO NOT MERGE INTO MAIN] feat: refactoring basefold API following "virtual oracle" philosophy#2749
Draft
rdalal wants to merge 2 commits into
Draft
[DO NOT MERGE INTO MAIN] feat: refactoring basefold API following "virtual oracle" philosophy#2749rdalal wants to merge 2 commits into
rdalal wants to merge 2 commits into
Conversation
erabinov
reviewed
Apr 23, 2026
| #[inline] | ||
| pub fn prove_trusted_mle_evaluations( | ||
| #[allow(clippy::type_complexity)] | ||
| pub fn prove_from_prebatched_inputs( |
Contributor
There was a problem hiding this comment.
maybe prove_single_multilinear? Just a thought.
erabinov
reviewed
Apr 23, 2026
|
|
||
| #[inline] | ||
| pub fn prove_trusted_mle_evaluations( | ||
| #[allow(clippy::type_complexity)] |
erabinov
reviewed
Apr 23, 2026
| final_poly, | ||
| pow_witness, | ||
| batch_grinding_witness, | ||
| batch_grinding_witness: Default::default(), |
Contributor
There was a problem hiding this comment.
nit: I think this is somewhat risky (someone might forget about it and try to verify this proof). Maybe the return-type of this function should be an UnbatchedBaseFoldProof which doesn't contain the witness.
Contributor
|
erabinov
reviewed
Apr 23, 2026
| evaluation_claims: &[MleEval<GC::EF>], | ||
| eval_claim: GC::EF, | ||
| proof: &BasefoldProof<GC>, | ||
| to_virtual_oracle: impl FnOnce(&[MerkleTreeOpeningAndProof<GC>], &[usize]) -> Vec<GC::EF>, |
Contributor
There was a problem hiding this comment.
I'd prefer to make a trait OracleOpening<GC> (or some such) that has a member fn to_virtual_oracle(&[MerkleTreeOpeningAndProof<GC>, ..]) -> Vec<GC::EF>.
That way you'll have a chance to name the different implementations.
I may be reaching for traits when they're unnecessary, but I think this function is an important part of the abstraction you're building.
erabinov
reviewed
Apr 23, 2026
| /// * `num_encoding_variables` — number of variables per stacked polynomial (encoding | ||
| /// width). Each committed MLE will be stacked into a tensor whose rows have | ||
| /// `2^num_encoding_variables` entries. | ||
| pub fn initialize_zk_prover_and_verifier<GC: ZkIopCtx, MK: ZkMerkleizer<GC>>( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactoring API for basefold prover and verifier to not repeat code in VEIL
THIS CHANGED THE VERIFIER CODE AND IS JUST FOR COMPARISON FOR NOW. NEVER MAKE THIS NON-DRAFT