diff --git a/circuits/builder/verify.rs b/circuits/builder/verify.rs index bec8ac7..08d9d6e 100644 --- a/circuits/builder/verify.rs +++ b/circuits/builder/verify.rs @@ -501,15 +501,18 @@ impl, const D: usize> TendermintVerify for CircuitBu trusted_block: &U64Variable, target_block: &U64Variable, ) { + let true_v = self._true(); let one = self.one(); let trusted_block_plus_one = self.add(*trusted_block, one); // Verify target block > trusted block. - self.gt(*target_block, trusted_block_plus_one); + let is_target_gt_trusted = self.gt(*target_block, trusted_block_plus_one); + self.assert_is_equal(is_target_gt_trusted, true_v); let skip_max_var = self.constant::(skip_max as u64); let max_block = self.add(*trusted_block, skip_max_var); // Verify target block <= trusted block + skip_max. - self.lte(*target_block, max_block); + let is_target_lte_skip_max = self.lte(*target_block, max_block); + self.assert_is_equal(is_target_lte_skip_max, true_v); } fn verify_skip(