Skip to content

fix(deploy): correct re-deploy preflight ownership reference in dev mode#33

Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom
fix/redeploy-owner-mismatch
Apr 20, 2026
Merged

fix(deploy): correct re-deploy preflight ownership reference in dev mode#33
UtkarshBhardwaj007 merged 1 commit intomainfrom
fix/redeploy-owner-mismatch

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

@UtkarshBhardwaj007 UtkarshBhardwaj007 commented Apr 20, 2026

Summary

  • In dev mode bulletin-deploy signs the DotNS register() extrinsic with its built-in DEFAULT_MNEMONIC, so previously-deployed domains are owned by the dev account's H160 (0x35Cdb…) — not the user.
  • The availability preflight was passing userSigner?.address as the ownership reference regardless of signer mode. When a user had both a dot init phone session AND was deploying via --signer dev, their phone H160 ≠ dev H160, so the preflight reported the re-deploy as taken by <dev H160> and blocked the deploy.
  • Fix: only pass ownerSs58Address when mode === "phone". In dev mode we skip the preflight ownership check; bulletin-deploy's own preflight (run with the right signer during deploy()) handles the re-deploy/update path correctly.

Note: the casing mismatch visible in the error line was unrelated — bulletin-deploy already does owner.toLowerCase() === checkAddress.toLowerCase() in checkOwnership. The H160 Address: line logged at the top of the screenshot is from bulletin-deploy's own dotns.connect() falling back to DEFAULT_MNEMONIC (since the preflight doesn't pass a signer), which is why it matches the "registered by" address.

Test plan

  • pnpm vitest run src/utils/deploy/availability.test.ts — existing 13 tests pass (the "skips the ownership check when no SS58 address is provided" case is the contract we now rely on in dev mode).
  • pnpm tsc --noEmit clean.
  • Manual: with a dot init phone session active, run dot deploy twice against the same name using --signer dev — second run should proceed rather than report "already registered".
  • Manual: with a phone session, dot deploy --signer phone twice — second run still shows "Already owned by you — will update the existing deployment." (unchanged behaviour).

…e mode

In dev mode bulletin-deploy signs DotNS with its built-in DEFAULT_MNEMONIC,
so the on-chain owner of a previously-deployed domain is the dev account,
not the user. Passing `userSigner.address` as the ownership reference made
the preflight mis-report re-deploys as `taken by <dev H160>` whenever the
user also had a `dot init` phone session.

Gate `ownerSs58Address` on `mode === "phone"` at both call sites. In dev
mode we skip the preflight ownership check entirely and let bulletin-deploy's
own preflight (run with the right signer during `deploy()`) classify the
re-deploy. The apparent casing mismatch in the error was unrelated —
bulletin-deploy already does a case-insensitive owner compare.
@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/fix/redeploy-owner-mismatch bash

@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit ac9c309 into main Apr 20, 2026
5 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the fix/redeploy-owner-mismatch branch April 20, 2026 20:23
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