Defer dashboard RPCs until after ckpool notifier completes on tip change

On ZMQ hashblock events, wait for the ckpool "Block update latency"
log line before firing dashboard RPC calls (getblockchaininfo,
getnetworkhashps, etc). This avoids competing with ckpool's
latency-critical getblocktemplate call for bitcoind RPC threads,
which matters when many services flood bitcoind on every new block.
This commit is contained in:
satoshi
2026-05-18 17:53:50 +03:00
parent 1157f3501a
commit c6f0ba5f4d
2 changed files with 34 additions and 6 deletions
+6
View File
@@ -103,6 +103,12 @@ func (a *Aggregator) IngestLatencyEvents(ctx context.Context, events <-chan logm
a.staleWorkHashes += (float64(ev.LatencyMs) / 1000.0) * hs5m
count, sum, last, stale := a.latencyCount, a.latencySumMs, a.latencyLastMs, a.staleWorkHashes
a.mu.Unlock()
// Signal the Run loop that ckpool's notifier is done so
// dashboard RPC calls can proceed without competing.
select {
case a.notifierDone <- struct{}{}:
default:
}
a.Log.Info("logmon: block update latency", "ms", ev.LatencyMs, "count", count)
// Blocks are infrequent (~10min); persist every event.
if a.Store != nil {