Person's usernames: read from Asset Hub dotNS instead of the People Chain (rebase of #349) - #426
Open
filip-parity wants to merge 12 commits into
Open
Person's usernames: read from Asset Hub dotNS instead of the People Chain (rebase of #349)#426filip-parity wants to merge 12 commits into
filip-parity wants to merge 12 commits into
Conversation
…eo-assethub address The documented 0x1c858C… value predates the Paseo Asset Hub Next V2 reset; the live DotnsPopController is 0xCC9323… (paritytech/dotns DEPLOYMENTS.md, same drift as paritytech/dotns#221). Discovery is on-chain, so this only touches the env-override docs.
…inst the live gateway Review findings on #349 after the rebase, verified against the live paseo-next-v2 and previewnet Asset Hubs (spec 2000036, identical) and the dotNS contracts on master. In-core identity lookup - Open the identity follow withRuntime=true. chainHead_v1_call is refused on a follow opened without runtime, so every ReviveApi_call view failed and no in-core session ever resolved a username; only the CLI's plain-RPC path worked. Adds a scripted chainHead test that fails on the old value. - LabelStore labels carry the network TLD (DotnsPopController._writeRecord appends protocolRegistry.tld(); ".paseo" on paseo-next-v2), and the classifier only stripped ".dot", so a settled "alice01.paseo" became the full username "alice01.paseo". resolve_labels now reads tld(), strips it, and drops subnames; classify_labels takes bare labels. - Always merge pendingClaims with the store: a public registration or an incoming transfer deploys the store while gateway names stay pending, so the store alone hid them. Page the store (append-only ledger shared with public names) instead of reading only the first 16 labels. - Probe TARGET() and pendingClaims first; target()/pendingClaim are the legacy fallbacks (the deployed dispatcher and controller only have the former). checked_add on chain-supplied ABI lengths. - Lite stems follow StringUtils.isSingleDotLiteLabel (DNS label + two digits), not alphabetic-only. register-name - AsDotnsGatewayInfo::RegisterFullName is {proof, ring_index, revision, signature} on the live runtime (individuality#1013); the shape assertion and the extra encoding lacked revision, so the command failed at the metadata check. Read the People-collection root revision at the pinned block, wait for Asset Hub's members-subscriber to import it, and encode it. Ring/root/roots helpers take the collection identifier; the LitePeople wrappers keep their behaviour. - Refresh the Asset Hub metadata fixture to the live V16 (spec 2000036). - Fail early when the member key is onboarded but not yet built into a root (the sliced members read cannot prove it), and validate the label and --link-lite shape before signing.
…sets - Previewnet has a live Bulletin chain (wss://previewnet.substrate.dev/bulletin, genesis 0x2778b1c9…, "Bulletin Local"), which dotli and dotns-sdk already use; the preset borrowed paseo's, so the host advertised and routed a Bulletin genesis that disagreed with the app's config. - The live drift test accepts "Individuality" for the People role (previewnet's People chain calls itself "Individuality Local"); it now passes for all six roles. - SPEC.md: previewnet endpoint table (pinned by the genesis-table test for every preset), register-name section, env/override wording; README: register-name, previewnet, HOST_CLI_* env vars. - Doc comments still describing usernames as People-chain Resources.Consumers reads now name the dotNS contracts on Asset Hub (regenerated Swift bindings and codegen golden follow).
…warm-path reads Ignored network tests against paseo-next-v2 Asset Hub: the live AsDotnsGatewayInfo::RegisterFullName shape (4 fields) the host asserts before signing, and the full dotNS resolution chain (pallet storage → dispatcher TARGET() → controller → registry → store factory → LabelStore) for an account with a settled store, proving the TLD is stripped and paging covers the store. Same rationale as the PGAS live tests: a fixture is a snapshot.
is_person_label in paritytech/individuality (support/src/labels.rs) accepts lowercase ASCII letters only, no digits or hyphens; the register-name pre-check now enforces the same instead of a looser DNS-label rule.
The paseo-next-v2 identity backend answers POST /usernames with "dotNS gateway is not enabled in this environment" (verified live), and since usernames are now read only from dotNS on Asset Hub, accounts registered through such a backend can never resolve one. Say so, and point at the previewnet preset / HOST_CLI_IDENTITY_BACKEND_BASE.
This was referenced Aug 17, 2026
…already minted Review on #349 (re-gius) and paritytech/dotns#235: the gateway enqueues a reservation for a reserved_base_label without asking the registrar, so a reservation over a registered name can never be claimed and holds the whole stem's reservation queue for the reservation window. The contract-side guard lands in dotns; the client asks first so an attestation cannot fail as a whole (and lose the lite name) once that guard exists. label_available reads DotnsRegistrar.available(uint256(node)) for the label's node under the network tldNode(), through the same transport as the username reads. attest() checks the reserved base name (shape per the pallet's is_valid_person, then availability); register-name checks its label. Live test on paseo: a minted name reports unavailable, an unminted one available.
…tNS registries
Previewnet's DotnsProtocolRegistry predates the configurable TLD (dotns
b4096968) and has no tld()/tldNode(); its TLD is ".dot". Username reads
of a settled LabelStore and the registrar availability check therefore
reverted there. network_tld() reads tld() and falls back to ".dot" when the
view reverts; the TLD node is derived locally (namehash) instead of read.
Live: settled-store labels and available() resolve on both paseo-next-v2
(".paseo") and previewnet (".dot"). The live tests take LIVE_ASSET_HUB_WS,
LIVE_MINTED_LABEL and LIVE_TLD to point at another network.
filip-parity
requested review from
GHkrishna,
Zebedeusz,
re-gius and
sphamjoli
August 17, 2026 11:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Rebase of #349 ("Person's usernames - read from AH dotNS instead of PC", by @Zebedeusz — kept as the first commit) onto
main, with the review fixes on top. Tracks #397; the client half of paritytech/individuality#755 and paritytech/dotns#230.What the host does after this PR
Usernames come from the dotNS contracts on Asset Hub, not the People Chain.
host_logic::dotns_gatewayholds the resolution steps once, over a two-method transport (storage,view=ReviveApi_calldry-run from the always-mappedVIEW_CALL_ORIGIN); the CLI drives it over plain RPC (dotns_read.rs) and the in-core runtime over onechainHead_v1follow opened with runtime (runtime/identity.rs). Every session-identity site (pairing_host.rs,sso_pairing.rs) resolves against the Asset Hub genesis;host_logic/identity.rs(People-chainResources.Consumers) is gone.Resolution:
DotnsGateway.DispatcherAddress→RootGatewayDispatcher.TARGET()→DotnsPopController→pendingClaims(user)(gateway-minted names not yet settled byclaimLabelStore) merged with the user'sLabelStorelabels viaprotocolRegistry()→get(storeFactory)→getLabelStore(user)→ pagedgetLabels. Store labels carry the network TLD (protocolRegistry.tld(),.paseoon paseo-next-v2); it is stripped and subnames are dropped.classify_labelsre-dots flat lite labels (alice01→alice.01, perStringUtils.isSingleDotLiteLabel) and treats the rest as full names.HOST_CLI_DOTNS_POP_CONTROLLERoverrides discovery when needed.register-name(CLI) registers a full-person username throughDotnsGateway.register_name: reads the People-collection ring index, members and root revision at one pinned People block, waits for Asset Hub'smembers-subscriberto hold that revision, then submits a General (v5) extrinsic authorized byAsDotnsGateway=RegisterFullName { proof, ring_index, revision, signature }(shape asserted from metadata before signing) withRestrictOrigins(true);Link::LiteUsername(default: the account's own lite name from dotNS) orLink::None(chat_key). Labels are validated with the pallet's rules ([a-z]+, ≤32 bytes; litestem.NN) up front.Configuration: every host config carries the Asset Hub genesis —
PairingHostConfig/SigningHostConfig,NativeRuntimeConfig/NativeHostRuntimeConfig(uniffi, Swift/Kotlin wrappers), wasmruntimeConfig.assetHub.genesisHash(required), JS types. Presets:paseo-next-v2andpreviewnet(own People/Bulletin/Asset Hub and identity backend), documented in SPEC §14.1 and pinned by the genesis-table test;HOST_CLI_IDENTITY_BACKEND_BASE/_TOKENoverride the backend.statement_allowancering/root helpers take a collection identifier (LitePeople wrappers unchanged; PGAS and allowance paths untouched).Verified
cargo build/test --workspace --all-features(812 tests), wasm32 check,fmt,clippy -D warnings, iOS bindings--check, codegen no drift.202→ name visible through dotNS/Asset Hub → ring onboarding → paired);identity-checkresolves it; pairing-host ⇄ signing-host SSO withgetUserIdresolved in-core from Asset Hub.identity-checkcold path; ignored live tests for theRegisterFullNameshape and for a settled store (TLD stripped, ~90 labels paged); the ignored preset-genesis test passes for all six roles.Link, proof message,DOTNS_GATEWAY_CONTEXT,RegisterFullNameand the label rules matchpallets/dotns-gatewayon paritytech/individualitymain; contract selectors and ABI shapes match paritytech/dotnsmaster.Review pointers
The commits after the first one are the review fixes, each with its rationale in the message: in-core follow with runtime (plus a scripted chainHead test), TLD/pending-claim/paging handling,
RegisterFullName.revision+ refreshed V16 fixture, previewnet Bulletin, docs.Known, outside this PR
POST /usernameswith "dotNS gateway is not enabled in this environment", so accounts registered through it cannot get a dotNS-readable username; the CLI says so and points at previewnet.hosts/dotlimust sendruntimeConfig.assetHub.genesisHash(required by the wasm host config) — companion change in dotli-community.claimLabelStoreis user-signed from the user's own funded H160 and stays outside the host; pending claims expire after 7 days (dotns side).