Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: "fix: add nonce constraint to fp" #1444

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions crates/core/machine/src/syscall/precompiles/fptower/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::air::MemoryAirBuilder;
use generic_array::GenericArray;
use itertools::Itertools;
use num::{BigUint, Zero};
use p3_air::{Air, AirBuilder, BaseAir};
use p3_air::{Air, BaseAir};
use p3_field::{AbstractField, PrimeField32};
use p3_matrix::{dense::RowMajorMatrix, Matrix};
use sp1_core_executor::{
Expand Down Expand Up @@ -202,18 +202,11 @@ where
let main = builder.main();
let local = main.row_slice(0);
let local: &FpOpCols<AB::Var, P> = (*local).borrow();
let next = main.row_slice(1);
let next: &FpOpCols<AB::Var, P> = (*next).borrow();

// Check that nonce is incremented.
builder.when_first_row().assert_zero(local.nonce);
builder.when_transition().assert_eq(local.nonce + AB::Expr::one(), next.nonce);

// Check that operations flags are boolean.
builder.assert_bool(local.is_add);
builder.assert_bool(local.is_sub);
builder.assert_bool(local.is_mul);

// Check that only one of them is set.
builder.assert_eq(local.is_add + local.is_sub + local.is_mul, AB::Expr::one());

Expand Down
Loading