feat: a runtime's own page
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
This commit is contained in:
2026-09-09 17:45:28 +03:00
co-authored by Claude Opus 5
parent 1260cc6d64
commit b006f54cd5
25 changed files with 1846 additions and 17 deletions
+152
View File
@@ -1039,3 +1039,155 @@ tr.mine .share-bar > i {
font-size: 11px;
line-height: 1.6;
}
/* ---- runtime ------------------------------------------------------------- */
/* The version strip. Reuses the chain chip: it is the same gesture — a row of
short labels where one is current — and a second visual language for it
would say the two are different sorts of choice. */
.runtime-strip {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 14px 16px;
border-bottom: var(--rule);
}
.runtime-pallet {
border-bottom: var(--rule);
}
.runtime-pallets > .runtime-pallet:last-child {
border-bottom: 0;
}
/* A whole-row target. A pallet's name is not the only part of the row worth
clicking — the counts beside it are what tells you whether opening it is
worth doing. */
.runtime-pallet-head {
display: grid;
grid-template-columns: 34px 1fr auto 20px;
align-items: center;
gap: 12px;
width: 100%;
appearance: none;
border: 0;
background: transparent;
color: var(--text-primary);
font: inherit;
text-align: left;
padding: 11px 16px;
cursor: pointer;
}
.runtime-pallet-head:hover {
background: var(--surface-2);
}
.runtime-pallet-name {
font-weight: 600;
}
/* The pallet index, and the variant indexes inside. Monospace and tabular
because they are the bytes on the wire, not decoration: reading down the
column is how you see that a pallet was inserted rather than appended. */
.runtime-index {
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
font-size: 11px;
color: var(--text-muted);
background: var(--surface-3);
padding: 1px 6px;
text-align: right;
min-width: 26px;
}
.runtime-counts {
font-size: 11px;
color: var(--text-muted);
}
.runtime-chevron {
font-family: var(--font-mono);
color: var(--text-muted);
text-align: center;
}
.runtime-pallet-body {
padding: 4px 16px 18px;
background: var(--surface-1);
}
.runtime-group {
padding: 12px 0 4px;
}
.runtime-envelope {
padding: 14px 16px;
border-bottom: var(--rule);
}
.runtime-list {
list-style: none;
margin: 8px 0 0;
padding: 0;
display: grid;
gap: 5px;
}
/* Flow rather than a grid: the parts of a line are a name, sometimes a value,
sometimes a type and sometimes a sentence, and a column per possible part
would be four columns mostly empty. */
.runtime-list li {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 4px 10px;
font-size: 12px;
line-height: 1.5;
}
.runtime-list code {
font-family: var(--font-mono);
font-size: 12px;
color: var(--text-primary);
overflow-wrap: anywhere;
}
/* The compiled-in value, in the data hue: it is the one thing on the line that
is a fact about this runtime rather than about its shape. */
.runtime-value {
font-family: var(--font-mono);
font-variant-numeric: tabular-nums;
color: var(--data-bright);
overflow-wrap: anywhere;
}
.runtime-type {
font-family: var(--font-mono);
font-size: 11px;
color: var(--text-muted);
overflow-wrap: anywhere;
}
/* `optional` or `default`, which is a property of the entry and belongs on its
line rather than under it. */
.runtime-modifier {
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-muted);
}
/* Documentation the runtime carries. Given the whole remaining width so it
wraps as prose, because that is what it is. */
.runtime-doc {
flex-basis: 100%;
color: var(--text-secondary);
font-size: 11px;
padding-left: 36px;
}
.runtime-extensions {
counter-reset: none;
}