Add best share analysis page, miner column, and UI improvements

- Best share page: hex + binary hash comparison against network target,
  per-bit coloring showing exactly which bits prevented a valid block,
  toggle between network diff at time of finding vs current diff
- Capture best share hash from ckpool logs with one-time backfill
- Persist network difficulty at time of best share for historical accuracy
- Add miner (worker) column to blocks table via coinbase address matching
- Truncate block hashes in table with full hash on hover
- Increase hashrate chart Y-axis to 7 ticks for better readability
This commit is contained in:
satoshi committed 2026-05-18 17:19:35 +03:00
1 parent f1dc0a8a79
commit 1157f3501a
17 files changed
+1499 -81

No files matched your search

+33 -20
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import { untrack } from "svelte";
import { snap } from "../stores/snapshot.svelte";
import { selectBestShare } from "../stores/selection.svelte";
import {
formatHashrate,
formatUptime,
@@ -115,11 +116,6 @@
fetch("/api/admin/ack-best", { method: "POST" });
}
// DEBUG: remove before shipping
function debugBest(): void {
localAcked = 0;
fetch("/api/admin/reset-ack-best", { method: "POST" });
}
</script>
<section class="grid-5">
@@ -149,11 +145,7 @@
{/each}
</div>
<div class="best-inner">
<div class="stat-label">
Best share
<!-- DEBUG: remove before shipping -->
<button class="debug-btn" onclick={(e: MouseEvent) => { e.stopPropagation(); debugBest(); }}>test</button>
</div>
<div class="stat-label">Best share</div>
<div class="stat-value">{formatDifficulty(data.best_diff)}</div>
<div
class="luck-sub"
@@ -167,7 +159,17 @@
{#if bestGlow}
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div class="ack-btn" onclick={ackBest} title="Dismiss the new best share animation">Nice</div>
<div class="ack-btn" onclick={ackBest} title="Dismiss the new best share notification">Nice</div>
{/if}
{#if data.best_diff > 0}
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div class="inspect-btn" onclick={selectBestShare} title="Inspect best share hash and leading zeros">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
</svg>
Inspect
</div>
{/if}
</div>
</div>
@@ -446,16 +448,27 @@
transform: scale(1.05);
}
.debug-btn {
font-size: 0.6rem;
padding: 0.1em 0.4em;
opacity: 0.3;
border-radius: 3px;
margin-left: 0.5em;
vertical-align: middle;
.inspect-btn {
display: flex;
align-items: center;
gap: 0.3em;
width: fit-content;
margin: 0.4em auto 0;
padding: 0.2em 0.7em;
font-size: 0.72rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--fg-dim);
border: 1px solid var(--border);
border-radius: 5px;
cursor: pointer;
transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.debug-btn:hover {
opacity: 1;
.inspect-btn:hover {
color: var(--accent);
border-color: var(--accent);
background: var(--bg-hover);
}
.height-card {