This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use eth_types::l2_types::BlockTrace;
1414pub struct Prover {
1515 // Make it public for testing with inner functions (unnecessary for FFI).
1616 pub inner : common:: Prover ,
17+ verifier : super :: verifier:: Verifier ,
1718 raw_vk : Option < Vec < u8 > > ,
1819}
1920
@@ -30,7 +31,13 @@ impl Prover {
3031 ) ;
3132 }
3233
33- Self { inner, raw_vk }
34+ let verifier = super :: verifier:: Verifier :: from_dirs ( params_dir, assets_dir) ;
35+
36+ Self {
37+ inner,
38+ raw_vk,
39+ verifier,
40+ }
3441 }
3542
3643 pub fn get_vk ( & self ) -> Option < Vec < u8 > > {
@@ -73,7 +80,9 @@ impl Prover {
7380
7481 self . check_and_clear_raw_vk ( ) ;
7582
76- match output_dir. and_then ( |output_dir| ChunkProof :: from_json_file ( output_dir, & name) . ok ( ) ) {
83+ let chunk_proof = match output_dir
84+ . and_then ( |output_dir| ChunkProof :: from_json_file ( output_dir, & name) . ok ( ) )
85+ {
7786 Some ( proof) => Ok ( proof) ,
7887 None => {
7988 let chunk_hash = ChunkHash :: from_witness_block ( & witness_block, false ) ;
@@ -87,7 +96,13 @@ impl Prover {
8796
8897 result
8998 }
99+ } ?;
100+
101+ if !self . verifier . verify_chunk_proof ( chunk_proof. clone ( ) ) {
102+ anyhow:: bail!( "chunk prover cannot generate valid proof" ) ;
90103 }
104+
105+ Ok ( chunk_proof)
91106 }
92107
93108 fn check_and_clear_raw_vk ( & mut self ) {
You can’t perform that action at this time.
0 commit comments