Skip to content

Commit

Permalink
update post param for prover address
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft committed Feb 24, 2023
1 parent f005d7e commit ce9b833
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 15 deletions.
21 changes: 11 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions common/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub struct ProofRequestOptions {
pub block: u64,
/// the rpc url
pub rpc: String,
/// the prover address
pub prover: String,
/// retry proof computation if error
pub retry: bool,
/// Parameters file or directory to use.
Expand Down
1 change: 1 addition & 0 deletions coordinator/src/shared_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ impl SharedState {
circuit: config.circuit_name.clone(),
block: block_num.as_u64(),
rpc: config.l2_rpc_url.to_string(),
prover: String::from(""),
retry: false,
param: config.params_path.clone(),
mock: config.mock_prover,
Expand Down
1 change: 1 addition & 0 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tokio = { version = "1.16.1", features = ["macros", "rt-multi-thread"] }
zkevm_common = { path = "../common" }
itertools = "0.10.3"
clap = { version = "4.0.14", features = ["derive", "env"] }
hex = "0.4.3"

# autogen
mock = { git = "https://github.com/smtmfft/zkevm-circuits.git", branch = "feature/root-circuit", optional = true }
Expand Down
8 changes: 6 additions & 2 deletions prover/src/circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use zkevm_circuits::keccak_circuit::keccak_packed_multi::KeccakCircuit;
use zkevm_circuits::pi_circuit2::PiCircuit;
use zkevm_circuits::pi_circuit2::PiTestCircuit;
use zkevm_circuits::state_circuit::StateCircuit;
use zkevm_circuits::super_circuit::SuperCircuit;
// use zkevm_circuits::super_circuit::SuperCircuit;
use zkevm_circuits::tx_circuit::TxCircuit;
use zkevm_circuits::util::SubCircuit;

Expand Down Expand Up @@ -55,10 +55,14 @@ pub fn gen_pi_circuit<
RNG: Rng,
>(
witness: &CircuitWitness,
prover_address: String,
mut _rng: RNG,
) -> Result<PiTestCircuit<Fr, MAX_TXS, MAX_CALLDATA>, String> {
let block = witness.evm_witness();
let circuit = PiTestCircuit::<Fr, MAX_TXS, MAX_CALLDATA>(PiCircuit::new_from_block(&block));
let prover = eth_types::Address::from_slice(
&hex::decode(prover_address.as_bytes()).expect("parse_address"),
);
let circuit = PiTestCircuit::<Fr, MAX_TXS, MAX_CALLDATA>(PiCircuit::new_from_block_with_prover(&block, prover));

Ok(circuit)
}
Expand Down
5 changes: 2 additions & 3 deletions prover/src/shared_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ macro_rules! gen_proof {
{ CIRCUIT_CONFIG.max_txs },
{ CIRCUIT_CONFIG.max_calldata },
{ CIRCUIT_CONFIG.max_rws },
_,
>(&witness, fixed_rng())?;
_>(&witness, task_options.prover, fixed_rng())?;
circuit_proof.k = CIRCUIT_CONFIG.min_k as u8;
circuit_proof.instance = collect_instance(&circuit.0.instance());
let prover = MockProver::run(CIRCUIT_CONFIG.min_k as u32, &circuit, circuit.0.instance())
Expand All @@ -105,7 +104,7 @@ macro_rules! gen_proof {
{ CIRCUIT_CONFIG.max_calldata },
{ CIRCUIT_CONFIG.max_rws },
_,
>(&witness, fixed_rng())?;
>(&witness, task_options.prover, fixed_rng())?;
// generate and cache the prover key
let pk = {
let cache_key = format!(
Expand Down

0 comments on commit ce9b833

Please sign in to comment.