From 6d3d2cb2838e4e19a6ab4ef14ddc8e39c27ab04f Mon Sep 17 00:00:00 2001 From: BGluth Date: Thu, 7 Sep 2023 13:32:07 -0600 Subject: [PATCH 1/2] Now builds on the latest nightly --- evm/src/cpu/kernel/constants/exc_bitfields.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evm/src/cpu/kernel/constants/exc_bitfields.rs b/evm/src/cpu/kernel/constants/exc_bitfields.rs index 2f62b032..6751d963 100644 --- a/evm/src/cpu/kernel/constants/exc_bitfields.rs +++ b/evm/src/cpu/kernel/constants/exc_bitfields.rs @@ -4,7 +4,7 @@ use ethereum_types::U256; /// Create a U256, where the bits at indices inside the specified ranges are set to 1, and all other /// bits are set to 0. -const fn u256_from_set_index_ranges(ranges: [RangeInclusive; N]) -> U256 { +const fn u256_from_set_index_ranges(ranges: &[RangeInclusive; N]) -> U256 { let mut j = 0; let mut res_limbs = [0u64; 4]; while j < ranges.len() { @@ -28,7 +28,7 @@ const fn u256_from_set_index_ranges(ranges: [RangeInclusive; U256(res_limbs) } -pub const STACK_LENGTH_INCREASING_OPCODES_USER: U256 = u256_from_set_index_ranges([ +pub const STACK_LENGTH_INCREASING_OPCODES_USER: U256 = u256_from_set_index_ranges(&[ 0x30..=0x30, // ADDRESS 0x32..=0x34, // ORIGIN, CALLER, CALLVALUE 0x36..=0x36, // CALLDATASIZE @@ -40,7 +40,7 @@ pub const STACK_LENGTH_INCREASING_OPCODES_USER: U256 = u256_from_set_index_range 0x5f..=0x8f, // PUSH*, DUP* ]); -pub const INVALID_OPCODES_USER: U256 = u256_from_set_index_ranges([ +pub const INVALID_OPCODES_USER: U256 = u256_from_set_index_ranges(&[ 0x0c..=0x0f, 0x1e..=0x1f, 0x21..=0x2f, From 4716fe7db41f6151de3b5dd0784f8e7d0b50d284 Mon Sep 17 00:00:00 2001 From: BGluth Date: Thu, 7 Sep 2023 13:33:08 -0600 Subject: [PATCH 2/2] Also included clippy fixes introduced by new nightly --- plonky2/src/fri/prover.rs | 2 +- plonky2/src/iop/challenger.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plonky2/src/fri/prover.rs b/plonky2/src/fri/prover.rs index 28cd1977..378f1dae 100644 --- a/plonky2/src/fri/prover.rs +++ b/plonky2/src/fri/prover.rs @@ -136,7 +136,7 @@ fn fri_proof_of_work, C: GenericConfig, c // obtaining our duplex's post-state which contains the PoW response. let mut duplex_intermediate_state = challenger.sponge_state; let witness_input_pos = challenger.input_buffer.len(); - duplex_intermediate_state.set_from_iter(challenger.input_buffer.clone().into_iter(), 0); + duplex_intermediate_state.set_from_iter(challenger.input_buffer.clone(), 0); let pow_witness = (0..=F::NEG_ONE.to_canonical_u64()) .into_par_iter() diff --git a/plonky2/src/iop/challenger.rs b/plonky2/src/iop/challenger.rs index d1751d38..9df49996 100644 --- a/plonky2/src/iop/challenger.rs +++ b/plonky2/src/iop/challenger.rs @@ -332,8 +332,8 @@ mod tests { // These are mostly arbitrary, but we want to test some rounds with enough inputs/outputs to // trigger multiple absorptions/squeezes. - let num_inputs_per_round = vec![2, 5, 3]; - let num_outputs_per_round = vec![1, 2, 4]; + let num_inputs_per_round = [2, 5, 3]; + let num_outputs_per_round = [1, 2, 4]; // Generate random input messages. let inputs_per_round: Vec> = num_inputs_per_round