@@ -24,7 +24,7 @@ use crate::{
2424 SP1VerifyingKey ,
2525} ;
2626
27- #[ cfg( feature = "sepolia" ) ]
27+ #[ cfg( not ( feature = "reserved-capacity" ) ) ]
2828use crate :: network:: proto:: types:: GetProofRequestParamsResponse ;
2929
3030use alloy_primitives:: { Address , B256 , U256 } ;
@@ -43,6 +43,12 @@ pub struct NetworkProver {
4343 pub ( crate ) tee_signers : Vec < Address > ,
4444}
4545
46+ #[ cfg( feature = "reserved-capacity" ) ]
47+ const DEFAULT_FULFILLMENT_STRATEGY : FulfillmentStrategy = FulfillmentStrategy :: Reserved ;
48+
49+ #[ cfg( not( feature = "reserved-capacity" ) ) ]
50+ const DEFAULT_FULFILLMENT_STRATEGY : FulfillmentStrategy = FulfillmentStrategy :: Auction ;
51+
4652impl NetworkProver {
4753 /// Creates a new [`NetworkProver`] with the given private key.
4854 ///
@@ -139,7 +145,7 @@ impl NetworkProver {
139145 pk,
140146 stdin : stdin. clone ( ) ,
141147 timeout : None ,
142- strategy : FulfillmentStrategy :: Hosted ,
148+ strategy : DEFAULT_FULFILLMENT_STRATEGY ,
143149 skip_simulation : false ,
144150 cycle_limit : None ,
145151 gas_limit : None ,
@@ -190,7 +196,7 @@ impl NetworkProver {
190196 /// let params = client.get_proof_request_params(SP1ProofMode::Compressed).await.unwrap();
191197 /// })
192198 /// ```
193- #[ cfg( feature = "sepolia" ) ]
199+ #[ cfg( not ( feature = "reserved-capacity" ) ) ]
194200 pub async fn get_proof_request_params (
195201 & self ,
196202 mode : SP1ProofMode ,
@@ -347,16 +353,16 @@ impl NetworkProver {
347353 ) -> Result < B256 > {
348354 // Ensure the strategy is supported in the network.
349355 cfg_if:: cfg_if! {
350- if #[ cfg( feature = "sepolia" ) ] {
356+ if #[ cfg( not ( feature = "reserved-capacity" ) ) ] {
351357 if strategy != FulfillmentStrategy :: Auction {
352358 return Err ( anyhow:: anyhow!(
353- "Strategy not supported with \" sepolia \" feature. Use FulfillmentStrategy::Auction."
359+ "This fulfillment strategy requires the \" reserved-capacity \" feature on sp1-sdk . Use FulfillmentStrategy::Auction or enable the feature ."
354360 ) ) ;
355361 }
356362 } else {
357363 if strategy == FulfillmentStrategy :: Auction {
358364 return Err ( anyhow:: anyhow!(
359- "FulfillmentStrategy::Auction requires the \" sepolia \" feature."
365+ "FulfillmentStrategy::Auction is not available with the \" reserved-capacity \" feature on sp1-sdk. Use a different strategy or disable the feature."
360366 ) ) ;
361367 }
362368 }
@@ -568,6 +574,7 @@ impl NetworkProver {
568574 let mut whitelist = whitelist. clone ( ) ;
569575
570576 // Attempt to get proof, with retry logic for failed auction requests.
577+ #[ allow( clippy:: never_loop) ]
571578 loop {
572579 let request_id = self
573580 . request_proof_impl (
@@ -612,7 +619,7 @@ impl NetworkProver {
612619 let mut proof = match self . wait_proof ( request_id, timeout, auction_timeout) . await {
613620 Ok ( proof) => proof,
614621 Err ( e) => {
615- #[ cfg( feature = "sepolia" ) ]
622+ #[ cfg( not ( feature = "reserved-capacity" ) ) ]
616623 // Check if this is an auction request that we can retry.
617624 if let Some ( network_error) = e. downcast_ref :: < Error > ( ) {
618625 if matches ! (
@@ -747,7 +754,7 @@ impl NetworkProver {
747754 max_price_per_pgu : Option < u64 > ,
748755 ) -> Result < ( Address , Address , Address , u64 , u64 , Vec < u8 > ) > {
749756 cfg_if:: cfg_if! {
750- if #[ cfg( feature = "sepolia" ) ] {
757+ if #[ cfg( not ( feature = "reserved-capacity" ) ) ] {
751758 let params = self . get_proof_request_params( mode) . await ?;
752759 let auctioneer_value = if let Some ( auctioneer) = auctioneer {
753760 auctioneer
@@ -811,7 +818,7 @@ impl Prover<CpuProverComponents> for NetworkProver {
811818 pk,
812819 stdin,
813820 mode,
814- FulfillmentStrategy :: Hosted ,
821+ DEFAULT_FULFILLMENT_STRATEGY ,
815822 None ,
816823 false ,
817824 None ,
0 commit comments