From 2931b16e5fe52a0154ea3cb9fdcd8e5f3110b673 Mon Sep 17 00:00:00 2001 From: beck <1504068285@qq.com> Date: Wed, 26 Aug 2026 20:12:11 +0800 Subject: [PATCH 1/2] fix(curio): import PDP SP miner worker key into shared Lotus daemon `new-cluster` registers the miner's address but never imports its key, so BalanceCheck permanently flags the wallet missing and /pdp/ping returns 503. --- src/commands/start/curio/db_setup.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/commands/start/curio/db_setup.rs b/src/commands/start/curio/db_setup.rs index 3c423fed..64f04b01 100644 --- a/src/commands/start/curio/db_setup.rs +++ b/src/commands/start/curio/db_setup.rs @@ -21,6 +21,7 @@ use crate::docker::core::docker_command; use crate::docker::network::{lotus_network_name, pdp_miner_network_name}; use crate::paths::foc_devnet_bin; use crate::paths::foc_devnet_docker_volumes; +use crate::paths::foc_devnet_genesis_sectors_pdp_sp; use std::error::Error; use std::thread; use std::time::Duration; @@ -179,6 +180,10 @@ fn create_base_cluster( let lotus_data_dir = foc_devnet_docker_volumes().join("lotus-data"); let lotus_data_mount = bind_mount(&lotus_data_dir, "/lotus-data")?; + // Needed to import this miner's worker key below + let genesis_sectors_dir = foc_devnet_genesis_sectors_pdp_sp(run_id, sp_index); + let genesis_sectors_mount = bind_mount(&genesis_sectors_dir, "/genesis-sectors")?; + // Create a unique container name for this operation let container_name = format!("foc-{}-curio-db-setup-{}", run_id, sp_index); @@ -194,6 +199,8 @@ fn create_base_cluster( &bin_mount, "--mount", &lotus_data_mount, + "--mount", + &genesis_sectors_mount, ]; // Add environment variables for database connection @@ -219,10 +226,12 @@ fn create_base_cluster( docker_args.push("-e"); docker_args.push(crate::constants::CURIO_LOG_LEVEL); - // Add image and command + // `new-cluster` writes this miner's address into the base layer config, + // so also import its worker key into the shared Lotus daemon. let bash_cmd = format!( - "sleep 3 && /usr/local/bin/lotus-bins/curio config new-cluster {}", - miner_id + "sleep 3 && /usr/local/bin/lotus-bins/curio config new-cluster {miner_id} && \ + /usr/local/bin/lotus-bins/lotus wallet import /genesis-sectors/pre-seal-{miner_id}.key", + miner_id = miner_id ); docker_args.extend_from_slice(&[ crate::constants::CURIO_DOCKER_IMAGE, From 02c420f87b2f80616fe22aad58012583d9ad37c2 Mon Sep 17 00:00:00 2001 From: beck <1504068285@qq.com> Date: Wed, 26 Aug 2026 22:13:56 +0800 Subject: [PATCH 2/2] fix(curio): tolerate already-imported worker key on rerun --- src/commands/start/curio/db_setup.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/start/curio/db_setup.rs b/src/commands/start/curio/db_setup.rs index 64f04b01..6c37e47d 100644 --- a/src/commands/start/curio/db_setup.rs +++ b/src/commands/start/curio/db_setup.rs @@ -227,10 +227,14 @@ fn create_base_cluster( docker_args.push(crate::constants::CURIO_LOG_LEVEL); // `new-cluster` writes this miner's address into the base layer config, - // so also import its worker key into the shared Lotus daemon. + // so also import its worker key into the shared Lotus daemon. Tolerate + // "key already exists" so reruns against an already-set-up cluster + // don't fail. let bash_cmd = format!( "sleep 3 && /usr/local/bin/lotus-bins/curio config new-cluster {miner_id} && \ - /usr/local/bin/lotus-bins/lotus wallet import /genesis-sectors/pre-seal-{miner_id}.key", + out=$(/usr/local/bin/lotus-bins/lotus wallet import /genesis-sectors/pre-seal-{miner_id}.key 2>&1); \ + echo \"$out\"; \ + echo \"$out\" | grep -qE 'imported key|key already exists'", miner_id = miner_id ); docker_args.extend_from_slice(&[