Closed sragss closed 2 months ago
Currently batch_commit
is called from impl StructuredOpeningProof for {Bytecode, RAM, InstructionLookups}
/ VM::Commit
/ R1CSProof::compute_witness_commit
.
StructuredOpeningProof
is not used anymore for Read/Write across {Bytecode, RAM, InstructionLookups} in favor of VM::commit
. It is still used for Init / Final but these have a batch_size
/ RATIO
of 1.
R1CSProof::compute_witness_commit
should likely be refactored to R1CSProof::compute_witness
and VM::commit
should handle the batch commitment.
A decent solution would be to switch the batch_size
param to an enum CS::BigBatch / CS::SmallBatch
which for Hyrax would correspond to NUM_R1CS_POLYS
/ 1
.
Includes a
batch_size
param in calls toCommitmentScheme::{batch_commit, batch_prove}
and includes thebatch_size
param in theCommitmentScheme::BatchedProof
struct if needed.Two unfortunate things:
batch_size
param to be used as the Hyrax sizing ratio. Theoretically this could be refactored to be an associated type onCommitmentScheme
calledBatchCommitConfig
which could store other info, we just aren't aware of another commitment scheme that needs it.batch_size
isn't quite the correct parameter name. Currently we callCommitmentScheme::{batch_commit, batch_prove}
for a range of real batch sizes {163, 40}. Across all of theseNUM_R1CS_POLYS=64
is close enough to get desired performance. Alsobatch_prove
is often passed a subset of the batch's polynomials, but still needs the matchingbatch_size
param to whatever was committed. We could return toRATIO
but only makes sense in the context of Hyrax.