Commit Graph

2 Commits

Author SHA1 Message Date
ef367d5993 fix: stop timing the catch-up, and name windows for what they are
Some checks failed
deploy / build (push) Failing after 7m48s
deploy / deploy-web (push) Has been skipped
deploy / deploy-api (push) Has been skipped
Planck's page reported a **0.175 s** block time against a true 29.8 — a factor
of 170 — flagged *measured* rather than nominal, so the headline block time, the
network hashrate (877 GH/s on a testnet nobody mines) and the window label were
all wrong and none of them looked it.

`measured_interval` divides elapsed time by height difference, which is the
chain's rate only if every height between two samples was watched arriving. A
gap fill is proof they were not. `record()` marked every head-stream block
`at_tip: true`, including the head that landed right after `fill_gap` closed a
1,251-block gap — so the pair straddling it measured how fast this observer
caught up. `ingest` now forgets its tip samples whenever it fills a gap and
records the closing head with `at_tip: false`. The interval goes nominal until
twenty fresh samples exist, which is `MIN_TIP_SAMPLES` doing its job: nominal
and labelled nominal beats measured and wrong.

The reported symptom was smaller and had the same root. `baba-gorchitsa` showed
three blocks in Planck's "six hours" having left for mainnet a day earlier — and
it was right to: 3,600 Planck blocks currently span **29 hours**, because the
chain's rate fell ninefold when its miners left. The label was built by
multiplying the block count by the current interval, which describes the rate
now rather than the period covered. It comes from `span_seconds` instead — the
authored-time span of exactly the blocks tallied, already the denominator of
every per-miner hashrate — and carries no "~", because nothing is estimated.

So the names went too. A window is a block count, and calling one `six_hours` is
a promise the site cannot keep on a chain whose rate moves; `/planck/six_hours`
was the reason a reader believed a day-old row was current. The selector reads
600 / 3.6k / 14.4k / 100.8k and the URL carries the count. Less friendly than
`6h`, and true on every chain. The old names still parse and are never emitted,
so shared links keep working — the router rewrites them.

Closes #14

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 14:32:11 +03:00
110fbc3631 feat: blackbeard.observer — live Quantus mining leaderboard
Cargo workspace plus a Vite frontend, following ~/git/architecture/generic.md.

Every block header carries its author's wormhole reward preimage in a `pow_`
PreRuntime digest, so authorship for the whole network is derivable from headers
alone — no indexer, no registration, no way for a miner to be left out. That
decoding, the hashrate maths and the telemetry name attribution live in
blackbeard-core with no I/O at all, so the parts that are easy to get subtly
wrong are exercised by unit tests rather than only against a live chain.

The browser holds one WebSocket: snapshot on subscribe, deltas thereafter. The
head stream is itself a push (chain_subscribeNewHeads), so a block reaches the
page the moment the node imports it. Messages are serialised once per broadcast,
and leaderboards are recomputed only for windows a socket is actually watching.
No RxJS — useSyncExternalStore is React's own contract for this.

Verified against the live Planck testnet: 12/12 headers decoded, telemetry names
attributed (quanpool-planck, baba-gorchitsa, …), warm start restoring 84 blocks
and 5 held names across a restart.

Three findings worth recording, all in CLAUDE.md:

- substrate-telemetry sends its JSON in *binary* frames. A text-only client
  connects, subscribes, reports healthy and receives nothing at all — and a
  Python probe hides it, because json.loads accepts bytes.
- Difficulty is a little-endian U512; decoding it big-endian gives a number
  wrong by ~10^150 that still renders fine.
- Planck's real block interval is ~13-15s against a 6s target with enormous
  variance, so a measured interval needs 20 tip samples before it is publishable.

Deploy assets, the Gitea Actions workflow and script/infra-setup.sh are included;
port 25864 is registered in architecture/port-allocations.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSDYiibCtELsrjQq6KXnoi
2026-09-04 12:33:54 +03:00