@@ -27,7 +27,7 @@ use sqlx::types::Uuid;
2727use std:: thread:: sleep;
2828use std:: { str:: FromStr , time:: Duration } ;
2929use tracing:: { error, info, warn} ;
30- use types:: { AlignedProofAggregationService , AlignedProofAggregationServiceContract , RPCProvider } ;
30+ use types:: { AlignedProofAggregationService , AlignedProofAggregationServiceContract } ;
3131
3232#[ derive( Debug ) ]
3333pub enum AggregatedProofSubmissionError {
@@ -50,7 +50,6 @@ pub struct ProofAggregator {
5050 proof_aggregation_service : AlignedProofAggregationServiceContract ,
5151 fetcher : ProofsFetcher ,
5252 config : Config ,
53- rpc_provider : RPCProvider ,
5453 sp1_chunk_aggregator_vk_hash_bytes : [ u8 ; 32 ] ,
5554 risc0_chunk_aggregator_image_id_bytes : [ u8 ; 32 ] ,
5655 db : Db ,
@@ -72,8 +71,6 @@ impl ProofAggregator {
7271
7372 info ! ( "Monthly budget set to {} eth" , config. monthly_budget_eth) ;
7473
75- let rpc_provider = ProviderBuilder :: new ( ) . connect_http ( rpc_url. clone ( ) ) ;
76-
7774 let signed_rpc_provider = ProviderBuilder :: new ( ) . wallet ( wallet) . connect_http ( rpc_url) ;
7875
7976 let proof_aggregation_service = AlignedProofAggregationService :: new (
@@ -108,7 +105,6 @@ impl ProofAggregator {
108105 proof_aggregation_service,
109106 fetcher,
110107 config,
111- rpc_provider,
112108 sp1_chunk_aggregator_vk_hash_bytes,
113109 risc0_chunk_aggregator_image_id_bytes,
114110 db,
@@ -226,7 +222,6 @@ impl ProofAggregator {
226222 self . proof_aggregation_service . clone ( ) ,
227223 self . sp1_chunk_aggregator_vk_hash_bytes ,
228224 self . risc0_chunk_aggregator_image_id_bytes ,
229- self . rpc_provider . clone ( ) ,
230225 self . config . monthly_budget_eth ,
231226 )
232227 } ,
@@ -322,7 +317,6 @@ async fn bump_and_send_proof_to_verify_on_chain(
322317 proof_aggregation_service : AlignedProofAggregationServiceContract ,
323318 sp1_chunk_aggregator_vk_hash_bytes : [ u8 ; 32 ] ,
324319 risc0_chunk_aggregator_image_id_bytes : [ u8 ; 32 ] ,
325- rpc_provider : RPCProvider ,
326320 monthly_budget_eth : f64 ,
327321) -> Result < TransactionReceipt , RetryError < AggregatedProofSubmissionError > > {
328322 // We start on 24 hours because the proof aggregator runs once a day, so the time elapsed
@@ -332,9 +326,13 @@ async fn bump_and_send_proof_to_verify_on_chain(
332326 // Iterate until we can send the proof on-chain
333327 loop {
334328 // Fetch gas price from network
335- let gas_price = rpc_provider. get_gas_price ( ) . await . map_err ( |e| {
336- RetryError :: Transient ( AggregatedProofSubmissionError :: GasPriceError ( e. to_string ( ) ) )
337- } ) ?;
329+ let gas_price = proof_aggregation_service
330+ . provider ( )
331+ . get_gas_price ( )
332+ . await
333+ . map_err ( |e| {
334+ RetryError :: Transient ( AggregatedProofSubmissionError :: GasPriceError ( e. to_string ( ) ) )
335+ } ) ?;
338336
339337 if should_send_proof_to_verify_on_chain (
340338 time_elapsed,
0 commit comments