Skip to content

Commit

Permalink
add sanity check to make sure ComparatorChip only use cur() in RLP (s…
Browse files Browse the repository at this point in the history
…croll-tech#980)

Co-authored-by: Steven <[email protected]>
  • Loading branch information
kunxian-xia and silathdiir authored Sep 23, 2023
1 parent 138b7a3 commit 21f887d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gadgets/src/comparator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ impl<F: Field, const N_BYTES: usize> ComparatorConfig<F, N_BYTES> {
meta: &mut VirtualCells<F>,
rotation: Option<Rotation>,
) -> (Expression<F>, Expression<F>) {
let rotation_is_cur = rotation.map_or(true, |r| r == Rotation::cur());
assert!(rotation_is_cur);

(
self.lt_chip.config.is_lt(meta, rotation),
self.eq_chip.config.is_equal_expression.clone(),
Expand Down

0 comments on commit 21f887d

Please sign in to comment.