-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapt for "upgrade 5 refactor" (#351)
* running * add the output dir * done * chore: bump serde (unit structs supported in flatten) * bump prover * bump prover * bump prover * fix some env var * clean --------- Co-authored-by: Rohit Narurkar <[email protected]>
- Loading branch information
1 parent
a9a0b02
commit 66b0aee
Showing
21 changed files
with
195 additions
and
233 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"strategy": "Simple", | ||
"degree": 21, | ||
"num_advice": [ | ||
63 | ||
85 | ||
], | ||
"num_lookup_advice": [ | ||
8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pub mod capacity_checker; | ||
pub mod l2geth; | ||
pub mod mock; | ||
pub mod prove; | ||
pub mod test_util; | ||
mod verifier; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use anyhow::bail; | ||
use halo2_proofs::{dev::MockProver, halo2curves::bn256::Fr}; | ||
use prover::{ | ||
eth_types::l2_types::BlockTrace, | ||
zkevm_circuits::{super_circuit::params::ScrollSuperCircuit, util::SubCircuit, witness::Block}, | ||
}; | ||
use snark_verifier_sdk::CircuitExt; | ||
|
||
use prover::{chunk_trace_to_witness_block, metric_of_witness_block, INNER_DEGREE}; | ||
|
||
pub fn mock_prove_target_circuit_chunk(block_traces: Vec<BlockTrace>) -> anyhow::Result<()> { | ||
let witness_block = chunk_trace_to_witness_block(block_traces)?; | ||
mock_prove_witness_block(&witness_block) | ||
} | ||
|
||
pub fn mock_prove_witness_block(witness_block: &Block) -> anyhow::Result<()> { | ||
log::info!( | ||
"mock proving chunk, chunk metric {:?}", | ||
metric_of_witness_block(witness_block) | ||
); | ||
let circuit = ScrollSuperCircuit::new_from_block(witness_block); | ||
let prover = MockProver::<Fr>::run(*INNER_DEGREE, &circuit, circuit.instances())?; | ||
if let Err(errs) = prover.verify_par() { | ||
log::error!("err num: {}", errs.len()); | ||
for err in &errs { | ||
log::error!("{}", err); | ||
} | ||
bail!("{:#?}", errs); | ||
} | ||
log::info!( | ||
"mock prove done. chunk metric: {:?}", | ||
metric_of_witness_block(witness_block), | ||
); | ||
Ok(()) | ||
} |
Oops, something went wrong.