Add verifier-datas tree (set) & in-circuit verification (#274)

* containers: add method to create new {Dict,Set,Array} with custom max_depth

* add vds_tree computation, update tree circuit interface

* add VDTree struct, add DEFAULT_VD_TREE, integrate it with MainPod,EmptyPod,frontend,etc.

* adapt frontend/serialization tests to new containers field (max_depth)

* adapt interfaces to allow using custom vd_tree in frontend & backend constructors

* rename VDTree to VDSet (and derivate namings too)

* containers 'new' always with param 'max_depth', use params.max_depth_mt_containers instead of the global constant MAX_DEPTH

* adapt after rebasing the branch to main latest changes

* apply review suggestions from @ed255

* use emptypod vd_mt_proofs (using vd_set as circuit input), merge the two existing set_targets methods of MainPodVerifyTarget

* document VDSet & vds_root
This commit is contained in:
arnaucube 2025-06-11 13:08:39 +02:00 committed by GitHub
parent 6258e52e1a
commit 273d803ebd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 486 additions and 259 deletions

View file

@ -659,8 +659,11 @@ fn process_literal_value(lit_val_pair: &Pair<Rule>) -> Result<Value, ProcessorEr
.into_inner()
.map(|elem_pair| process_literal_value(&elem_pair))
.collect();
let middleware_array = middleware::containers::Array::new(elements?)
.map_err(|e| ProcessorError::Internal(format!("Failed to create Array: {}", e)))?;
let middleware_array =
middleware::containers::Array::new(crate::constants::MAX_DEPTH, elements?)
.map_err(|e| {
ProcessorError::Internal(format!("Failed to create Array: {}", e))
})?;
Ok(Value::from(middleware_array))
}
Rule::literal_set => {
@ -668,8 +671,10 @@ fn process_literal_value(lit_val_pair: &Pair<Rule>) -> Result<Value, ProcessorEr
.into_inner()
.map(|elem_pair| process_literal_value(&elem_pair))
.collect();
let middleware_set = middleware::containers::Set::new(elements?)
.map_err(|e| ProcessorError::Internal(format!("Failed to create Set: {}", e)))?;
let middleware_set =
middleware::containers::Set::new(crate::constants::MAX_DEPTH, elements?).map_err(
|e| ProcessorError::Internal(format!("Failed to create Set: {}", e)),
)?;
Ok(Value::from(middleware_set))
}
Rule::literal_dict => {
@ -684,9 +689,11 @@ fn process_literal_value(lit_val_pair: &Pair<Rule>) -> Result<Value, ProcessorEr
Ok((Key::new(key_str), val))
})
.collect();
let middleware_dict = middleware::containers::Dictionary::new(pairs?).map_err(|e| {
ProcessorError::Internal(format!("Failed to create Dictionary: {}", e))
})?;
let middleware_dict =
middleware::containers::Dictionary::new(crate::constants::MAX_DEPTH, pairs?)
.map_err(|e| {
ProcessorError::Internal(format!("Failed to create Dictionary: {}", e))
})?;
Ok(Value::from(middleware_dict))
}
_ => unreachable!("Unexpected rule: {:?}", inner_lit.as_rule()),