Skip to content

feat(deploy): zero-tap dev-mode playground publish#193

Open
UtkarshBhardwaj007 wants to merge 1 commit into
mainfrom
feat/dev-publish-zero-taps
Open

feat(deploy): zero-tap dev-mode playground publish#193
UtkarshBhardwaj007 wants to merge 1 commit into
mainfrom
feat/dev-publish-zero-taps

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • dot deploy --signer dev --playground now requires zero phone taps when a phone session is active. Every on-chain step — Bulletin storage, DotNS register/setContenthash, and registry publish — is signed by a synthesised dev signer derived from bulletin-deploy's DEFAULT_MNEMONIC bare-root account (5DfhGyQd…). The user's session H160 is passed as the registry contract's new owner parameter, so their app still appears in MyApps even though Alice signed the tx.
  • resolveSignerSetup reshape: dev+session → synthesised Alice publishes with claimedOwnerH160 = session.addresses.productH160. dev+--suri → SURI signer publishes as itself. dev+nothing → Alice publishes + owns; stderr warning + telemetry tag fire (covers the "forgot dot init" footgun). Phone mode unchanged.
  • Sign-event proxy is now skipped when publishSigner.source === "dev" so the "check your phone" callout doesn't flash for in-process Alice signing.
  • Summary card surfaces both the actual signer (Alice's SS58) AND a new "App owner" row showing the user's H160, in both TUI and headless paths.
  • ResolvedSigner gains an optional addresses field forwarded from SessionHandle. Regression test pins the forwarding so a refactor can't silently drop it.
  • New signerModeAlice.test.ts snapshot pins three independent equivalences: signerMode's publish address, bulletin-deploy's bare-root, and the canonical SS58 literal. Catches both upstream churn and a CLI-side revert to createDevSigner("Alice") (which would be Substrate //Alice = 5Grwva…, a different account).

Pairs with playground-app#193 — the contract change that adds the 4th Option<Address> owner arg to publish() and the publisher field on AppInfo. Must merge + redeploy first; this CLI change calls registry.publish(domain, cid, vis, owner) with the 4-arg signature.

Changeset: playground-cli: minor. CLAUDE.md updated in two places (Deploy/Bulletin invariants).

Behaviour matrix

--signer --suri session Bulletin storage / DotNS signer Registry publish signer Recorded as owner Phone taps
phone yes session session session H160 3 (DotNS) + 1 (publish) = 4
dev yes * SURI SURI SURI H160 0
dev yes Alice (bulletin-deploy default) Alice (synthesised) session H160 (claimed) 0
dev no Alice Alice Alice H160 0 (with stderr warning)

Test plan

  • pnpm test — 555 passing locally (2 new — signer.test.ts addresses forwarding, signerModeAlice.test.ts snapshot).
  • pnpm format:check, pnpm lint:license, pnpm build — green.
  • After playground-app#193 merges and the registry is redeployed:
    • dot deploy --signer dev --playground --suri //Alice against Paseo Next v2 — expect zero phone taps, getOwner(domain.dot) returns SURI account's H160. E2E test frontend-only deploy completes end-to-end covers this.
    • dot deploy --signer dev --playground with an active dot init session — manual smoke. Expect zero phone taps, app appears in MyApps under the user's account on the phone.
    • dot deploy --signer dev --playground with NO session and NO --suri — stderr warning fires, app is published under Alice; verify via getOwner.
    • dot deploy --signer phone --playground — unchanged behaviour, 4 taps.
  • Re-deploy from dev mode of a previously-dev-published app — expect success (publisher branch of is_authorized_to_republish).
  • Re-deploy from dev mode of a previously-phone-published app — expect Unauthorized revert (intentional asymmetric lock-in; documented in the contract and CLAUDE.md).

Notes / deferred

  • E2E coverage of the dev+session+claimed-owner flow needs SSO session mocking infrastructure; a placeholder .skip test is in place with a clear comment pointing at unit-level coverage (run.test.ts).
  • Five .skip-gated write-test stubs added to the contract suite in playground-app#193 to document the on-chain assertions for when the local-target wiring lands.
  • Mainnet allowlist on the owner parameter is deferred — testnet-only relaxation per spec.

`dot deploy --signer dev --playground` now requires zero phone taps
when a phone session is active. Every on-chain step (storage, DotNS,
registry publish) is signed by a synthesised dev signer derived from
bulletin-deploy's DEFAULT_MNEMONIC bare-root account; the user's
session H160 is passed as the registry contract's new `owner` arg so
their app still appears in MyApps.

`resolveSignerSetup` reshape:
  - dev + session: publishSigner = synthesised Alice (source `dev`),
    claimedOwnerH160 = session.addresses.productH160. No phone tap.
  - dev + `--suri`: publishSigner = SURI signer. SURI account is
    recorded as owner; claimedOwnerH160 stays null.
  - dev + nothing: publishSigner = synthesised Alice; Alice owns.
    stderr warning + telemetry tag surfaced — "forgot dot init" case.
  - phone: unchanged.

Sign-event proxy now skipped when publishSigner.source === `dev`, so
the "check your phone" callout doesn't flash for in-process Alice
signing. Summary card gains an "App owner" row when claimedOwnerH160
is set. Both the TUI and headless code paths source the signer row
from setup.publishSigner.address so dev+session shows Alice, not a
blank.

`ResolvedSigner` gains an optional `addresses` field forwarded from
SessionHandle so signerMode can read the user's productH160 without
re-deriving from the raw session. Snapshot test pins the dev-publish
address against the canonical bulletin-deploy bare-root SS58.

Pairs with playground-app feat/registry-claimed-owner (the new 4-arg
`publish(domain, metadata_uri, visibility, owner)`). Requires that
contract to be redeployed on Paseo Next v2 before this can run end-
to-end against the live network.
@github-actions
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/feat/dev-publish-zero-taps bash

@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Pass · ❌ FAIL

Tag: e2e-ci-pr · Branch: feat/dev-publish-zero-taps · Commit: 89be87d · Run logs

Cell Result Time
pr-mod ✅ PASS 1m28s
pr-preflight ✅ PASS 2m02s
pr-deploy-foundry ❌ FAIL 3m35s
pr-init-session ✅ PASS 1m51s
pr-deploy-frontend ❌ FAIL 7m30s
pr-deploy-cdm ❌ FAIL 5m43s
pr-install ✅ PASS 1m24s
${{ matrix.cell }} ⏭️ SKIP 0m-1s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

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