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
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n select spec_version, spec_name, first_seen_height\n from runtime_metadata where chain = $1 order by spec_version asc\n ",
"query": "\n select spec_version, spec_name, first_seen_height, fetched_at,\n octet_length(metadata) as \"bytes!\"\n from runtime_metadata where chain = $1 order by spec_version asc\n ",
"describe": {
"columns": [
{
@@ -17,6 +17,16 @@
"ordinal": 2,
"name": "first_seen_height",
"type_info": "Int8"
},
{
"ordinal": 3,
"name": "fetched_at",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "bytes!",
"type_info": "Int4"
}
],
"parameters": {
@@ -27,8 +37,10 @@
"nullable": [
false,
false,
false
false,
false,
null
]
},
"hash": "4777ff33fa3c39f2bad9d5c4182460c0d32eb157d92bdb6f836ac4f097cc7a01"
"hash": "19a2efd4f573d2fc407b5db4b6fcfd585db063b0d9f02c6f2e3f19896cf2af8e"
}
@@ -0,0 +1,16 @@
{
"db_name": "PostgreSQL",
"query": "\n update runtime_metadata\n set first_seen_height = case\n when first_seen_height = 0 then $3\n else least(first_seen_height, $3)\n end\n where chain = $1 and spec_version = $2\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Int8",
"Int8"
]
},
"nullable": []
},
"hash": "9d4ef01721039a1c9d5d9ad5774f55563a5bf525dfbdc2881b3a60763c42a083"
}