Skip to content

Commit

Permalink
use Ws instead of Http and clean compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft committed Feb 28, 2023
1 parent 2dd437d commit 85f6da7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions prover/src/circuit_witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use eth_types::ToBigEndian;
use eth_types::Word;
use eth_types::H256;
use eth_types::{geth_types, Bytes};
use ethers_providers::Http;
// use ethers_providers::Http;
use ethers_providers::Ws;
use halo2_proofs::halo2curves::bn256::Fr;
use std::str::FromStr;
// use std::str::FromStr;
use zkevm_circuits::evm_circuit;
use zkevm_circuits::pi_circuit::PublicData;
use zkevm_common::prover::CircuitConfig;
Expand Down Expand Up @@ -72,14 +73,14 @@ impl CircuitWitness {
propose_tx_hash: &str,
l2_rpc_url: &str,
) -> Result<Self, Box<dyn std::error::Error>> {
let l1_url = Http::from_str(l1_rpc_url)?;
let l1_url = Ws::connect(l1_rpc_url).await?;
let l1_geth_client = GethClient::new(l1_url);
let propose_tx_hash = eth_types::H256::from_slice(
&hex::decode(propose_tx_hash).expect("parse propose tx hash"),
);
let txs_rlp = get_txs_rlp(&l1_geth_client, propose_tx_hash).await?;

let l2_url = Http::from_str(l2_rpc_url)?;
let l2_url = Ws::connect(l2_rpc_url).await?;
let l2_geth_client = GethClient::new(l2_url);
// TODO: add support for `eth_getHeaderByNumber`
let block = l2_geth_client
Expand Down
8 changes: 4 additions & 4 deletions prover/src/shared_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::circuit_witness::CircuitWitness;
use crate::circuits::*;
use crate::utils::collect_instance;
use crate::utils::fixed_rng;
use crate::utils::gen_num_instance;
// use crate::utils::gen_num_instance;
use crate::utils::gen_proof;
use crate::G1Affine;
use crate::ProverKey;
Expand All @@ -17,10 +17,10 @@ use halo2_proofs::plonk::{keygen_pk, keygen_vk};
use halo2_proofs::poly::commitment::Params;
use hyper::Uri;
use rand::{thread_rng, Rng};
use snark_verifier::loader::native::NativeLoader;
use snark_verifier::system::halo2::compile;
// use snark_verifier::loader::native::NativeLoader;
// use snark_verifier::system::halo2::compile;
use snark_verifier::system::halo2::transcript::evm::EvmTranscript;
use snark_verifier::system::halo2::Config as PlonkConfig;
// use snark_verifier::system::halo2::Config as PlonkConfig;
use std::collections::HashMap;
use std::fmt::Write;
use std::fs::File;
Expand Down

0 comments on commit 85f6da7

Please sign in to comment.