Pool daemon: --template-timeout-s (default 20, was a fixed 5 s): pool-1's node builds a template in 1.6 to 1.8 s under load, four parallel member fetches overran 5 s and no job was issued for 7 minutes (7 October 2026, 06:08Z)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-07 06:10:39 +00:00
parent 1797ebadfa
commit 2c0bd55fa7
2 changed files with 9 additions and 3 deletions

View file

@ -35,12 +35,16 @@ pub struct Config {
pub snapshot_interval_s: u64,
/// How long the start-up waits for the node to answer a template before the daemon refuses to start (exit 3)
pub node_wait_secs: u64,
/// Per-member template fetch timeout. 7 October 2026, 06:08Z: pool-1's node built a template in 1.6 to 1.8 s under
/// its own miner plus four members, the fixed 5 s gave up on the parallel fetches, no job was issued for 7 minutes,
/// every block the stale templates found was an orphan, and vardiff could not act (a new target rides with a job)
pub template_timeout_s: u64,
}
impl Config {
pub fn usage() -> ! {
eprintln!(
"usage: igneum-pool [--node grpc://127.0.0.1:26610]... [--evm-rpc http://127.0.0.1:26790] [--listen 0.0.0.0:4463] [--node-wait-secs 60]\n\
"usage: igneum-pool [--node grpc://127.0.0.1:26610]... [--evm-rpc http://127.0.0.1:26790] [--listen 0.0.0.0:4463] [--node-wait-secs 60] [--template-timeout-s 20]\n\
\x20 [--http 127.0.0.1:4480] [--data-dir ./data] [--payout-key <file>] [--fee-percent 1] [--min-payout 1.0]\n\
\x20 [--pplns-window 2.0] [--payout-interval-s 60] [--dry-run] [--network devnet|testnet|mainnet]\n\
\x20 [--share-interval-s 10] [--min-shift 0] [--max-shift 60] [--stale-grace-ms 2000] [--orphan-after-daa 120]\n\
@ -73,6 +77,7 @@ impl Config {
verify_threads: 2,
snapshot_interval_s: 15,
node_wait_secs: 60,
template_timeout_s: 20,
};
let mut i = 0;
while i < args.len() {
@ -104,6 +109,7 @@ impl Config {
"--verify-threads" => c.verify_threads = val().parse::<usize>().unwrap_or_else(|_| Config::usage()).max(1),
"--snapshot-interval-s" => c.snapshot_interval_s = val().parse().unwrap_or_else(|_| Config::usage()),
"--node-wait-secs" => c.node_wait_secs = val().parse().unwrap_or_else(|_| Config::usage()),
"--template-timeout-s" => c.template_timeout_s = val().parse::<u64>().unwrap_or_else(|_| Config::usage()).max(1),
"-h" | "--help" => Config::usage(),
_ => Config::usage(),
}

View file

@ -39,7 +39,7 @@ pub fn extra_data(member: &Member, pool_address: &[u8; 20]) -> Vec<u8> {
/// cache build), so it runs under `spawn_blocking`.
pub async fn fetch_job(pool: &Arc<Pool>, member: &Arc<Member>) -> Result<(), String> {
let t0 = Instant::now();
let tmpl = match tokio::time::timeout(Duration::from_secs(5), pool.node.get_block_template(pool.pay_address.clone(), extra_data(member, &pool.pool_address))).await {
let tmpl = match tokio::time::timeout(Duration::from_secs(pool.cfg.template_timeout_s), pool.node.get_block_template(pool.pay_address.clone(), extra_data(member, &pool.pool_address))).await {
Ok(Ok(t)) => t,
Ok(Err(e)) => {
pool.template_failures.fetch_add(1, Ordering::Relaxed);
@ -47,7 +47,7 @@ pub async fn fetch_job(pool: &Arc<Pool>, member: &Arc<Member>) -> Result<(), Str
}
Err(_) => {
pool.template_failures.fetch_add(1, Ordering::Relaxed);
return Err("template timed out".to_string());
return Err(format!("template timed out after {} s (--template-timeout-s)", pool.cfg.template_timeout_s));
}
};
pool.last_template_ok_ms.store(unix_ms(), Ordering::Relaxed);