@@ -1168,6 +1168,10 @@ impl Config {
1168
1168
. validate ( )
1169
1169
. map_err ( |e| format ! ( "Atlas config error: {e}" ) ) ?;
1170
1170
1171
+ if miner. mining_key . is_none ( ) && miner. pre_nakamoto_mock_signing {
1172
+ return Err ( "Cannot use pre_nakamoto_mock_signing without a mining_key" . to_string ( ) ) ;
1173
+ }
1174
+
1171
1175
Ok ( Config {
1172
1176
config_path : config_file. __path ,
1173
1177
node,
@@ -2384,7 +2388,7 @@ impl Default for MinerConfig {
2384
2388
max_reorg_depth : 3 ,
2385
2389
// TODO: update to a sane value based on stackerdb benchmarking
2386
2390
wait_on_signers : Duration :: from_secs ( 200 ) ,
2387
- pre_nakamoto_mock_signing : true ,
2391
+ pre_nakamoto_mock_signing : false , // Should only default true if mining key is set
2388
2392
}
2389
2393
}
2390
2394
}
@@ -2739,6 +2743,12 @@ pub struct MinerConfigFile {
2739
2743
2740
2744
impl MinerConfigFile {
2741
2745
fn into_config_default ( self , miner_default_config : MinerConfig ) -> Result < MinerConfig , String > {
2746
+ let mining_key = self
2747
+ . mining_key
2748
+ . as_ref ( )
2749
+ . map ( |x| Secp256k1PrivateKey :: from_hex ( x) )
2750
+ . transpose ( ) ?;
2751
+ let pre_nakamoto_mock_signing = mining_key. is_some ( ) ;
2742
2752
Ok ( MinerConfig {
2743
2753
first_attempt_time_ms : self
2744
2754
. first_attempt_time_ms
@@ -2837,7 +2847,9 @@ impl MinerConfigFile {
2837
2847
. wait_on_signers_ms
2838
2848
. map ( Duration :: from_millis)
2839
2849
. unwrap_or ( miner_default_config. wait_on_signers ) ,
2840
- pre_nakamoto_mock_signing : self . pre_nakamoto_mock_signing . unwrap_or ( true ) ,
2850
+ pre_nakamoto_mock_signing : self
2851
+ . pre_nakamoto_mock_signing
2852
+ . unwrap_or ( pre_nakamoto_mock_signing) , // Should only default true if mining key is set
2841
2853
} )
2842
2854
}
2843
2855
}
0 commit comments