Allow entries as args in custom statements (#498)
- Introduce a new operation ReplaceValueWithEntry that allows taking any statement and replacing literal arguments with entries given a matching Contains statement. - Allow entries as args in custom statements - Circuit optimization: For the public statements slots in the circuit we only support None and Copy which take at most 1 argument; but we were still doing max_statement_args random accesses per slot; so I reduced that to just 1 random access to a previous statement.
This commit is contained in:
parent
22d25e5cb2
commit
dbd958dcca
18 changed files with 515 additions and 190 deletions
|
|
@ -316,7 +316,9 @@ mod tests {
|
|||
backends::plonky2::mock::mainpod::MockProver,
|
||||
examples::{custom::eth_dos_batch, MOCK_VD_SET},
|
||||
frontend::{MainPodBuilder, Operation},
|
||||
middleware::{self, containers::Set, CustomPredicateRef, Params, PodType, DEFAULT_VD_SET},
|
||||
middleware::{
|
||||
self, containers::Set, CustomPredicateRef, Params, PodType, ValueRef, DEFAULT_VD_SET,
|
||||
},
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
@ -507,7 +509,7 @@ mod tests {
|
|||
.find(|s| matches!(s, middleware::Statement::Custom(_, _)))
|
||||
.expect("should have a custom statement");
|
||||
if let middleware::Statement::Custom(_, args) = custom_st {
|
||||
assert_eq!(args[0], pred_b_hash);
|
||||
assert_eq!(args[0], ValueRef::Literal(pred_b_hash));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue