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

Commit

Permalink
assert instead of panic
Browse files Browse the repository at this point in the history
  • Loading branch information
miha-stopar committed Jan 30, 2024
1 parent fe9fe2a commit 3d85376
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions zkevm-circuits/src/mpt_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,20 +494,16 @@ impl<F: Field> MPTConfig<F> {
cached_region.assign_stored_expressions(&self.cb.base, challenges)?;
}

if self.params.max_nodes < (2 * HASH_WIDTH + 1) {
panic!(
assert!( self.params.max_nodes >= (2 * HASH_WIDTH + 1),
"The parameter max_nodes is set too low for the mult table: {}, mult table height: {}",
self.params.max_nodes,
2 * HASH_WIDTH + 1,
);
}
if offset > self.params.max_nodes {
panic!(
assert!( offset <= self.params.max_nodes,
"The parameter max_nodes is set too low, max_nodes: {}, offset: {}",
self.params.max_nodes,
offset,
);
}

for offset in 0..self.params.max_nodes {
assignf!(region, (self.q_enable, offset) => true.scalar())?;
Expand Down

0 comments on commit 3d85376

Please sign in to comment.