@@ -113,6 +113,10 @@ pub enum ProofType {
113
113
///
114
114
/// Uses the RISC0 prover to build the block.
115
115
Risc0 ,
116
+ /// # powdr
117
+ ///
118
+ /// Uses powdrVM to build the block.
119
+ Powdr ,
116
120
}
117
121
118
122
impl std:: fmt:: Display for ProofType {
@@ -122,6 +126,7 @@ impl std::fmt::Display for ProofType {
122
126
ProofType :: Sp1 => "sp1" ,
123
127
ProofType :: Sgx => "sgx" ,
124
128
ProofType :: Risc0 => "risc0" ,
129
+ ProofType :: Powdr => "powdr" ,
125
130
} )
126
131
}
127
132
}
@@ -135,6 +140,7 @@ impl FromStr for ProofType {
135
140
"sp1" => Ok ( ProofType :: Sp1 ) ,
136
141
"sgx" => Ok ( ProofType :: Sgx ) ,
137
142
"risc0" => Ok ( ProofType :: Risc0 ) ,
143
+ "powdr" => Ok ( ProofType :: Powdr ) ,
138
144
_ => Err ( RaikoError :: InvalidProofType ( s. to_string ( ) ) ) ,
139
145
}
140
146
}
@@ -149,6 +155,7 @@ impl TryFrom<u8> for ProofType {
149
155
1 => Ok ( Self :: Sp1 ) ,
150
156
2 => Ok ( Self :: Sgx ) ,
151
157
3 => Ok ( Self :: Risc0 ) ,
158
+ 4 => Ok ( Self :: Powdr ) ,
152
159
_ => Err ( RaikoError :: Conversion ( "Invalid u8" . to_owned ( ) ) ) ,
153
160
}
154
161
}
@@ -161,6 +168,7 @@ impl From<ProofType> for VerifierType {
161
168
ProofType :: Sp1 => VerifierType :: SP1 ,
162
169
ProofType :: Sgx => VerifierType :: SGX ,
163
170
ProofType :: Risc0 => VerifierType :: RISC0 ,
171
+ ProofType :: Powdr => VerifierType :: Powdr ,
164
172
}
165
173
}
166
174
}
@@ -194,6 +202,14 @@ impl ProofType {
194
202
#[ cfg( not( feature = "risc0" ) ) ]
195
203
Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
196
204
}
205
+ ProofType :: Powdr => {
206
+ #[ cfg( feature = "powdr" ) ]
207
+ return powdr_driver:: PowdrProver :: run ( input. clone ( ) , output, config, store)
208
+ . await
209
+ . map_err ( |e| e. into ( ) ) ;
210
+ #[ cfg( not( feature = "powdr" ) ) ]
211
+ Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
212
+ }
197
213
ProofType :: Sgx => {
198
214
#[ cfg( feature = "sgx" ) ]
199
215
return sgx_prover:: SgxProver :: run ( input. clone ( ) , output, config, store)
@@ -233,6 +249,14 @@ impl ProofType {
233
249
#[ cfg( not( feature = "risc0" ) ) ]
234
250
Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
235
251
}
252
+ ProofType :: Powdr => {
253
+ #[ cfg( feature = "powdr" ) ]
254
+ return powdr_driver:: PowdrProver :: aggregate ( input. clone ( ) , output, config, store)
255
+ . await
256
+ . map_err ( |e| e. into ( ) ) ;
257
+ #[ cfg( not( feature = "powdr" ) ) ]
258
+ Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
259
+ }
236
260
ProofType :: Sgx => {
237
261
#[ cfg( feature = "sgx" ) ]
238
262
return sgx_prover:: SgxProver :: aggregate ( input. clone ( ) , output, config, store)
@@ -271,6 +295,14 @@ impl ProofType {
271
295
#[ cfg( not( feature = "risc0" ) ) ]
272
296
Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
273
297
}
298
+ ProofType :: Powdr => {
299
+ #[ cfg( feature = "powdr" ) ]
300
+ return powdr_driver:: PowdrProver :: cancel ( proof_key, read)
301
+ . await
302
+ . map_err ( |e| e. into ( ) ) ;
303
+ #[ cfg( not( feature = "powdr" ) ) ]
304
+ Err ( RaikoError :: FeatureNotSupportedError ( * self ) )
305
+ }
274
306
ProofType :: Sgx => {
275
307
#[ cfg( feature = "sgx" ) ]
276
308
return sgx_prover:: SgxProver :: cancel ( proof_key, read)
@@ -355,6 +387,8 @@ pub struct ProverSpecificOpts {
355
387
pub sp1 : Option < Value > ,
356
388
/// RISC0 prover specific options.
357
389
pub risc0 : Option < Value > ,
390
+ /// Powdr prover specific options.
391
+ pub powdr : Option < Value > ,
358
392
}
359
393
360
394
impl < S : :: std:: hash:: BuildHasher + :: std:: default:: Default > From < ProverSpecificOpts >
0 commit comments