Commit Graph

53 Commits

Author SHA1 Message Date
dedee707f5 chore: say what the window actually holds, for #13
All checks were successful
deploy / build (push) Successful in 8m15s
deploy / deploy-web (push) Successful in 6s
deploy / deploy-api (push) Successful in 17s
Static reading cannot settle #13. Warm start logs restoring 19,910 blocks for
mainnet and the board it serves divides every share by 1,065, and every
explanation that would reconcile the two is ruled out in the code: the deque is
only ever pushed and popped at a capacity of 100,800, `tail(n)` yields
`min(n, len)`, `tally` counts every entry it walks, nothing filters rows, the
board recomputes every five seconds, and there is exactly one non-test
`ChainRuntime` and one `RollingWindow` per chain, shared by `Arc`.

So: log the length. `warm start: window restored` now carries `held` beside
`blocks` — the two must agree, and when they did not, every share on the site was
computed over the difference with nothing saying so. `recompute_leaderboard`
logs what it asked for, what was held and what it tallied at debug.

The new test pins the half of the contradiction that lives in
`blackbeard-core`: a window pushed 19,910 blocks holds 19,910, tallies 3,600 for
a 3,600 window, and tallies 19,910 when asked for more than it holds. That is
the arithmetic the served response contradicts, so an investigation upstream of
it does not have to re-establish that a deque holds what was pushed.

Refs #13

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 12:34:43 +03:00
4774b8cfaa feat(ui): a light theme, following the browser, with a toggle in the masthead
All checks were successful
deploy / build (push) Successful in 1m12s
deploy / deploy-api (push) Has been skipped
deploy / deploy-web (push) Successful in 4s
Dark, light, or whatever the browser asks for. Auto is the default, so a reader
who has never touched it gets their own system's answer rather than ours.

The light palette is selected, not inverted. `#bd8829` carries every magnitude
on this site at 6.6:1 against the warm-black and **2.77:1** against paper — the
validator says so, and 2.77 is under the 3:1 floor a mark has to clear. So light
mode gets its own step of the same bronze, and its `--data-bright` sits *darker*
than `--data`, because emphasis on paper is weight rather than glare. Same for
the washes: a glow at 0.08 alpha on warm-black is a smear at 0.08 on paper, so
the nine colour literals that were still loose in the stylesheet became tokens —
each one was a colour the second theme could not have overridden.

Every value was chosen by running the dataviz validator against the surface it
actually sits on, both modes. The single-hue rule is untouched and still
load-bearing in both: bronze and crimson fail CVD separation as a categorical
pair whichever ground they are on.

`auto` is a preference rather than a third palette. It resolves to a concrete
`light` or `dark` before the stylesheet ever sees it, which is what keeps this to
one definition per palette instead of one per palette per media query — and it
has to resolve before the *first paint*, because anything running after the
bundle loads runs after the page has been painted once, and on a light
preference that is a full-screen flash of warm-black. Hence the inline script,
whose duplication of `lib/theme.ts` is the cheaper of the two costs.

Two things that would otherwise bite: `localStorage` throws rather than returning
null where site data is blocked, so every access is guarded and falls back to
what the browser wants; and `auto` keeps listening, so a machine that turns dark
at sunset does not leave a reader on the daylight palette until they reload.

The toggle shows the state it is in, never the state it would move to — a control
that displays its own destination is why these get guessed at — and its
accessible name carries that state, since the icon cannot.

Checked in a browser, both themes, on the standings, a miner page and the share
chart. Worth recording what that turned up: dark carries 46 text elements under
4.5:1 and light carries 3, each beating its dark counterpart. The gap is
`--text-muted` at 3.7, the deliberate existing value CLAUDE.md has always
documented — not introduced here, and not something to change without deciding
to change the dark design.

Closes #12

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 12:22:30 +03:00
9def0c8b6a feat: route reads that need old state to an endpoint that has it
All checks were successful
deploy / build (push) Successful in 7m53s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Failover moved on a transport failure and never on a JSON-RPC error, both
right — but a node that has pruned the state being asked for does neither. It
answers `{"result": null}`, which is a success, so whichever endpoint happened
to be sticky decided how far back the whole site could see.

The tempting fix is wrong. Null is also the correct answer for most keys read
here: an account with no balance, an item never set, the treasury's
`System::Account` entry, absent because the treasury was never funded. Retrying
every one of those against every endpoint would multiply the load to re-derive
an answer already in hand, and still end in null. The distinction is not in the
response — it is whether the node could have known, which is a property of the
endpoint.

So `classify_depth` probes each one at startup, reading `System::Number` at
block one. That key is derived in a test rather than pasted, because a mistyped
key is absent everywhere and would classify every endpoint as pruned. An
endpoint that answers holds all state after block one; one that cannot be
reached stays `Unknown` and routes as pruned, since an unreachable host must not
become the archive of record by default.

Reads naming a block hash then go through `call_deep`. It tries the sticky
endpoint first, so the common case — mainnet's loopback node, which is an
archive — costs no extra round trip. Only a null from an endpoint never shown to
hold old state buys a second opinion, and `state_call`'s refusal is treated the
same way, because that is how difficulty is read and a node that cannot execute
against dropped state errors rather than returning null.

All seven configured endpoints probe as archives right now, so this changes no
current behaviour. It is what stops history going quietly blank the day one of
them stops being one — and it says so in the log when it happens, because an
endpoint that cannot see as far back as the site is asking is a configuration
fact worth surfacing rather than a chain fact.

Closes #9

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 12:12:11 +03:00
4fb856827c fix: a bogus length prefix aborted the daemon, and the gap fill never resumed
All checks were successful
deploy / build (push) Successful in 8m3s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 17s
Two faults, one visible symptom: both testnet leaderboards frozen for a day at
the height their gap opened at, while mainnet was fine.

The daemon had aborted 316 times in ten hours, always identically —
`memory allocation of 82014765760 bytes failed`, 76.4 GiB. That is
1,025,184,572 x 80, and 80 is `size_of::<scale_value::Value<u32>>()`:
scale-value sizes a sequence's `Vec` from the compact length in the blob before
decoding a single item, so a blob that disagrees with the registry asks for an
allocation of any size at all and Rust aborts on the failed one. The step that
would have caught the mismatch is the one that never runs, which is why
`decode_events(&blob).ok()` could not help — there was no `Err`, only SIGABRT.

Every decode now goes through `Runtime::decode_checked`, which walks the bytes
first with scale-decode's `IgnoreVisitor`. That crate has no `with_capacity`
anywhere, so an impossible length runs out of input on the first item and comes
back as an error. The regression test is the exact four-byte blob, reproduced
against the mainnet fixture before the guard went in — the abort message matched
production byte for byte.

`fill_gap` then turned a short process lifetime into no progress whatsoever: it
accumulated the whole gap and wrote once after the loop, so every interruption
discarded everything read. Each block is four RPC round trips, one a historical
state read; 1,696 blocks against a remote endpoint does not fit in the two
minutes the aborts allowed. And this is not only about the aborts —
`blackbeard-api-cert.path` restarts the service several times a day, so any gap
wider than that interval was already unfillable, logging
`filling a gap in the head stream` on every start with the same `from` and
looking like progress. It flushes every 256 blocks now, and says how many it
recorded.

Both traps are in CLAUDE.md, because neither looks broken from the outside: one
presents as a service that is merely restarting, the other as a catch-up that is
merely slow.

Closes #10
Closes #11

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 12:02:07 +03:00
db9ee142bc config: give mainnet the two public archive nodes as fallbacks
All checks were successful
deploy / build (push) Successful in 8m10s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 16s
Mainnet was the only chain left on a single endpoint, and that endpoint is our
own node — so a restart on bob took the flagship chain off the site while both
testnets, on two endpoints each, stayed up.

Our node stays first, and has to: loopback pays no network hop, and `127.0.0.1/32`
is the only address whitelisted against its `--rpc-rate-limit 300`. Behind it are
`rpc1-` and `rpc2-mainnet.quantus.com`, both of which answer `archive_v1_*`,
report the same genesis and the same runtime, and accept a `wss://` upgrade.

They took some finding, which is recorded in the template's comment so the next
person does not repeat the search: mainnet uses a different domain *and* a
different prefix from the testnets, its bootnodes serve only p2p on 30333, and
the official explorer talks to a GraphQL indexer rather than to any node at all.

This buys availability, not depth. Failover moves on a transport failure, and a
pruned node answers `{"result": null}` — a success, so a deep state read would
stop at it rather than fall through to a peer that has the answer. Filed as #9.

Closes #8

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 11:38:10 +03:00
1a59b2d398 feat: several endpoints per chain, so one host cannot stop it
All checks were successful
deploy / build (push) Successful in 8m19s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 16s
A chain entry held exactly one `rpc_url` and one `ws_url`, and when that host
went down everything for that chain stopped — headers, difficulty, backfill,
state reads, runtime discovery. The endpoints already existed in pairs:
`a2-planck` and `a2-heisenberg` both answer and neither was configured. We were
choosing single points of failure the network went to some trouble to avoid.

`rpc_urls` and `ws_urls` are lists now, and `rpc_url`/`ws_url` still work as a
one-element list — a config naming one endpoint is still a valid config, and
making every deployment rewrite its entry would be this feature breaking the
thing it exists to make reliable.

Endpoints are stuck to rather than balanced across, which is the design and not
laziness: a storage read at an old block hash needs a node that still holds that
block's state, and nodes prune on their own schedules, so alternating would
return a mixture of answers and absences that reads as sparse data rather than a
configuration problem. The cursor is shared across clones so a failover one task
finds is not rediscovered by every other task on the chain.

Failing over on the wrong thing was the trap worth avoiding. A JSON-RPC error is
the node answering — moving on `count exceeds maximum value` would hide a
caller's mistake behind a second node making the same complaint — so a new
`Malformed` variant separates "did not answer" from "answered, with an error".
A pruned block returns `{"result": null}`, a success, and never looks unhealthy.

The WebSocket rotates at reconnect, where the loop already was; racing
subscriptions across endpoints and deduplicating heads buys nothing, since heads
are a liveness signal and ingest fills gaps against `chain_getBlockHash` anyway.

Verified live with a dead endpoint configured first: Planck stayed `full` at its
real height, the RPC logged one `failed over` with from and to, and the head
subscription logged the loss with the endpoint count beside it — because "the
chain is unreachable" and "one of three endpoints is unreachable" are different
operational facts and used to look identical.

Closes #7

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 11:17:03 +03:00
27a4f30304 feat: index Planck
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
`a1-planck.quantus.cat` answers, and has all along. The config comment claimed
Planck "publishes no RPC endpoint we can find" — true when written, and never
rechecked after the node we ran for it was switched to mainnet. A million blocks
of history and 2.38M zk-tree leaves were sitting there unasked for.

Measured before committing to it. Three chains backfilling at once cost 4.8% of
one core, five of eight Postgres connections with one active, and no movement in
API latency — summary 7 ms p95, block 13 ms, account 49 ms. The walk is bound by
RPC round trips rather than by anything local, so it needs no deployable of its
own; and `backfill` only reads in-memory state while writing solely to Postgres,
so it contends with nothing the API serves.

Unthrottled deliberately: ~46 hours at roughly 20 requests a second against a
public node. Leaning on public decentralised testnet infrastructure exercises
what it is there for.

Restart resilience confirmed by killing the process mid-walk — `event_scan.low`
stayed put rather than jumping back to the tip. That is load-bearing here rather
than tidy, because the cert-rotation path restarts this service several times a
day and a cursor in memory would mean Planck never finishing.

`a2-planck` answers too, and is noted for when a chain can hold more than one
endpoint.

Closes #6

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 11:10:03 +03:00
adaf00e1f5 ui: separate mainnet from testnets in the chain nav
All checks were successful
deploy / build (push) Successful in 1m1s
deploy / deploy-api (push) Has been skipped
deploy / deploy-web (push) Successful in 5s
`Quantus` and `Heisenberg` sat side by side, identically styled. One is the real
network. Somebody reading a balance, a reward or a transfer had no way to tell
from the chrome whether the number meant anything, and Planck makes it two
testnets against one mainnet.

Two labelled groups rather than a styling difference alone, because a lone
visual difference reads as decoration to anyone who has not been told what it
means:

    MAINNET  [ Quantus 329 ]    TESTNETS  [ Planck 110 ] [ Heisenberg 4 ]

The dashed border on a testnet chip is a second channel behind the heading
rather than the only one, and every chip's tooltip now says outright that a
testnet's balances and rewards are not real.

No backend work: `ChainInfo.mainnet` has been on the wire since the registry was
written and the frontend simply ignored it. It stays operator-asserted and is
never inferred from the name — a chain publishing itself as "Quantus Staging
Mainnet" must not collect the heading by having the word in its title.

A chain list with no mainnet in it renders one `TESTNETS` group rather than an
empty `MAINNET` heading.

Closes #5

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 11:05:38 +03:00
7d081c7746 fix: map enumeration asked for more keys than the node allows
All checks were successful
deploy / build (push) Successful in 8m23s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
`/heisenberg/reversible` reported 0 pending. The chain has 2.

`state_getKeysPaged` caps `count` at 1,000 and *rejects* rather than truncates:
`PENDING_LIMIT` was 1,600, so every call errored, and `.unwrap_or_default()`
turned the error into an empty page. Nothing looked broken — it looked like a
chain with nothing in flight, which is precisely what mainnet legitimately looks
like. It would have stayed wrong indefinitely.

Caught only because `ReversibleTransfers::NextTransactionId` is a plain counter
reading 5 on Heisenberg, which contradicted the page. Every path tested during
the original work happened to be under the cap — `GENESIS_LIMIT` is 500, and the
`System::Account` check used 3 — so the machinery looked verified.

Three fixes. The clamp lives in `rpc.rs`, because 1,000 is the node's ceiling
rather than a caller's preference. The route no longer swallows the error: a
chain whose runtime lacks the pallet already returns 404, so a failure here is a
real fault and now says so. And the constant is under the cap so the common case
is one request.

Verified against Heisenberg's two real pending transfers, which also exercise
the unknown-deadline path — both were scheduled before the event index reaches,
so they render as pending with no countdown rather than being dropped.

CLAUDE.md gains the general shape: `unwrap_or_default()` on anything that talks
to a node is how a wrong answer comes to look like a right one.

Closes #4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 10:50:14 +03:00
88086552cb fix: show a block's events, joined to the extrinsics that caused them
All checks were successful
deploy / build (push) Successful in 9m18s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 14s
The block page listed extrinsics and nothing else. Block 1 holds twenty-eight
indexed events and the route returned none of them — visible from the outside,
because an account page linked to a `Wormhole::NativeTransferred` at block 1 and
block 1 showed no sign of it.

`phase` and `extrinsic_index` were stored for exactly this join and had never
been used. Each extrinsic now carries its own events beneath it, and the block's
own events sit in their phases.

Block 1 is the argument for doing it that way. As extrinsics alone it is a
single `Timestamp::set`. Its events are the entire opening distribution:
twenty-one `Wormhole::NativeTransferred` in `Initialization`, owned by no
extrinsic at all and sent from the minting account — not block zero, and not
anything a transaction did. `Vesting::LaunchMomentSet` fires there too, so
vesting has been exercised despite the call index showing zero `Vesting::*`
dispatched: a pallet the runtime uses looks unused from the call side alone.

Closes #3

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 09:14:56 +03:00
dd8086df0d feat: mark the accounts a chain names, and make genesis unmissable
All checks were successful
deploy / build (push) Successful in 8m4s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Some accounts are special and nothing about the address said so. The treasury
looked like any other empty account, the minting sentinel looked like a wallet,
and the twenty-one accounts endowed at genesis looked like they earned it.

No curated list. The chain names them itself, in three places that are three
different claims and are not flattened into one badge: a runtime constant
(compiled in, immutable for that spec_version), a storage value (assigned, and
changeable), and a balance in block zero (history, and not a role — an account
can be endowed and have no job). Labels derive from the chain's own name, so a
pallet added next year is labelled without an edit. The chip is the claim; the
citation beneath it is the evidence.

Two rules hold it together, both learned the hard way and both now in CLAUDE.md.
An account is told from a hash by registry path, never by shape — after
`normalise` both are `0x` and sixty-four hex characters, so `decode_typed` now
returns the account set the decoder collected while it still knew. And a storage
entry names an account only if its value *is* one: `System::Events` is full of
accounts and names none, and the first cut labelled half the chain's active
addresses `Events`.

Computing all of this walks every plain storage entry and enumerates block zero
— dozens of round trips, fine once and pathological on every account page view —
so it is cached for five minutes. Constants change with the runtime, state
assignments almost never, genesis never.

Block zero gets the endowments, because they have no extrinsic and no event and
are invisible to anyone who has not read the chainspec, and a Genesis link sits
in the nav to give somebody who would never think to look an unmissable way to.
Mainnet started with 5,670,000 QTC across 21 accounts — one holds 5,669,940 and
the other twenty got 3 each — shown beside what each holds today, so what a
founding account did with its stake is one row. When genesis state cannot be
read the page says so rather than showing an empty table: missing data and a
chain that endowed nobody are different claims.

Closes #2

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 09:04:45 +03:00
c08d3c4e04 feat: pending reversible transfers, with a countdown
All checks were successful
deploy / build (push) Successful in 7m44s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
Scheduled transfers that have not yet landed, counting down to the block they
execute at. `ReversibleTransfers` is the most distinctive thing this chain does
and the observer said nothing about it.

The only view here built from both halves, each authoritative about a different
thing. State — `PendingTransfers` — says what is still pending: a cancelled or
executed transfer is simply gone from the map, and that absence beats replaying
every event since genesis and reconstructing the set, which fails silently. The
event index says when each is due, because `TransactionScheduled` carries
`execute_at` and, contrary to what the issue assumed, the stored struct does
not. A transfer scheduled before the index reaches shows as pending with an
unknown deadline rather than being dropped for half a story.

Enumerating a map needs the prefix and `state_getKeysPaged` — there is no list,
only keys derived from the things in it — and recovering a key from a storage
key needs the hasher to have kept it. `Blake2_128Concat` and `Twox64Concat` do,
`Twox128` and friends do not, so `key_offset` is `None` there rather than a
guess. Verified against a populated map since the target one is empty:
`System::Account` enumerates, its keys decode back to accounts, and the balances
read.

`execute_at` is a `DispatchTime<BlockNumber, Moment>` — an enum, so reading the
wrong arm would show a millisecond timestamp as a height. Time remaining is an
estimate from a block interval that moves; the block count is the fact and the
page says so.

The page reads "nothing is in flight" today, correctly and deliberately: zero of
this pallet's six calls have been dispatched on mainnet. It exists before the
first one because catching the first one is the point.

CLAUDE.md gains the workflow this was the first of — issue first, closed by the
commit, and corrections recorded as comments on the issue rather than as
surprises in a diff.

Closes #1

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 08:42:35 +03:00
6b0e02e059 feat: read chain state, decoded against the runtime
Some checks failed
deploy / build (push) Successful in 7m59s
deploy / deploy-web (push) Failing after 4s
deploy / deploy-api (push) Successful in 16s
The observer could read headers, events, extrinsics, metadata and difficulty,
and not a single pallet storage item. Answering "which address is this chain's
treasury" meant going outside it and hand-deriving twox128 prefixes, which is a
gap in the tool rather than an answer.

The treasury is the case that shows why. `set_treasury_account` reads *never* on
the call index and `TreasuryAccountUpdated` reads *never* on the event index —
both true, because the address was set at genesis, so no extrinsic ever carried
it and no event ever announced it. It exists only in state. It is
qzjsuLN7Nhu4bjvmUbjSTr2ZTeZ7oRxXpQP9fdv6PcHUCRrVR, and it has never been funded.

`Runtime::storage_key` builds a key entirely from the runtime's own description
— the pallet's storage prefix, the item name, and each key's declared hasher —
because a wrong hasher yields a key that reads as *absent* rather than as an
error, and nothing would catch it. Its test pins two keys against ones read off
the live chain by hand. Keys are SCALE-encoded against the type the entry
declares, so a map on an account, a u32 or a tuple all work without this knowing
which it is.

Absent is not zero, and only the modifier knows which: an `optional` entry
holding nothing means nothing, a `default` entry means the runtime's default,
and the state page marks the latter rather than passing it off as something the
chain wrote. `read_balance` deliberately does not apply the default —
`AccountInfo` zeroes, Substrate reaps empty accounts, and falling back would
turn "does not exist" into "holds nothing", which is the treasury's exact case.

/:chain/state lists all 40 keyless entries decoded, and an account page now
carries a real balance beside the flows it already summed. Those are different
numbers: rewards say what an account was paid, a balance says what it has, and
they differ by every transfer out.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 08:33:21 +03:00
1e8869e7a1 feat: index the whole event surface, and show what has never fired
All checks were successful
deploy / build (push) Successful in 7m31s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
The event interest list was an allowlist of two entries, which meant every
capability the chain grew was invisible until somebody remembered to add a line
— the exact failure the metadata-oracle approach exists to avoid. It is a
denylist now.

Nothing is excluded for being unused. Whether a capability is exercised is the
question an analyst is asking: a chain that ships vesting and governance nobody
touches is telling you something, and it can only tell you that if the silence
is recorded rather than filtered on the way in. The rule for exclusion is
narrower than volume and narrower than usefulness — an event carrying no account
can never answer "everything involving this account", which is what the index is
for. Three kinds both name no account and fire every block, so they are skipped:
ZkTree::LeafInserted, QPoW::DifficultyAdjusted, System::ExtrinsicSuccess. They
render as "not indexed" rather than as a zero, because a zero reads as disuse.

Balances::Minted looked like a fourth. It fired exactly as often as
MinerRewarded across a 120-block sample and for the same reason, but it names an
account, minting is not only for miners, and showing a reward twice on one page
is a presentation problem to solve on that page rather than a reason to lose the
record. Kept.

`/:chain/event` is the call index's other half — 19 of 107 kinds fired — and
`/:chain/event/:pallet/:variant` the feed behind a row. Measured on live
mainnet the widening took the index from ~1.2 to ~3.4 rows per block and bought
739 accounts' worth of wormhole transfers that were previously invisible.

Signatures also lose their associated-type ceremony: the runtime writes
`<<T as frame_system::Config>::Lookup as StaticLookup>::Source`, which is
correct and forty characters of scaffolding around one word, and three of those
in a row pushed the counts off the side of the table. Generics are untouched —
`BalanceOf<T>` is information.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 07:55:19 +03:00
6b45004907 feat: the call index — declared surface against actual use
All checks were successful
deploy / build (push) Successful in 7m46s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Every explorer shows what happened on a chain. None shows the difference
between what a chain can do and what it has done, because none holds the
runtime's declared surface next to the activity. We already hold both, so this
is a join rather than new indexing.

    quantus    v152   6 of 58 dispatchables used
    heisenberg v148   6 of 58 — and a different six

The gap is the interesting half. ReversibleTransfers, TechReferenda, Vesting
and Preimage are shipped, documented and untouched; "this chain has governance
nobody has used" is a different statement from "this chain has no governance",
and only one of them appears on a list of what happened. Unused calls keep their
signature and their docs, both read from the chain rather than a source tree,
and are dimmed rather than hidden.

Two chains on the same runtime family diverging is the other thing it surfaces:
mainnet has exercised the wormhole batch verifiers and nothing else, while
Heisenberg has a whole multisig lifecycle and no wormhole traffic.

`/:chain/call/:pallet/:call` is the feed behind a row — who dispatched it, with
what arguments, and whether it worked. Nothing is written per call type: the
arguments render through the same `Payload` as everything else, so a pallet
added next year gets a row on the index when the runtime declares it and a
working page the moment somebody uses it.

`BlockExtrinsic` gained `height` and `at`, which are redundant on a block's own
page and the entire point on a feed where every row is a different block.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 07:44:29 +03:00
93358dd920 ui: the window belongs to the miner page, not just the standings
All checks were successful
deploy / build (push) Successful in 1m14s
deploy / deploy-api (push) Has been skipped
deploy / deploy-web (push) Successful in 6s
Choosing a window on a miner's page navigated back to the standings. Not a
mis-wired link: there was no URL for "this miner, over a day", so the only thing
the control could do was go somewhere that had one.

So the miner route carries it: `/quantus/miner/0x…/day`. That is the right place
for it regardless — a miner's rank and hashrate are *of* a window, and a link
sent without one shows the recipient something other than what the sender was
looking at. In the path rather than a query string, so it reads the way the
standings' own window already does. The bare `/quantus/miner/0x…` still resolves,
at the default window, so existing links keep working.

And the control now appears only where it changes something: the standings, and
a miner's page, which is one row of those same standings. A block happened once,
a balance has no span, a runtime is not a rate, and the three indexes are not
ranked — on all of those it was a live control that did nothing, which teaches a
reader to distrust it on the two pages where it works.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-10 06:23:38 +03:00
f9ea292a70 fix: a hashrate estimate now carries its error bar
All checks were successful
deploy / build (push) Successful in 7m25s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 15s
The leaderboard credited a miner with "1.55 GH/s" on the strength of one block,
last seen four hours earlier, to three significant figures. Block finding is
Poisson: k blocks carries a relative standard error of 1/√k, so one block is
±100% and it takes twenty-five to reach ±20%. The estimator was unbiased and the
presentation was not honest, which is the half that matters to a reader.

`miner_hashrate` now returns the count's uncertainty with the figure, and the
leaderboard and miner page render it — dimmed below four blocks, where the error
bar is wider than half the value.

Checked first that the arithmetic itself is sound, because the obvious
suspicion was the formula. It is the chain's own: `qpow-math::is_valid_nonce`
accepts when `hash < U512::MAX / difficulty`, `verify_nonce_internal` passes it
what `get_difficulty()` returns, and the hash is uniform — 200,000 samples of
`hash_squeeze_twice` gave 0.4995 of 2^512 against a uniform 0.5, and 12.48%
below 2^509 against 12.5%. Acceptance is 1/difficulty, so expected trials is
difficulty, exactly. The two network estimators — difficulty over tip interval,
and summed work over window span — also agree within 5% on live data.

What that leaves is recorded in CLAUDE.md and is not an observer bug: our three
miners measure 1.66 GH/s (1.39 instantaneous), while the chain credited the same
preimage 5.3 GH/s over 29 blocks. Sampling does not explain 14 sigma.
`miner_cpu_hash_rate` is 0 on all three — every hash is on GPU — and the miner's
CPU path calls `qpow_math::get_nonce_hash` directly while the CUDA kernel is a
separate implementation with its own counter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 19:48:51 +03:00
edce856263 feat: decode extrinsics, and show them
All checks were successful
deploy / build (push) Successful in 7m17s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 15s
An event is the chain's account of what happened; an extrinsic is the request
that caused it, and carries what no event does — who signed, what they called,
the nonce and tip, and whether it worked. A history built from events alone
omits every failed attempt and never names a submitter.

The same oracle does both. The metadata's extrinsic type carries four
parameters and the registry names all of them, including
`qp_dilithium_crypto::types::DilithiumSignatureScheme` — the part that looked
like it would need hand-written post-quantum knowledge and does not. The chain
describes its own signature scheme, so `decode_extrinsic` reads a Quantus
transaction without a line of code that knows Quantus exists.

Two facts about this chain's extrinsics, both now in CLAUDE.md. The first byte
is not the version: the top two bits are a type tag, and mainnet carries `0x84`
(signed, v4) and `0x05` (bare, v5) in the same block while the metadata declares
version 4 — check the byte against the metadata and you reject every timestamp
inherent on the chain. And a signature is 5.3 KiB, two orders of magnitude
larger than the call it authorises; it is decoded to find where the call begins
and then discarded, keeping only the scheme's name and the byte count.

Both halves of a block index in one pass, off calls already being made. Whether
a dispatch succeeded comes from the `ExtrinsicSuccess`/`ExtrinsicFailed` events
in that same decoded list — read, used, not stored.

The block page grows a table below the facts: call, signer, arguments, and the
signature's size. The account page merges extrinsics into the history it already
had, ordered by block with the request above the results it caused. `source` is
1 for an extrinsic and 0 for an event so that every part of the sort key
descends, which lets the paging cursor be a plain row comparison rather than a
mixed-direction one Postgres cannot express.

Nested calls are why this had to be generic. A `Utility::batch_all` carries whole
calls in its arguments, so a transfer's recipient can be three levels down — and
because the decoder collects account ids wherever they appear, that batched
transfer shows on the recipient's page tagged *received* even though they signed
nothing. Verified on mainnet 12,616: the batch renders both its transfers with
destinations and values, above the two `Balances::Transfer` events they produced.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 18:27:54 +03:00
efbe901646 feat: section indexes, so the routes can be found
All checks were successful
deploy / build (push) Successful in 7m33s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Every route added lately was reachable only by already knowing an address — a
block hash, a preimage, an SS58 string, a spec_version. Fine for a link somebody
sent you, useless for discovering the pages exist. A kind with nothing after it
is now the index of that kind, and a nav under the chain chips names them.

Not the same page three times. Blocks is the record behind the live ticker,
paged by height. Accounts ranks by tokens earned over the whole indexed record,
which is a different question from the standings' blocks-per-window and here a
different answer: difficulty rose 346-fold inside mainnet's first day, so an
early block cost a three-hundredth of a current one. Runtimes is the only list
with no other home — a block does not name its runtime and neither do the
standings.

No `/:chain/miner`: the standings already are the index of miners, and a second
page of the same rows under another address would be two answers to one
question. That path redirects there, along with anything else that resolves to
the front page without being spelled like it, so the address bar and the section
nav agree about where the reader is.

Two things caught by looking at the rendered pages:

The block index's gaps came from `observed_at` and read *three milliseconds*
between blocks on a chain targeting twelve seconds — exactly the trap CLAUDE.md
records, since a gap fill writes a whole batch within one second. They come from
`authored_at` now, the chain's own clock.

The first page of that index came from the live ticker, which is ordered
oldest-first because that is the order it is pushed in, so page one climbed and
every page after it descended. The index sends a cursor for its first page too.

Accounts shows the address beside any node name: one node legitimately reports
for several payout addresses, and the first cut had two rows reading
`pearl-prover` with nothing to tell them apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 18:07:11 +03:00
289a80a7eb fix: a single-runtime chain lost the one fact worth having
All checks were successful
deploy / build (push) Successful in 7m19s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 15s
`discover_runtimes` seeded its map with two plain inserts — the runtime at
block 1 and the runtime at the tip. On a chain that has only ever run one, both
probes report the same `spec_version` and the second insert overwrote the
first, so the recorded height was the tip rather than block 1.

Mainnet therefore read "in force from #13,501", which is where this observer
started watching and not where the runtime started. Heisenberg hid it: its two
ends are different runtimes, so nothing was overwritten and all six boundaries
came out right.

Both call sites and the recursion now go through one `note` helper that keeps
the lowest height seen. That is the invariant the whole search rests on —
bisection meets a runtime inside its reign before it finds where the reign
began, so a probe can only improve the bound and none may worsen it — and it
was previously written out twice, correctly in the recursion and not at the
seed.

`lower_first_seen` takes the minimum, so the wrong row corrects itself on the
next discovery pass rather than needing a migration.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:57:02 +03:00
b006f54cd5 feat: a runtime's own page
All checks were successful
deploy / build (push) Successful in 7m12s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
`/quantus/runtime/152` — every pallet, call, event, error, storage entry and
constant the runtime declares, with the constants' values decoded against their
own declared types. Nothing transcribed from a source tree: a source tree says
what the chain should be running, metadata says what it ran.

The set of runtimes is found rather than waited for. Decoding caches one the
moment it needs it, so left alone the cache is "whatever the backfill has walked
past" — days on a chain a million blocks deep. `spec_version` only increases, so
the boundaries are a sorted sequence and bisection finds each in log₂(height)
probes. On Heisenberg that turned up six runtimes and the block each took over
at: v126 from 1, v128 from 132, v131 from 342,813, v136 from 669,129, v144 from
812,055, v148 from 977,079 — two more than the four upgrade boundaries this
approach was originally verified against.

Discovery is its own task, not a poll step. `state_getRuntimeVersion` at an old
block makes the node instantiate the runtime WASM from that block's state:
~4 s against Heisenberg's endpoint versus ~0.25 s at the tip, and a hundred of
those inside a four-second loop stalls difficulty and the summary broadcast for
minutes on every start.

Reading Heisenberg's two ends side by side is the case for the page. Between
v126 and v148 the chain dropped Referenda, ConvictionVoting, Recovery, Assets
and AssetsHolder, added Vesting and Origins, gained `WeightReclaim` and moved
`ChargeTransactionPayment` after the two Quantus-specific extensions. Every one
breaks a decoder written against the other version and none is visible from a
block.

`U256`/`U512` now render as one decimal rather than four or eight little-endian
limbs, identified by registry path exactly as `AccountId32` already was.
Difficulty as `[1189189, 0, 0, 0, 0, 0, 0, 0]` describes the bytes correctly and
tells a reader nothing. `ChainSummary` gained `spec_version`/`spec_name` so the
footer can say what the site is decoding against, and link to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:45:28 +03:00
1260cc6d64 ui: the block route is a page too
Same reasoning as the miner and account routes one commit ago, which the block
route was deliberately left out of: a block is read against the standings, and
the ticker row below is what you clicked to get here. On reflection that is an
argument about how someone arrived, not about what the URL names — and the URL
names one block. The board is what `/:chain/:window` is for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:44:58 +03:00
1410d3dda7 ci: skip the Rust build and API deploy on frontend-only pushes
All checks were successful
deploy / build (push) Successful in 7m25s
deploy / deploy-web (push) Successful in 6s
deploy / deploy-api (push) Successful in 15s
The musl release build plus the gate is most of the wall clock, and a commit
that touches only `web/` cannot change a byte of it. A `what changed` step
diffs against the previous head and sets one output; the gate, the build, the
ts-rs drift check and the whole `deploy-api` job hang off it. Not
`on.push.paths`, which would skip the entire workflow — the site still has to
build and ship.

Anything unrecognised counts as Rust. A false positive costs a slow deploy; a
false negative leaves a binary on bob that does not match the commit, and
nothing would report it. Two entries in the path list are less obvious than
they look: `asset/`, because deploy-api ships the systemd units, the firewalld
service and the rendered config from it; and `web/src/api/generated/`, because
the drift gate only runs once `cargo test` has regenerated those files, so a
hand-edit of them must not be able to arrive labelled frontend-only — that is
exactly the change the gate exists to catch.

Checked against this session's five commits: the two pure-UI ones classify as
frontend, the three touching crates or .sqlx classify as Rust, and a
hand-edited generated type classifies as Rust.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:23:31 +03:00
e330d2b78a ui: a miner and an account are pages, not dialogs
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
Both were panels that opened above the standings, which is right for a block —
"who won this one, and where do they sit" is read against the board, and the
ticker row below is what you clicked to get here — and wrong for the other two.
A miner's page and an account's page are somebody's own record and the whole
subject of the URL that reached them; eleven other miners' rows underneath is
the site failing to notice which page it is on.

The close buttons go with it. Neither panel opened over something the reader
was looking at, so there is nothing to close back to, and the back button and
the chain chip already do what it would. "Mark as yours" stays: that is a real
control and not navigation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:21:06 +03:00
d6f4c0c21e ui: only advertise chains we can actually read
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
The nav listed every chain telemetry names, with the ones we hold no RPC
endpoint for as disabled chips saying "no endpoint". The reasoning was that
they are part of the network and hiding them misrepresents its shape. In
practice it put five dead chips above the standings on every page — four of
which have never had anything behind them — and made the one live chain the
smallest thing in the row.

Nothing is blocked. `/:chain/...` still resolves for any chain the backend
knows, `/v1/chains` still reports every one of them with its `tracking`, and
promoting one is still a single `[[chains]]` entry. This is only about what the
page offers unprompted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:15:29 +03:00
d5a286f220 feat: account pages, built on the event index
All checks were successful
deploy / build (push) Successful in 7m5s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 16s
`/quantus/account/qzp2AxZw…` answers the question the official explorer
answers badly: what an address has actually been paid, every reward, back as far
as the index has read. Everything comes from this observer's own decoding — no
subsquid, no external indexer, nothing that stops working when the node prunes
the state behind it.

There is no case per event type anywhere in this. `chain_event` gained an
`accounts` column filled by the decoder itself, which knows which values are
`AccountId32` by registry path — the same knowledge that keeps it from
rendering a block hash as an address — so "everything involving this account"
is one containment query that already covers pallets nobody has written yet.
The frontend labels what it recognises and renders anything else as its own key
and value, so a new event type shows up as itself rather than not at all.

Events also carry the block's own timestamp now. `block.authored_at` holds the
same thing but only for blocks this process was running for, and a payment
history that renders "height 412" with no date because the observer was not
alive in March is not a history.

The preimage and the address are two ends of one identity and each page now
links to the other. Address to preimage is a lookup among preimages seen, not a
calculation: the derivation runs one way.

Verified against mainnet: 13,384 reward events indexed from genesis to the tip,
quanpool's page reconciling to 3,784.98 QTC over 12,346 blocks, and transfers
rendering their counterparties as linked addresses without a line of code that
knows what a transfer is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 17:04:45 +03:00
49c266a905 ui: real URLs for every view
The hash router was the right size for a chain and a window. It stopped being
once a block, a miner and — shortly — an account each became a page worth
sending someone: a fragment never reaches a server, so those URLs cannot carry a
title, be crawled, or be resolved by anything but the page itself.

So paths, via react-router, which was already a dependency and unused. Both
vhosts already answer any path with `index.html`, so nothing outside the client
changed. `lib/routes` holds the grammar in one place and `fromLegacyHash`
rewrites the old form on load, so every `#/…` link already published still lands
where it meant to.

Segments are named — `/quantus/block/13160`, not `/quantus/13160` — rather than
told apart by shape. Shape works until two kinds of thing can look alike, and an
SS58 address is arbitrary base58 with no rule keeping it clear of a window name
forever. Six characters buys the whole class of problem away before accounts
arrive.

Everything navigable is an anchor now, chain chips and the window control
included, which is what "real URLs" has to mean in practice: middle-click opens
another chain's 24h view in a tab, and the back button walks the panels. The
miner panel had no address at all before this — opening one changed the page and
not the URL.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 16:53:41 +03:00
eb26a7bb3c feat: decode events against the runtime's own metadata
A header says who mined a block, not what they were paid: the amount is
remaining supply over an emission divisor plus fees, quantized with dust
carried forward, so only the `MinerRewarded` event knows it. Reading it means
decoding SCALE against the registry of the runtime that produced the block, and
this chain's shapes differ from vanilla Substrate because of the post-quantum
signatures.

So the chain describes itself. `state_getMetadata` at a block hash executes
`Metadata_metadata` against the runtime WASM in that block's state; the v14
registry that comes back drives a decoder that knows nothing about mining,
rewards or transfers. `INDEXED_EVENTS` is the only place a name appears —
adding transfers or anything the chain grows next is one line and a query, not
a migration, a struct and a decoder.

Metadata is cached per spec_version, because a node that starts pruning would
otherwise make history undecodable. Blocks are tried against the tip's runtime
first, which costs no extra call; `decode_events` refuses a partial read, so a
block from before an upgrade fails loudly rather than decoding into plausible
nonsense, and that failure is what asks which runtime actually produced it.

`backfill` walks outward from the tip — to the tip first, then toward genesis —
because live indexing alone leaves holes an account page would show: a restart,
an RPC blip, a gap fill that ran before the metadata was cached. Progress is a
cursor rather than `max(height)`, since a block with no indexed event and a
block never read are otherwise the same answer.

Verified on mainnet: block 13160's preimage derives, through the same Poseidon2
the chain runs, to exactly the `miner` field of its own reward event — so the
header author and the payee join with no lookup table.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 16:47:10 +03:00
6a29250c88 feat(ui): link the source repository from the footer
All checks were successful
deploy / build (push) Successful in 6m42s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
The repository is public now. The site's claim is that every miner is derived
from public block headers with no registration and no opt-in; the code doing
the deriving being readable is the other half of that, so it belongs beside the
caveats rather than nowhere.

Its own line under them, not a fourth item in the `space-between` flow, which
would strand a short line against a long one — and it is a different kind of
statement from the three above: where to go and check the numbers, not a
caveat about them. Opens in its own tab so the WebSocket behind the page keeps
its connection.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 15:57:31 +03:00
9eb4bee649 fix: a miner's hashrate is the work it did, not its share of today's network
All checks were successful
deploy / build (push) Successful in 6m31s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 14s
Reported against a Grafana panel showing roughly a sixth of what the site did.
Grafana was closer to the truth.

The estimate was `share of blocks in the window × current network hashrate`.
That is only correct while the network is the same size across the whole
window. Measured on mainnet's launch day it was nowhere near: difficulty rose
346-fold inside one 14,400-block window, from 96.4B to 33.4T. A miner that won
its blocks early — when a block cost a three-hundredth of what it costs now —
had that share multiplied by today's network. For this observer's own node the
site reported 25.4 GH/s against an actual 2.5 GH/s.

Difficulty is expected hashes per block by definition, so the difficulty of the
blocks a miner won, summed and divided by the time they spanned, is its
hashrate directly — with no reference to the network's size, and immune to that
size changing underneath, because every block carries the difficulty in force
when it was won. The observer has recorded per-block difficulty correctly since
the parent-state fix, so the data was already there.

`miner_series` had the same flaw and is fixed the same way: summed work per
bucket over the bucket's own duration.

The window's duration is taken from `authored_at`, not `observed_at`. A stretch
this process caught up on carries observation times seconds apart for blocks
minutes apart, and dividing real work by that would invent hashrate — the same
trap the history series was built to avoid.

The headline network figure is unchanged. It divides current difficulty by the
measured interval because it answers a different question: how hard is a block
to win right now, not what did this miner do over the last twelve hours. The
two no longer sum to each other, which is correct and is what the footer now
says.

`standings_rank_by_blocks_then_recency` asserted 400.0 from the old formula;
its third argument is now the window's duration, so it asserts the work-based
figure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 15:45:34 +03:00
17ad5b1f74 fix: a restart no longer empties the ticker and the hashrate
All checks were successful
deploy / build (push) Successful in 6m30s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Reported from the live site: the network hashrate occasionally drops to a
fraction of what it was, the live blocks table truncates to a single row and
rebuilds, and the cycle repeats on an unclear schedule.

The schedule is `blackbeard-api-cert.path`. It watches the host certificate and
runs `systemctl restart blackbeard-api` when it rotates — four times in the
last day, on top of every deploy. Nothing was crashing; `NRestarts` is 0.

What a restart lost was two pieces of memory-only state. The block ticker is
built from live blocks and has no other source, so it came back with one row
and refilled over the next minute. The tip samples behind the measured interval
were dropped outright, because the window replay pushes every row with
`at_tip: false` — correct for blocks a previous process caught up on, wrong for
the ones it genuinely watched arrive, which the `at_tip` column has recorded
since `0002`. Without them `measured_interval` returns `None` and the hashrate
falls back to the configured target: at mainnet's ~1.5s against a 12s target,
an eight-fold drop, correctly labelled nominal and wrong.

Warm start now restores both. It runs after the attributions and carried names
because the ticker rows need their display names. Restored tip samples are
capped at ten minutes old — the interval stays arithmetically valid across a
gap, since blocks kept being produced and both terms grow together, but it
stops being *current*, and a sample from an hour ago averaged with one from now
describes the hour rather than the tip.

The underlying restart is left alone: it is a certificate-rotation safeguard
and not mine to remove. It is now simply not visible, which is what it should
always have been — and worth noting the store already recycles pooled
connections hourly for exactly that rotation, so the restart is belt-and-braces
over a case already handled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 15:21:25 +03:00
18a99ddc8f fix(ui): head the miner panel with the best identifier, not the preimage
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
The panel body listed the address and preimage, but its heading still read
`0x134e73f0…df59` — the one identifier a miner does not recognise, given top
billing. It now falls back through name, address, preimage, which is the order
a reader can actually use them in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 15:15:12 +03:00
a3eb670d11 feat: identify miners by the address they are paid at, not the preimage
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
A reward preimage is exact and unrecognisable — no miner knows theirs by sight.
The address is the string they configured and the one their balance shows
against, and the two are related by a derivation the chain performs anyway:
`pallets/mining-rewards` pays `qp_wormhole::derive_wormhole_address`, which is
`qp_poseidon_core::rehash_to_bytes`. Running the same function reproduces the
address exactly, with no RPC and no lookup table.

The derivation takes the preimage and nothing else — no genesis, no chain
parameters — so one preimage is one account on every Quantus chain. The unit
test pins it against a real pair (this observer's own node and the address it
was paid at), so a dependency upgrade that changed the derivation fails the
build rather than quietly relabelling every miner on the site.

Unnamed miners now render as their address. The miner panel shows all three
identifiers, because they answer different questions: the node name is an
inference and may be absent, the address is what the miner recognises, and the
preimage is what the header actually carries and the only one the chain
asserts.

SS58 is written out rather than pulled from `sp-core`, which would bring a
substrate runtime's worth of dependencies to format 36 bytes — the same trade
the readme records for declining subxt. Base58 is hand-rolled because it is
long division and nothing else; blake2 is not, because checksums are not worth
hand-rolling. Both are covered by the address test vector.

`RecentBlock` gains the attribution source: the ticker cannot tell a node name
from an address by looking, since `quanpool-payout-mainnet` and `quantus-radar`
both begin with the letter Quantus addresses do. Two tests that asserted the
old display policy now assert the new one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 15:13:25 +03:00
ffcfb79cab feat(attribution): carry a miner's name across chains by reward preimage
All checks were successful
deploy / build (push) Successful in 7m6s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
Live telemetry names the miners who win often and leaves everyone else as a
hex string. Measured on mainnet: of 22 miners, 2 were named and 14 had no name
available anywhere — but 6 already had one on Planck, under the same reward
preimage. Those 6 are exactly the small operators the naming is worst for,
because a name needs a block whose first reporter the feed could separate and
they win few blocks.

The preimage is derived from a secret only its owner holds, so the same
preimage on two chains is the same operator. That is an inference the site can
stand behind, unlike guessing from timing — and it is the only lever that works
without waiting on the feed at all.

It is a separate `AttributionSource` and renders as one. `Carried` names carry
no confidence and no votes, because they assert nothing about this chain: only
that this is who the operator was last known to be. Any live attribution here
outranks one, and the row shows an `elsewhere` chip rather than the telemetry
`node` chip so the two can never be read as the same claim.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:59:29 +03:00
a177e805f4 fix(ui): say what a held name with no current votes actually means
All checks were successful
deploy / build (push) Successful in 6m40s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 15s
A mapping outlives the votes that earned it — deliberately, so a name does not
blink out whenever the feed goes quiet. But the tooltip then rendered "0% of 0
attributed blocks point here", which is arithmetic nonsense dressed as a
statistic.

The top miner takes 87% of blocks at a two-second interval, so its twenty
observations span about forty-seven seconds; votes age out of the window
constantly and this is the ordinary state, not an edge case. It now says the
name rests on evidence older than the current window, which is what is true.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:50:32 +03:00
992237b03c fix(ui): pluralise the verb, not just the noun, in the attribution tooltip
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
Read "100% of 1 attributed block point here" on the live site.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:46:44 +03:00
bfd3470840 feat(attribution): offer a best-effort name, and say how thin the evidence is
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
A name now appears as soon as one node leads the vote, rather than waiting for
three. On a chain that resolves a first reporter for about one block in seven,
the old bar left almost every miner permanently anonymous — and since a later
block can overturn a mapping, a guess that corrects itself is more useful than
a blank that never fills in.

What is refused is a dead heat. Choosing between two equally-voted nodes would
be a coin toss wearing a telemetry badge, which is a different thing from a
thin but real lead.

The honesty moves to the presentation instead of being dropped. A percentage
alone cannot separate "100% of 1" from "86% of 7", so `Attribution` and
`LeaderboardRow` now carry the number of votes behind the name. The leaderboard
marks a mapping resting on a single block or a narrow lead with `node?` and a
dashed chip, and the tooltip states both figures and that a later block can
correct it. Dashed rather than a second colour: the accent hue is reserved for
identity and alarm, and this is neither — the same claim held more loosely.

The footer now says node names are inferred from which node reported a block to
telemetry first, never something the miner asserted, and that the reward
preimage beside them is the only identity the chain itself vouches for.

`a_single_lucky_vote_still_names_nobody` asserted the old policy and is
replaced by `one_vote_names_but_says_it_is_only_one`, which pins the new
contract: it names, and it reports `votes == 1` so the UI can mark it. A new
`a_dead_heat_names_nobody` keeps the case that is still refused.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:44:48 +03:00
ef3a4b2689 fix(attribution): a held name survives silence, and only a clear lead replaces it
Some checks failed
deploy / build (push) Successful in 6m31s
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
Reported from the live site: a name would appear and then be "often forgotten
if it doesn't mine a new block within the window".

`attribute` dropped the held key the moment the vote window contained no vote
for it. That reads silence as contradiction — the same mistake as counting
abstentions in the confidence denominator, one layer further on. The window
holds twenty observations and mainnet resolves a first reporter on roughly one
block in seven, so an incumbent's votes routinely roll out before any
replacement earns one. The name vanished at that moment and the row fell back
to the raw preimage until three fresh votes rebuilt it.

A held name is now replaced rather than dropped: it stands until a different
node leads it by `TAKEOVER_MARGIN`. The margin is the other half of the same
problem — a window carrying about three cast votes flips on a single vote under
a bare majority rule, and pools demonstrably run several nodes that all report
their blocks (this miner has answered to both `QUANPOOL - quanpool-com` and
`quanpool-payout-mainnet`). Requiring a lead of two rides that out instead of
oscillating between siblings.

Takeover after a restart or rename still works, and is still tested: a node
that genuinely owns the blocks accumulates votes and passes the margin within a
few blocks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:37:58 +03:00
337dfa0f86 fix(attribution): retry the telemetry join until the feed catches up
All checks were successful
deploy / build (push) Successful in 6m36s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
Names were still absent after fixing the confidence denominator, because no
vote was being cast at all. The cause is that `ATTRIBUTION_SETTLE` was doing
duty for two unrelated quantities.

It was written for one: how long node reports take to spread across the network
once telemetry has the block. Eight seconds is right for that. But the lookup
also has to wait out a second quantity nobody had measured — how far behind the
chain the feed itself runs. On Planck the two coincide, because ~240 nodes at a
13 s block time is ~18 reports a second and the feed keeps up. Mainnet is ~190
nodes at ~1 s, an order of magnitude more traffic, and the feed sits about 57
blocks back. Measured against the node: chain tip 9539, highest height the feed
had reported in the preceding 110 s was 9482.

So every lookup asked who reported a block roughly fifty seconds before
telemetry had heard of it. `first_import` missed every time, every observation
became an abstention, and no author was ever named.

The join now retries every 5 s until the feed reaches the block, giving up at
three minutes and recording an honest abstention then. It adapts to whatever
the lag is rather than assuming it is zero.

Confirmed live: the top miner resolved to `QUANPOOL - quanpool-com` at
confidence 1.00 within about two minutes of restart, from 3 votes cast over 21
blocks. That 3-of-21 is also why the previous commit was necessary and not
sufficient — under the old denominator it would have scored 0.15 against a 0.6
bar and stayed nameless.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 14:12:30 +03:00
057937e9cc fix(attribution): measure confidence over votes cast, not the whole window
All checks were successful
deploy / build (push) Successful in 6m46s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Successful in 14s
Mainnet has shown no node names since launch. Every miner renders as its raw
preimage while Planck, on the same code and the same feed, names twenty.

`votes` holds one slot per block checked and a `None` for every block whose
first reporter the feed could not separate from its second. Those are
abstentions — the feed did not say who led — but confidence divided agreement
by `votes.len()`, counting them as votes against. Measured on the live feed,
mainnet resolves a clean lead on about a quarter of blocks, so the best score
any author could reach was 0.25 against a `MIN_CONFIDENCE` of 0.6. No name
could ever be held, however unanimous the votes that were actually cast. Planck
cleared the bar only because 41-87% of its blocks produced usable votes.

Confidence is now agreement among cast votes, which is what it always meant:
"of the blocks where we could tell who was first, this fraction pointed here".
`MIN_VOTES` guards the other side, so a single vote in an otherwise silent
window is not read as 100% agreement.

`a_held_name_survives_a_confidence_dip` asserted `confidence < 1.0` after five
unresolvable blocks. That assertion encoded the bug. It now asserts the
opposite for abstentions and keeps a real dip — disagreeing votes — as the case
that lowers confidence.

Two false leads are recorded in CLAUDE.md so the next person does not spend the
afternoon on them: the feed delivers a 190-node roster before any live block
traffic, so `ImportedBlock` does not appear for ~40 s after subscribing and a
short probe concludes the feed is dead; and the roster's `AddedNode` entries
carry a height-0 placeholder block with a zero hash, which inflates the
apparent count of nodes claiming to be first if counted as import reports.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 13:59:21 +03:00
2cb8f1cf21 config: the node on bob is mainnet now, not Planck
All checks were successful
deploy / build (push) Successful in 7m34s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
Mainnet launched today and the node was switched to it. The observer reads
whatever the node is on, so the `[[chains]]` entry pointing at 127.0.0.1:9944
had to follow it — until now the daemon was filing mainnet's blocks under the id
`planck`, with Planck's genesis and PLK still attached to them.

Read from the node, not assumed: `system_chain` "Quantus", genesis
`0xfb5487c0…626fba`, token QTC. `mainnet = true` is asserted here rather than
inferred, which is the field's whole purpose — telemetry also carries a chain
calling itself "Quantus Staging Mainnet", and it is not this one.

The target block time is **12 s, not the 6 s Planck used**.
`TARGET_BLOCK_TIME_MS` is 12_000 in the runtime the node actually runs —
checked at commit b017e642, the `0.11.1-b017e6420aa` its `system_version`
reports, rather than at the tip of the chain repo. It is the denominator for
every hashrate published before twenty tip samples exist, which on a chain
hours old is all of them, so carrying 6.0 across would have put out a mainnet
hashrate at exactly twice its true value — labelled "nominal", not broken.

Planck keeps its 268 telemetry nodes and stays in the site's navigation as
`no_endpoint`: still listed, no longer navigable, because authorship comes from
block headers and we no longer run a node that serves Planck's. That is an
ordinary state here, not an outage.

Nothing about the node itself is touched by this; every command run against it
was a read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-09 12:07:21 +03:00
53dac3717b feat: block explorer routes, addressed by hash
All checks were successful
deploy / build (push) Successful in 6m33s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 16s
`#/:chain/:height` opens a block and then rewrites the address to
`#/:chain/:hash`. The redirect is the point, not tidiness: `block` is keyed on
(chain, height) and a reorg overwrites, so a height names a *position* and a
link to one comes to mean a different block the moment the chain forks there. A
hash names one block for good — including after it has lost, which is the only
way an orphan is linkable at all.

`GET /v1/chains/{chain}/blocks/{ref}` takes either spelling; a decimal number
and 32 bytes of hex cannot be confused, so a caller holding a number is not made
to guess which one this API wanted. The same reasoning puts block refs in the
second path segment beside the window: no window name is all digits or 0x plus
64 hex characters.

The answer is assembled from two sources because neither is sufficient, and
they fail at different times:

- The node holds the block and forgets it. Non-canonical bodies go once finality
  passes them (blocks-pruning defaults to archive-canonical, and Planck finalises
  ~100 blocks back), and difficulty is a state read behind a 256-block default.
- The observer holds what the node never had — when the block was seen, whether
  that sighting was at the tip — and what it has since forgotten: the difficulty
  read while the state behind it still existed.

So resolution degrades in a stated order rather than failing. Node first; a
header it cannot serve falls back to `block_displacement`, which is what makes
an orphan describable at all; a node that is away falls back to the recorded
row. `from_node` tells the reader which they are looking at, and every value
neither source has is spelled out in words — "the body is pruned", "this
observer never saw this block" — because a blank on a block page reads as zero.

Verified against the live chain: a tip block carries difficulty, one extrinsic,
a 1.9 s gap and 473 ms of propagation; height 1000000 keeps its body and loses
difficulty to state pruning; genesis has no author digest and does not panic; a
seeded displacement serves as an orphan with the winner linked, and the winner
lists it in `also_seen`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-08 16:30:41 +03:00
0ce58094e4 feat(data): record what a reorg displaced
All checks were successful
deploy / build (push) Successful in 6m31s
deploy / deploy-web (push) Successful in 6s
deploy / deploy-api (push) Successful in 18s
`block` is keyed on (chain, height) so a replacement overwrites rather than
accumulates — a schema keyed on the hash would inflate the losing fork's author
forever. The cost is that the losing block vanishes without a trace, and with it
any record that the height was ever contested. `block_displacement` is that
trace: one row per displacement, holding the whole row that was about to be
overwritten.

It cannot be reconstructed later. `blocks-pruning` defaults to
archive-canonical, which discards non-canonical bodies once finality passes them
— about a hundred blocks behind the tip on Planck — and difficulty is a state
read against a 256-block default. Minutes after a reorg the chain itself can no
longer answer for the block, so what is captured at the moment of the swap is
all there will ever be. That is why the row holds the author and the difficulty
rather than just the hash: the author is the interesting field, it says who lost
the race, and it costs a table that gains a row only when the chain forks.

The capture is a CTE ahead of the upsert, in the same statement. Every
data-modifying CTE sees the same snapshot, so it reads the pre-update row even
though the insert below it is replacing that row in the same breath, and a
failure rolls back both — which two statements without a transaction would not.
A trigger would do the same thing invisibly to anyone reading the query.

Nothing reads the table yet, deliberately. The read shape belongs with the
block route that will use it; what matters now is that the history exists by
the time that lands, which it cannot do retroactively.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-08 15:55:07 +03:00
337d1ef516 ci: format the frontend with prettier and gate it
All checks were successful
deploy / build (push) Successful in 6m44s
deploy / deploy-web (push) Successful in 8s
deploy / deploy-api (push) Successful in 15s
`cargo fmt --check` has gated the Rust half since the first commit; nothing
gated the TypeScript, so 25 of 31 files under web/src had drifted from the
.prettierrc that was already sitting in the repo. `pnpm format:check` is now the
counterpart, in the same step as `pnpm lint`.

The reformat is whitespace only — the emitted bundle hashes identically before
and after.

web/.prettierignore excludes src/api/generated. Those files are written by ts-rs
from the entities crate and CI already fails on any diff in them after `cargo
test`; formatting them here would be reverted by the next regeneration and turn
that drift gate red on every subsequent build. Verified by regenerating and
confirming the tree stays clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-08 15:01:28 +03:00
9cbc2cc274 ui: put the miner count before the height tile
Some checks failed
deploy / build (push) Waiting to run
deploy / deploy-api (push) Has been cancelled
deploy / deploy-web (push) Has been cancelled
Height is the one tile with no sparkline — it only goes up, and a straight
diagonal reports nothing — so it sat in the middle of the row with an empty
slot under it, splitting the four lines into two and two. Last, it stops
interrupting them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-08 14:59:26 +03:00
7e5c2de936 feat: sparkline history under the headline tiles
All checks were successful
deploy / build (push) Successful in 6m36s
deploy / deploy-web (push) Successful in 6s
deploy / deploy-api (push) Successful in 16s
Adds `GET /v1/chains/{chain}/series` and a sparkline under network hashrate,
difficulty, block time and miners. Height gets none — it only goes up, and a
straight diagonal reports nothing.

The chart is bucketed by height, not by time: every point is the same number of
blocks, so every point carries equal statistical weight and a stretch nobody
recorded stays the same width on the axis as one that was. A bucket is the
window over fifty, which makes a full window exactly fifty buckets — that is
what lets the rolling miner count at the last point be the same number printed
in the tile above it, rather than a per-bucket count that would sit well below
it. Buckets are anchored to absolute height for the same reason `miner_series`
bins from the epoch: anchored to the tip instead, every boundary slides by one
on every block and the chart shifts under a reader watching it.

Interval comes from `authored_at`, never `observed_at`. A gap fill writes a
whole batch of observation times within the same second, so deltas taken from
it read as a chain producing hundreds of blocks a second — the trap
`RollingWindow`'s `at_tip` flag exists to avoid, which until now lived only in
memory. It is a column as of `0002`, so the distinction survives a restart and
`observed_at` is interpretable at all.

Each point's interval is a three-bucket moving average. The mean of one
bucket's gaps still carries real Poisson error — 72 blocks of a 15 s interval
lands at ±1.8 s — and across fifty points that draws a chain that appears to
change size every few minutes and does not.

Fixes a wrong number found on the way in: `pallet_qpow` retargets in
`on_finalize`, so `QPoWApi_get_difficulty` at the latest state is the
difficulty for the *next* block, not the one just seen. Every stored difficulty
was off by one block — invisible, because a gradual retarget still looks
plausible. It is now asked at `header.parent_hash`, the same call the miner
made when it built the block. A node that has pruned that state gets `None`
rather than the current value: substituting it is exactly how a gap fill would
stamp today's difficulty across a stretch of old heights. The CLI backfill had
the same bug at greater scale, copying one reading across an entire range.

Unknowns are drawn as breaks in the line, never interpolated: an outage, a
difficulty a pruned node cannot supply, a point without a full window of
authors behind it. A chart that guesses across what was never recorded is the
same class of lie as a hashrate divided by a sync speed, and just as hard to
catch afterwards.

Read against the dataviz skill first, per CLAUDE.md. Single series, one hue;
emphasis on the newest point is `--data-bright`, a lighter step of the same
bronze, because the usual "current period in the accent" convention is the one
change that would break this palette. The hover readout borrows each tile's
note line — five floating tooltips across a row of 180px tiles is a pile, not a
hover layer — and the same readout is on keyboard focus and in the aria-label,
since the line does not start at zero and its height is not a quantity anyone
should be estimating.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
2026-09-08 14:39:27 +03:00
b552b08b10 docs: record the mesh-bind, hairpin and runner-label gotchas
All checks were successful
deploy / build (push) Successful in 6m44s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 14s
Each of these failed a CI run this session and none of them looks like what it
is: a loopback health probe refused by a healthy daemon, a proxy that cannot
resolve its own public name, and 'cargo: command not found' on a node runner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSDYiibCtELsrjQq6KXnoi
2026-09-04 13:56:42 +03:00
3db86cfc66 fix(ci): health-probe the address the API actually binds, not loopback
All checks were successful
deploy / build (push) Successful in 6m51s
deploy / deploy-web (push) Successful in 5s
deploy / deploy-api (push) Successful in 15s
The probe curled 127.0.0.1:25864 and got connection-refused against a daemon
that was running perfectly — the journal it captured on failure showed it
serving. The API binds the host's *mesh* address by design: the fleet has one
firewalld default zone, so a wildcard bind plus the named service would publish
it on every address the host carries, and the edge proxy is at another site, so
loopback-only would not serve the site at all.

`hostname -f` resolves to that mesh address, so the probe needs no value carried
between steps. Verified against the running service: loopback refuses, the FQDN
returns 200.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSDYiibCtELsrjQq6KXnoi
2026-09-04 13:48:14 +03:00
151a30ae1a ci: run the build on the rust runner, drop corepack, pin the site check to loopback
Some checks failed
deploy / build (push) Successful in 7m0s
deploy / deploy-web (push) Successful in 4s
deploy / deploy-api (push) Failing after 1m26s
Three things that would each have failed the run seconds in
(architecture/gitea-runners.md §4):

- `runs-on: fedora-43` for a cargo build is `cargo: command not found` — the
  fedora images are node/shell runners with no Rust. `rust` is built on
  `runner-fedora-44`, so it carries node + pnpm as well and one job still builds
  both halves. musl stays: that runner is Fedora 44 and the targets are 43.
- `corepack enable` is not bundled by any image and pnpm is already on PATH.
- The site check curled the public name *from the edge proxy*, where it resolves
  to the site WAN address and dead-ends on the OPNsense LAN interface. Pinned to
  loopback, which still exercises the stream router, SNI, the vhost, the
  cross-site hop and the API.

Deploy jobs stay on `infra`: §4 is about tooling, not routing, and these targets
are mesh-only .internal names — same reasoning as lair/quantus and lair/mail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSDYiibCtELsrjQq6KXnoi
2026-09-04 13:37:31 +03:00
36a10ac691 fix(api): allow every configured CORS origin, not just the last
Some checks failed
deploy / build (push) Failing after 5s
deploy / deploy-api (push) Has been skipped
deploy / deploy-web (push) Has been skipped
`CorsLayer::allow_origin` replaces rather than appends, so folding over the
configured list left only `blackbeard.internal` allowed and silently refused
`blackbeard.observer` — the site's own public origin. It broke nothing, because
the frontend is served same-origin and never consults CORS, which is precisely
why it would have gone unnoticed until something else called the API.

Verified on the deployed vhost: both configured origins are now echoed back and
an unlisted one is refused.

Also records the deployment gotchas this session turned up (exact-argument
sudoers matching, the runas spec for the config check, the cross-site hop the
loopback probe cannot see, and why a WebSocket upgrade test needs --http1.1).

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