Merkle tree for custom predicate batches (#471)
Resolve https://github.com/0xPARC/pod2/issues/466 Now batches are identified by the root of a merkle tree that contains all the predicates (using sequential indices as keys). This means that the format to identify a custom predicate reference is still a hash + index, but the calculation of the hash is different. The MainPod circuit now isn't limited by number of batches but instead number of custom predicates; and for each one we verify a merkle proof to verify the batch id. I've removed a bunch of tests from lang that were testing splitting into multiple batches because there's no longer any need for that. In a future PR we'll remove the code that handles batch splitting. Each custom predicate needs 148.2 gates (which is very close to my estimate of 142.7 in https://github.com/0xPARC/pod2/issues/466#issuecomment-3823531286 where I actually made a mistake and considered 5 predicates per batch instead of 4 in the previous Params).
This commit is contained in:
parent
a7a30176a7
commit
641d8dabdd
17 changed files with 331 additions and 761 deletions
|
|
@ -777,7 +777,7 @@ mod tests {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
let batch = CustomPredicateBatch::new(¶ms, "TestBatch".to_string(), vec![pred]);
|
||||
let batch = CustomPredicateBatch::new("TestBatch".to_string(), vec![pred]);
|
||||
|
||||
let batch_id = batch.id().encode_hex::<String>();
|
||||
let input = format!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue