diff --git a/docs/arithmetization/tables/cpu.tex b/docs/arithmetization/tables/cpu.tex index b3f1be65a..590b95668 100644 --- a/docs/arithmetization/tables/cpu.tex +++ b/docs/arithmetization/tables/cpu.tex @@ -71,5 +71,5 @@ \subsubsection{CPU columns} before) the instruction. \texttt{stack\_len\_bounds\_ aux} is used to check that the stack doesn't overflow in user mode. We use the last four columns to prevent conflicts with the other general columns. See \ref{stackhandling} for more details. \label{push_general_view} - \item \texttt{Push}: \texttt{push\_prover\_input\_not\_kernel} is used to skip range-checking the output of a PUSH operation when we are in privileged mode, as the kernel code is known and trusted. + \item \texttt{Push}: \texttt{is\_not\_kernel} is used to skip range-checking the output of a PUSH operation when we are in privileged mode, as the kernel code is known and trusted. \end{itemize} diff --git a/docs/arithmetization/zkevm.pdf b/docs/arithmetization/zkevm.pdf index 5a9d91dd6..d1986f70d 100644 Binary files a/docs/arithmetization/zkevm.pdf and b/docs/arithmetization/zkevm.pdf differ diff --git a/evm_arithmetization/src/cpu/columns/general.rs b/evm_arithmetization/src/cpu/columns/general.rs index 8affe6f08..64b7e4ce5 100644 --- a/evm_arithmetization/src/cpu/columns/general.rs +++ b/evm_arithmetization/src/cpu/columns/general.rs @@ -193,15 +193,14 @@ pub(crate) struct CpuStackView { pub(crate) stack_len_bounds_aux: T, } -/// View of the first `CpuGeneralColumn` storing the product of the negated -/// `is_kernel_mode` flag with the `push_prover_input` combined op flag, to -/// filter out `PUSH` instructions from being range-checked when happening in -/// the KERNEL context. +/// View of the first `CpuGeneralColumn` storing the negation of +/// `is_kernel_mode` flag, to filter out `PUSH` instructions from being +/// range-checked when happening in the KERNEL context. #[repr(C)] #[derive(Copy, Clone)] pub(crate) struct CpuPushView { /// Product of `push_prover_input` with the negated `is_kernel_mode` flag. - pub(crate) push_prover_input_not_kernel: T, + pub(crate) is_not_kernel: T, /// Reserve the unused columns. _padding_columns: [T; NUM_SHARED_COLUMNS - 1], } diff --git a/evm_arithmetization/src/cpu/control_flow.rs b/evm_arithmetization/src/cpu/control_flow.rs index 18aeb65ba..a88576456 100644 --- a/evm_arithmetization/src/cpu/control_flow.rs +++ b/evm_arithmetization/src/cpu/control_flow.rs @@ -82,8 +82,7 @@ pub(crate) fn eval_packed_generic( // it is set to 0 if the operation is a `PROVER_INPUT`, as the latter is a // kernel-only instruction. This is enforced in the `decode` module. yield_constr.constraint( - lv.op.push_prover_input - * ((lv.is_kernel_mode + lv.general.push().push_prover_input_not_kernel) - P::ONES), + lv.op.push_prover_input * ((lv.is_kernel_mode + lv.general.push().is_not_kernel) - P::ONES), ); // If a non-CPU cycle row is followed by a CPU cycle row, then: @@ -152,10 +151,7 @@ pub(crate) fn eval_ext_circuit, const D: usize>( // it is set to 0 if the operation is a `PROVER_INPUT`, as the latter is a // kernel-only instruction. This is enforced in the `decode` module. { - let temp = builder.add_extension( - lv.is_kernel_mode, - lv.general.push().push_prover_input_not_kernel, - ); + let temp = builder.add_extension(lv.is_kernel_mode, lv.general.push().is_not_kernel); let constr = builder.mul_sub_extension(lv.op.push_prover_input, temp, lv.op.push_prover_input); yield_constr.constraint(builder, constr); diff --git a/evm_arithmetization/src/cpu/cpu_stark.rs b/evm_arithmetization/src/cpu/cpu_stark.rs index a30306afb..55a3bf2d4 100644 --- a/evm_arithmetization/src/cpu/cpu_stark.rs +++ b/evm_arithmetization/src/cpu/cpu_stark.rs @@ -265,7 +265,7 @@ pub(crate) fn ctl_data_byte_packing_push() -> Vec> { pub(crate) fn ctl_filter_byte_packing_push() -> Filter { Filter::new( vec![( - Column::single(COL_MAP.general.push().push_prover_input_not_kernel), + Column::single(COL_MAP.general.push().is_not_kernel), Column::single(COL_MAP.op.push_prover_input), )], vec![], diff --git a/evm_arithmetization/src/witness/operation.rs b/evm_arithmetization/src/witness/operation.rs index 233e47ff6..07d48819b 100644 --- a/evm_arithmetization/src/witness/operation.rs +++ b/evm_arithmetization/src/witness/operation.rs @@ -388,7 +388,7 @@ pub(crate) fn generate_push>( // This is necessary to filter out PUSH instructions from the BytePackingStark // CTl when happening in the KERNEL context. - row.general.push_mut().push_prover_input_not_kernel = F::ONE - row.is_kernel_mode; + row.general.push_mut().is_not_kernel = F::ONE - row.is_kernel_mode; if code_context != KERNEL_CONTEXT { byte_packing_log(state, base_address, bytes);