Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix/bool checks (#1230)
Browse files Browse the repository at this point in the history
### Description

Boolean checks were missing for a step's `is_create` and `is_root`
fields.

### Issue Link

Issue originated from Scroll's fork:
scroll-tech#325

### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
  • Loading branch information
roynalnaruto authored Feb 22, 2023
1 parent 95986bf commit 477f70a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ impl<F: Field> ExecutionConfig<F> {
1.expr(),
)
});
// For every step, is_create and is_root are boolean.
cb.condition(q_step.clone(), |cb| {
cb.require_boolean(
"step.is_create is boolean",
step_curr.state.is_create.expr(),
);
cb.require_boolean("step.is_root is boolean", step_curr.state.is_root.expr());
});
// q_step needs to be enabled on the last row
cb.condition(q_step_last, |cb| {
cb.require_equal("q_step == 1", q_step.clone(), 1.expr());
Expand Down

0 comments on commit 477f70a

Please sign in to comment.