@@ -42,10 +42,11 @@ pub struct ProofAggregator {
4242 engine : ZKVMEngine ,
4343 proof_aggregation_service : AlignedProofAggregationServiceContract ,
4444 fetcher : ProofsFetcher ,
45+ config : Config ,
4546}
4647
4748impl ProofAggregator {
48- pub fn new ( config : & Config ) -> Self {
49+ pub fn new ( config : Config ) -> Self {
4950 let rpc_url = config. eth_rpc_url . parse ( ) . expect ( "RPC URL should be valid" ) ;
5051 let signer = LocalSigner :: decrypt_keystore (
5152 config. ecdsa . private_key_store_path . clone ( ) ,
@@ -62,24 +63,25 @@ impl ProofAggregator {
6263
6364 let engine =
6465 ZKVMEngine :: from_env ( ) . expect ( "AGGREGATOR env variable to be set to one of sp1|risc0" ) ;
65- let fetcher = ProofsFetcher :: new ( config) ;
66+ let fetcher = ProofsFetcher :: new ( & config) ;
6667
6768 Self {
6869 engine,
6970 proof_aggregation_service,
7071 fetcher,
72+ config,
7173 }
7274 }
7375
74- pub async fn start ( & mut self , config : & Config ) {
76+ pub async fn start ( & mut self ) {
7577 info ! ( "Starting proof aggregator service" ) ;
7678
7779 info ! ( "About to aggregate and submit proof to be verified on chain" ) ;
7880 let res = self . aggregate_and_submit_proofs_on_chain ( ) . await ;
7981
8082 match res {
8183 Ok ( ( ) ) => {
82- config
84+ self . config
8385 . update_last_aggregated_block ( self . fetcher . get_last_aggregated_block ( ) )
8486 . unwrap ( ) ;
8587 info ! ( "Process finished successfully" ) ;
@@ -113,7 +115,7 @@ impl ProofAggregator {
113115 info ! ( "Starting proof aggregation program..." ) ;
114116 let ( aggregated_proof, zkvm_merkle_root) = self
115117 . engine
116- . aggregate_proofs ( proofs)
118+ . aggregate_proofs ( proofs, self . config . proofs_per_chunk )
117119 . map_err ( AggregatedProofSubmissionError :: ZKVMAggregation ) ?;
118120 info ! ( "Proof aggregation program finished" ) ;
119121
0 commit comments