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;
14
14
pub struct Prover {
15
15
// Make it public for testing with inner functions (unnecessary for FFI).
16
16
pub inner : common:: Prover ,
17
+ verifier : super :: verifier:: Verifier ,
17
18
raw_vk : Option < Vec < u8 > > ,
18
19
}
19
20
@@ -30,7 +31,13 @@ impl Prover {
30
31
) ;
31
32
}
32
33
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
+ }
34
41
}
35
42
36
43
pub fn get_vk ( & self ) -> Option < Vec < u8 > > {
@@ -73,7 +80,9 @@ impl Prover {
73
80
74
81
self . check_and_clear_raw_vk ( ) ;
75
82
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
+ {
77
86
Some ( proof) => Ok ( proof) ,
78
87
None => {
79
88
let chunk_hash = ChunkHash :: from_witness_block ( & witness_block, false ) ;
@@ -87,7 +96,13 @@ impl Prover {
87
96
88
97
result
89
98
}
99
+ } ?;
100
+
101
+ if !self . verifier . verify_chunk_proof ( chunk_proof. clone ( ) ) {
102
+ anyhow:: bail!( "chunk prover cannot generate valid proof" ) ;
90
103
}
104
+
105
+ Ok ( chunk_proof)
91
106
}
92
107
93
108
fn check_and_clear_raw_vk ( & mut self ) {
You can’t perform that action at this time.
0 commit comments