From 8b58725fa8608fbe73fc17a6d806c24787899752 Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Fri, 30 Sep 2022 10:22:46 -0700 Subject: [PATCH] Fix bootstrap channel indices --- evm/src/cpu/bootstrap_kernel.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/evm/src/cpu/bootstrap_kernel.rs b/evm/src/cpu/bootstrap_kernel.rs index 533589af..dd52f166 100644 --- a/evm/src/cpu/bootstrap_kernel.rs +++ b/evm/src/cpu/bootstrap_kernel.rs @@ -17,7 +17,6 @@ use crate::cpu::kernel::aggregator::KERNEL; use crate::cpu::kernel::keccak_util::keccakf_u32s; use crate::generation::state::GenerationState; use crate::memory::segments::Segment; -use crate::memory::NUM_CHANNELS; use crate::vars::{StarkEvaluationTargets, StarkEvaluationVars}; /// The Keccak rate (1088 bits), measured in bytes. @@ -47,8 +46,7 @@ pub(crate) fn generate_bootstrap_kernel(state: &mut GenerationState // Write this chunk to memory, while simultaneously packing its bytes into a u32 word. let mut packed_bytes: u32 = 0; - for (addr, byte) in chunk { - let channel = addr % NUM_CHANNELS; + for (channel, (addr, byte)) in chunk.enumerate() { state.set_mem_cpu_current(channel, Segment::Code, addr, byte.into()); packed_bytes = (packed_bytes << 8) | byte as u32;