Skip to content

Commit 5d4475c

Browse files
committed
fixed configuration system
1 parent 13782eb commit 5d4475c

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

stackslib/src/config/mod.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,13 @@ impl Config {
11041104
},
11051105
miner_status,
11061106
confirm_microblocks: false,
1107-
max_execution_time: miner_config.max_execution_time,
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+
},
11081114
}
11091115
}
11101116

@@ -1147,7 +1153,13 @@ impl Config {
11471153
},
11481154
miner_status,
11491155
confirm_microblocks: true,
1150-
max_execution_time: miner_config.max_execution_time,
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+
},
11511163
}
11521164
}
11531165

@@ -2179,8 +2191,8 @@ pub struct MinerConfig {
21792191
pub tenure_extend_cost_threshold: u64,
21802192
/// Define the timeout to apply while waiting for signers responses, based on the amount of rejections
21812193
pub block_rejection_timeout_steps: HashMap<u32, Duration>,
2182-
2183-
pub max_execution_time: Option<Duration>,
2194+
/// Define max execution for contract calls
2195+
pub max_execution_time: Option<u64>,
21842196
}
21852197

21862198
impl Default for MinerConfig {
@@ -2630,7 +2642,7 @@ pub struct MinerConfigFile {
26302642
pub tenure_timeout_secs: Option<u64>,
26312643
pub tenure_extend_cost_threshold: Option<u64>,
26322644
pub block_rejection_timeout_steps: Option<HashMap<String, u64>>,
2633-
pub max_execution_time: Option<Duration>,
2645+
pub max_execution_time: Option<u64>,
26342646
}
26352647

26362648
impl MinerConfigFile {

0 commit comments

Comments
 (0)