Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions circuit-benchmarks/src/tx_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -59,7 +59,7 @@ mod tests {
s: word!("0x61159fa4664b698ea7d518526c96cd94cf4d8adf418000754be106a3a133f866"),
}];

let randomness = Fr::random(&mut rng);
let randomness = Fr::from(0xcafeu64);
let mut instance: Vec<Vec<Fr>> = (1..POW_RAND_SIZE + 1)
.map(|exp| vec![randomness.pow(&[exp as u64, 0, 0, 0]); MAX_TXS * VERIF_HEIGHT])
.collect();
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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::<Fr>::new(randomness, rw_map, 1 << 16);
let power_of_randomness = circuit.instance();

Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/evm_circuit/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -1423,7 +1423,7 @@ pub fn block_convert(
code_db: &bus_mapping::state_db::CodeDB,
) -> Block<Fr> {
Block {
randomness: Fr::rand(),
randomness: Fr::from(0xcafeu64),
context: block.into(),
rws: RwMap::from(&block.container),
txs: block
Expand Down
7 changes: 3 additions & 4 deletions zkevm-circuits/src/state_circuit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -91,7 +90,7 @@ fn test_state_circuit_ok(
..Default::default()
});

let randomness = Fr::rand();
let randomness = Fr::from(0xcafeu64);
let circuit = StateCircuit::<Fr>::new(randomness, rw_map, N_ROWS);
let power_of_randomness = circuit.instance();

Expand All @@ -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::<G1Affine>::unsafe_setup::<Bn256>(degree);

Expand Down Expand Up @@ -981,7 +980,7 @@ fn bad_initial_tx_receipt_value() {
}

fn prover(rows: Vec<Rw>, overrides: HashMap<(AdviceColumn, isize), Fr>) -> MockProver<Fr> {
let randomness = Fr::rand();
let randomness = Fr::from(0xcafeu64);
let circuit = StateCircuit::<Fr> {
randomness,
rows,
Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/super_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 =
<Secp256k1Affine as CurveAffine>::CurveExt::random(&mut rng).to_affine();
Expand Down