fix(deploy): correct re-deploy preflight ownership reference in dev mode#33
Merged
UtkarshBhardwaj007 merged 1 commit intomainfrom Apr 20, 2026
Merged
Conversation
…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.
Contributor
|
Dev build ready — try this branch: |
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.
Summary
register()extrinsic with its built-inDEFAULT_MNEMONIC, so previously-deployed domains are owned by the dev account's H160 (0x35Cdb…) — not the user.userSigner?.addressas the ownership reference regardless of signer mode. When a user had both adot initphone session AND was deploying via--signer dev, their phone H160 ≠ dev H160, so the preflight reported the re-deploy astaken by <dev H160>and blocked the deploy.ownerSs58Addresswhenmode === "phone". In dev mode we skip the preflight ownership check; bulletin-deploy's own preflight (run with the right signer duringdeploy()) 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()incheckOwnership. TheH160 Address:line logged at the top of the screenshot is from bulletin-deploy's owndotns.connect()falling back toDEFAULT_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 --noEmitclean.dot initphone session active, rundot deploytwice against the same name using--signer dev— second run should proceed rather than report "already registered".dot deploy --signer phonetwice — second run still shows "Already owned by you — will update the existing deployment." (unchanged behaviour).