File tree Expand file tree Collapse file tree 3 files changed +12
-15
lines changed
Expand file tree Collapse file tree 3 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,4 @@ opt-level = 3
4040[features ]
4141default = []
4242prove = []
43- sp1 = []
44- risc0 = []
4543gpu = [" risc0-zkvm/cuda" ]
Original file line number Diff line number Diff line change @@ -23,18 +23,16 @@ impl Display for ZKVMEngine {
2323}
2424
2525impl ZKVMEngine {
26- pub fn from_rust_features ( ) -> Option < Self > {
27- #[ cfg( feature = "sp1" ) ]
28- {
29- return Some ( ZKVMEngine :: SP1 ) ;
30- }
31-
32- #[ cfg( feature = "risc0" ) ]
33- {
34- return Some ( ZKVMEngine :: RISC0 ) ;
35- }
26+ pub fn from_env ( ) -> Option < Self > {
27+ let key = "AGGREGATOR" ;
28+ let value = std:: env:: var ( key) . ok ( ) ?;
29+ let engine = match value. as_str ( ) {
30+ "sp1" => ZKVMEngine :: SP1 ,
31+ "risc0" => ZKVMEngine :: RISC0 ,
32+ _ => panic ! ( "Invalid AGGREGATOR, possible options are: sp1|risc0" ) ,
33+ } ;
3634
37- None
35+ Some ( engine )
3836 }
3937}
4038
Original file line number Diff line number Diff line change @@ -64,7 +64,8 @@ impl ProofAggregator {
6464 rpc_provider,
6565 ) ;
6666
67- let engine = ZKVMEngine :: from_rust_features ( ) . expect ( "A feature defining zkvm engine" ) ;
67+ let engine =
68+ ZKVMEngine :: from_env ( ) . expect ( "AGGREGATOR env variable to be set to one of sp1|risc0" ) ;
6869 let fetcher = ProofsFetcher :: new ( config) ;
6970
7071 Self {
@@ -75,7 +76,7 @@ impl ProofAggregator {
7576 }
7677
7778 pub async fn start ( & mut self , config : & Config ) {
78- info ! ( "Starting proof aggregator service" , ) ;
79+ info ! ( "Starting proof aggregator service" ) ;
7980
8081 info ! ( "About to aggregate and submit proof to be verified on chain" ) ;
8182 let res = self . aggregate_and_submit_proofs_on_chain ( ) . await ;
You can’t perform that action at this time.
0 commit comments