@@ -8,7 +8,7 @@ use prover_primitives::{alloy_primitives::keccak256, B256};
88use prover_utils:: read_env_var;
99#[ cfg( feature = "local" ) ]
1010use sp1_sdk:: CpuProver ;
11- #[ cfg( feature = "network" ) ]
11+ #[ cfg( all ( feature = "network" , not ( feature = "local" ) ) ) ]
1212use sp1_sdk:: { network:: NetworkMode , NetworkProver } ;
1313use sp1_sdk:: { HashableKey , Prover , ProverClient , SP1ProvingKey , SP1Stdin , SP1VerifyingKey } ;
1414use sp1_verifier:: PlonkVerifier ;
@@ -27,16 +27,21 @@ pub struct BatchProver<C> {
2727 vk : SP1VerifyingKey ,
2828}
2929
30- #[ cfg( feature = "network" ) ]
31- pub type DefaultClient = NetworkProver ;
3230#[ cfg( feature = "local" ) ]
3331pub type DefaultClient = CpuProver ;
32+ #[ cfg( all( feature = "network" , not( feature = "local" ) ) ) ]
33+ pub type DefaultClient = NetworkProver ;
34+
35+ // If both features are enabled (e.g. defaults + `--features local`), prefer `local`.
36+ // If neither is enabled, fail fast with a clear message.
37+ #[ cfg( all( not( feature = "local" ) , not( feature = "network" ) ) ) ]
38+ compile_error ! ( "One of `local` or `network` features must be enabled for morph-prove." ) ;
3439
3540/// A batch prover that uses the default proving client based on the feature flag.
3641impl Default for BatchProver < DefaultClient > {
3742 fn default ( ) -> Self {
3843 let prover_client = {
39- #[ cfg( feature = "network" ) ]
44+ #[ cfg( all ( feature = "network" , not ( feature = "local" ) ) ) ]
4045 {
4146 ProverClient :: builder ( )
4247 . network_for ( NetworkMode :: Mainnet )
0 commit comments