Compare commits

...

1 Commits

Author SHA1 Message Date
dante
ca6443bcbc refactor: range check sanity toggled by CHECKMODE 2025-01-10 15:05:29 -05:00
3 changed files with 12 additions and 2 deletions

View File

@@ -75,6 +75,16 @@ impl FromStr for CheckMode {
}
}
impl CheckMode {
/// Returns the value of the check mode
pub fn is_safe(&self) -> bool {
match self {
CheckMode::SAFE => true,
CheckMode::UNSAFE => false,
}
}
}
#[allow(missing_docs)]
/// An enum representing the tolerance we can accept for the accumulated arguments, either absolute or percentage
#[derive(Clone, Default, Debug, PartialEq, PartialOrd, Serialize, Deserialize, Copy)]

View File

@@ -4038,7 +4038,7 @@ pub(crate) fn range_check<F: PrimeField + TensorType + PartialOrd + std::hash::H
}
let is_assigned = !w.any_unknowns()?;
if is_assigned && region.check_range() {
if is_assigned && region.check_range() && config.check_mode.is_safe() {
// assert is within range
let int_values = w.int_evals()?;
for v in int_values.iter() {

File diff suppressed because one or more lines are too long