diff --git a/circuit-benchmarks/src/tx_circuit.rs b/circuit-benchmarks/src/tx_circuit.rs index f5f1fbd16c..03ed22aca6 100644 --- a/circuit-benchmarks/src/tx_circuit.rs +++ b/circuit-benchmarks/src/tx_circuit.rs @@ -7,7 +7,7 @@ mod tests { use env_logger::Env; use eth_types::{address, geth_types::Transaction, word, Bytes}; use group::{Curve, Group}; - use halo2_proofs::arithmetic::{BaseExt, CurveAffine, Field}; + use halo2_proofs::arithmetic::{BaseExt, CurveAffine}; use halo2_proofs::plonk::{create_proof, keygen_pk, keygen_vk, verify_proof, SingleVerifier}; use halo2_proofs::{ pairing::bn256::{Bn256, Fr, G1Affine}, @@ -59,7 +59,7 @@ mod tests { s: word!("0x61159fa4664b698ea7d518526c96cd94cf4d8adf418000754be106a3a133f866"), }]; - let randomness = Fr::random(&mut rng); + let randomness = Fr::from(0xcafeu64); let mut instance: Vec> = (1..POW_RAND_SIZE + 1) .map(|exp| vec![randomness.pow(&[exp as u64, 0, 0, 0]); MAX_TXS * VERIF_HEIGHT]) .collect(); diff --git a/integration-tests/tests/circuits.rs b/integration-tests/tests/circuits.rs index 2171039c6e..3e5c953202 100644 --- a/integration-tests/tests/circuits.rs +++ b/integration-tests/tests/circuits.rs @@ -25,7 +25,6 @@ async fn test_evm_circuit_block(block_num: u64) { } async fn test_state_circuit_block(block_num: u64) { - use halo2_proofs::arithmetic::BaseExt; use halo2_proofs::pairing::bn256::Fr; log::info!("test state circuit, block number: {}", block_num); @@ -50,7 +49,7 @@ async fn test_state_circuit_block(block_num: u64) { ..Default::default() }); - let randomness = Fr::rand(); + let randomness = Fr::from(0xcafeu64); let circuit = StateCircuit::::new(randomness, rw_map, 1 << 16); let power_of_randomness = circuit.instance(); diff --git a/zkevm-circuits/src/evm_circuit/witness.rs b/zkevm-circuits/src/evm_circuit/witness.rs index 23d4133044..98f120b3ca 100644 --- a/zkevm-circuits/src/evm_circuit/witness.rs +++ b/zkevm-circuits/src/evm_circuit/witness.rs @@ -20,7 +20,7 @@ use bus_mapping::{ use eth_types::{evm_types::OpcodeId, ToWord}; use eth_types::{Address, Field, ToLittleEndian, ToScalar, Word}; use eth_types::{ToAddress, U256}; -use halo2_proofs::arithmetic::{BaseExt, FieldExt}; +use halo2_proofs::arithmetic::FieldExt; use halo2_proofs::pairing::bn256::Fr; use itertools::Itertools; use sha3::{Digest, Keccak256}; @@ -1423,7 +1423,7 @@ pub fn block_convert( code_db: &bus_mapping::state_db::CodeDB, ) -> Block { Block { - randomness: Fr::rand(), + randomness: Fr::from(0xcafeu64), context: block.into(), rws: RwMap::from(&block.container), txs: block diff --git a/zkevm-circuits/src/state_circuit/test.rs b/zkevm-circuits/src/state_circuit/test.rs index 9caa98de4f..e9fb24ed22 100644 --- a/zkevm-circuits/src/state_circuit/test.rs +++ b/zkevm-circuits/src/state_circuit/test.rs @@ -14,7 +14,6 @@ use eth_types::{ use gadgets::binary_number::AsBits; use halo2_proofs::poly::commitment::Params; use halo2_proofs::{ - arithmetic::BaseExt, dev::{MockProver, VerifyFailure}, pairing::bn256::{Bn256, Fr, G1Affine}, plonk::{keygen_vk, Advice, Circuit, Column, ConstraintSystem}, @@ -91,7 +90,7 @@ fn test_state_circuit_ok( ..Default::default() }); - let randomness = Fr::rand(); + let randomness = Fr::from(0xcafeu64); let circuit = StateCircuit::::new(randomness, rw_map, N_ROWS); let power_of_randomness = circuit.instance(); @@ -109,7 +108,7 @@ fn degree() { #[test] fn verifying_key_independent_of_rw_length() { - let randomness = Fr::rand(); + let randomness = Fr::from(0xcafeu64); let degree = 17; let params = Params::::unsafe_setup::(degree); @@ -981,7 +980,7 @@ fn bad_initial_tx_receipt_value() { } fn prover(rows: Vec, overrides: HashMap<(AdviceColumn, isize), Fr>) -> MockProver { - let randomness = Fr::rand(); + let randomness = Fr::from(0xcafeu64); let circuit = StateCircuit:: { randomness, rows, diff --git a/zkevm-circuits/src/super_circuit.rs b/zkevm-circuits/src/super_circuit.rs index c9e1013163..ff7eddf79b 100644 --- a/zkevm-circuits/src/super_circuit.rs +++ b/zkevm-circuits/src/super_circuit.rs @@ -290,7 +290,7 @@ mod super_circuit_tests { }; use ethers_signers::{LocalWallet, Signer}; use group::{Curve, Group}; - use halo2_proofs::arithmetic::{CurveAffine, Field as Halo2Field}; + use halo2_proofs::arithmetic::CurveAffine; use halo2_proofs::dev::{MockProver, VerifyFailure}; use halo2_proofs::pairing::bn256::Fr; use mock::{TestContext, MOCK_CHAIN_ID}; @@ -426,7 +426,7 @@ mod super_circuit_tests { .handle_block(&block.eth_block, &block.geth_traces) .expect("could not handle block tx"); let mut block = block_convert(&builder.block, &builder.code_db); - block.randomness = Fr::random(&mut rng); + block.randomness = Fr::from(0xcafeu64); let aux_generator = ::CurveExt::random(&mut rng).to_affine();