# The consensus layer **Scope.** Everything that decides *which chain is the chain*: who may seal a block, whose turn it is, which of two competing histories wins, what a proof of execution binds, and when a block stops being reorganisable. It does not cover execution, the ledgers, identity or the network transport, except where consensus reads them. **Line numbers were re-pointed at `9220195`** on 2026-09-07; the chapter itself was written at `6c7f981` on 2026-09-06 with the working tree dirty. Treat every `file.ts:line` as an anchor to check rather than a coordinate to trust — `npm run citations` now scores them in CI, but only the ones written as `` `Symbol` (`path.ts:NNN`) ``; a bare line reference in prose is still unchecked. Symbol names are stable; line numbers drift. Every number here comes from the code or from a test run named where it is used. Where something is not measured, it says **unmeasured**. --- ## 1. What this layer decides Five separable questions, five components, and the separation is load-bearing — each answer is a pure function of committed data, so a node replaying in 2030 reaches the verdict the node that first accepted the block reached in 2026. | Question | Component | File | |---|---|---| | Who may seal at height H? | **Gladsheim** (the seated set) | `src/core/valhalla.ts` | | Whose *turn* is it? | **Tyr** (round-robin slot rotation) | `src/core/tyr.ts` | | Which of two chains wins? | **Skuld** + **Norn** (slot-coverage fork choice) | `src/core/skuld.ts`, `consensus/urd.ts` | | What did the producer actually do? | **PoE** (proof of execution) | `consensus/poe.ts` | | When can this no longer be rewritten? | **Settlement** (depth + ratchet is the line reported; a rewrite is refused only below the quorum-gated irreversible line, §3.5) | `src/core/blockchain.ts` | Plus two things hanging off them: **Urd**, a constant-size hash fold of the history (`consensus/urd.ts`), and **Nidingr**, the record that carries proven equivocation into a block and takes the offender's seat (`src/governance/nidingr.ts`). Every judgement of an incoming header runs the same two refusals in the same order, in four places: ``` header | verifyProducerAuthorisedAt <- Gladsheim: is this address seated at H? | (blockchain.ts:6042) v verifyInTurnAt <- Tyr: is it this address's slot, and is the | slot after its parent's? (blockchain.ts:6033) v ordering / execution / roots ``` The four sites: | Site | Call | Why it must be there | |---|---|---| | produce | `blockchain.ts:2896` | a node that seals out of turn builds a branch every peer rejects, and believes its own chain | | accept | `blockchain.ts:4211` | the ordinary follower path | | offer (fork pool) | `blockchain.ts:4561` | fork choice ranks on headers and only executes the winner, so an unauthorised branch that is merely well-formed would compete against honest ones | | replay | `blockchain.ts:5506` | if ingress and replay disagree about validity, a node holds a chain its own `validateChain()` accepts and every peer refuses | The replay site passes its **own** `GladsheimSchedule` (`replaySeating` `blockchain.ts:15506`). That is not a nicety: `restoreSnapshot` replays, and at that moment the live schedule holds exactly one anchor — epoch zero — so a replay consulting it refuses every block from height 128 onward and the node rejects the chain it was just running. --- ## 2. Tyr — slot leadership `src/core/tyr.ts`. Norse: the god of law and of the Thing. He stands beside **Fenrir**, the name this registry gives to slashing. Tyr appoints and refuses; nothing in `tyr.ts` bites. Fenrir does, as of 2026-09-10 — see §14 — and no part of the bite is in this file. ### 2.1 The failure this exists for There was no leader election of any kind. `verifyProducerAuthorised` asked whether a producer was *in* the validator set and never whether it was *that producer's turn*, so every member of the set was entitled to seal every height. Two nodes on default flags each sealed on their own 3-second timer, both at height H, both authorised, both accepted by everybody. Fork choice was then handed two branches identical in density and in length, and `SkuldResolver.strictlyBetter` refused to swap on a tie *in either direction* — by design. The split was permanent. Twelve blocks later both nodes reported conflicting blocks as `final`, with no byzantine actor anywhere and no rule broken. A chain that forks irreparably when two honest validators are switched on is not a consensus protocol; it is a broadcast bus. Reproduced end to end at `tests/integration/consensus.integration.test.ts:793`. ### 2.2 What it is **Round-robin authority-based slot leadership** — a fixed roster taking turns by slot. Chosen because it is the smallest scheme sound on the material this chain already has, and because it is not novel. The alternatives were rejected for reasons about this chain rather than about them (`tyr.ts:37-52`): BFT proposer rotation needs the pre-vote/pre-commit rounds that give it liveness and no node here exchanges one; VRF leadership needs a per-slot verifiable random function and an epoch randomness beacon, neither of which exists; stake weighting needs stake, and `Einherjar.stake` is a field anybody can write. ``` slot(t) = floor((t - epochStartMs) / slotMs) tyr.ts:112 leader(slot) = roster[((trunc(slot) % n) + n) % n] tyr.ts:189 ``` The double-modulo is not decoration. JavaScript's `%` keeps the sign of the dividend, so a negative slot indexes backwards off the front of the array and returns `undefined` — and a leader check comparing against `undefined` accepts nobody while reporting nothing useful. Slots before the epoch are refused earlier (`tyr.ts:260`); the normalisation means a direct caller gets an answer rather than a hole. The four rules, all in `TyrSchedule.verifyHeader` (`tyr.ts:534`): 1. height 0 is exempt — the genesis has no producer signature and no slot leader; its authority is the genesis hash (`tyr.ts:254`); 2. `slot < 0` is refused — stamped before the chain's first slot; 3. `slot <= parentSlot` is refused, **when the parent is present**; 4. `header.producer !== leader(slot)` is refused. Rule 3 is the half that does the real work. The timestamp rule only forbids going *backwards*, and equal stamps are legal so that two honest blocks inside one millisecond are legal. Without "one block per slot", a single leader could extend the chain by a hundred heights inside its own turn and win every density comparison against honest producers who each took one. The slot has to be **spent**, not merely entered. The parent is optional (`parent?: BlockHeader`) because gossip does not promise order. A block whose parent has not arrived is still checkable against the rotation, and holding it on that merit is how a competing branch gets assembled at all. That is why the offer site (`blockchain.ts:4561`) passes no parent — rule 3 is checked again with the parent present before the block can join a chain. ### 2.3 Where the roster comes from Two rotations exist, and which one a node uses depends on where its validator set came from (`blockchain.ts:1124-1191`): | `validatorSetSource` | Set | Rotation | |---|---|---| | `genesis` (production default) | `validatorSetFromGenesis(genesis)` | `TyrRotation` over `GladsheimSchedule.rosterAt(height)` | | `declared` (`--validators`) | the operator's list | `TyrSchedule`, fixed at construction | | `development-open` | `null` — open | **none**; `verifyInTurnAt` returns `{accepted:true}` | `TyrRotation` (`tyr.ts:695`) resolves the roster at a height through a `TyrRosterAt` callback (`TyrRosterAt` `tyr.ts:621`), wired to `this.seating.rosterAt(height)` at `blockchain.ts:1189`. `undefined` is a real answer and is a **refusal**, not an open rotation (`requireScheduleAt` `tyr.ts:755`). The distinction is sharper here than for the authorised set: a node that guessed a roster would not merely be permissive, it would enforce a *different* rotation from its peers — refusing honest blocks and accepting out-of-turn ones, in both directions at once. `GladsheimSeating.roster()` (`valhalla.ts:499`) is the seats sorted **by domain in byte order**, mapped to address. Not by genesis `index`: a member governance admitted has no genesis index, and inventing one would be a number two nodes could pick differently. This changes the rotation order relative to the genesis node list, and the rotation order is chain identity — accepted in the cycle the genesis hash was already moving. The frozen array from `roster()` is cached and handed out **by reference**, because `TyrRotation` keys its schedule cache on that exact array in a `WeakMap` (`tyr.ts:397`). A `roster()` returning a fresh copy would miss on every block and rebuild a 1313-entry position index each time. A reorg that rebuilds the seating produces a new array and therefore a new schedule, which is the required behaviour rather than a lucky one. Duplicates in a roster are collapsed, first position kept (`tyr.ts:159-165`). A roster listing one address twice would hand that validator two turns per rotation, which is stake weighting arrived at by accident. `validateGenesisSpec` already refuses a duplicated node address; this is the second door, because a `declared` set comes straight from an operator's flag. `tyrRosterFromNodes` (`tyr.ts:844`) sorts by `index` then address bytes — the order `genesisNodeSetRoot` hashes. **It has no production caller.** It is referenced only from `consensus.integration.test.ts`, which pins it against the genesis root sort so the two cannot drift apart in silence. Read its doc comment as documentation of the genesis commitment, not as a description of what the chain rotates over. ### 2.4 Why it is a refusal and not a hint A production hint would be worth nothing: a producer that ignores the schedule is exactly the producer the schedule exists to stop. `TyrSchedule.nextSlotFor` (`tyr.ts:379`) and `TyrRotation.nextSlotFor` (`tyr.ts:820`) are explicitly labelled production hints and **nothing validates against them**; they return `-1` for an address outside the rotation, because "never" is the honest answer and a number is a lie a scheduler could act on. Neither has a production caller. What the runtime actually does: `HestiaNode.offerIdentityRecords` (`src/node/hestia.ts:4966`) consults `BlockchainCore.leadership()` (`blockchain.ts:7608`) and skips queuing records when it is not this node's turn. The producer loop itself (`hestia.ts:1533`) does **not** check the turn — it calls `produceBlock()` on a timer it re-arms each turn, and on a turn with work or a heartbeat due `produceBlock` throws `refusing to seal out of turn: ...` (`OutOfTurnError`, `blockchain.ts:1726`). The loop's `catch` counts and reports every other seal failure and discards that one uncounted. On a rotation of N with one local validator, a node therefore throws and discards an exception on roughly `(N-1)/N` of the turns that reach the seal; an idle turn returns before it. Correct behaviour with an ugly shape, and it means the "out of turn" refusal is invisible in logs. ### 2.5 Why there is no backup leader The obvious remedy — "if the leader has been silent for `g` slots, the next validator may take the slot" — reintroduces the original defect through a side door. Two validators disagreeing about whether `g` slots have elapsed both seal at one height, and the fork that creates is indistinguishable from the one this file exists to prevent. **A rule that lets somebody else seal in your slot is a rule that lets two nodes seal in one slot.** The lever for liveness is the size of the roster, which is a genesis decision made in the open, not a consensus loophole. Stated at `tyr.ts:83-89` and restated for the shrinking roster at `tyr.ts:381-383`. A leader that is down cannot stall the chain, because the slot advances with the *clock*, not with the chain: an absent leader produces an empty slot and the height arrives one slot later. There is no timeout to tune and no view change to get wrong. Pinned by `consensus.integration.test.ts:725`. ### 2.6 Liveness: N/k, with worked numbers With a roster of `N` and `k` validators actually online, the expected gap between blocks is `N/k` slots. `slotMs` is `CHAIN_CONFIG.blockTargetSeconds * 1000` = **3000 ms** (`src/core/config.ts:12`, read at `blockchain.ts:1178`, `1187`, `1276`). | N | k | slots/block | seconds/block | | |---|---|---|---|---| | 3 (declared) | 3 | 1 | 3 s | the intended cadence | | 13 | 3 | 4.33 | 13 s | | | 1313 (full genesis roll) | 3 | 437.67 | **1313 s ≈ 21.9 min** | the "roughly one block every 22 minutes" at `tyr.ts:79` | | 1313 | 1313 | 1 | 3 s | | This is why a small deployment must **declare** a small validator set rather than inherit the full roll. A related measurement is recorded in `docs/NAMING.md` under **Bragi**: an STR.domain claim waits for the submitting node's own slot, measured at 6,126 ms against 135 ms on a three-node rotation, and by the same arithmetic 39 s on a 13-member roster and 65.65 minutes on the 1313-member roster — that last figure being one full rotation (1313 × 3 s), which is the wait for *your own* turn, not `N/k`. `N` is not a constant once the roster is the seating. Three statements, and the first must not be dressed up (`tyr.ts:352-379`): - **Ejecting a producing validator makes the chain slower, and the seating roster does not fix that.** `k` falls by one, so the gap goes from `N/k` to `(N-1)/(k-1)`, larger whenever `N > k`. Losing a producer costs blocks, whatever the rotation is built from. - **What the seating roster removes is the extra penalty a frozen roster added on top.** With `N` frozen, the gap after an ejection is `N/(k-1)` rather than `(N-1)/(k-1)` — one slot in every `N` belongs to a validator that may no longer seal and that nobody may seal for. The saving is exactly `1/(k-1)` slots per block, and it is a slot that never comes back rather than a one-off cost. Worked: 1313 seats, 3 nodes running, eject one of the three. Seating roster: `1312/2 = 656` slots = **1968 s = 32.8 min**. Frozen roster: `1313/2 = 656.5` slots = **1969.5 s**. Difference 1.5 s per block — half a slot, permanently. - **The epoch of lag before an ejection binds costs nothing in liveness.** Between the offence and the next epoch boundary the equivocator is still seated and still leads its slots, so `N` and `k` are unmoved. `VALIDATOR_EPOCH_BLOCKS` (128, 384 s at a 3-second target) is a **safety** window, not a throughput one. **The floor is one.** `Odin.applyEject` refuses an ejection that would leave the assembly with no voting power (`src/governance/odin.ts:672`), so the roster cannot be driven to zero by evidence. A roster of one is a single sealer and no rotation at all — a governance emergency rather than a consensus failure, and reachable only by ejecting every other member on proof. ### 2.7 What Tyr refuses, and what it cannot do Refuses: a block from a seated validator that is not the slot leader; a leader that seals twice inside its own slot (when the parent is known); a block stamped before the chain's first slot; a block at any height when this node cannot name the seating for that height. Cannot do: - **Cannot stop a producer sealing into a slot that has already passed**, provided the slot is after its parent's. Not preventable: validation has to reach the same verdict during replay as on arrival, and a rule bounded by `Date.now()` would make a block's validity depend on *when* it was replayed. Two blocks at one height in different slots are therefore possible between honest validators; fork choice separates them on the earlier slot. - **Cannot stop a producer looking forward.** `verifyBlockOrdering` (`blockchain.ts:1937`) bounds a timestamp at `MAX_BLOCK_DRIFT_MS` = 120 000 ms ahead of the validating node's clock (`blockchain.ts:281`). At a 3-second slot that is **40 slots** of lookahead, so a producer can seal early if one of the next 40 slots is its own — a `40/N` chance per attempt. The price is that the chain's clock ratchets past every slot it skipped, so the stolen slots are gone rather than replayed. It cannot seal in a slot that is not its own at any drift, because the leader check does not consult a clock at all. - **Does nothing on a `development-open` chain.** `tyrScheduleFor` returns `null` for an open set (`tyr.ts:540`) and `verifyInTurnAt` then answers `{accepted: true}` (`verifyInTurnAt` `blockchain.ts:16460`). **A development chain on default flags has no leader election, and two producers on it will still fork.** The fix is not a flag, it is declaring a validator set. --- ## 3. Skuld and Norn — fork choice as a total order `src/core/skuld.ts` (the resolver, the reorg, the equivocation witness) and `consensus/urd.ts` (the comparator and the density measure). ### 3.1 The failure this exists for Two failures, one on top of the other. **First, there was no fork handling at all.** `acceptBlock` required `height === chain.length`, so the first block seen at a height won permanently and a competing branch — however much better — was rejected as "declares height N, expected N+1". `nornForkChoice`, a complete density-based fork choice, existed and was called from nothing but a test. That absence was load-bearing for other failures too: a replayed registration record, a wedged mempool, a snapshot restored over corrupt state each ended in "and then the node is stuck forever" specifically because there was no way back. **Second, and this is the one that matters here: two comparators disagreed.** `nornForkChoice` ranked density, then length, then head-hash bytes. `SkuldResolver.strictlyBetter` ran its own density-then-length check and refused to adopt on anything below it. They agreed in every case except one, and it was the case that occurred: a pair tying on density **and** length was named a winner by fork choice and then vetoed by the resolver. Nobody decided, so nobody moved. That is the whole of the two-honest-producers fork. Both nodes seal at height H on the same 3-second tick. Each branch is one block covering one slot, so density ties and length ties, and `strictlyBetter` returned false in **both** directions. Both nodes kept their own block, extended it, and after `requiredConfirmations` blocks `finalityStatus` said `final` on two conflicting histories. No byzantine actor, no invalid block, no rule broken. **Two implementations of one decision is one implementation and one disagreement.** The fix was not to make the resolver's rule smarter; it was to delete it and make it a restatement of the single comparator (`skuld.ts:728`, calling `compareBranches`). ### 3.2 The order `compareBranches(left, right, options)` — `compareBranches` `consensus/urd.ts:562`. Negative means `left` is preferred. Four steps, first non-zero wins: ``` 1. distinct slots the suffix filled (a plain count) 2. suffix length 3. earliest first slot of the suffix 4. head hash, byte order ``` **Step 1 was the minimum sliding-window density until 2026-10-11**, and the change is a consensus rule, so it is stated here with its cause. The window is ten slots — thirty seconds — and Asgard seals when it has work and otherwise once a minute, so the live chain's suffix after any fork point more than a minute old always held a window with no block in it and scored **0**. A rival branch of one lawful block spans no window and scored 1/10. One stale block therefore outranked the entire live chain at any length; every seat that met one reorganised backwards onto it, the settlement ratchet then forbade the way back, and three days of "dead branches that will not converge" were this one step. Measured from a seat's own `finalityConflict` record — our head 1788, competing one block at 1693, `lengthAdvantage −95`, `wouldHaveWon: true` — and written up with the block log that proves the reorg in `launch/FORK_RECOVERY.md` §14 and above `compareBranches` itself. Counting the slots a suffix filled is the slot-coverage measure with the one denominator both branches share — the time since the fork — cancelled out: a private branch built by fewer leaders still fills fewer slots, packing still earns nothing, and an idle minute on the honest chain is no longer a loss. **Total and strict, and both words are load-bearing.** Two nodes each holding a chain the other has never seen must end up on the same one, and without a round of voting that only happens if every node ranks the same pair identically and the ranking never calls two *different* chains equal. Strict means `< 0` at `skuld.ts:733`, so an exactly equal pair — which can only be the same chain — never swaps, and nothing churns. Pinned by `consensus.integration.test.ts:816`, which re-offers the loser five times and asserts the head does not move. Both places that choose use the whole order. `SkuldResolver.resolve` used to keep the *longest* branch among the winners (`skuld.ts:587` now uses `strictlyBetter`), which is step 2 applied as if it were the whole of a four-step order: with three or more candidate branches a node could pick a branch that fork choice ranks below another branch it also held, and a peer holding the same three in a different sequence could pick the other one. Convergence is a property of the order, and it only holds if every place that chooses uses the whole order. ### 3.3 Why slot precedes hash Step 3 is deliberately ahead of step 4. Two blocks at one height in different slots are ordinary under Tyr — the leader of slot 11 seals on a parent it holds because slot 10's block has not reached it yet — and the branch starting in the earlier slot is the one whose leader had the rightful turn first. Ranking by hash before slot would mean **a producer could win a rightful turn away from an earlier leader by grinding its own block hash**, and it is a race it enters for free: nudge the timestamp inside the slot, or reorder the batch, and the hash changes. Pinned by `consensus.integration.test.ts:839`, which offers the *later* branch first, sees it adopted, then offers the earlier one and watches it win. An empty suffix answers `POSITIVE_INFINITY` for its first slot (`firstSlotOf` `urd.ts:702`) — it took no slot, so it loses the slot comparison to any branch that took one. Returning 0 would have made "added nothing" beat every real branch. Adopting on step 3 or 4 is a reorg on a cosmetic difference, and that is only safe because a branch cannot be manufactured: under Tyr a slot has exactly one lawful author, so an attacker cannot enter the tiebreak at a slot that is not its own, and signing twice in one slot is recorded as evidence. **On a chain with no schedule the tiebreak is grindable** (`urd.ts:284`) — one more reason a `development-open` chain is not a network. ### 3.4 Density over DISTINCT slots `minimumChainDensity` `consensus/urd.ts:713`. The slot-coverage rule: a chain built by an adversary who was offline or withholding has gaps in some window, and gaps are what a long-range attack cannot hide. Density is blocks-per-slot in `[0, 1]`, minimised over any sliding window of `windowSlots`. It is still computed and reported in every `NornVerdict`; since 2026-10-11 it is **not ranked on**, for the reason §3.2 gives. What the order ranks on is `slotsFilled`, which is this measure's numerator — and the rule below about distinct slots is the part that carries over unchanged. The measure is over **distinct slots**, and this is the whole of it: ```ts const slots = [...new Set(headers.map(h => slotOf(h.producedAtMs, options)))].sort((a,b)=>a-b); ``` Counting *blocks* inverted the defence, and it was introduced by the timestamp fix rather than present from the start. Monotonicity permits **equal** stamps — refusing them would refuse an honest producer sealing twice inside a millisecond — so an attacker may legally stamp a whole branch at one instant. With blocks in the numerator and `windowSlots` in the denominator, eleven blocks over a ten-slot window scored 1.1, and the cap added to stop a *gappy* chain scoring above 1.0 turned that into a **perfect** score. Measured before the fix, recorded at `consensus/urd.ts:328` and `tests/integration/block-timestamp.integration.test.ts:213`: forty blocks at a single millisecond scored **1.0**, beating an honest chain with two genuinely missed slots at **0.8**. Packing is legal and has to be **worth nothing** rather than be forbidden. The current tests: | Assertion | Test | |---|---| | 40 blocks at one millisecond score `< 0.1` | `block-timestamp.integration.test.ts:215` | | 11 blocks filling every slot score exactly `1` | `:220` | | a gappy honest chain outranks a packed one | `:229` | | repeating a slot inside an honest branch earns nothing | `:235` | The partial-window branch (`urd.ts:340-349`) carries the same fix in its denominator: `owedSlots = max(windowSlots, blockCount, lastSlot - firstSlot + 1)`. Dividing by `windowSlots` alone was the second half of the defect. The windowed pass (`urd.ts:374-379`) also counts distinct slots: a window holding one slot filled twenty times has one slot filled. **Exact-integer comparison.** Fork choice must not turn on a float epsilon, and since 2026-10-11 it compares no density at all: step 1 is an integer count of slots. Densities are still rounded once to a grid of `1/DENSITY_SCALE` with `DENSITY_SCALE = 1_000_000` (`urd.ts:481`), so the figure a `NornVerdict` reports is the same on every node; `scaledDensity` `urd.ts:890` has no caller in `src/` or `consensus/`. Two nodes cannot rank the same pair differently because their arithmetic drifted in the last bit. **`MAX_DENSITY_SLOT_SPAN = 100_000`** (`urd.ts:59`) is defence in depth against a timestamp this function does not itself validate. The windowed loop runs once per slot between first and last and filters the slot list on each pass, so before `producedAtMs` was bounded, two frames could imply an arbitrary slot range — the comment at `urd.ts:351-365` records 43 ms for a 10^10 ms spread, linear from there, which at the largest representable timestamp is hours of blocked event loop per offered block. `verifyBlockSelfConsistency` now bounds the timestamp so this is unreachable through ingress; the guard stays because the function is exported and pure, and a fork-choice ranking that can be made to run for hours should not depend on every present and future caller having validated first. The chain builds Skuld with `windowSlots: 10` and `epochStartMs: genesis.producedAtMs` (`blockchain.ts:1276-1283`). The origin is the genesis timestamp and not zero, deliberately: density slots and Tyr's leadership slots have to *be* the same slots, or the branch a node prefers and the branch it will accept are indexed differently. `Odin` is handed the same origin for the same reason (`blockchain.ts:1102`, `odin.ts:206-223`) — three subsystems indexing three different sets of slots is how the offence one of them proves becomes innocent to another. `slotMs` here is the **compiled-in** `CHAIN_CONFIG.blockTargetSeconds`, not the governed `chain.blockTargetSeconds`. Stated at `blockchain.ts:2867-2873`: fork choice has to be a function of an agreed height rather than of whatever each node holds right now, or two nodes mid-vote rank the same two branches differently. ### 3.5 The three rules that make a reorg safe 1. **A reorg is refused below the irreversible line, and only there.** ~~Finality is not negotiable. A branch forking at or below the finalised line is skipped before any density arithmetic.~~ *Corrected 2026-10-29; the rule changed on 2026-10-10 and this line did not.* A branch forking below the **depth** line is recorded as a `FinalityConflict`, and it is skipped before any density arithmetic only when it also forks below the **irreversible** line (`irreversible` `skuld.ts:1452`, refused at `backed` `:1500`). That line rises only at a height where this node measured a quorum (`irreversibleHeight` `blockchain.ts:13372`); below the depth line and above the irreversible one, the branch falls through to fork choice and is judged on its merits. On Asgard the quorum (876 of 1,313) has never been reached, so the irreversible line is **-1** and a node that waited for `final` holds a depth, not a promise: live `getStatus` on 2026-10-29 answered `finalityBacking.irreversibleLine: -1` and recorded a branch forking 1181 blocks below the depth line that was judged and lost. §8.5. 2. **Strictly better, decided by a total order.** §3.2. 3. **Adopt only what fully validates.** `tryBestFork` (`blockchain.ts:12566`) builds the candidate chain in a **throwaway `BlockchainCore`**, applies every block through `acceptBlock`, then runs `validateChain()`, and only then swaps state in. A reorg that half-applies is worse than the fork it was meant to heal. The rebuild is a replay rather than an undo, from a checkpoint near the fork point when one will do and from genesis when none will (both below): undo is faster and is how a reorg goes subtly wrong, because it has to invert every effect a block had and anything it forgets to invert survives into the new chain as state nobody can account for. The trial inherits `mode` and the declared validator set — it used to inherit neither, so it was a development chain with an open set, and a branch of unauthorised blocks replayed cleanly. The one place fork choice actually executes a branch was the one place the set was not consulted. It also runs on the chain's own slot length. Until 2026-11-17 it took the compiled-in 3 s slot whatever the chain ran on, so on a test chain paced faster (`slotMs`, refused on every registered realm) it asked Tyr about the wrong slot, refused lawful blocks as "not the leader", and blacklisted the winning branch of a one-block tip contest. The loser then never rejoined. Measured on the local heartbeat harness, and reproduced in `fork-trial-slot-length.integration.test.ts`. A live chain was never affected. **And without a per-block rollback copy, since 2026-11-18.** `acceptBlock` copies the ledger, the domain registry and the pool's books before it executes a block, so that a block it refuses leaves nothing behind. On the trial's throwaway core that copy was never read, because a refusal ends the trial and drops the core, and it cost one copy of the whole state per replayed block. Measured with `scripts/reorg-trial-bench.mjs` on a chain with 1,314 genesis domains and empty blocks, one one-block reorganisation at height 2,000 took 46.4 s with the copies and 1.3 s without. `reorg-trial-equivalence.integration.test.ts` keeps the old trial as the oracle and requires identical verdicts and identical snapshot bytes. **And from a checkpoint near the fork point, since 2026-11-22.** Copies or none, that trial cost O(height): on a saved Asgard fork (tip 40,997, a seven-block suffix, 2026-11-22), 36 s of CPU, synchronously, on every seat that heard it. From a checkpoint: 0.3 s, onto the same state root. A node now keeps its own state at a few of its own canonical heights (`src/core/fork-checkpoint.ts`), and a trial starts at the one below the fork: the same `acceptBlock`, and the same replay `validateChain()` runs, over the blocks above it. What it takes on trust is only the state AT the checkpoint, which is this process's own, is bound to the hash of a block still canonical, carries a digest of its bytes, and must load to the root the chain's own header `DEFERRED_DEPTH` higher commits to. **It may only adopt.** Anything but a clean pass - a refusal, a throw, a checkpoint that does not open - runs the trial from genesis, which is unchanged, and which alone may reject a branch for good. A checkpoint is never written to disk and never taken from a peer; it is dropped when a reorganisation replaces its block, taken from the live state only while every block since genesis went through `acceptBlock`, derived on a throwaway core when this node sealed one of them, and not taken at all above a block the replay folds differently (a bond in an epoch anchor under rule version 5). At most a dozen are held, about 0.27 MB each on 1,313 seats and 1,314 proved domains. `fork-checkpoint-equivalence` and `fork-checkpoint-records` hold it to the trial from genesis over random forks, every record kind, rule activations, certificates, presence and pruned nodes. One difference is deliberate and is pinned there: a block archived WRONG below the checkpoint no longer stops a reorganisation above it. The trial from genesis reads the whole archive: a block that does not link leaves the branch untried, and one that links but whose BODY is not what its header commits to is refused. That refusal sits at or below the fork, so it is about this node's own storage and not about the branch: the branch is HELD, not rejected (`fork-parking`; with parking off it is still rejected for good, `fork-checkpoint-guards`). A checkpoint trial reads neither. A trial whose nearest checkpoint is more than half the chain below the fork goes straight to genesis, and a trial that found none near keeps the state it passed through `DEFERRED_DEPTH` below the fork, where no reorganisation at the tip reaches it. `strblk node --fork-checkpoints off` (or `SOURCELESS_FORK_CHECKPOINTS=off`) tries every branch from genesis, and a value that is neither `on` nor `off` is refused at the start; `forkTrials` on the operator's `/api/status` says what the trials did, and a node logs one line, with the reason and the duration, for each one run from genesis. **And a block a checkpoint refuses waits before genesis is asked, since 2026-11-22.** Because only genesis may reject, one seat that sealed a block with a wrong root cost every node that heard it 36 s on one thread, each further variant cost it again, and no lost slot was needed: one that plainly extended the head did. Now the block is PARKED (`src/core/fork-parking.ts`): left out of the branches, with what stands on it, while what it stands on is judged on its own. Parked is not rejected and is never written down. What parks one is a trial from a checkpoint that stops at it, by a refusal or a throw; a refusal by this node's own `acceptBlock` on its own head, where no checkpoint could say (a checkpoint is asked first, so a node whose live state is wrong and whose checkpoints are right heals in the same offer); a throw out of a trial from genesis, which no longer leaves `offerBlock`; and, with nothing said about the block, a spent budget where no checkpoint was near enough to judge its branch. It is tried again when two other producers, neither its own nor proved equivocators, have built on it; when it is its TURN; when the checkpoint that refused it is no longer the one a trial would start from; or when it is evicted, at 128 blocks or 128 KiB. Further variants of one slot, and any more blocks of a producer of which four wait, are parked unseen, and go first when there is no room; the four speak against its next one until a block of its goes on the chain, or they have waited their time and would not win. The wait is counted from when a block was first parked, also when it has left the pool or the list since. With parking, the pool holds two variants of what one producer sealed in one slot: the two that others have built on, or the newest. A trial from genesis that passes a producer's block lets go of everything parked over that producer (of a proved equivocator, only when the block is adopted), one that passes a block a checkpoint had refused drops the checkpoints and lets every refusal go, and one that refuses a branch leaves a checkpoint of this node's own chain behind, so the next bad block beside that head is a checkpoint trial. **What it costs, and how long it can be made to last.** Two budgets. The trials nobody waited for (of a supported block, or of a branch no checkpoint was near) share two at once and one more every 30 minutes. Turns have one of their own that nothing else can take, back 15 minutes after it is used. A trial that ends in an adoption, or costs no more than 250 ms, is not charged. At 36 s a trial that is 108 s in the first minutes and 216 s an hour after, 6% of one core; eight other producers on a block skip the budget, and the trial is still synchronous. A call runs one trial that is charged and the next look is 30 seconds from its end. A turn comes 10 minutes after the block was parked plus a per-process share of 20 more, on the node's own clock read forwards only, and goes to the producer served least recently, among the blocks that would win fork choice. So no key is served twice ahead of another, however many blocks it signs, and an honest block that would win is tried within 30.5 minutes with nobody's help, and 15 more for each OTHER KEY with a block in that line: 45.5 against one attacking seat key, 60.5 against two; where what it is tried with has a bad block on top, the rest is adopted a look later. Two nodes cannot end on different LASTING verdicts over any of it, because the only verdict is genesis's and every way out ends in a trial. `strblk node --fork-parking off` (or `SOURCELESS_FORK_PARKING=off`; a value that is neither is refused at the start) goes to genesis at once, and so does `--fork-checkpoints off`, which is the way back to what a node did before either; parking is off as well where fewer than four seats are declared, and no branch waits untried above a block no checkpoint may be taken over; `forkTrials.parking` on `/api/status` counts what waits, this node's own longest wait, and the worst cost an hour from the last trial it timed. `fork-parking` pins all of it: two partitions of which one holds a wrong checkpoint, and up to three keys draining both budgets while an honest branch waits on a node every checkpoint of which is wrong about it. **What it costs an honest network: a short split.** One seat that signs two blocks in one slot, a bad one to some nodes first and a good one to the rest, leaves those that heard the bad one first waiting on the good one until two other producers have built on it: measured over 40 runs on two nodes, 1 to 3 blocks, the median 2, never more, where a trial from genesis would have settled it at once. It heals by itself, nothing is rejected, and the seat has proved against itself what it did. It is the price of not letting that seat buy 36 s of every node. In an open set with fewer than three producers there is nobody to be the second other one, and it is the turn that settles it. Failures are **discarded, not merely refused** (`SkuldResolver.reject`, `skuld.ts:609`). Fork choice ranks on headers and never executes, so a branch can win on paper and fail on execution. Without the rejection index the winner was re-selected on every offer, aborting the reorg each time and — worse — *masking* every honest branch behind it, because only the single best candidate was ever tried. One cheap message left a follower permanently unable to join the majority chain, paying a full O(chain) replay on every subsequent block. `MAX_FORK_ATTEMPTS = 4` (`blockchain.ts:376`) bounds the work one offer can cost. A block this node has discarded, or that stands on one, is **reported refused with its reason and not relayed**, since 2026-11-22: it used to be accepted into the pool and passed on, so every node helped to carry it. A parked block is kept and not relayed either, and not counted against anybody. The refusal is not a fault of the sender, which may hold the block as a competitor it has never had reason to execute, so nothing is scored and nobody is banned (`peer-faults.ts`). Through a rolling upgrade a node on an older build still relays such a block; a newer one counts it `invalid-payload`, answers refused and keeps the session. **What is discarded is the refused block and what stands on it, since 2026-11-22.** It was the whole branch, so one bad block on top of an honest branch, sealed before a node had switched to it, rejected the honest blocks under it for good: everything built on them afterwards linked to nothing, and the node stayed on its losing suffix until it was restarted. One faulty seat during a tip split was enough. The blocks below the refused one stay in the pool and are judged on their own (`refusedPart`; `reject-only-refused.integration.test.ts`). The replay says which block it refused for the same reason. Which blocks those are is their POSITION in the branch and never the height one declares: an orphan is admitted with its height compared to nothing, so a seat could restate one and have the honest blocks under it condemned with it again. It has a price: each bad block on one honest prefix is a trial of its own, where the first used to take the prefix and every sibling with it. After a successful reorg the displaced suffix is re-offered as candidate branches in its own right (`blockchain.ts:2707`) — it may yet win back if its producer extends it, and discarding it would make the reorg irreversible. Branch assembly is deterministic: siblings are walked in `compareBytes` order of their hashes (`skuld.ts:689`, `:696`), so two nodes holding the same candidates build the same branches in the same order and reach the same verdict. A block that does not declare the height after its parent's is left out of every branch, with what stands on it: no `acceptBlock` takes one. ### 3.6 Bounds Everything a peer can drive is bounded, and in every case the **oldest** is dropped rather than the newest refused: | Structure | Bound | Where | |---|---|---| | candidate blocks | `DEFAULT_MAX_CANDIDATES = 512` | `skuld.ts:299` | | known-bad blocks | `MAX_REJECTED = 4096` | `skuld.ts:302` | | equivocation alarms | `MAX_ALARMS = 1024` | `skuld.ts:207` | | sightings index | `slashingWindowBlocks`, default 1,325 | `skuld.ts:204`, `:788` | Refusing new candidates would let an attacker pin the pool full of stale branches and block every real one; refusing new alarms would let one validator equivocate a thousand times to hide the thousand-and-first, which is the wrong way round. **The candidate pool drops whole BRANCHES, not single blocks** (2026-11, `SkuldResolver.makeRoomFor`). Oldest-single-block eviction dropped the root of a branch that Verdandi fetches root first, and a branch without its root never links: one of the reasons the Asgard partition at height 32,307 stayed open between connected halves. When the pool is full, branches are ranked - linked to this node's chain first, then most recently extended - and the lowest goes whole; the new block's own branch is trimmed from the top and never from its root. The bound itself, and the "newest is not refused for being new" reason above, are unchanged. A branch longer than the pool is held as its root-most prefix, so a node adopts it once that prefix outranks the node's own suffix since the fork: the pool bounds how long a MINORITY suffix can be and still heal. ### 3.7 Skuld as witness Skuld is the one component that sees every block a producer signs **on every branch**, which makes it the only place a `(producer, slot)` collision is visible at all — the candidate pool is keyed by block hash, and a hash key is exactly what hides an equivocation. `witness` (`skuld.ts:1265`) keeps one sighting per `(producer, slot)` and one per `(producer, height)`, and returns any alarm the call newly proves. Two properties of the ordering matter: - **`offer` witnesses before its early returns** (`skuld.ts:389`). Evidence is not contingent on the block being useful: a producer could otherwise equivocate and get the second block refused for an unrelated reason — a full pool, a branch already known bad — and the proof would be dropped with the block. Alarms are returned on **every** path out of `offer`, including the refusals. - **`acceptBlock` witnesses too** (`blockchain.ts:2232` and `:2541`, via `witnessAndAccuse`). For a long time the only witness caller was `produceBlock`, so a follower held every peer's block on its chain and in no index, and the only pair it could ever complete was one where its *own* new block conflicted with something it had seen — a node accusing itself. A `GjallarhornAlarm` (`skuld.ts:141`) carries two complete signed headers and the genesis hash, so any third party can run `verifyGjallarhornAlarm` (`skuld.ts:173`) and reach the same verdict. Nothing in it is a claim by the raising node. Headers are ordered by block-hash bytes so two nodes that saw the pair in opposite orders produce byte-identical evidence. Two kinds, because only one is unambiguous. `same-slot` is the offence — one authority, one slot, two distinct headers, and no sequence of honest events produces it. `same-height` in *different* slots is recorded and deliberately **not** called an offence, because a producer re-proposing at one height after a reorg dropped its block is honest. Collapsing the two would mean accusing honest validators of the one thing meant to be unforgivable, which is how an evidence system stops being believed. `verifyGjallarhornAlarm` also carries a fix worth naming, because it was a live forgery. Block hashes are **not recomputable from headers alone** — `computeBlockHash` needs the body — so on an alarm that arrived from elsewhere they are an unverified claim. One real signed header presented twice with two invented hashes passed the "same block twice" guard: both headers name the accused, both carry the accused's key, both are at the claimed height, and both signatures verify, because they are the *same* signature. The check is now on canonical bytes of the headers (`skuld.ts:171`), which is the property that was actually meant. Locally raised alarms could never contain it — `witness` returns early on `seen.hashHex === block.hashHex` — which is exactly why it was invisible until the alarm became something a block could carry. ### 3.8 What Skuld cannot do - **It does not punish, and the thing that does is not this file.** A penalty in property needs stake, and `Einherjar.stake` (`valhalla.ts:1176`) is still a plain `bigint` on an in-memory registry entry: no ledger holds it, no transaction locks it, no account is debited when it changes, and nothing in consensus reads it. **Fenrir** (**BUILT 2026-09-10**, `src/governance/fenrir.ts`) does not use it. It burns a **bond**, which is a ledger lock posted by a `fenrirRecords` transaction after genesis, taken by `Odin.applyEject` through a `slash-bond` effect on this same alarm's evidence. Skuld sounds; Nidingr takes the seat; Fenrir takes the bond, if there is one — **a validator that posted no bond is ejectable and is not slashable**. - **There is no admissibility window.** `slashingWindowBlocks` bounds this node's memory of *sightings* and nothing else, so it bounds how far back a **new** alarm can be assembled. A very old alarm, once raised, is refused by no rule. Alarms already raised are deliberately not pruned: forgetting the proof would mean an equivocation expires quietly because nobody looked in time. - **`alarmsFor` (`skuld.ts:1325`) has no caller outside its own file.** `hasEquivocated` (`skuld.ts:1336`) has one, and it decides no block: fork parking reads it so that a proved equivocator's parked blocks are let go only by an adoption. --- ## 4. Gladsheim — the seated set `src/core/valhalla.ts`. Norse: Odin's hall, in which the high-seats stand and inside which Valhalla itself is built. Valhalla says who has been *admitted*; Gladsheim says who is **seated for the epoch a block is being judged in**. ### 4.1 The failure this exists for `BlockchainCore.validatorSetCommittedAt` was `void height; return this.authorisedProducers` — a constant, with its own comment conceding that validator admission was not chain state. Three things followed, and none was small: - **A compromised validator key could never be revoked.** Not by governance, not by evidence, not by anybody. The set was fixed at genesis for the life of the chain. - **No node could ever be added.** `decentralisationRatio` was therefore permanently zero, and `genesis-nodes.ts` promised a schedule to move it that nothing could execute. - **Quorum-backed settlement was impossible**, because `quorumMembers()` answered from a `Map` two nodes could disagree about, so a quorum rule over it would be a rule each node enforced against itself. ### 4.2 Derived, never stored The source is the **Einherjar roll** — `EinherjarRoll` on `LedgerManager`, which is *already* chain state: the genesis node set as its base, plus every change folded into a block, committed under `VALIDATOR-ROLL` in the state root and replayed identically by every node from the blocks alone. > **This used to say the Althing, and the change is owner decision 5 rather than a refactor.** > Until 2026-09-14 the seat source was the assembly pool `pool:althing`, which fused two questions > decision 5 separates: **who may seal** and **who may vote**. An `admit-member` created a producer > and a `remove-member` removed one, so the electorate and the producer set could not be moved > independently — and decision 5 says the 1313 genesis nodes are starting validators that **do not > vote**. The two rolls are now two rolls. `docs/design/VALIDATOR_ROLL.md` is the design; > `GladsheimSeating.fromOdin` survives for the assembly's own arithmetic and is no longer consulted > by `observeSeating`. > > **The roll is answered AT A HEIGHT**, which the Althing never had to be: a block sealed at H is > judged against the roll in force at H, by a follower and by the `validateChain` replay a year > later. A register answering "the set as it is now" gives two different answers to those two > questions, and the second is a chain that rejects its own history the first time a validator is > evicted. > > **What moves the roll**: `admit-validator` and `evict-validator` (governance actions returning a > `change-seat` effect), a Nidingr `eject` — which now takes the seat as well as the assembly place — > and four identity records, because ceasing a domain ceases the validator (row 25). A relinquish > **suspends** the seat, a lapse burn, a burn or a sale **evicts** it. > > **Genesis did not move**: the change list folds into the state root only when it is non-empty, so > a chain that has admitted and evicted nobody folds byte-identically to what it folded before this > existed. `8ee28b94…` / `a6bf0085…` / `abaa1b65…` are unchanged and a test pins them. ``` Einherjar roll (LedgerManager, chain state) | GladsheimSeating.fromEinherjar(roll, height) v GladsheimSeating ---- producers() -> may this address seal? (per epoch) ---- roster() -> whose turn is it? valhalla.ts:337 ---- quorumMembers() / quorumThreshold() | GladsheimSchedule.observe(height, seating) valhalla.ts:508 v GladsheimSchedule ---- seatingAt(H) / producersAt(H) / rosterAt(H) ``` **"One weight, one meaning" was the argument for deriving seats from the assembly, and owner decision 5 withdrew it.** It read: a node's validation power *is* its voting power, so a separate validator roll would be a second opinion about a node's weight and a second thing to keep in step. That was a good argument for a chain where validators are the electorate. Decision 5 says they are not — the 1313 genesis nodes are starting validators and do not vote, and the franchise is one active master wNFT one vote — so the weight a seat carries and the weight a voter carries are now two different quantities about two different sets, and one roll could not express both. The second registry the paragraph refused is `EinherjarRoll`, and it exists because the premise changed. `fromAlthingRoll` — the constructor `fromGenesisNodes` and `fromOdin` go through; `fromEinherjar` does not, and `EinherjarRoll` makes the same two refusals on the way in — refuses two kinds of member (`valhalla.ts:256-284`): zero power — a producer that may seal but may not vote on whether it should breaks the one-weight rule in the first place it is applied — and an entry that resolves to no address, which could not be checked against `header.producer` at all, so seating it would be authorising a name. It also normalises the domain, because the roll holds `str.treasury` where `GenesisNodeRecord` holds `STR.TREASURY`, and `commitmentHex()` exists to make "did we derive the same set" one comparison rather than a diff over 1313 entries. Note the honest divergence recorded at `valhalla.ts:250-254`: this makes the derived set differ from `validatorSetFromGenesis`, which is a plain map over `spec.nodes` and counts a zero-power node. Said out loud rather than diverging silently. Seats are sorted by domain in byte order at construction and frozen (`valhalla.ts:235`), never kept in insertion order — a seating is compared, hashed and used as a rotation order, and all three have to be a function of the *set* rather than of the order a node happened to read the roll in. ### 4.3 Epoch boundaries, not immediate effect A roll change binds at the next **epoch** boundary. `VALIDATOR_EPOCH_BLOCKS = 128` (`valhalla.ts:157`) — 384 seconds at the 3-second target. ``` epochOf(H) = H / 128 valhalla.ts:160 seatingAnchorHeight = epochStart(E) - DEFERRED_DEPTH, clamped valhalla.ts:176 epochAnchoredBy(H) = (H + 3) % 128 === 0 ? (H+3)/128 : null valhalla.ts:517 ``` Worked, with `DEFERRED_DEPTH = 3` (`blockchain.ts:190`): | Epoch | Heights it governs | Anchor height | |---|---|---| | 0 | 0 – 127 | genesis, by construction | | 1 | 128 – 255 | 125 | | 2 | 256 – 383 | 253 | | 3 | 384 – 511 | 381 | Epoch zero is anchored by the genesis and by nothing else (`valhalla.ts:523-525`) — without that guard, a chain with `DEFERRED_DEPTH === epochBlocks` would let a later height re-seat epoch zero. The constructor also refuses an epoch no longer than the commitment lag (`valhalla.ts:477-483`), because such an epoch's anchor would sit inside itself: the seating governing an epoch would depend on state produced under that seating. **Why not immediate effect.** Three reasons, and the first is about Tyr rather than about the set (`valhalla.ts:51-72`): - **The set has to be stable while a block is judged.** Tyr is `roster[slot mod n]`, so admitting or removing one member **renumbers every future assignment**. Under immediate effect, one governance record landing at height H reshuffles whose turn it is at H+1 — and a producer that was the lawful leader when it started assembling its block is not the leader by the time its block is judged. That is not a rare race; it is what happens every time the roll moves. - **A reorg must not change who was authorised.** With a per-height set, a record that moves from block H to H+1 across a reorganisation moves the whole rotation with it, and a block that was authorised when it arrived stops being authorised when it is replayed. Quantising means the answer changes only at heights every node already agrees on. - **The lag was already there.** `H - DEFERRED_DEPTH` is the deepest height every node agrees on when it judges H. The epoch merely quantises *when* the answer may move, so the anchor is one height per epoch rather than one per block. **The epoch length is compiled in and deliberately not governable** (`valhalla.ts:136-143`). If it were governed, "what epoch is height H in" would depend on which epoch the vote that changed it landed in, which depends on the length in force then — a node would have to walk the chain to answer a question every node must answer identically for every height it judges. A governed value buys flexibility nobody asked for and pays for it with a rule that is no longer a function of H. 128 was chosen against three bounds: above `DEFERRED_DEPTH` so an epoch's anchor is strictly inside an earlier epoch; well above the default `requiredConfirmations` (12) so the anchor height is already settled when the epoch it governs begins; short enough that an ejection is an ejection. **The cost is stated rather than worked around.** An ejection on proven equivocation binds at the next epoch boundary, so an equivocator can go on producing for at most one epoch. That is the price of a rotation two nodes cannot disagree about, and it is not the only defence acting during it: Skuld still refuses the branch on fork choice, and the equivocation is already proven and on the chain. ### 4.4 The replay trap Because the seating is *derived from blocks and never stored*, a node's live `GladsheimSchedule` holds only the epochs it has walked to. There is no way back: governance state is not indexed by height, and a snapshot per block would copy 1313 members per block to record that none of them moved (`valhalla.ts:450-455`). So the anchor is **recorded as it is passed**, once per epoch, by `observe`, called on every path that applies a block: | Path | Call | |---|---| | produce | `blockchain.ts:2242` | | accept | `blockchain.ts:2550` | | replay | `blockchain.ts:3257`, with `replaySeating` and the replay's own governance | `observe` ignores heights that anchor nothing, so the caller hands over what it has every block rather than repeating the epoch arithmetic — getting that arithmetic subtly different in three places is how a producer and its own replay come to disagree about who may seal. It is called *after* the block is on the chain, so a seal that threw or rolled back cannot leave an anchor derived from state no block accounts for. **The trap:** `restoreSnapshot` replays, and at that moment the live schedule holds exactly one anchor. A replay consulting it refuses every block from height 128 onward with "no validator seating recorded", and the node rejects the chain it was just running. Hence `replaySeating` (`blockchain.ts:3008`) and the `seating` parameter threaded through `authorisedProducersAt` (`blockchain.ts:3392`) and `verifyInTurnAt` (`blockchain.ts:16460`). Pinned by `consensus.integration.test.ts:1405`. `undefined` from `seatingAt` is a **refusal**, never an open set. `requireProducersAt` (`requireProducersAt` `valhalla.ts:889`) and `requireRosterAt` (`valhalla.ts:928`) throw rather than return null precisely so no caller can write `producersAt(h) ?? null` and, with one plausible-looking fallback, turn "this node cannot say who was authorised there" into "the set is open". That is a one-character difference between a refusal and an unauthenticated producer set, on the path that decides who may seal. The throw from `requireProducersAt` is caught and converted to a refusal exactly once, in `verifyProducerAuthorisedAt` (`blockchain.ts:16785`). Tyr reads `rosterAt` and makes the same conversion through its own `requireScheduleAt`; `requireRosterAt` has no caller (§9 item 10). Anchors are pruned to `retainEpochs` (default 8, floor 2) with **epoch zero never pruned** (`valhalla.ts:700-708`) — it is the only anchor a node can hold without having observed a block, and dropping it would leave a restarted node unable to judge its own early history. ### 4.5 Reorg handling `GladsheimSchedule.rewindAbove` (`valhalla.ts:987`) drops every anchor decided by state above a height, and the class comment in `valhalla.ts` used to describe reorg safety in terms of it. **That is not how the chain does it.** `rewindAbove` has no production caller; the only reference outside `valhalla.ts` is `consensus.integration.test.ts:1173`. The reorg path takes the seating **whole** from the trial core: ```ts this.seating.loadSnapshot(trial.seating.snapshot()); // blockchain.ts, inside tryBestFork ``` The reasoning at that call site is sound and arguably stronger — the trial built its anchors by applying the winning branch block by block, so its schedule is what that history seats, and an anchor "corrected" in place would be a seating derived from one branch answering for a block on another. The class doc in `valhalla.ts` now says the same: it names `rewindAbove` as having no production caller and records that it used to describe it as the reorg path. `loadSnapshot` refuses a snapshot taken under different epoch arithmetic (`valhalla.ts:678`) rather than reinterpreting it: the anchors are recoverable by replaying the chain, and a wrong answer about who may produce is not recoverable at all. ### 4.6 Quorum, and the gap that was closed The gap this file used to report: `quorumMembers()` returned only seats whose **key** the roll held; the genesis roll holds **addresses**; a `ValkyrieAttestation` is checked against a key; therefore on a chain that has enacted no `admit-member` the seating has 1313 seats and **zero** attestable members. Getting past it looked like a genesis format change and, after launch, a hard fork. The observation was right and the conclusion was one level off. **An attestation carries its own public key.** The question a verifier actually has is not "what key does this seat hold" but "does this seat *admit* the key in front of me", and `deriveAddress(presented) === seat.address` answers it with exactly the strength `presented === seat.publicKeyHex` would have. Only `verifyQuorum`'s key-equality comparison made an address look useless — and it was the only place in the tree still asking that way: `verifyBlockAuthor` has always bound `producerPublicKeyHex` to `header.producer` this way, and `Odin` already binds a genesis member's ballot key to `PoolMember.address`. `seatAdmitsKey` (`consensus/poe.ts:471`) is the single place that binding is decided: | Seat holds | Rule | |---|---| | `publicKeyHex` only | presented key must **equal** it | | `address` only | presented key must **derive** it | | both | both must hold — two claims about one member that disagree are not a member | | neither | nothing is admitted (fail-closed) | The stated key wins where there is one, because a roll that named a key and then accepted a different key deriving the same address would be discarding a commitment it already holds. `rollAddress` (`valhalla.ts:724`) applies the same rule on the way in. The consequence: all 1313 genesis seats are attestable, with **no genesis format change and no chain identity change**, and `GenesisNodeRecord`'s reason for committing an address rather than a key is untouched and now load-bearing in one more place. `quorumMembers()` (`valhalla.ts:557`) is therefore the **whole** seating, and `quorumThreshold()` (`quorumThreshold` `valhalla.ts:596`) is `floor(seats * 2 / 3) + 1` over the whole seating and never over a subset — the denominator is the set that **exists**, not the part of it that answered. `keylessSeats()` (`valhalla.ts:400`) survives as an operational number — which seats must sign with the custody key behind their committed address rather than with a key governance recorded — and is explicitly no longer an attestability gap. It has no caller. ### 4.7 What quorum does not do **It does not gate settlement, and it must not, yet.** `Block.attestations` is carried outside the hashed content — necessarily, since a signature over the block hash cannot be inside it — so two nodes holding the identical chain can hold different attestation sets for the same block. A settlement rule reading that array is a rule each node enforces against its own inbox: exactly the per-node-answer defect Gladsheim removed from admission, reintroduced one layer up. It is also unsafe in the direction that matters, because **settlement is what bounds fork choice**: a chain that never collected enough signatures would never settle, the ratchet floor would never rise, and a reorganisation could then reach arbitrarily deep. *Added 2026-10-29: that trade was taken the other way on 2026-10-10, for the refusal only.* What `final` REPORTS is still depth, but what REFUSES a reorganisation is now the quorum-gated irreversible line (§3.5, §8.5). On Asgard, which has never collected a quorum, that line is -1, so a reorganisation can in principle reach any depth and is bounded only by fork choice ranking every branch the same way on every node. The cost this paragraph names is the one being paid. Making it consensus needs the attestation set to become chain state — a later block committing to the attestations it saw for an earlier one, at which point every node replays the same set and a supermajority rule over it means the same thing everywhere. This paragraph said that needed a **signed header**, and therefore a `BlockHeader` change and a chain identity change. Logretta rule version 6 (`finality-gating`) does it without one: the committee's certificate rides in a later block's body and is folded into `recordsRootHex`, so the genesis hash and all history stay byte-identical (`src/core/logretta.ts`). It is declared and implemented and scheduled on no realm — `dev`, `midgard` and `asgard` run version 3 (`src/core/snotra.ts`) — so on every chain a block is still settled at depth 12. **What "a chain identity change" costs is now a concrete number rather than a phrase**, and the window in which it is cheap is closing. The development genesis hash moved twice on 2026-09-07 and is now `8ee28b94b15c1db6cfb7e052d2ade53b5e1a8be5d8698e17a679f4b567a576ea`, pinned on the `DEV` record in the realm register (`src/core/snotra.ts:192`). Nothing is deployed, so the cost of moving it today is zero. It would not be zero later, and mainnet is no longer hypothetical: **Asgard's chain id is 1313 and ratified** — `ASGARD_CHAIN_ID` (`src/core/config.ts:47`) — though ratifying the id ratified nothing about the genesis, and `ASGARD` (`src/core/snotra.ts:596`) ~~still carries `genesisSource: { kind: 'unlaunched' }` and refuses to start for want of a genesis~~ *(corrected 2026-10-29: it now carries `genesisSource: { kind: 'operator' }` and a pinned genesis hash, `src/core/snotra.ts:630-638`; the genesis is dated 2026-09-24 and Asgard launched on 2026-10-05)*. A header change was affordable in the interval between those two facts; that interval has closed. ### 4.7a What DOES enforce the attestation rule: stripping, at admission Changed after this chapter was written. `keepVerifiedAttestations` (`src/core/blockchain.ts:14536`) is now the single enforcement point for attestations, and **dropping is the enforcement**. It runs on admission and on restore, takes the seating as a parameter, and replaces `block.attestations` with whatever `admissibleAttestations` can verify against the block hash and against the seating at that height. No seating for a height means keep **nothing** — fail-closed, and no block's validity is lost, because attestations are evidence, sit in no state root and decide no block's validity; what they back is this node's own irreversible line (§3.5), and only ones that verify can raise it. **The defect it closes was reachable and cheap.** The rule used to live in `replayChain` and nowhere else. `acceptBlock` never looked at `block.attestations`; attestations sit outside the block hash by design; and they survive the wire (`serializeBlock` / `deserializeBlock` in `src/storage/mimir.ts`, reached from `parseWireBlock`). So a peer could take an honest block off the gossip, append **one fabricated attestation** — the hash still matched, because the hash does not cover them — and offer it. `acceptBlock` took it, the block went onto the chain, and from that moment the node's own `validateChain()` answered `block N carries an attestation that does not verify` for the rest of that chain's life. One worthless signature, and a node could never validate its own chain again. The one site that enforced the rule was the one site that cannot refuse a block, only condemn everything. **Why drop rather than refuse the block**, which is the question the fix turns on. Nothing signs how many attestations a block carries, so two honest nodes holding the identical block legitimately hold different sets of them — whatever gossip reached each. A rule that refused a block over its attestations would therefore have to refuse only *invalid* ones and never absent or fewer ones, and even then it would hand an attacker a cheap way to make an honest block unusable to whichever nodes hear the attacker's copy first. Dropping has neither problem: it is monotone, it converges — every honest node removes exactly the junk and keeps exactly what was real — and it leaves block validity a function of hashed content alone, which is the only thing a producer's signature actually covers. Moving the rule to admission is only half the repair. The other half is that **a replay must not ask the question at all**, and that is a statement about what a chain *is*: the block hash covers the header, the transactions and the records and does not cover the attestation list, so a verdict on the chain that read them would depend on which gossip arrived, and on bytes anyone who can write the snapshot file may choose. `replayChain` no longer asks, and the comment where the check used to stand (`src/core/blockchain.ts:4554-4576`) says so rather than leaving the absence to be read as an oversight. This is what the `docs/ARCHITECTURE.md:296` row in §10 means by "forged quorum: closed differently than the row imagines". It is closed by stripping what cannot be counted, not by a quorum gate — and a stripped set is what this node's irreversible line (§3.5) is measured over, so only signatures that verify can move it. ### 4.7b How many attestations a block may hold, and how long it holds them Added 2026-10-07, from a measurement on the live Asgard chain rather than from a review of this chapter. Height 29 carried 23 transactions (12 926 B) and **751 attestations (220 691 B)**; height 31 carried 24 transactions (13 488 B) and **772 attestations (226 865 B)**. Signatures were **93.9% of the block**. Three size rules existed and they did not compose: - `produceBlock` seals with `attestations: []` and measures the block **there**, against `MAX_BLOCK_BYTES` = 400 000. - `admitAttestation` appends afterwards, and until this change it appended with **no byte bound of any kind**. - `acceptBlock` and the fork path both refuse anything over `MAX_BLOCK_BYTES`. So a block that was legal at the instant it was sealed became, purely by collecting the signatures the chain wants it to collect, a block **no catching-up node would accept** — and it became that on exactly the blocks with the most agreement behind them. The reserve nominally covering the attestations is `BLOCK_ENVELOPE_HEADROOM_BYTES` = 16 384 bytes, against the 226 865 measured: short by more than thirteen times. Nobody had hit it only because the roll has never reached its own quorum — 1 313 seats need `floor(1313 × 2/3) + 1 = 876` signatures and 751 to 772 arrive. Attestation bytes alone reach 400 000 at roughly **1 361 to 1 384 seats**, so the roll as it stands is within 5% of a hard ceiling, and `tests/integration/attestation-retention.integration.test.ts` reproduces the crossing at 1 500 seats: **426 202 bytes** against the 400 000 limit, with the receiving node refusing the block its own producer sealed legally. **Two node-local controls, both switchable, both declared in Logberg, both defaulting to the conservative setting.** 1. **The cap** (`block.attestationCapPolicy`, default `quorum`). A node keeps at most `quorumThreshold()` verified signatures per block, and never more bytes than `MAX_BLOCK_BYTES` allows whatever the count says. The cap **is** the threshold and is not a number chosen here: the threshold is what every reader of the set is asking about, so a set capped there answers every question the full set answers. Capping *below* it was refused — that makes quorum permanently unreachable by construction, which is worse than the defect. Applied at both doors into the array: `admitAttestation` for gossip, `keepVerifiedAttestations` for a set a peer attached. 2. **The prune** (`block.attestationRetentionPolicy`, default `keep`). Below the depth line a node may drop them and serve blocks without them. Sound because **nothing that decides a block's validity reads them**: the reported line is depth-based, `verifyQuorum` gates nothing, the irreversible line is drawn before the prune runs (`irreversibleHeight`, then `pruneFinalAttestations`), and `computeBlockHash` folds the header, the transactions, the allocations and the registrations and stops. The test measures that rather than restating it — a Pulsar handed a stripped block folds a **bit-identical `UrdProof`**. Default `keep` because the two directions are not symmetric: a node that kept the signatures can drop them later, and a node that dropped them can never answer *how close to quorum was height 29* again — which, on a chain that has never reached its own quorum, is the question being asked most. Both are `local` in Logberg and neither touches validity. A capped node holds a **subset** of what an uncapped peer holds, and the subset still reaches the threshold, so the two never disagree about a block — which is already the normal condition under §4.7a. **What neither is allowed to do is report an absence as a measurement.** `AttestationRetention` (`consensus/poe.ts`) names the states an empty or truncated set can be in — `collecting`, `closed`, `capped`, `pruned`, `unretained` for a block that collected nothing and has left the collection window, and `seating-unknown` for a height whose seating this node cannot name — and `BlockchainCore.attestationRetentionAt` derives it from this node's own head, policy and seating. Nothing travels on the wire: a retention claim carried with a block would be a relay's assertion about evidence, and a peer could then downgrade an honest `quorum-short` finding to `unmeasured` for free. `assessPoEThreat` answers `unmeasured` with `attestations-pruned` or `attestations-unretained` instead of scoring a quorum it cannot see — and the short-circuit sits *above* the witness measurement, because `attestedWitnesses` reads the same array and would otherwise hand out a forty-point `witnesses-unattested` accusation built from bytes the node deleted itself. The explorer renders **PRUNED** where the count would go, and counts those blocks out of the ratio rather than into its numerator. The sync win is the second reason the prune exists. `VERDANDI_MAX_RESPONSE_BYTES` was 196 608, so a 241 641-byte block over-filled a sync response **on its own**: a serving node answered with one block where the protocol allows thirty-two. Since 2026-11-15 it is 519 139 (the sync frame limit less the envelope, `src/network/verdandi.ts`), which carries two such blocks. Stripped, the same block is 14 776 bytes and all thirty-two fit. ### 4.8 `ValhallaRegistry` is not consensus `ValhallaRegistry` (`valhalla.ts:1181`) is a per-process `Map` and stays one. It is constructed by `strblk`, which hands it to the RPC surface, Forseti and the ops dashboard, and by well over a hundred test files, as a local note of what an operator has been told about the validator set, and its key-binding rules — one key to one node, no silent rotation, no two identities behind one key (`valhalla.ts:768-788`) — are real and load-bearing wherever a caller supplies the member set explicitly. The boundary is written down rather than inferred: **nothing in consensus may read this class.** --- ## 5. Nidingr — equivocation ejection `src/governance/nidingr.ts`. Old Norse `níðingr`: the one who has broken faith. The offence is against the word given and the punishment this file deals is loss of **standing**, not loss of property. The name carries the boundary: nothing in this file takes a balance, locks a stake, or moves a single minor unit. It is no longer the whole cost: **Fenrir** (`src/governance/fenrir.ts`) rides on the same evidence, `Odin.applyEject` returns a `slash-bond` effect beside taking the seat, and block execution burns the offender's bond where that validator posted one. ### 5.1 The failure this closes Gjallarhorn proved equivocation and cost nothing. `SkuldResolver.witness` assembled two signed headers into an alarm any third party could re-verify, `hasEquivocated()` answered truthfully, and then: no runtime path read it, no block carried it, and a validator caught signing two blocks in one slot went on producing forever. **Evidence that changes no outcome is a log line.** ### 5.2 Why it travels in a block Three properties an ejection needs, and each already exists on the governance-record path (`nidingr.ts:27-38`): - **Every node must reach the same verdict from the same bytes.** `governanceRecords` is already covered by the header's `recordsRootHex`, already folded in `produceBlock`, `acceptBlock` and the `validateChain` replay, and already applied at the block's own timestamp. - **The evidence must be self-proving.** Two signed headers are; that is Gjallarhorn's whole design. Nothing in the record is the submitting node's claim. - **It must not need a vote.** A proposal-and-ballot route would put a proven equivocator on the roll for the thirty-day governance-change timelock, voting on its own removal. Mathematics does not need a quorum to confirm it. ### 5.3 Why it carries no authorization Anybody may present it; nobody can manufacture it. Manufacturing it means producing two distinct headers in one slot signed by the accused's own key **for this chain** — `blockSigningPayload` (`blockchain.ts:3495`) folds the genesis hash, so a header signed for another SourceLess deployment does not verify here. `verifyNidingrEvidence` (`nidingr.ts:216`) re-derives the offence from the evidence, the chain's genesis hash and the chain's slot origin. Five checks, each of which an attacker must defeat with a real signature from the accused key: 1. **The right chain** — `genesisHashHex` must match this chain's binding. 2. **Two different headers** — canonical bytes must differ, not two hashes claimed beside one header (`nidingr.ts:248`). This is the check whose absence made a duplicate header with invented hashes into a working forgery. 3. **One producer, one key, one height** — both headers name the accused, name the accused's key, and claim the height the evidence claims. 4. **Both signatures verify**, via `verifyGjallarhornAlarm` rather than a second copy of the rule. There is one definition of "these two headers prove an equivocation". 5. **One slot**, computed here from the chain's own origin and **never read off the evidence**. A slot supplied by the party presenting the evidence is a threshold supplied by the accuser. Three fields present on a `GjallarhornAlarm` are deliberately dropped from the on-chain `NidingrEvidence` (`nidingr.ts:80-98`): | Dropped | Why | |---|---| | `observedAtMs` | local, different on every node — carried, two honest producers would build different bytes for one offence, two records-root contributions, and a duplicate that applies twice | | `blockHashes` | not recomputable from headers, so an unverifiable claim on untrusted evidence — this is the field the forgery used | | `slot` | derived from the two `producedAtMs` and the chain's origin instead | `headers` is ordered by canonical bytes (`orderedHeaders` `nidingr.ts:195`) and the order is **part of the record**, checked at `nidingr.ts:255`: two nodes seeing the pair in opposite orders must produce identical bytes, or one equivocation becomes two records with two different contributions to the records root. Every numeric field is a decimal string (`NidingrHeader` `nidingr.ts:72`), because `JSON.stringify` throws on a `bigint` and a float in consensus state is two nodes waiting to round differently. **`same-height` cannot be presented at all.** The type is `kind: 'same-slot'` and `nidingrEvidenceFromAlarm` (`nidingr.ts:168`) throws rather than downgrading — the only two things a caller can do with a refusal are fix it or drop it, and both are better than a record that quietly means less than its kind says. **Ejection is from the rolls only.** The domain keeps its own pool and goes on governing itself; what it loses is its place on the assembly's roll and, through the `change-seat` eviction `Odin.applyEject` returns (§5.6), its seat on the Einherjar roll Gladsheim derives the producer set from — the set it may no longer seal in. Removing a domain from its own pool would be deleting an identity on evidence about a key. ### 5.4 The two-part dedup The obvious dedup — a set of evidence keys this node has already submitted, held beside the governance queue — is an **unbounded structure on a consensus path whose size a peer decides**. It was not built. Instead the two questions are asked of state that already exists (`nidingr.ts:351-394`, `blockchain.ts:2324`): | Question | Answered by | Property | |---|---|---| | "Have I already **raised** this?" | `SkuldResolver.alarmsByKey` (`skuld.ts:975`) | bounded at `MAX_ALARMS`; `witness` returns an alarm only the first time a pair becomes provable, so the same pair arriving from forty peers yields one alarm and therefore one accusation | | "Has this already been **applied**?" | `Odin.ejections` (`odin.ts:489`, read via `hasEjected` `odin.ts:1688`) | **chain state** — folded into the governance root, carried in the snapshot, replayed identically by every node | Only the second survives a restart. After one, Skuld's index is empty, the pair is re-witnessed from the blocks during replay, and the alarm is correctly raised again — from Skuld's point of view it has just proven an equivocation it did not know about. A node-local memory of what it happened to submit would be a second, weaker opinion about it. `nidingrEvidenceHashHex` (`nidingr.ts:332`) is the one definition of the key, shared between the accuser that asks and the applier that records. `Odin.applyEject` used to compute it inline, which was correct and unshareable — two spellings of one key is how the asker and the applier come to disagree about whether they mean the same offence. ### 5.5 The four declines `nidingrAccusationFor` (`nidingr.ts:448`) returns a discriminated union, not `NidingrEvidence | undefined`, because every decline is something an operator may need to see: "the accused already lost its seat" and "this node cannot place the accused on any roll" are very different silences. Ordered by what they cost: 1. **Not `same-slot`** — declined before anything is built. 2. **Already applied** — chain state; the only guard that survives a restart. 3. **Not on the roll now** — nothing left to take. This is what makes a second accusation after an ejection has bound a **silence** rather than a governance record every node refuses. 4. **The two rolls disagree** about who this address is. The seating at the offending height says member X, the live roll says Y. Not resolved by preferring one: accusing either would be choosing a defendant. Reported and left alone. Both rolls are consulted because they answer different questions and either alone is wrong. The seating at the offending height is what makes the address nameable *as it was*; the live roll is what the record will actually apply to, and `Odin.applyEject` resolves the accused against the roll as it stands when the record folds. The policy lives here rather than at the call site because three of the four end in a governance record every node refuses, and a refusal is not free — `Odin.applyEject` **throws** on evidence already applied (`applyEject` `odin.ts:894`) and on a producer no longer on the roll (`odin.ts:651`), so an accuser that does not check first spends a queue slot and an operator-visible refusal on each one. There are three call sites; written at each, the check ends up subtly different in two of them. `accuseFrom` (`blockchain.ts:10340`) may not throw: it runs after the block is on the chain, so an error out of it would abandon a committed block mid-flight. A full queue is an ordinary outcome and is dropped — the alarm itself is kept and the offence stays provable. ### 5.6 What Odin refuses on the way in `applyEject` (`odin.ts:878`), in cost order — evidence first, because everything after it is a lookup and a record carrying no proof should never reach the roll at all: - **no `slotOrigin` → refuse every ejection record** (`odin.ts:623`). Not "eject on weaker evidence": a node that cannot compute the slot cannot tell the offence from the honest re-proposal. This is a property of the code that constructs `Odin` — `LedgerManager` is the only chain-path construction site — so every node on a given build answers identically. - the evidence must verify; - the evidence hash must not already be in the ejection index; - **exactly one** roll member may bind to the producer address (`odin.ts:649-657`) — a roll binding two members to one key makes "who signed this" ambiguous, and ejecting whichever came first in iteration order is a coin flip two nodes could call differently; - the record's `member` must be the name the roll gives that address; - a key on the roll must be the key that signed, not merely one that hashes the same way; - the ejection must not leave the Althing with no voting power — an assembly emptied by ejections is a chain that can no longer admit a validator. **Since 2026-09-14 the same refusal guards the seat roll**: `EinherjarRoll.apply` rolls its own write back rather than leave the chain with no seat, because a chain with no seat can never seal the block that would give it one. And the ejection now returns a **seat eviction beside the `slash-bond`**. Removing the member from `pool:althing` used to BE the eviction, because the Althing was what Gladsheim seated; under decision 5 it is a removal from the electorate only. The owner's decision record named this as the defect a naive split ships in silence — an equivocation ejection that removes a voter and leaves the equivocator seated. --- ## 6. PoE — the proof of execution `consensus/poe.ts`. `POE_VERSION = 'poe-v3'` (`poe.ts:21`), checked before anything else in `verifyPoEProof` so a v2 proof cannot be read as a malformed v3 one, or a v3 proof as a v2 one that dropped some fields. ### 6.1 The shape, exactly as it stands ```ts interface PoEProof { // spec/interfaces.ts:88 txHashHex: string; merkleRootHex: string; transactionCount: number; signatureVerifiedCount: number; witnessSet: string[]; // ADVISORY createdAtMs: number; version: string; } ``` **Six fields came out this cycle** and are gone: `zk13Valid`, `zk13VerifiedCount`, `godCypherValid`, `godCypherVerifiedCount`, `threatScore`, `threatLevel`. Three findings, each sufficient on its own (`poe.ts:67-93`): 1. **They were never measured and could not be.** They arrived as optional arguments to `buildPoEProof` and no production caller ever set them, so every block ever produced carried `zk13VerifiedCount: 0, zk13Valid: true`. There is no path to fixing it by wiring a verifier in either: a `Block` carries no `ZK13Proof` and no `GodCypherPayload` anywhere in its shape, so a verifier holding the block has nothing to recount them from. **A number a verifier cannot recompute is a number it cannot refuse.** 2. **A producer that measured honestly could not report it.** `verifyPoEProof` *required* `zk13Valid && godCypherValid`, so a producer that had verified a batch and found a failure was unable to seal a block saying so. The only representable state was "everything verified", which carries zero bits: a field with one legal value is not evidence, it is reassurance. 3. **Every penalty branch of the threat score was a rejection branch.** `verifyPoEProof` also required `signatureVerifiedCount === transactionCount` and `witnessSet.length > 0`, which are exactly the two other conditions the score priced. On any block a node could accept, `threatScore` was `0` or `10` and `threatLevel` was always `low` — rendered with a **green badge**. A safety badge that is green on every block that exists, and cannot exist on a block that is not green, is not a measurement. Renaming the fields and marking them producer-asserted was considered and refused: it would leave an unbackable producer claim inside a structure that is hashed, signed, gossiped, stored forever and rendered to users, and the honest name for a claim like that is **absent**. This changed `hashPoEProof`, therefore every header's `consensusProofHashHex`, therefore every block hash including block zero's. Nothing is deployed and the genesis hash was already moving, so there is no migration; after launch this would be a hard fork. ### 6.2 What the proof binds Standalone (`verifyPoEProof`, `poe.ts:186`) checks version, two 64-character hex lengths, a non-empty witness set, a non-negative timestamp and count, and `signatureVerifiedCount === transactionCount`. It answers "is this a well-formed proof of **some** batch" and nothing about which one — `txHashHex` and `merkleRootHex` are only checked for **shape**, because there is nothing to compare them against. Any caller holding the block must use `verifyPoEProofForBlock`, or it is accepting a proof of somebody else's work as a proof of this block's. `verifyPoEProofForBlock` (`poe.ts:278`) is what makes it evidence. Before it existed, a block could carry a "proof of execution" describing a completely different batch — three transactions in the body, a proof claiming zero, a merkle root of `dd` repeated — and both `acceptBlock` and `validateChain` passed. The proof was decoration. | Proof field | Bound to | |---|---| | *(the proof itself)* | `header.consensusProofHashHex` — the signed header names it, so it cannot be swapped in flight | | `merkleRootHex` | `header.txRootHex` | | `transactionCount` | `block.transactions.length` | | `txHashHex` | recomputed by `poeTxHash(block.transactions)` | | `signatureVerifiedCount` | `block.transactions.length` | | `createdAtMs` | `header.producedAtMs` — so a proof minted for an earlier block with an identical batch cannot be replayed onto this one | | `version` | the constant | | `witnessSet` | **nothing, by default** — see §6.3 | Every field of a `poe-v3` proof except `witnessSet` is in that list. That is the property the shape change was for: there is no longer a field a producer can lie in without being refused. The caller must still bind header to body — `txRootHex === computeTxRoot(txs)`, the block hash, the producer signature. Those live in `blockchain.ts` and are deliberately not duplicated here, to keep `consensus/poe.ts` free of an import cycle back into core. Genesis is the one height whose proof body is not carried (`poe.ts:293`): block zero's authority is the genesis hash, which the caller has already bound. ### 6.3 What it does not bind: the witness set `PoEProof.witnessSet` is `string[]` — bare node ids, no keys, no signatures. **The producer writes it.** A block can name `STR.SOURCELESS`, `STR.TREASURY` and `STR.YODA` as its witnesses without any of them having seen it, and nothing in the type can tell a verifier otherwise. Nothing in consensus — quorum, settlement, fork choice — may read it (`poe.ts:24-30`). The verifiable witness statement is a different object: a `ValkyrieAttestation`, which signs `valkyriePayload(blockHash, nodeId, context, attestedAtMs)` (`poe.ts:355`). The `context` field separates a block attestation from a Ghost pre-confirmation — without it, one signature is valid in both roles, and a block attestation would count as a pre-confirmation for any entry whose commitment equals that block hash. `attestedAtMs` is signed too, so a relay cannot rewrite the timestamp any future timeliness rule would depend on. `attestedWitnesses` (`poe.ts:233`) measures a proof's claimed witnesses against exactly those signatures. **The producer is deliberately not credited**: a header signature proves authorship, which is not the statement "I witnessed the execution of this batch", and conflating the two would let every block witness itself. Pinned by `consensus.integration.test.ts:454`. `requireAttestedWitnesses` (`poe.ts:215`) rejects any unbacked claim. It is **off by default and must stay off at seal time** — a block is sealed before any attestation over its hash can exist, so no witness claim can be backed yet. Promoting the field itself from advisory to evidence would mean changing *when* the proof is completed, not just its shape, which is governance's call rather than this module's. **As the code stands, no caller ever sets it.** The only references to `requireAttestedWitnesses` outside the interface are the doc comments and the branch itself. On every path in the running system, the witness set is unchecked. **The identifiers used not to match, and now do.** `produceBlock` defaulted to `witnessSet: opts.witnessSet ?? [this.producer]`, and `this.producer` is an **address**; `attestedWitnesses` matches `attestation.nodeId` against `QuorumMember.nodeId`, which `GladsheimSeating.quorumMembers()` sets to `seat.domain` — a **domain**. An address and a domain never compare equal, so the default witness set was unbackable *by construction*, not merely unbacked: no signature from any seat under any key could satisfy it, and `requireAttestedWitnesses` turned on would have refused every block this chain produced. Nothing noticed, because that option has no caller. **Decided this cycle: a witness id is a seat id, and a seat is named by its STR domain.** The choice is forced rather than preferred — a verifier holds the block and the seating for its height and nothing that could bridge two id spaces, so the id has to be the one the seating hands out, and that is `quorumMembers().nodeId`. It is also the id `valkyriePayload` signs, so the statement that was signed and the statement that is checked name the member the same way. The domain and not the address, for two reasons that outlive the bug: the address is the *credential* `seatAdmitsKey` checks and it moves when a member rotates its key, and the roll may bind two members to one address — `Odin.applyEject` must refuse an ejection when it does — so an address can name two seats where the domain, being the roll's own key, names exactly one. `produceBlock` now resolves it through `GladsheimSeating.domainFor`, which already existed as the one answer to "which member does this producer address belong to" and which Nidingr already reads. A producer no seating seats keeps its address: not a seat id, unable to be mistaken for one, and refused by any verifier that checks the claim — the true answer for a producer the roll does not seat, and reachable only on a `development` chain with an open set or a `--validators` list outside the Althing. On a genesis-sourced chain `verifyProducerAuthorisedAt` has already refused to seal unless the producer is seated, so a backable id always exists there. `verifyPoEProof` requires `witnessSet.length > 0`, so the list cannot simply be left empty instead. ### 6.4 Quorum arithmetic `measureQuorum` (`poe.ts:508`) returns **counts, not a verdict**, because "2 of 3, one ignored" is the answer an operator asking why settlement has not arrived needs, and a boolean cannot carry it. An attestation is **ignored** — not fatal — when the node id is not a seat, the seat does not admit the presented key, the node id has already been counted, or the signature does not verify over this block hash in this context. Failing the whole set on the first bad signature would let any participant halt settlement on any block by appending one worthless signature; attestations are gossiped and aggregated by whoever assembles them, so counting the valid ones is the behaviour that survives a hostile aggregator. Duplicates cannot inflate a quorum, because `counted` is a set keyed by node id. `reached = threshold > 0 && counted.length >= threshold` (`poe.ts:536`). A non-positive threshold is never reached: a set with no seats has no supermajority, and reading `0 >= 0` as a quorum would make an empty seating settle everything. `attachAttestations` (`blockchain.ts:13718`) now takes **only** the hash and the attestations. The members and the threshold used to be arguments, which is how a hostile aggregator hands a node a one-member set and a threshold of one and gets a quorum. Both now come from `this.seating.seatingAt(block.header.height)`, and a height with no seating is a throw. ### 6.5 The threat assessment `assessPoEThreat` (`poe.ts:864`) is computed **by the verifier, from the block in front of it**, and is not in the proof, not in any hash, and not signed. Every condition worth scoring is either one that makes the block invalid — refused rather than scored — or one only the receiving node can observe, such as how many attestations actually arrived. Neither belongs in a field sealed by the party being assessed. It also means two nodes may legitimately disagree, which is exactly why it must not gate anything in consensus. `unmeasured` is a band and it is the important one (`poe.ts:703`). The failure mode being fixed is not "wrong number", it is "reassurance from an absence": a caller with no seating must not get `low` and paint it green again. | Gap code | Score | Covered by | |---|---|---| | `genesis` | 0 → `unmeasured` | `consensus.integration.test.ts:600` | | `proof-absent` | 60 | `:581` | | `seating-unknown` | 0 → `unmeasured`, returns early | `:541` | | `witnesses-unattested` | 40 | `:557` | | `witnesses-partly-attested` | 20 | `:564` | | `quorum-short` | 30 | `:557`, `:564` | | `large-batch` (`> 100` tx) | 10 | `:589` | | `attestations-capped` | 0, a floor and not a headcount | `attestation-retention.integration.test.ts` | | `attestations-pruned` | 0 → `unmeasured`, returns early | `attestation-retention.integration.test.ts` | | `attestations-unretained` | 0 → `unmeasured`, returns early | `attestation-retention.integration.test.ts` | Bands: `>= 80` critical, `>= 50` high, `>= 20` medium, else low (`poe.ts:1021-1025`). Total capped at 100. **All ten gap codes have test coverage** — the standing quality gate holds. Three `seating-unknown` returns exist in `assessPoEThreat` (`poe.ts:864`), and all three matter: no `quorumMembers` at all, a seating this node no longer holds for the height (tested in `attestation-retention.integration.test.ts`), and a threshold of zero. A threshold that is missing must not read as a threshold met. **In production, nothing calls the assessment.** Its one production caller was the explorer, which later fed it the seating and so painted every Asgard block amber for a short quorum and named a seat as an "unbacked" witness. Neither is a fault on this chain, where quorum decides no block's validity, so the explorer stopped scoring: its block page now shows the count of signatures this node admitted, against the seating at the block's own height, and no band (`src/explorer/hlidskjalf.ts:1676-1687`). No file in `src/` or `consensus/` calls `assessPoEThreat`, so the witness and quorum terms are exercised by tests only. `GladsheimSchedule.measureBlockQuorum` (`valhalla.ts:962`) has no caller: `BlockchainCore.quorumAt(height)` runs the same `measureQuorum` arithmetic itself over `quorumSeatingAt(height)` — the seated set, or the Dómr committee where rule version 5 is in force, which no realm schedules — and it is what the collection measurements in `docs/design/QUORUM_FINALITY.md` read. --- ## 7. Urd — the recursive fold `consensus/urd.ts`. Norse: the Norn of what-has-become; her well holds every deed. ### 7.1 What it is Each proof commits to the previous proof, the block hash, the state root and the height: ``` proof(n) = sha256("poe-succinct-v1" | proof(n-1) | blockHash | stateRoot | height) urd.ts:128 proof(0) folds URD_GENESIS_PROOF_HEX = "0" * 64 urd.ts:50 ``` Constant size for any chain length. A light client (`HeimdallClient` `urd.ts:312`) advances one block at a time in O(1) and stores one proof regardless of height. The structure is a recursive proof-composition design. ### 7.2 It is a hash fold, not a SNARK Stated plainly at `urd.ts:22-26`, and it is the single most important sentence in the file: > this fold is hash-based, **NOT** a zk-SNARK. It gives constant-size state and O(1) > incremental verification for a client that follows the chain. It does **NOT** yet verify > the whole history from the tip alone, without ever seeing the intermediate > blocks, and without learning their contents. **What that costs, concretely:** - `verifyUrdSummary` (`urd.ts:257`) calls `urdSummarize`, which folds every block. Checking a claim against a tip is **O(chain)** and requires holding every block. There is no verify-from-tip. - The fold proves *linkage*, not *correctness*. `urdFold` checks height continuity, parent linkage, and that the block's hash matches its contents — it does not execute anything. A chain of perfectly linked blocks with wrong state roots folds cleanly. - A follower who trusts a checkpoint is trusting whoever handed it over. There is no succinct argument to check. - No zero-knowledge property of any kind. Every intermediate block is required and is in the clear. `urdFold` (`urd.ts:193`) **recomputes** the block hash rather than folding the one the block carries (`urd.ts:118-125`). Folding an asserted hash lets a peer move a light client onto a checkpoint committing to a state root that never existed — and the client keeps nothing else, so that checkpoint is its whole view. `verifyFoldable` (`urd.ts:71`) is the authorship gate in front of the fold. Folding used to check height, parent and hash-matches-contents and nothing about **who wrote the block**, so a single peer could walk a light client onto a fabricated chain with an empty producer key, the string `'not-a-signature'`, and attacker-chosen state roots. It runs on unauthenticated peer input, so a malformed block produces a **verdict rather than an exception** — an uncaught throw on the receive path is a node-wide halt. It also re-checks the PoE proof against the header's `consensusProofHashHex` when one is named (`urd.ts:91-101`). **The seat (PRF-3, 2026-11-15).** A signature proves *a* key signed for this genesis, and any fresh keypair passes that. Handed a seated set, `verifyFoldable` also refuses a producer outside it, through the full node's own `verifyProducerAuthorised` and in the full node's words ("not in the authorised validator set"). The set comes from `lightClientSeatsFor`, which chooses it the way `BlockchainCore` does: declared validators if any, the genesis roll in production (`genesisSeatedSet`, which is `GladsheimSeating.fromGenesisNodes` behind a check that the spec hashes to the anchor), an open set in development. `HeimdallClient` takes it from a `genesis` option, `StarwNode` from `seatedProducers`, and `HestiaNode` wires the latter for a Pulsar. **The limit:** a full node reads each epoch's seating from the Einherjar roll, which is state; a light client holds the genesis roll for every height. That is exact while the roll is unchanged (live Asgard: `changes: []` at 33,223) and fails closed after a change. The slot rotation is not judged by the light client, because it is a function of that roll and of the governance rule schedule. The fold is untouched: an honest chain folds to the identical proof. ### 7.3 Wiring | Function | Production callers | |---|---| | `verifyFoldable`, `urdFold`, `verifyUrdFold` | `src/network/starw-node.ts:590-600` (`tryAdvance`) | | `urdSummarize` | `src/cli/strblk.ts:454`, `:1437`; `src/ops/dashboard.ts:175`, `:378` | | `verifyUrdSummary` | **none** | | `HeimdallClient` | `src/hostless/lagrange.ts:146`. *Corrected 2026-09-18* — this row read **none**, and `docs/NAMING.md:53` and `docs/reality/NODE_AND_HOSTLESS.md:357` had it right all along. Two published sources disagreed on a load-bearing fact | So the fold is enforced on the block-gossip path, and the light client the recursive structure exists for is constructed in one place: the Lagrange light station (`src/hostless/lagrange.ts:146`). --- ## 8. Settlement ### 8.1 The rule ``` confirmations(H) = head - H + 1 blockchain.ts:2901 deepestFinal = head - requiredConfirmations + 1 blockchain.ts:2839 finalizedHeight() = max(deepestFinal, finalizedFloor) blockchain.ts:2839 ``` `confirmations` counts the block itself, so a block at H is settled once `head - H + 1 >= depth`, i.e. `H <= head - depth + 1`. Returning `head - depth` left a **one-block gap**: a branch forking there rewrote a block the chain had already called settled, the resulting chain validated clean, and nothing downstream flagged it. A merchant who waited exactly the advertised depth could still have the settling block rewritten — the whole promise, missed by one. The same reasoning and the same arithmetic appear in `SkuldResolver.finalizedHeight` (`skuld.ts:1915`). Worked, at `head = 20`, `depth = 12`: `deepestFinal = 9`. Block 9 has `20 - 9 + 1 = 12` confirmations. Block 10 has 11 and is `confirming`. ### 8.2 The depth `requiredConfirmations` is a **getter, not a captured number** (`blockchain.ts:531`). Governance can move it, and a value captured in the constructor would mean a passed proposal changed the committed state and nothing read it back — enacted and not obeyed. | Source | Value | |---|---| | node-local override (`options.requiredConfirmations`) | wins if set | | governed `chain.requiredConfirmations` | default 12 (`src/core/config.ts:13`), registry range **4 – 127** (`src/core/logberg.ts`, `chain.requiredConfirmations`) — *corrected 2026-09-20, this said 4 – 1000 and a vote for any depth above 127 is refused* | | defensive floor | `DEFERRED_DEPTH + 1 = 4` | The node-local override is deliberately **not** in the state root: it changes only how deep a reorg this node accepts and when it says `final`, so nodes with different depths still agree on which chain is valid and which blocks it contains. A node choosing a deeper value is simply more cautious than the network asks. A node-local setting that entered the root would fork the chain on a configuration choice. The floor exists because of deferred execution. `DEFERRED_DEPTH = 3` (`blockchain.ts:190`) means a header's `stateRootHex` is the root as of `height - 3`, not of this block: consensus agrees on **ordering** first, and the execution result is committed to three blocks later. A producer that executes incorrectly at H is caught at H+3. **Settlement must therefore sit strictly deeper than the lag**, or a block would be called settled in the same breath as the first check of its execution result. Enforced at construction (`blockchain.ts:1301`) rather than left to configuration. ### 8.3 The ratchet `finalizedFloor` (`blockchain.ts:2390`) is the deepest height this chain has **ever** called settled, and it is never lowered. Governance may raise the depth. Without the ratchet, raising it from 12 to 24 silently un-settles every block between the old line and the new one: a merchant who took payment at 12 confirmations under the rule in force when they took it would have that settlement reopened by a vote they were not party to. **Settlement a later vote can withdraw is not settlement.** The parameter governs blocks going forward and can never reach backwards. Three ways the promise could break, and all three are closed: - **By a vote.** `finalizedHeight()` returns `max(computed, floor)`. - **By a read that never happens.** The line is drawn **when the block lands** (`blockchain.ts:2237`, `:2546`), not when someone asks. A ratchet that advanced only on a read would record nothing at all if the depth were raised before anyone happened to ask — which is precisely the moment it exists to protect. - **By the fork resolver holding a second opinion.** Skuld is constructed with **thunks** (`blockchain.ts:1293-1294`) for both the depth and the floor. Passing the depth alone was not enough: the chain kept the floor and the resolver recomputed `head - depth + 1` without it, so a governed depth increase let the resolver rewrite a block the chain was still calling settled. The measurement recorded at `skuld.ts:236-241`: after a real vote took the depth from 12 to 24, a branch forking at height 5 was refused before the vote and adopted after, rewriting block 6 while the chain went on reporting it settled. **A promise made by one object and not the other is not a promise.** `finalityStatus` (`blockchain.ts:14803`) consults the ratchet **first**: reporting `confirming` for a block this node previously called settled is the same broken promise as reorganising it, made to whoever is reading the status instead of to whoever took the payment. The ratchet is safe against reorgs by construction: a reorg below the line is refused, so the branch it forks from always contains every block the ratchet has already committed to. *Corrected 2026-10-29: since 2026-10-10 the refusal is drawn at the irreversible line and not at this one (§3.5, §8.5), so on a chain with no measured quorum a block this ratchet calls `final` can be displaced by a branch fork choice ranks higher. The ratchet still never LOWERS what is reported.* On snapshot restore the floor is now **derived rather than adopted** (changed after this chapter was written): `deriveFinalizedFloor` replays the confirmation depth across the restored chain and takes the max of `h - depth(h) + 1`. So a stale or edited snapshot cannot walk settlement in either direction — but not for the reason this paragraph originally gave. The old rule *did* adopt the field, upward only, bounded at `head - DEFERRED_DEPTH`; both directions turned out reachable in practice, and the guard that looked sufficient was not. `finalizedFloor` is not in the state root, because it is node-local by the same argument as the depth. Covered by `tests/integration/finality-ratchet.integration.test.ts`, which drives the depth change through real proposals, real ballots from the genesis roll, and real blocks. ### 8.4 Why quorum does not gate it See §4.7. Summarised: `Block.attestations` is outside the hashed content, so a quorum rule over it is a rule each node enforces against its own inbox; and because settlement is what bounds fork choice, a chain that never collected enough signatures would never settle, the ratchet floor would never rise, and a reorganisation could reach arbitrarily deep. **There used to be nothing to gate on, and that half is now closed** (changed after this chapter was written). The paragraph that stood here said: no production code path creates a `ValkyrieAttestation`; `valkyrieAttest`, `StarwNode.broadcastAttestation` and `attachAttestations` have only test callers; `PROTOCOLS.attest` has a topic, a 16 KB budget (`src/network/protocol.ts:103`) and a receive-side validator (`src/network/starw-node.ts:1280`) and no publisher; so `block.attestations` is always empty on a running network and every quorum measurement is `0/threshold`. All of that was true. What exists now is a **collection path**, and only a collection path — the settlement rule is untouched and still reads nothing. `BlockchainCore.attestBlock` produces this node's own signed judgement or `null`; `BlockchainCore.admitAttestation` takes one heard from the network onto a block within `ATTESTATION_WINDOW_BLOCKS` (8) of the head; `StarwNodeOptions.valkyrie` wires the two into the send and receive sides of the `attest` topic, signing on `broadcastBlock` and on a successful `acceptBlockFromPeer`; `BlockchainCore.attestability` says which of seven reasons a node will not sign, because `null` alone reads as a broken path when it is usually a configuration fact. `BlockchainCore.quorumAt(height)` measures a block's quorum with `measureQuorum` over `quorumSeatingAt(height)`; `GladsheimSchedule.measureBlockQuorum` still has no caller. Measured on thirteen nodes over real TCP (`scripts/attest-measure.mjs`): **96.4% of the seating attests**, every node reaches the 9-of-13 threshold on every block, and the spread from a block's `producedAtMs` to the last signature it collects is **34–127 ms**. At the full 1313-seat roll it does not fit — 438 frames a second on one link against Gleipnir's 64 sustained, and 51.5% of frames refused by the real limiter. The ceiling of about 230 attesting seats derived from it was an estimate, withdrawn 2026-10-07 after the live chain carried 751 to 772. All of it is in `docs/design/QUORUM_FINALITY.md`, together with the design for what a header change would buy. **One thing has not changed and must not be read as changed: none of this gates settlement.** Both reasons above still hold in full, because the attestation array is still outside the hashed content. What the collection path removes is the second of the two blockers — "there is nothing to gate on" — and it removes it without touching the first. **The production wiring is in place**, as a `valkyrie` option on the `StarwNode` that `HestiaNode.start` builds — and it has to be there rather than where the chain is created, because `openLocalStore` creates the `BlockchainCore` *before* `this.node` is assigned. On the real thirteen-process testnet in production mode: **22 of 22 blocks attested, best 13 of 13 seats.** **In `development` mode that same testnet collects nothing, and that is correct.** It passes `--validators` with harness keys and no genesis, so the chain falls back to `devGenesisSpec()` and its 1313 seats: `verifyProducerAuthorisedAt` accepts every block because the *declared* set is what authorises sealing, and `seating.domainFor(producer)` is `undefined` because the seating is derived from the validator roll. **A node can be authorised to seal and not be seated to attest** — the same fact §6.3 records for `defaultWitnessSet` — and the testnet now asserts that mechanism by name rather than tolerating a zero. ### 8.5 What settled at depth does not mean, since 2026-10-10 *Added 2026-10-29.* §8.1 to §8.3 describe the line a node REPORTS. The line it REFUSES on is a different one, and on the live chain the two are far apart. | | Depth line (`finalizedHeight`) | Irreversible line (`irreversibleHeight`) | |---|---|---| | Rises when | a block is buried `requiredConfirmations` deep | the height at the depth line carries a quorum this node measured (`irreversibleHeight` `blockchain.ts:13372`) | | Decides | what `finalityStatus` reports as `final` (`finalityStatus` `blockchain.ts:14803`) | which branches fork choice refuses outright (`irreversible` `skuld.ts:1452`; `backed` `:1500`) | | On Asgard, 2026-10-29, height 17109 | **17098** | **-1** | Read live with `getStatus`, whose `finalityBacking` carries both lines and `backed`, and whose `finalityConflict` names the deepest branch this node has judged below the depth line (a stale branch or a one-block tie this node watched lose is filed under `staleBranchRejected` instead, for display only; see `isLostTie` in `src/core/var.ts`). One whose head this node has since buried, and that its fork resolver has not recorded for an hour, is shown under `finalityConflictHistory` with its age instead — for display only: an old record is not evidence the fork closed, and `transaction` still answers every payment above it contested. Since 2026-11-09 an unbacked conflict stops contesting payments only once its resolver has not recorded it for a day AND its competing head is 1,440 or more blocks below this node's head — bounds an operator may lower to an hour and 600 blocks (`--contest-retire-quiet-ms`, `--contest-retire-depth`) and no further — or at once when it is a stale branch, a lost tie re-offered long after it was sealed (`isStaleBranch`) (`contestsSettlement` in `src/core/var.ts`); a backed one never stops, and a retired one stays on record and is named in the `reason` of every payment it would have covered. **A merchant or an exchange that releases on `final` while `backed` is `false` is relying on depth alone.** What `final` itself should report is an open owner decision, recorded at `finalityStatus` (`blockchain.ts:14803`), and this section describes the code rather than deciding it. --- ## 9. Known limits Blunt, roughly in order of how much they matter. 1. **Quorum is measured and gates only the reorg-refusal line.** The line `finalityStatus` reports is depth-based; `irreversibleHeight` rises only where this node measured a quorum, and Skuld refuses a branch only below it (§3.5). The second half of this entry — "and nothing produces the input" — was true when this chapter was written and is no longer: a collection path exists (§8.4), the `attest` topic has a publisher, and thirteen nodes over real TCP collect **96.4% of the seating** on every block. What has not moved is the gate on the reported line. Closing that is now written as Logretta rule version 6 (`finality-gating`): a committee certificate rides in a later block's body, folded into `recordsRootHex`, so it needs no `BlockHeader` change and moves no genesis hash. No realm schedules it, so on every chain a block is still settled at depth 12. The design, its costs and the estimated ceiling withdrawn on 2026-10-07 are in `docs/design/QUORUM_FINALITY.md`, and the version 6 design is `docs/design/FINALITY_GATING_KEYSTONE.md`. **One caveat in this entry was wrong as stated and is corrected here.** It said the production wiring in `src/node/hestia.ts` "is not in place". It is: `HestiaNode.start` passes a `valkyrie` hook pair — `attest` onto `BlockchainCore.attestBlock` and `admit` onto `BlockchainCore.admitAttestation` — into the `StarwNode` it builds (`src/node/hestia.ts:527`), and §8.4 and §10 of this same file already said so. An audit found the three statements disagreeing inside one volume, which is the same defect this chapter records against other documents. The caveat that does stand is the second one: **the full 1313-seat roll cannot be collected at all on the network as configured** — 792 of 876 at best across four consecutive slots, 51.5% of frames refused by the real limiter. `hestia.ts:519-526` says this in the comment above the wiring, and gives the reason it is wired anyway: a path nothing calls is a path nobody maintains. 2. **Slashing reaches only the seats that bonded.** `Einherjar.stake` (`valhalla.ts:1176`) still has no ledger lock behind it and is still read by nothing. **Fenrir** (**BUILT 2026-09-10**) does not use it: it burns a bond posted by transaction after genesis, decided by the same `eject` record Nidingr already carries. The bond is optional because a genesis-declared one would have hard forked a launched network, so the honest statement is that an unbonded validator loses its seat and nothing else. `fenrirCoverage` measures how many seats that is, at any height. 3. **A `development-open` chain has no consensus.** No producer set, no rotation, no leader election; `verifyInTurnAt` returns `{accepted:true}` unconditionally (`blockchain.ts:4966`). Two producers on it will still fork exactly as before Tyr existed, and the fork-choice tiebreak on head hash is grindable there (`urd.ts:284`). Reachable only through `mode: 'development'`, and there is no option that opens the set in production. **The last clause of this entry — "an operator running a 'test network' on defaults is running a broadcast bus" — is no longer true, and the reason is worth recording rather than deleting.** It was true because omitting `--genesis` meant the development chain, in development mode, with a warning on stdout that a service manager swallows: the wrong answer was the DEFAULT. **Snotra** (`src/core/snotra.ts`) removed the default rather than improving the warning. `assertNetworkSelected` (`src/core/snotra.ts:689`) refuses when all of `--network`, `--genesis` and `--dev` are omitted, and `strblk node` calls it before a data directory is opened (`src/cli/strblk.ts:679`). There is now no way to reach an open producer set without having typed something that says so. What has not changed is what happens once you do type it: the mode is still open, and the three sentences above still describe it exactly. 4. **`slashingWindowBlocks` still reaches nothing on the chain path, and was deliberately not wired.** `SkuldOptions` accepts it and `pruneSightings` reads it, but `BlockchainCore` passes none, so the chain always uses `DEFAULT_SLASHING_WINDOW_BLOCKS = 1_325`. An operator who sets `ParameterSet.slashingWindowBlocks` through Forseti still sees their own input echoed back by RPC and changes nothing on the chain. **There is no chain-state source to wire it from:** `GOVERNED_PARAMETERS` maps only `blockTargetSeconds` and `requiredConfirmations`, `isGovernableParameter('chain.slashingWindowBlocks')` is `false` and is pinned false by `verify-economics.integration.test.ts:408`, and `ParameterSet` is by its own doc "what an operator's local console holds" — a per-`JsonRpcSurface` object built with a literal 144 in `rpc.ts:137`, which `BlockchainCore` holds no reference to. Wiring from there would be wiring from a local flag. The overstated comment was corrected instead, and it now records what wiring would require: a `PARAMETER_REGISTRY` entry with a declared range, a `GOVERNED_PARAMETERS` entry so the console value stops being a second opinion, and a thunk from `BlockchainCore` in the shape of `finalityDepth`. That is a new governed consensus parameter and therefore governance's call. **One correction to the reason, because the obvious fear is the wrong one.** Two nodes with different windows do *not* disagree about whether a presented alarm or a `NidingrEvidence` record is valid: neither `verifyGjallarhornAlarm` nor `verifyNidingrEvidence` has an age rule at all, and both verify from the two signed headers and the chain binding alone — which is what §3.8 already says. A short-windowed node still accepts an ejection record a long-windowed one built. What differs is only which offences a node can still *assemble for itself*. A local value would therefore not fork the chain; it would silently decide how much proven byzantine behaviour that node is able to prove — which is why the answer is a governed parameter or the compiled-in default, and not a console flag. 5. **`requireAttestedWitnesses` still has no caller, but the default `witnessSet` is now backable.** The type mismatch is closed: a witness id is a seat's STR domain everywhere, `produceBlock` resolves it through `GladsheimSeating.domainFor`, and a block sealed by a seated node names an id that an attestation from that seat satisfies. Pinned by `consensus.integration.test.ts` ("names a witness the seating in force can actually back"), which fails on the old default. What remains is that no production path turns the flag on — and it must stay off at seal time, because a block is sealed before any attestation over its hash can exist (§6.3). Promoting the field from advisory to evidence is still a change to *when* the proof is completed, and still governance's call. 6. **`assessPoEThreat` has no production caller.** The explorer, its one caller, stopped scoring blocks and now shows counts instead (`src/explorer/hlidskjalf.ts:1676-1687`), so the witness and quorum terms are exercised only by tests. **The half of this entry about `measureBlockQuorum` has moved and is corrected rather than closed.** It said the method "has no production caller at all". For a while it had one; it has none again, because `BlockchainCore.quorumAt` (`src/core/blockchain.ts:14398`) now runs `measureQuorum` itself over `quorumSeatingAt(height)`. And `quorumAt` is read on a production path: `quorumReachedAt` feeds `irreversibleHeight`, the line Skuld refuses a reorganisation below, and `finalityBacking` reports it. Its other callers are `scripts/attest-measure.mjs` and `scripts/v4-activation-rehearsal.mjs`. What still reads no quorum outcome is the line `finalityStatus` reports, and the entry stays here for that reason. 7. **Urd is a hash fold and gives no verify-from-tip.** §7.2. That half stands: `verifyUrdSummary` walks every block and has no caller. *Corrected 2026-09-18* — the claim that `HeimdallClient` has none was wrong. It is constructed at `src/hostless/lagrange.ts:107`, so the light-client story IS instantiated, and the honest statement is sharper than the one it replaces: **that client is anchored only when its caller passes a genesis hash, and `LagrangeStation.follow` refuses to fold a block when it is not.** An anchored `HeimdallClient` verifies authorship before folding; an unanchored one folds whatever tip reaches it first. Until 2026-09-18 neither did — `verifyFoldable` existed for this and its only caller was a full node that re-validates anyway, and a block with an empty producer key and the literal string `not-a-signature` was measured being folded and reported as head. Even anchored, the check proved *a* key signed for this genesis and never that it held a seat; since 2026-11-15 (PRF-3) a client given the genesis spec also refuses a producer outside the genesis roll — see §7.2. 8. **Corrected: `valhalla.ts`'s class doc no longer describes a reorg mechanism that does not run.** `GladsheimSchedule`'s comment now states the rule the chain actually follows — an anchor is never corrected in place, and the chain adopts the schedule the trial core built through `loadSnapshot(trial.seating.snapshot())` — and `rewindAbove`'s own doc now says outright that it has no production caller and is referenced only from `consensus.integration.test.ts`. The behaviour was always sound; only the documentation was stale. 9. **`tyrRosterFromNodes` has no production caller, and its doc comment now says so.** It used to open "the rotation a genesis declares", which reads as a description of the live rotation; on a genesis-sourced chain the rotation is Gladsheim's domain-byte order. It survives as the pinned definition of the genesis root's sort order, exercised only by tests, and the comment now names `GladsheimSeating.roster()` as what the chain actually rotates over. 10. **Several `Gladsheim` accessors are unused:** `keylessSeats` (`valhalla.ts:595`), `requireRosterAt` (`valhalla.ts:928`), `canAnswerFor` (`valhalla.ts:940`). Likewise `SkuldResolver.alarmsFor`, and both `TyrSchedule.nextSlotFor` and `TyrRotation.nextSlotFor`. None is wrong; all are surface with no consumer, which means none is exercised outside its unit test. 11. **The producer loop throws on a turn that is not this node's when there is work to seal.** `hestia.ts:1533` calls `produceBlock()` on a re-armed timer and discards the "refusing to seal out of turn" throw (`OutOfTurnError`) uncounted, while its `catch` counts and reports every other seal failure. On a roster of N with one local validator that is roughly `(N-1)/N` of the turns that reach the seal. Correct, and the out-of-turn check itself gives an operator debugging "why is my node not sealing" no signal; the nearest one is the `not-producing` fault, raised once this seat's slot has come round twice with nothing sealed. 12. **An equivocator keeps its seat for up to one epoch** — 128 blocks, 384 s at the 3-second target — because ejection binds at the next boundary. Accepted deliberately (§4.3); listed here because it is a real window in which a proven byzantine validator still leads its slots. 13. **The reorg trial is a `BlockchainCore` replay** — from this node's nearest fork checkpoint at or below the fork point when one is usable (`trialFromCheckpoint`, O(fork depth), on by default), and from genesis otherwise (`blockchain.ts:2646`), O(chain) and the only trial that may reject — up to `MAX_FORK_ATTEMPTS = 4` per offer. Chosen over undo because undo has to invert every effect a block had, and anything it forgets to invert survives into the new chain as state nobody can account for. The cost of the genesis fallback is real and grows with chain length; it is measured on one machine by `node scripts/reorg-trial-bench.mjs`, which times the trial from genesis and from a checkpoint at several heights. 14. **Density window and slot length are compiled in, not governed.** `windowSlots: 10` and `slotMs = CHAIN_CONFIG.blockTargetSeconds * 1000` are fixed where Skuld, Tyr and Odin are constructed. The governed `chain.blockTargetSeconds` moves only the producer's scheduling interval (`blockchain.ts:2875`). Deliberate — a rule whose slots move when a vote passes is a rule two nodes mid-vote disagree about — but it means a governed block-time change silently desynchronises the production cadence from the density window, and nothing warns about it. 15. **Throughput is unmeasured at network scale.** `npm run bench` measures one node's seal rate in tx/s on one machine and `npm run bench:network` one hop; no benchmark exists for network-wide blocks/sec or transactions/sec, fork-choice cost at scale, or seating derivation cost on the full 1313-seat roll. The 1313-key genesis derivation is measured at ~507 ms cold (`src/core/genesis-nodes.ts:170`) and is cached per process. **One adjacent number now exists and it is not throughput**, so it is recorded rather than counted against this entry. `scripts/attest-measure.mjs` measured, on one machine, the cost of the attestation path at full roll: **signing 1313 attestations 538–1221 ms**, and **verifying and admitting 1313 of them 182–481 ms — 6.1 to 16.0% of one 3-second slot**. That is the signature workload a slot would carry if the roll could attest, which it cannot (item 1). It says nothing about how many transactions a block can execute, which is what this entry is about and has no network-scale number. --- ## 10. Where other documents contradict this code Per the standing rule, these are recorded rather than repeated or silently reconciled. A **conflict between sources** — two documents each asserting something, disagreeing about which is true — goes to governance and is never settled in a commit. A **doc that has gone stale against the code** is a different thing: the code is the fact, and the document is corrected to match it. The rows struck through below were the second kind, and `docs/ARCHITECTURE.md` now matches. Conflict 2 (PoE vs SPoV) was the first kind, and the owner decided it on 2026-10-13. | Document | Claim | The code | |---|---|---| | ~~`docs/ARCHITECTURE.md` §2.2~~ | PoE proofs carry `zk13VerifiedCount` and `godCypherVerifiedCount` | **Resolved.** §2.2 now states that all six fields came out with `poe-v3` and why, and lists what a verifier actually recomputes. | | ~~`docs/ARCHITECTURE.md` §2.2~~ | "**Valhalla** admits Einherjar, binds each to its key, and computes the 2/3+1 quorum threshold" | **Resolved.** §2.2 now attributes the seated set and the threshold to **Gladsheim**, derived from the Althing roll, and records that `ValhallaRegistry` is excluded from consensus. | | ~~`docs/ARCHITECTURE.md` §11~~ | “finality: confirmations ≥ requiredConfirmations → final” | **Resolved.** The step-11 line now carries `max(head - requiredConfirmations + 1, finalizedFloor)` and states that the ratchet is consulted first. | | `docs/ARCHITECTURE.md:296` | trust boundary "Validator → block: Valkyrie signature against Valhalla roll; failure mode: forged quorum" | **Half open, and this row said otherwise until an audit caught it contradicting §8.4 of this same file.** *Production* and *attaches*: closed. `HestiaNode` wires collection into its `StarwNode` (commit `c093d28`), a seated node signs on accept, and the 13-node testnet observes 22/22 blocks attested at 13/13 seats in production mode — the first attestation on a real block on a real network in this tree. *Forged quorum*: closed differently than the row imagines, by `admissibleAttestations` stripping what it cannot count rather than by a quorum gate. What remains open is that **the result gates only the reorg-refusal line** (`irreversibleHeight`): the line reported is depth alone on every realm, gating it is rule version 6 and scheduled nowhere, and quorum on the 1313-seat roll is measured structurally unreachable through the current rate limits (792/876 at best, 51.5% of frames refused). See `docs/design/QUORUM_FINALITY.md`. | | ~~`docs/ARCHITECTURE.md` gap row~~ | "No slashing — equivocation is detectable and is not punished" | **Resolved twice.** The row first became "No *economic* slashing", crediting Nidingr and `Odin.applyEject` with the seat. Since 2026-09-10 it records **Fenrir** as built: the burn rides on that same record, out of a ledger-locked bond posted after genesis, and the row now names the residue — an unbonded validator is ejectable and is not slashable — instead of implying full coverage. | | `docs/SECURITY.md:26` | assumption “Fewer than 1/3 of validation power is Byzantine → *finality can be violated; the quorum rule stops working*” | settlement is by depth and reads no quorum. The consequence of a byzantine third here is a fork-choice and liveness problem, not a quorum-rule problem. | | `docs/ECOSYSTEM_RECHECK_2026-08-29.md:59` (**conflict 2**) | this build calls the consensus **PoE**; `alexccoin/sourceless-blockchain` calls it **SPoV** (Sourceless Proof-of-Validation) | **Decided 2026-10-13 by the owner:** the public name is and stays *Proof of Existence*, and the mechanism is a proof of execution of the block's batch (`docs/NAMING.md`, the PoE row). The version string moved to `poe-v3` when the proof shape moved; the decision changed no code. | `docs/ARCHITECTURE.md:316` ("Urd is a hash fold, not a SNARK") and `docs/ARCHITECTURE_NOTES.md:56` agree with the code and are correct. `docs/NAMING.md`'s entries for Tyr, Gladsheim, Nidingr, Urd, Norn, Skuld, Valhalla and Fenrir all match the code as read. Fenrir's row was rewritten on 2026-09-10 when the component was built; it had said "still unbuilt and still unbuildable". ~~**`docs/NAMING.md` has been damaged by a global find-and-replace, and two of its rows are now false.** Re-checked at `9220195`: the register named two different components **Snotra**, the light client row claimed a `SnotraClient` that does not exist, and Gjallarhorn was given as Snotra's horn — which also falsified `src/core/snotra.ts`, whose own argument for the name is that Heimdall is already spent in `docs/NAMING.md` on the light client.~~ **Struck 2026-09-12: the damage was repaired in `d18d323` on 2026-09-07, four days before this chapter was last edited, and the table was stale the day it was re-checked.** Both rows are back: - `docs/NAMING.md:53` reads *"**Heimdall** | light client (`HeimdallClient`, `consensus/urd.ts`) | Norse: the watchman who sees to the edge of the world"*, and carries its own **Restored 2026-09-07** note naming the global replace that ate it. The class is `HeimdallClient` `consensus/urd.ts:312`. - `docs/NAMING.md:60` gives Gjallarhorn correctly as *"the horn Heimdall keeps at the edge of the world and blows when something is coming"*. The follow-on claim goes with it: `src/core/snotra.ts:46` still argues the realm register is "not Heimdall" because the name is already spent on the light client, and that argument is sound again — **Heimdall** appears six times in `docs/NAMING.md`, on its own row and referenced from four others, including Snotra's. The entry is kept struck rather than deleted because the lesson is the one this chapter keeps finding in the other direction: a book recording a defect the tree had already closed is its own defect, and a "re-checked at `9220195`" stamp on a row nobody re-checked is the worst form of it. --- ## 11. How to check this chapter ``` npx tsc -p tsconfig.json --noEmit npx vitest run tests/integration/consensus.integration.test.ts npx vitest run tests/integration/skuld-fork.integration.test.ts \ tests/integration/block-timestamp.integration.test.ts \ tests/integration/finality-ratchet.integration.test.ts \ tests/integration/determinism.integration.test.ts \ tests/integration/poe-binding.integration.test.ts ``` Observed on 2026-09-06 at `6c7f981` with the working tree dirty: typecheck clean; `consensus.integration.test.ts` **64 passed**; the other five files **85 passed**. Re-run on 2026-09-07 at `9220195`: `consensus.integration.test.ts` **65 passed** (1 file), the other five **89 passed** (5 files). Both counts move as the suite grows — they are recorded so a reader can tell whether the tree they are holding is the one this chapter describes, not as a target. The attestation numbers in §8.4 come from a separate harness and are not in the suite: ``` node scripts/attest-measure.mjs ``` It stands up real `BlockchainCore`s, real `StarwNode`s, real Ratatoskr rate limiting, real Bifrost sealing, real TCP sockets and real ed25519, on **one machine, one process, one clock** — so every latency it reports is a floor and not a forecast, and there are no hostile peers, no partitions and no packet loss. The full write-up, including the 1313-seat refusal and the ≈230-seat ceiling, is `docs/design/QUORUM_FINALITY.md`. The two claims most worth re-deriving yourself, because everything else rests on them: - **The order is total.** Read `compareBranches` (`urd.ts:562`) and `strictlyBetter` (`skuld.ts:728`) side by side and confirm they are the same comparator. If they ever diverge again, the two-honest-producers fork comes back. - **`undefined` is a refusal.** Grep for `seatingAt`, `producersAt`, `rosterAt` and `scheduleAt` and confirm every consumer either uses the `require*` form or converts the absence into a `{accepted: false}`. One `?? somethingPlausible` on that path turns "this node cannot say who was authorised" into "the set is open".