Revert block-broadcast fallback path
Removes the entire fallback submitter mechanism: ckpool patch 0004,
the blocksubmit package, the wiring in main.go, the config fields,
the aggregator's fallback counters and snapshot fields, the healthz
fallback fields, and the TS type fields plus the HealthBanners
fallback alert.
Reasoning: ckpool's primary bitcoind submission must remain the
single source of truth, and getting the parallel "race a fallback
during the submit" semantics right is more architectural complexity
than the marginal reliability gain justifies. The original upstream
behavior — submit to bitcoind, retry indefinitely if unavailable —
is what we want.
Kept intact:
* Submit-attempt vs confirmed counters (block_submit_attempts /
block_submits_confirmed). Useful on their own as a "did bitcoind
confirm the submission?" signal.
* HealthBanners shows submit_gap and zmq_stale only.
* /healthz exposes submit_gap, zmq_stale, etc.
* All P0 reliability work (tailer cursor, reconcile loop, reorg
detection, multi-solve guard) and other P1 (RPC retry, WS
back-pressure, ZMQ tracking, startup readiness gate).
This commit is contained in:
@@ -4,20 +4,15 @@
|
||||
|
||||
// submit_gap > 0 means ckpool tried to submit at least one block that
|
||||
// never got the "Solved and confirmed" follow-up — so either bitcoind
|
||||
// rejected the submission or the RPC dropped. The number stays > 0
|
||||
// forever after such an event (these are persistent counters), so we
|
||||
// only show it as a banner when the fallback hasn't covered for it
|
||||
// OR there's been a recent fallback the operator should investigate.
|
||||
// rejected the submission or the RPC dropped. These are persistent
|
||||
// counters so the banner stays visible until the operator clears it
|
||||
// by inspecting bitcoind's logs.
|
||||
const submitGap = $derived.by(() => {
|
||||
const d = snap.data;
|
||||
if (!d) return 0;
|
||||
return Math.max(0, (d.block_submit_attempts ?? 0) - (d.block_submits_confirmed ?? 0));
|
||||
});
|
||||
|
||||
const fallbackCount = $derived(snap.data?.fallback_submits_total ?? 0);
|
||||
const lastFallbackAt = $derived(snap.data?.last_fallback_submit_at ?? 0);
|
||||
const lastFallbackVia = $derived(snap.data?.last_fallback_via ?? "");
|
||||
|
||||
// ZMQ stale = configured but no event in 30+ minutes. Bitcoin's avg
|
||||
// block interval is 10 min; 30 min covers normal variance without
|
||||
// false-alarming on quiet stretches.
|
||||
@@ -26,41 +21,18 @@
|
||||
if (!d || !d.zmq_enabled || !d.has_last_zmq_event) return false;
|
||||
return (d.last_zmq_event_age ?? 0) > 1800;
|
||||
});
|
||||
|
||||
// Show the fallback banner for 24h after the most recent fallback
|
||||
// event so the operator sees the alert during their next check-in
|
||||
// even if the underlying problem auto-resolved.
|
||||
const fallbackRecent = $derived.by(() => {
|
||||
if (!lastFallbackAt) return false;
|
||||
const ageSec = Date.now() / 1000 - lastFallbackAt;
|
||||
return ageSec >= 0 && ageSec < 86400;
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if submitGap > 0 || fallbackRecent || zmqStale}
|
||||
{#if submitGap > 0 || zmqStale}
|
||||
<div class="banners">
|
||||
{#if fallbackRecent}
|
||||
<div class="banner alert">
|
||||
<span class="icon">!</span>
|
||||
<div class="text">
|
||||
<strong>Fallback broadcaster used</strong>
|
||||
—
|
||||
our primary bitcoind didn't accept a block submission. Backup
|
||||
RPC <code>{lastFallbackVia}</code> took over
|
||||
{formatAgo(lastFallbackAt)}. Total fallbacks since first run: {fallbackCount}.
|
||||
Investigate primary bitcoind health.
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if submitGap > 0 && !fallbackRecent}
|
||||
{#if submitGap > 0}
|
||||
<div class="banner warn">
|
||||
<span class="icon">?</span>
|
||||
<span class="icon">!</span>
|
||||
<div class="text">
|
||||
<strong>Submit gap:</strong>
|
||||
{submitGap} block{submitGap === 1 ? "" : "s"} attempted but not
|
||||
confirmed by bitcoind. Either rejected at submission or the
|
||||
RPC dropped. Configure backup RPC URLs to enable automatic
|
||||
fallback broadcast.
|
||||
confirmed by bitcoind. Investigate primary bitcoind logs —
|
||||
submission may have been rejected or the RPC dropped.
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -94,11 +66,6 @@
|
||||
border: 1px solid transparent;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.banner.alert {
|
||||
background: rgba(220, 80, 80, 0.10);
|
||||
border-color: rgba(220, 80, 80, 0.40);
|
||||
color: rgb(230, 130, 130);
|
||||
}
|
||||
.banner.warn {
|
||||
background: rgba(220, 170, 60, 0.10);
|
||||
border-color: rgba(220, 170, 60, 0.40);
|
||||
|
||||
Reference in New Issue
Block a user