diff --git a/venus-worker/src/sealing/config.rs b/venus-worker/src/sealing/config.rs index d80923fd2..cd93ceeb8 100644 --- a/venus-worker/src/sealing/config.rs +++ b/venus-worker/src/sealing/config.rs @@ -22,8 +22,20 @@ pub struct Config { } impl Config { - pub(crate) fn new(config: Sealing, plan: Option, hot_config_path: impl Into) -> Result { + pub(crate) fn new(config: Sealing, plan: Option, hot_config_path: Option>) -> Result { let default_config = SealingWithPlan { plan, sealing: config }; + + let hot_config_path = match hot_config_path { + Some(hot_config_path) => hot_config_path.into(), + None => { + // If hot_config_path is Option::None (for example, wdpost planner does not require hot config file), + // it means there is no hot config file. + // We point the hot config file to a non-existent file or a meaningless file (such as "/tmp/xxx") + // to avoid loading the hot config file + PathBuf::from("/tmp/non-existent-file") + } + }; + let hot_config = HotConfig::new(default_config, merge_config, hot_config_path).context("new HotConfig")?; let config = hot_config.config(); tracing::info!(config = ?config, "sealing thread config"); diff --git a/venus-worker/src/sealing/sealing_thread/mod.rs b/venus-worker/src/sealing/sealing_thread/mod.rs index 7d6f0cbf2..5eb71761e 100644 --- a/venus-worker/src/sealing/sealing_thread/mod.rs +++ b/venus-worker/src/sealing/sealing_thread/mod.rs @@ -38,7 +38,7 @@ impl SealingThread { Ok(( Self { - config: Config::new(sealing_config, plan, location.hot_config_path())?, + config: Config::new(sealing_config, plan, Some(location.hot_config_path()))?, store, ctrl_ctx, idx,