Skip to content

feat: migrate to the new playground-registry + identity-spine contracts - #484

Open
ReinhardHatko wants to merge 1 commit into
mainfrom
rh/registry-identity-spine
Open

ReinhardHatko wants to merge 1 commit into
mainfrom
rh/registry-identity-spine

Conversation

@ReinhardHatko

Copy link
Copy Markdown
Collaborator

Migrates the CLI onto the migrated playground-registry and the new global @w3s/playground-identity spine (the pvm-contract-sdk port, playground-app rh/cdm-migration-contracts). Companion to the contract migration handoff doc; must ship in lockstep with the contract deploy + CDM publish (see rollout notes below).

Contract model changes

  • publish / publishDev are separate methods again. publishDev (6 args) is authorized on-chain by env::caller() matching one of the registry's compiled-in dev signers and is exempt from the reveal gate. publish (7 args) is gated fail-closed by require_revealed() — the caller must be verified in the identity spine — and its trailing is_dev_signer boolean is ignored (kept for ABI compatibility, always passed false).
  • Routing keys on the signer's on-chain identity, not --suri provenance (signerMode.ts::isKnownDevPublishSigner, applied in BOTH publish pipelines — deploy and decentralize). An arbitrary --suri key (e.g. the dedicated e2e deployer) publishes as a reveal-gated user; routing it through publishDev would revert Unauthorized.
  • owner is a plain Address (no Option SolType); the zero address is the "none" sentinel (shared ZERO_H160 constant). The override is honored only on publishDevpublishToPlayground now rejects claimedOwnerH160 without isDevSigner before the metadata upload instead of letting the chain revert OwnerOverrideForbidden after it.
  • String reads return "" as the none/tombstone sentinel (no more { isSome, value }). Decoded in one place — registry.ts::queryMetadataUri — with a runtime ABI-drift guard, consumed by mod, SetupScreen, the e2e fixture, and the fixture tool.

Identity gate

  • The builder-identity gate now reads spine.isVerified(productH160) — the exact predicate the on-chain publish gate delegates to (the migrated registry no longer exposes get_root_account).
  • Contract resolution is split: registry-only / identity-only / both (getReadOnlyRegistryContract / getReadOnlyIdentityContract / getReadOnlyPlaygroundContracts), so pure registry reads (mod browse, e2e fixtures, operator tools) are not coupled to spine availability in the meta-registry.
  • Deterministic ABI drift (non-boolean isVerified response) fails fast to the soft unverifiable outcome instead of burning the retry budget.
  • Known limitation (documented, deliberately not changed here): in --suri mode the gate checks the session's H160 while the chain checks the suri key's H160 — a product-behavior decision tracked separately.

UX

  • NotRevealed and Unauthorized reverts surface actionable remedies keyed on the decoded revert reason (with a substring fallback for TxDispatchError-shaped reverts), instead of an opaque failure at the last step of a deploy.

Rollout — read before merging

  1. The CLI resolves contract addresses live from the CDM meta-registry but bundles the ABI from cdm.json. The committed cdm.json was spliced from the contract build artifacts ahead of the deploy; once the migrated contracts are published to CDM, refresh it with cdm i (fixes the placeholder version/address metadata on the identity entry).
  2. The moment the meta-registry's latest flips to the new registry, older CLI releases break (old ABI against new contract) — release this the same day.
  3. The e2e deployer must be seeded once in the spine (admin_set_identity) or every publish e2e leg reverts NotRevealed — documented in docs/e2e-bootstrap.md, including re-seeding after a spine redeploy.
  4. Deploy order per the handoff: spine → registry → seed identities → set_verifier(spine) → import state → publish to CDM → smoke test (publishDev without reveal succeeds; scored publish from a seeded account succeeds; unrevealed account reverts NotRevealed).

Verification

  • pnpm format:check, pnpm lint:license, pnpm typecheck (both with and without the local .cdm augmentation — the CI condition), pnpm test (1006/1006).
  • Reviewed via a 10-angle multi-agent code review; all confirmed findings fixed or documented (the --suri gate mismatch above is the one deferred decision).

The registry was ported onto pvm-contract-sdk with identity split out
into a global @w3s/playground-identity spine, changing the ABI shapes
and the publish authorization model:

- publish/publishDev are separate methods again: publishDev (6 args) is
  authorized by env::caller() matching a compiled-in dev signer and is
  exempt from the reveal gate; publish is gated FAIL-CLOSED by
  require_revealed() and ignores its trailing is_dev_signer flag.
  Routing keys on the signer's H160 (isKnownDevPublishSigner), not on
  --suri provenance, in BOTH publish pipelines (deploy + decentralize),
  so arbitrary suri keys (e.g. the e2e deployer) publish as
  reveal-gated users.
- The owner arg is a plain Address (zero = none; shared ZERO_H160
  constant) — Option is not a SolType. The override is honored only on
  publishDev; publishToPlayground rejects claimedOwnerH160 without
  isDevSigner before any on-chain work. String reads return "" as the
  none sentinel, decoded in one place (queryMetadataUri, with an
  ABI-drift guard).
- The builder-identity gate reads spine.isVerified(productH160) via a
  dedicated identity-only resolution (registry-only reads stay
  decoupled from spine availability); deterministic ABI drift fails
  fast instead of burning the retry budget.
- NotRevealed/Unauthorized reverts surface actionable remedies keyed
  on the decoded revert reason.

cdm.json carries the new ABIs (spliced from the contract build
artifacts); refresh with `cdm i` once the migrated contracts are
deployed and published to CDM — this must ship in lockstep with that
deploy. The e2e deployer must be seeded in the spine
(admin_set_identity) before the publish e2e legs can pass; documented
in docs/e2e-bootstrap.md.
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/rh/registry-identity-spine bash

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: rh/registry-identity-spine · Commit: e17118f · Run logs

Cell Result Time
pr-login-session ❌ FAIL 5m05s
pr-mod ❌ FAIL 2m28s
pr-deploy-foundry ✅ PASS 0m51s
pr-install ✅ PASS 0m55s
pr-deploy-cdm ✅ PASS 3m27s
pr-preflight ❌ FAIL 3m19s
pr-deploy-frontend ❌ FAIL 3m01s
${{ matrix.cell }} ⏭️ SKIP 0m00s
${{ matrix.cell }} ⏭️ SKIP 0m00s

Sentry traces: view spans for this run

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.

1 participant