diff --git a/evm/src/arithmetic/arithmetic_stark.rs b/evm/src/arithmetic/arithmetic_stark.rs index 4fcbb534..4695798a 100644 --- a/evm/src/arithmetic/arithmetic_stark.rs +++ b/evm/src/arithmetic/arithmetic_stark.rs @@ -138,8 +138,10 @@ impl ArithmeticStark { } // Pad the trace with zero rows if it doesn't have enough rows - // to accommodate the range check columns. - for _ in trace_rows.len()..RANGE_MAX { + // to accommodate the range check columns. Also make sure the + // trace length is a power of two. + let padded_len = trace_rows.len().next_power_of_two(); + for _ in trace_rows.len()..std::cmp::max(padded_len, RANGE_MAX) { trace_rows.push(vec![F::ZERO; columns::NUM_ARITH_COLUMNS]); }