Skip to content

Commit 6fd0da2

Browse files
committed
fix: remove unstable features from plonky2
Signed-off-by: Brandon H. Gomes <[email protected]>
1 parent 11600b9 commit 6fd0da2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+213
-370
lines changed

ecdsa/src/curve/curve_msm.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use itertools::Itertools;
2-
use plonky2_field::types::Field;
3-
use plonky2_field::types::PrimeField;
2+
use plonky2_field::types::{Field, PrimeField};
43
use rayon::prelude::*;
54

65
use crate::curve::curve_summation::affine_multisummation_best;
@@ -188,8 +187,7 @@ pub(crate) fn to_digits<C: Curve>(x: &C::ScalarField, w: usize) -> Vec<usize> {
188187
mod tests {
189188
use num::BigUint;
190189
use plonky2_field::secp256k1_scalar::Secp256K1Scalar;
191-
use plonky2_field::types::Field;
192-
use plonky2_field::types::PrimeField;
190+
use plonky2_field::types::{Field, PrimeField};
193191

194192
use crate::curve::curve_msm::{msm_execute, msm_precompute, to_digits};
195193
use crate::curve::curve_types::Curve;

ecdsa/src/curve/curve_multiplication.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::ops::Mul;
22

3-
use plonky2_field::types::Field;
4-
use plonky2_field::types::PrimeField;
3+
use plonky2_field::types::{Field, PrimeField};
54

65
use crate::curve::curve_types::{Curve, CurveScalar, ProjectivePoint};
76

ecdsa/src/curve/secp256k1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ const SECP256K1_GENERATOR_Y: Secp256K1Base = Secp256K1Base([
4141
mod tests {
4242
use num::BigUint;
4343
use plonky2_field::secp256k1_scalar::Secp256K1Scalar;
44-
use plonky2_field::types::Field;
45-
use plonky2_field::types::PrimeField;
44+
use plonky2_field::types::{Field, PrimeField};
4645

4746
use crate::curve::curve_types::{AffinePoint, Curve, ProjectivePoint};
4847
use crate::curve::secp256k1::Secp256K1;

ecdsa/src/gadgets/biguint.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,10 @@ impl<F: RichField + Extendable<D>, const D: usize> SimpleGenerator<F>
346346
mod tests {
347347
use anyhow::Result;
348348
use num::{BigUint, FromPrimitive, Integer};
349+
use plonky2::iop::witness::PartialWitness;
350+
use plonky2::plonk::circuit_builder::CircuitBuilder;
351+
use plonky2::plonk::circuit_data::CircuitConfig;
349352
use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig};
350-
use plonky2::{
351-
iop::witness::PartialWitness,
352-
plonk::{circuit_builder::CircuitBuilder, circuit_data::CircuitConfig},
353-
};
354353
use rand::Rng;
355354

356355
use crate::gadgets::biguint::{CircuitBuilderBiguint, WitnessBigUint};

ecdsa/src/gadgets/curve_fixed_base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ mod tests {
7171
use plonky2::plonk::circuit_data::CircuitConfig;
7272
use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig};
7373
use plonky2_field::secp256k1_scalar::Secp256K1Scalar;
74-
use plonky2_field::types::Field;
75-
use plonky2_field::types::PrimeField;
74+
use plonky2_field::types::{Field, PrimeField};
7675

7776
use crate::curve::curve_types::{Curve, CurveScalar};
7877
use crate::curve::secp256k1::Secp256K1;

ecdsa/src/gadgets/nonnative.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use plonky2::iop::generator::{GeneratedValues, SimpleGenerator};
66
use plonky2::iop::target::{BoolTarget, Target};
77
use plonky2::iop::witness::PartitionWitness;
88
use plonky2::plonk::circuit_builder::CircuitBuilder;
9-
use plonky2_field::types::PrimeField;
10-
use plonky2_field::{extension::Extendable, types::Field};
9+
use plonky2_field::extension::Extendable;
10+
use plonky2_field::types::{Field, PrimeField};
1111
use plonky2_u32::gadgets::arithmetic_u32::{CircuitBuilderU32, U32Target};
1212
use plonky2_u32::gadgets::range_check::range_check_u32_circuit;
1313
use plonky2_u32::witness::GeneratedValuesU32;

evm/src/arithmetic/arithmetic_stark.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@ use plonky2::field::extension::{Extendable, FieldExtension};
66
use plonky2::field::packed::PackedField;
77
use plonky2::hash::hash_types::RichField;
88

9-
use crate::arithmetic::add;
10-
use crate::arithmetic::columns;
11-
use crate::arithmetic::compare;
12-
use crate::arithmetic::modular;
13-
use crate::arithmetic::mul;
14-
use crate::arithmetic::sub;
9+
use crate::arithmetic::{add, columns, compare, modular, mul, sub};
1510
use crate::constraint_consumer::{ConstraintConsumer, RecursiveConstraintConsumer};
1611
use crate::stark::Stark;
1712
use crate::vars::{StarkEvaluationTargets, StarkEvaluationVars};

evm/src/arithmetic/modular.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@
8787
//! In the case of DIV, we do something similar, except that we "replace"
8888
//! the modulus with "2^256" to force the quotient to be zero.
8989
90-
use num::{bigint::Sign, BigInt, One, Zero};
90+
use num::bigint::Sign;
91+
use num::{BigInt, One, Zero};
9192
use plonky2::field::extension::Extendable;
9293
use plonky2::field::packed::PackedField;
9394
use plonky2::field::types::Field;

evm/src/bin/assemble.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use std::env;
2-
use std::fs;
1+
use std::{env, fs};
32

43
use hex::encode;
54
use plonky2_evm::cpu::kernel::assemble_to_bytes;

evm/src/cpu/kernel/assembler.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ use plonky2_util::ceil_div_usize;
77

88
use super::ast::PushTarget;
99
use crate::cpu::kernel::ast::Item::LocalLabelDeclaration;
10-
use crate::cpu::kernel::ast::StackReplacement;
10+
use crate::cpu::kernel::ast::{File, Item, StackReplacement};
1111
use crate::cpu::kernel::keccak_util::hash_kernel;
12+
use crate::cpu::kernel::opcodes::{get_opcode, get_push_opcode};
1213
use crate::cpu::kernel::optimizer::optimize_asm;
1314
use crate::cpu::kernel::stack::stack_manipulation::expand_stack_manipulation;
1415
use crate::cpu::kernel::utils::u256_to_trimmed_be_bytes;
15-
use crate::cpu::kernel::{
16-
ast::{File, Item},
17-
opcodes::{get_opcode, get_push_opcode},
18-
};
1916
use crate::generation::prover_input::ProverInputFn;
2017
use crate::keccak_sponge::columns::KECCAK_RATE_BYTES;
2118

@@ -374,8 +371,9 @@ mod tests {
374371

375372
use itertools::Itertools;
376373

374+
use crate::cpu::kernel::assembler::*;
375+
use crate::cpu::kernel::ast::*;
377376
use crate::cpu::kernel::parser::parse;
378-
use crate::cpu::kernel::{assembler::*, ast::*};
379377

380378
#[test]
381379
fn two_files() {

0 commit comments

Comments
 (0)