Print debugging info if a pod does not verify (#141)
* Print debugging info if a pod does not verify * Use logging for incorrect pods; add additional test
This commit is contained in:
parent
22db6ce4c6
commit
fee70af12b
4 changed files with 111 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use anyhow::{anyhow, Result};
|
||||
use itertools::Itertools;
|
||||
use log::error;
|
||||
use plonky2::hash::poseidon::PoseidonHash;
|
||||
use plonky2::plonk::config::Hasher;
|
||||
use std::any::Any;
|
||||
|
|
@ -434,10 +435,22 @@ impl Pod for MockMainPod {
|
|||
self.operations[i]
|
||||
.deref(&self.statements[..input_statement_offset + i])
|
||||
.unwrap()
|
||||
.check(&self.params, &s.clone().try_into().unwrap())
|
||||
.check_and_log(&self.params, &s.clone().try_into().unwrap())
|
||||
})
|
||||
.collect::<Result<Vec<_>>>()
|
||||
.unwrap();
|
||||
if !ids_match {
|
||||
error!("Verification failed: POD ID is incorrect.");
|
||||
}
|
||||
if !has_type_statement {
|
||||
error!("Verification failed: POD does not have type statement.");
|
||||
}
|
||||
if !value_ofs_unique {
|
||||
error!("Verification failed: Repeated ValueOf");
|
||||
}
|
||||
if !statement_check.iter().all(|b| *b) {
|
||||
error!("Verification failed: Statement did not check.")
|
||||
}
|
||||
ids_match && has_type_statement && value_ofs_unique & statement_check.into_iter().all(|b| b)
|
||||
}
|
||||
fn id(&self) -> PodId {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue