# The tolerant rule handshake: a build that implements more is not refused for it **Status: decided and built.** Code: `src/network/bifrost-rules.ts`, wired through `src/network/bifrost.ts` and `src/node/hestia.ts`. Tests: `tests/integration/bifrost-tolerant-rules.integration.test.ts`. Where something is measured it says where; where it is not, it says **unmeasured**. Date: 2026-10-25. Revised 2026-10-26 after independent review (§2.2, and the fallback in §2), and again the same day after a defect found merging into #12/#15 (§2.3, the genesis row of the table). --- ## 1. The finding Since `slnn-handshake-3.0.0` both Bifrost legs carry `consensusRuleVersions`, and `consensusRulesRefusal` refused any peer whose declared set was not EQUAL to this node's. A build declares what it IMPLEMENTS — `implementedRuleVersions()` — so the first build to implement a new rule version declares one number more than every node already running. That is what blocks the permissionless-validator upgrade. Rule v4 (PR #12) and v5 (PR #15) each add a version to the register, and #15's own test pins the declaration at `[2, 3, 4, 5]`. Every live Asgard seat declares `[2, 3]`. Measured earlier against the live fleet: a v4/v5 build held **0 sessions** with the `[2, 3]` seats. A rolling deploy of it would split the mesh by build — two halves, each sealing valid blocks the other never hears, which is how the October below-settlement fork started. Nothing about it depends on v4 being scheduled: the refusal fires on capability alone. ## 2. The rule **What a node declares.** The versions its build implements that are not newer than the version in force at its next height — the highest of the required versions below (`advertisedRuleVersions`). **What a node requires of a peer.** Only the versions the chain applies at this node's tip or at the next height it will judge (`requiredRuleVersions`, horizon `RULE_REFUSAL_HORIZON_BLOCKS = 1`). For each such version: | this node | peer | verdict | |---|---|---| | implements it | declares it | proceed | | lacks it | declares it | **refuse** — this node is out of date and cannot judge the next block | | lacks it | lacks it | proceed — neither can, and neither can harm the other | | implements it | lacks it, the genesis puts it in force by height 1 | **refuse** — every honest node declares it at any tip | | implements it | lacks it, declares a newer version | **refuse** — the peer is already past its activation | | implements it | lacks it, otherwise | proceed — the peer may simply be behind | A peer declaring versions this node lacks, or versions above this node's ceiling, is never refused for that. A config with no rule view at all — every test party, every measurement script — declares and compares exactly as before. A node whose view fails (no chain and no realm named, or a provider that throws) uses the schedule this build's chain adopts by default (`buildDefaultRuleView`), never the untrimmed declaration. ### 2.1 Why the declaration is clipped, not intersected with the schedule The obvious reading is "declare implemented versions that are in force or scheduled". On Asgard that is `[3]`: the realm's schedule is v3 from height 0 (`src/core/snotra.ts`) and names no v2. Every legacy seat declares `[2, 3]` and compares for equality, so `[3]` is refused by all of them — the same partition, one version lower. Clipping only what is ABOVE the version in force gives `[2, 3]` on Asgard, Midgard and the development chain alike, which is byte-for-byte the legacy declaration. That is the property the rollout stands on, and the first test pins it for all three realms. ### 2.2 Why the clip is at the version IN FORCE, not the newest scheduled The first cut of this release clipped at the newest SCHEDULED version. Independent review found the hole: a v4 build would then start declaring `[2, 3, 4]` in the block the `schedule-rules` vote lands in, and every seat still on a pre-tolerant build — including outside operators nobody can upgrade — would refuse it for the whole lead, at least `MIN_RULE_ACTIVATION_LEAD` (1,325) blocks, while both sides still seal valid v3 blocks. That is the below-activation partition of §2.4, reintroduced by the declaration instead of the comparison. Clipped at the version in force at the next height, a v4 build keeps declaring `[2, 3]` until H − 1, so a pre-tolerant `[2, 3]` seat peers with it at H − 100 and at H − 2 and is refused at H − 1, the first height at which it cannot follow anyway. The tests pin those three heights against the real legacy comparison. ### 2.3 Why a peer that might be behind is let through A declaration is clipped by the schedule and tip the DECLARING node holds. An upgraded node syncing from height 0 declares one version fewer than it implements until it reaches H − 1. If up-to-date nodes refused it, a node that joins after an activation could sync from nobody, permanently. Letting it through costs nothing that matters: the handshake was never the gate on block validity — `consensusRulesAtHeight` is, on every node, at every height, and it refuses to judge an activation height on a build that does not implement the version — and a node that truly lacks the version refuses its upgraded peers itself, from its own schedule, by the second row. A newcomer may fetch history from a peer past H; it can never accept, produce or seal H under rules it cannot apply. **This holds for a GENESIS-scheduled activation too, and the first cut got that wrong.** It refused a peer lacking any version named in the genesis schedule, on the ground that every node knows the genesis. Every node does know it — but what is compared is the declaration, and the declaration is clipped at the declaring node's next height. On a chain born with v4 activating at H in its genesis schedule (`scripts/open-admission-demo-net.mjs` on #12, or any business fork launched with a genesis `consensusSchedule` since 0743ef4), a newcomer at tip 0 declares `[2, 3]` and every peer past H refused it: found by A/B while merging into #12/#15, **0 of 2 newcomers synced** in the demo. The rule now refuses for a genesis version only when it is in force by the first height any node judges (`mustBeDeclaredAtEveryTip`: activation at or below the one-block horizon), because only then is it in every honest declaration at every tip. `tests/integration/bifrost-genesis-schedule-sync .integration.test.ts` reproduces the failure end to end — two newcomers joining a producer already past a genesis activation over real sockets: 0 of 2 reach the head under the old rule, 2 of 2 under this one. A governance-scheduled activation (v4 on Asgard) was never affected: its version is not in the genesis schedule. ### 2.4 Why the horizon is one block Refusing an out-of-date node EARLY cuts it off while it is still a valid participant: below the activation it seals blocks every upgraded node accepts. Two halves that each keep sealing valid blocks without hearing each other is a fork below the activation height. So nothing is refused until the version is in force at the next height to be judged, which is the first height at which the out-of-date node genuinely cannot follow — and at which it halts anyway. Node-local policy, not consensus: two nodes holding different horizons refuse at different heights and agree on every block. ## 3. The rollout, in two steps 1. **The tolerant release, fleet-wide, first.** It implements `[2, 3]` and declares `[2, 3]` on Asgard, so a legacy seat cannot tell it from itself; it can be rolled one seat at a time with no partition at any point. Since §2.2 a straggler left on a legacy build no longer partitions anything before H − 1, so completing this step is no longer a precondition for the vote — it is still done first, because only a tolerant node gives the named "upgrade this node" refusal at H − 1. 2. **The v4 build, rolling.** It declares `[2, 3]` and peers with everyone, legacy stragglers included, while v4 is unscheduled AND after it is scheduled, until H − 1. Governance schedules v4 at H (`schedule-rules`, at least `MIN_RULE_ACTIVATION_LEAD` blocks ahead). From H − 1, v4 builds declare `[2, 3, 4]`, and a node still lacking v4 is refused — by a legacy seat's own equality, or by a tolerant node's own schedule with a sentence telling its operator to upgrade — and halts at H as it always would. The hard gate is the one there always was: every seat on a v4 build before H. The mixed-fleet simulation walks every phase above and finds one connected mesh at each; the same fleet with the v4 build declaring its whole set splits in two, which is the measured 0-peer finding. ## 4. Risks of rolling it onto the live fleet - **Every seat must be on a v4 build before H, verified rather than assumed** — including hosts that carry their own code rather than the repository's. A seat that is not stops at H; that is the activation's own rule, unchanged here. - **Live behaviour is unmeasured.** Proven in-process and over loopback sockets only. The tolerant release has not been run against a live Asgard seat. Across BUILDS it was measured on loopback with real `HestiaNode` processes on the development genesis (2026-10-26, this release at 753b911, the v4 build from #12, a pre-tolerant build from main 5738566): with v4 unscheduled the v4 build held a session with the pre-tolerant build and with this release, in both directions; with v4 scheduled at H = 2 (tip 0 = H − 2) it still held a session with both; at H = 1 (tip 0 = H − 1) both refused it — this release naming itself as out of date. - **The build-default view must track `BlockchainCore`'s default schedule.** A node with neither a store nor a realm uses it. A test holds the two equal, so a build that keeps an opt-in version out of the chain's default fails that test until `buildDefaultRuleView` excludes it too. #12 does keep v4 out, and both defaults now read one filter, `defaultableRuleVersions` in `src/core/logretta.ts`; without it a chainless node on the v4 build (a Pulsar) declared `[2, 3, 4]` and was refused by every `[2, 3]` peer, which `slnn-mesh` caught. - **PRs #12 and #15 carry this release by merge, unchanged in substance.** Their handshake byte pins use parties with no rule view, so those keep declaring the whole set and their numbers do not move; a node started by `hestia.ts` on those builds declares `[2, 3]` until H − 1, which `bifrost-tolerant-rules.integration.test.ts` pins on those branches with the build as the v4 side. ## 5. What did not change No wire field, no transcript byte, no `BIFROST_VERSION`, and nothing under `src/core/`. Genesis digests measured before and after with `strblk genesis --identity`, identical: | realm | genesisHash | |---|---| | development | `8ee28b94b15c1db6cfb7e052d2ade53b5e1a8be5d8698e17a679f4b567a576ea` | | Midgard II | `e88a8753925935b0c003961f7988fe3df6f466cf648584a7bf39c486c4772d37` | | Asgard (`launch/asgard-genesis.json`) | `1cf8655125cc1bbbc0ca06a491f53775499785c349b4d0f5748d5ea170e517bf` | The state roots and genesis block hashes printed beside them are identical too. --- *Created by Alex M Stratulat and the SourceLess team.*