Skip to content

Commit

Permalink
fix: mtable: prohibit encoding value at disabled step
Browse files Browse the repository at this point in the history
  • Loading branch information
junyu0312 committed Jul 1, 2024
1 parent 8e2cca4 commit c70212a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/zkwasm/src/circuits/mtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct MemoryTableConfig<F: FieldExt> {
start_eid_cell: AllocatedU32StateCell<F>,
end_eid_cell: AllocatedU32StateCell<F>,
eid_diff_cell: AllocatedU32StateCell<F>,
// It MUST NOT be unlimited to ensure mtable terminates at capability.
// It MUST NOT be unlimited to ensure mtable termination.
rest_mops_cell: AllocatedCommonRangeCell<F>,
offset_cell: AllocatedU32Cell<F>,
offset_diff_cell: AllocatedU32Cell<F>,
Expand Down Expand Up @@ -358,6 +358,8 @@ impl<F: FieldExt> MemoryTableConfig<F> {
// post_init_encode_cell assigned iff at memory finalized position.
post_init_encode_cell.curr_expr(meta)
* (constant_from!(1) - is_memory_finalized_position_bit.clone()),
post_init_encode_cell.curr_expr(meta)
* (constant_from!(1) - enabled_cell.curr_expr(meta)),
// encode post_init_encode_cell.
(post_init_encode_cell.curr_expr(meta)
- address_encode_cell.curr_expr(meta)
Expand Down

0 comments on commit c70212a

Please sign in to comment.