From 841c58294d51746e71869e85bbf96f7aeba110b3 Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Thu, 20 Apr 2023 14:13:26 +0200 Subject: [PATCH] Fix todo in kernel bootstrapping --- evm/src/cpu/bootstrap_kernel.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/evm/src/cpu/bootstrap_kernel.rs b/evm/src/cpu/bootstrap_kernel.rs index 192c4e7a..f29c3c1f 100644 --- a/evm/src/cpu/bootstrap_kernel.rs +++ b/evm/src/cpu/bootstrap_kernel.rs @@ -85,8 +85,11 @@ pub(crate) fn eval_bootstrap_kernel>( } // If this is the final bootstrap row (i.e. delta_is_bootstrap = 1), check that - // - all memory channels are disabled (TODO) + // - all memory channels are disabled // - the current kernel hash matches a precomputed one + for channel in local_values.mem_channels.iter() { + yield_constr.constraint_transition(delta_is_bootstrap * channel.used); + } for (&expected, actual) in KERNEL .code_hash .iter() @@ -141,8 +144,12 @@ pub(crate) fn eval_bootstrap_kernel_circuit, const } // If this is the final bootstrap row (i.e. delta_is_bootstrap = 1), check that - // - all memory channels are disabled (TODO) + // - all memory channels are disabled // - the current kernel hash matches a precomputed one + for channel in local_values.mem_channels.iter() { + let constraint = builder.mul_extension(delta_is_bootstrap, channel.used); + yield_constr.constraint_transition(builder, constraint); + } for (&expected, actual) in KERNEL .code_hash .iter()