Skip to content

Commit e2a2d7a

Browse files
committed
use max_execution_time_secs instead of max_execution_time
1 parent 5612e6f commit e2a2d7a

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

stackslib/src/config/mod.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,13 +1104,9 @@ impl Config {
11041104
},
11051105
miner_status,
11061106
confirm_microblocks: false,
1107-
max_execution_time: if let Some(max_execution_time_secs) =
1108-
miner_config.max_execution_time
1109-
{
1110-
Some(Duration::from_secs(max_execution_time_secs))
1111-
} else {
1112-
None
1113-
},
1107+
max_execution_time: miner_config
1108+
.max_execution_time_secs
1109+
.map(Duration::from_secs),
11141110
}
11151111
}
11161112

@@ -1153,13 +1149,9 @@ impl Config {
11531149
},
11541150
miner_status,
11551151
confirm_microblocks: true,
1156-
max_execution_time: if let Some(max_execution_time_secs) =
1157-
miner_config.max_execution_time
1158-
{
1159-
Some(Duration::from_secs(max_execution_time_secs))
1160-
} else {
1161-
None
1162-
},
1152+
max_execution_time: miner_config
1153+
.max_execution_time_secs
1154+
.map(Duration::from_secs),
11631155
}
11641156
}
11651157

@@ -2192,7 +2184,7 @@ pub struct MinerConfig {
21922184
/// Define the timeout to apply while waiting for signers responses, based on the amount of rejections
21932185
pub block_rejection_timeout_steps: HashMap<u32, Duration>,
21942186
/// Define max execution time for contract calls: transactions taking more than the specified amount of seconds will be rejected
2195-
pub max_execution_time: Option<u64>,
2187+
pub max_execution_time_secs: Option<u64>,
21962188
}
21972189

21982190
impl Default for MinerConfig {
@@ -2242,7 +2234,7 @@ impl Default for MinerConfig {
22422234
rejections_timeouts_default_map.insert(30, Duration::from_secs(0));
22432235
rejections_timeouts_default_map
22442236
},
2245-
max_execution_time: None,
2237+
max_execution_time_secs: None,
22462238
}
22472239
}
22482240
}
@@ -2642,7 +2634,7 @@ pub struct MinerConfigFile {
26422634
pub tenure_timeout_secs: Option<u64>,
26432635
pub tenure_extend_cost_threshold: Option<u64>,
26442636
pub block_rejection_timeout_steps: Option<HashMap<String, u64>>,
2645-
pub max_execution_time: Option<u64>,
2637+
pub max_execution_time_secs: Option<u64>,
26462638
}
26472639

26482640
impl MinerConfigFile {
@@ -2806,7 +2798,7 @@ impl MinerConfigFile {
28062798
}
28072799
},
28082800

2809-
max_execution_time: self.max_execution_time
2801+
max_execution_time_secs: self.max_execution_time_secs
28102802
})
28112803
}
28122804
}

0 commit comments

Comments
 (0)