Skip to content

fix(host-cli): advertise the People genesis the chain reports - #416

Merged
TarikGul merged 4 commits into
mainfrom
tg/paseo-people-genesis
Aug 16, 2026
Merged

fix(host-cli): advertise the People genesis the chain reports#416
TarikGul merged 4 commits into
mainfrom
tg/paseo-people-genesis

Conversation

@TarikGul

Copy link
Copy Markdown
Member

paseo-next-v2's People chain reports 89a63b11…; the preset carried c5af1826…. The preset, its routing entry, PASEO_NEXT_V2_INDIVIDUALITY and SPEC.md now carry the value the chain reports.

The drift had no routing symptom, which is why it survived. url_for answers an unrecognised genesis with people_ws, so both hashes reached the People chain. Products are where it landed: get_chain_info hands back the advertised hash and
PASEO_NEXT_V2_INDIVIDUALITY exports it, so a product building a People-chain transaction signed CheckGenesis over a genesis that chain does not have. The host's own allowance extrinsics read the hash from the chain via fetch_genesis_hash and were never exposed to it.

Coverage

served_chain_genesis_hashes_match_the_endpoint_routes pins the two constants against each other, and both were wrong the same way. Its replacement, the_advertised_genesis_matches_what_each_chain_reports, asks each endpoint for its own genesis. It collects every mismatch rather than stopping at the first, since a wipe drifts more than one role, and asserts how many roles it checked, because --ignored runs it without the test that holds the served set non-empty.

Both genesis tests resolve a role through NetworkConfig::url_for_role, matched exhaustively so a new ChainIdentifier stops compiling rather than reaching a None that only a test run notices.

ring-vrf-smoke.ts imports the constant the way ring-vrf-e2e.ts already does, leaving four hand-maintained definitions of the People genesis, two of them test-pinned. Its listRingVrfKeys predicate compared derivationIndex.tag against "Left", and DerivationIndex is Index | Raw, so the comparison was always false and the script always threw. It passes for the first time here.

Verification

Live against paseo through the CLI: the new test matches all three served roles and fails when the stale hash is restored, battery.sh --signing-host runs the ring-VRF registry e2e green, ring-vrf-smoke.ts reports RING_VRF_OK, and
smart-contract-allowance-smoke.ts reports Allocated.

The preset carried `c5af1826...` for paseo-next-v2's People chain; the chain
reports `89a63b11...`. Both hashes reached the People chain anyway, because
`url_for` answers an unrecognised genesis with `people_ws`, so the drift had no
routing symptom. What it did reach was products: `get_chain_info` handed back the
stale hash and `PASEO_NEXT_V2_INDIVIDUALITY` exported it, so a product building a
People-chain transaction signed `CheckGenesis` over a genesis that chain does not
have. The host's own allowance extrinsics were never affected — those read the
hash from the chain via `fetch_genesis_hash`.

Refreshes the preset, its routing entry, `well-known-chains.ts` and SPEC.md, and
drops the fifth copy by importing the constant into `ring-vrf-smoke.ts` the way
`ring-vrf-e2e.ts` already does.

`served_chain_genesis_hashes_match_the_endpoint_routes` could not catch this: it
pins the two constants against each other and both were wrong the same way, as
its own doc comment conceded. `the_advertised_genesis_matches_what_each_chain_reports`
asks each endpoint for its genesis instead, collecting every mismatch and
asserting the checked count so `--ignored` cannot pass on an empty served set.
Both genesis tests now resolve the role through `url_for_role`, matched
exhaustively so a new `ChainIdentifier` stops compiling rather than surfacing as
a panic in an ignored test.

Also fixes the `listRingVrfKeys` predicate in `ring-vrf-smoke.ts`, which compared
`derivationIndex.tag` against `"Left"`. `DerivationIndex` is `Index | Raw`, so the
comparison was always false and the script always threw.
@TarikGul
TarikGul requested a review from a team August 15, 2026 00:24
@TarikGul

Copy link
Copy Markdown
Member Author

The same live check currently shows an Asset Hub mismatch that this branch does not yet correct:

  • wss://paseo-asset-hub-next-rpc.polkadot.iochain_getBlockHash(0) = 0x23e730eb1c6fecae09c917439a5038cb6122d0d48980e8b9bbf0ff56f94a2ca6
  • PASEO_NEXT_V2_CHAIN_ENDPOINTS still advertises 0xbf0488dbe9daa1de1c08c5f743e26fdc2a4ecd74cf87dd1b4b1eeb99ae4ef19f

brevity-dozer origin/dev and dotli-community origin/main both use 23e730eb…; both also use the 89a63b11… People genesis fixed here. Epoca's vendored environment matches those live endpoint values. UAK's current paseo-next-v2.json carries bf0488db… / c5af1826…, so copying that bundle into a host would reproduce both mismatches.

Assethub should have been corrected in #391.

TarikGul and others added 2 commits August 15, 2026 08:56
Review found a mutation the whole suite accepted: point People at Bulletin's
genesis and URL, and every assertion agrees. The constants match each other, the
role routes to the URL the preset names, and the live check passes because the
Bulletin endpoint truthfully reports the hash it was handed. Nothing tied a role
to the identity of the chain behind it, so the live test claimed more than it
showed. It now reads `system_chain` and requires the name to carry the role.

Unreachable endpoints are collected rather than panicked on. People is probed
first, so one unreachable RPC aborted before Bulletin or Asset Hub were seen,
which is the outcome the "collect every mismatch" design paragraph exists to
avoid, and a connection error read identically to real drift.

The probe count is derived from the served set instead of a hardcoded three, so
adding a role widens the test rather than failing it, with non-emptiness asserted
separately because a derived count cannot notice a set that shrank to nothing.

Adds the guard the change most needed and did not have: nothing tied
`well-known-chains.ts` to the preset, and products sign `CheckGenesis` over the
TypeScript constant, not over anything in this crate. It is compiled in with
`include_str!`, so a renamed export breaks the build rather than drifting.
Comment thread rust/crates/truapi-host-cli/src/network.rs Outdated
Comment thread rust/crates/truapi-host-cli/SPEC.md
Asserting them separately meant one unreachable endpoint discarded every drift
the answering endpoints had already proven, and then claimed drift was unproven
when it was not. Both are collected into one failure, drift first.

Pins SPEC.md's §14.1 table the same way as `well-known-chains.ts`. It is the
fourth hand-maintained copy of these hashes and the only one covering Bulletin,
since the TypeScript exports People and Asset Hub but no Bulletin constant.
@TarikGul
TarikGul added this pull request to the merge queue Aug 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 16, 2026
@TarikGul
TarikGul added this pull request to the merge queue Aug 16, 2026
Merged via the queue into main with commit 87a5515 Aug 16, 2026
16 checks passed
@TarikGul
TarikGul deleted the tg/paseo-people-genesis branch August 16, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants