From dff0e2ff68c6032fbaa42cb1f31e353ffbcbb5ad Mon Sep 17 00:00:00 2001 From: Filip Baciu Date: Sun, 13 Sep 2026 04:21:50 +0300 Subject: [PATCH] fix(cli): supply the persist field on subname registration and sync the v0.7.0 ABIs The v0.7.0 registry's SubnodeRecord carries a persist flag deciding whether the subname is indexed into the owner's LabelStore. The CLI never set it: released 0.9.1 fails at encoding (its build-time ABI has the field), and the committed v0.6.0 ABIs miss the new selector entirely. registerSubnode now persists by default with --no-persist to opt out, and the committed ABIs move to the v0.7.0 release, matching the deployed reference chain. Verified on paseo-v2 (v0.7.0): register subname completes and the name resolves with its owner; 0.9.1 fails with 'Invalid boolean value'. Fixes the issuance half of paritytech/dotns#285 (the lite-read half shipped in 0.9.1). --- packages/cli/abis/DotnsContentResolver.json | 5 +++ packages/cli/abis/DotnsNameEscrow.json | 5 +++ packages/cli/abis/DotnsNameWhitelist.json | 5 +++ packages/cli/abis/DotnsPopController.json | 15 +++++++++ packages/cli/abis/DotnsRegistrar.json | 26 ++++++++++++++++ .../cli/abis/DotnsRegistrarController.json | 26 ++++++++++++++++ packages/cli/abis/DotnsRegistry.json | 31 +++++++++++++++++++ packages/cli/abis/DotnsResolver.json | 5 +++ packages/cli/abis/DotnsReverseResolver.json | 7 ++++- packages/cli/abis/PopRules.json | 5 +++ packages/cli/package.json | 2 +- packages/cli/src/cli/commands/register.ts | 6 +++- .../cli/src/cli/commands/registerCommand.ts | 1 + packages/cli/src/commands/register.ts | 9 ++++++ packages/cli/src/types/types.ts | 4 +++ 15 files changed, 149 insertions(+), 3 deletions(-) diff --git a/packages/cli/abis/DotnsContentResolver.json b/packages/cli/abis/DotnsContentResolver.json index 11dbf435..97b37dde 100644 --- a/packages/cli/abis/DotnsContentResolver.json +++ b/packages/cli/abis/DotnsContentResolver.json @@ -40,6 +40,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", diff --git a/packages/cli/abis/DotnsNameEscrow.json b/packages/cli/abis/DotnsNameEscrow.json index 4c56d3d2..b5b6fd8f 100644 --- a/packages/cli/abis/DotnsNameEscrow.json +++ b/packages/cli/abis/DotnsNameEscrow.json @@ -325,6 +325,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", diff --git a/packages/cli/abis/DotnsNameWhitelist.json b/packages/cli/abis/DotnsNameWhitelist.json index d77bb1c7..bb2c0c5d 100644 --- a/packages/cli/abis/DotnsNameWhitelist.json +++ b/packages/cli/abis/DotnsNameWhitelist.json @@ -238,6 +238,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", diff --git a/packages/cli/abis/DotnsPopController.json b/packages/cli/abis/DotnsPopController.json index b42909a1..f39f3fb5 100644 --- a/packages/cli/abis/DotnsPopController.json +++ b/packages/cli/abis/DotnsPopController.json @@ -73,6 +73,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", @@ -1061,6 +1066,11 @@ } ] }, + { + "type": "error", + "name": "LiteNameAlreadyIssued", + "inputs": [] + }, { "type": "error", "name": "NoActiveReservation", @@ -1072,6 +1082,11 @@ } ] }, + { + "type": "error", + "name": "NotAuthorised", + "inputs": [] + }, { "type": "error", "name": "NotHolder", diff --git a/packages/cli/abis/DotnsRegistrar.json b/packages/cli/abis/DotnsRegistrar.json index 445aad40..d01e1c7a 100644 --- a/packages/cli/abis/DotnsRegistrar.json +++ b/packages/cli/abis/DotnsRegistrar.json @@ -147,6 +147,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "name", "type": "string", @@ -879,6 +884,27 @@ "name": "InvalidOwner", "inputs": [] }, + { + "type": "error", + "name": "LabelEntryConflict", + "inputs": [ + { + "name": "store", + "type": "address", + "internalType": "address" + }, + { + "name": "labelhash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "existing", + "type": "string", + "internalType": "string" + } + ] + }, { "type": "error", "name": "NameNotAvailable", diff --git a/packages/cli/abis/DotnsRegistrarController.json b/packages/cli/abis/DotnsRegistrarController.json index d2a0cc64..6b4c6d6c 100644 --- a/packages/cli/abis/DotnsRegistrarController.json +++ b/packages/cli/abis/DotnsRegistrarController.json @@ -104,6 +104,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", @@ -629,6 +634,27 @@ "name": "InvalidLabel", "inputs": [] }, + { + "type": "error", + "name": "LabelEntryConflict", + "inputs": [ + { + "name": "store", + "type": "address", + "internalType": "address" + }, + { + "name": "labelhash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "existing", + "type": "string", + "internalType": "string" + } + ] + }, { "type": "error", "name": "LabelTooShort", diff --git a/packages/cli/abis/DotnsRegistry.json b/packages/cli/abis/DotnsRegistry.json index 46a9ec9f..c00faea7 100644 --- a/packages/cli/abis/DotnsRegistry.json +++ b/packages/cli/abis/DotnsRegistry.json @@ -21,6 +21,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", @@ -221,6 +226,11 @@ "name": "owner", "type": "address", "internalType": "address" + }, + { + "name": "persist", + "type": "bool", + "internalType": "bool" } ] } @@ -463,6 +473,27 @@ "name": "InvalidLabel", "inputs": [] }, + { + "type": "error", + "name": "LabelEntryConflict", + "inputs": [ + { + "name": "store", + "type": "address", + "internalType": "address" + }, + { + "name": "labelhash", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "existing", + "type": "string", + "internalType": "string" + } + ] + }, { "type": "error", "name": "NodeAlreadyOwned", diff --git a/packages/cli/abis/DotnsResolver.json b/packages/cli/abis/DotnsResolver.json index 37d55b4c..3f30d578 100644 --- a/packages/cli/abis/DotnsResolver.json +++ b/packages/cli/abis/DotnsResolver.json @@ -40,6 +40,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", diff --git a/packages/cli/abis/DotnsReverseResolver.json b/packages/cli/abis/DotnsReverseResolver.json index f3b92503..64e8cba5 100644 --- a/packages/cli/abis/DotnsReverseResolver.json +++ b/packages/cli/abis/DotnsReverseResolver.json @@ -34,6 +34,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", @@ -305,7 +310,7 @@ "internalType": "address" }, { - "name": "tokenId", + "name": "node", "type": "uint256", "internalType": "uint256" } diff --git a/packages/cli/abis/PopRules.json b/packages/cli/abis/PopRules.json index a304c4d6..6e3ccb1e 100644 --- a/packages/cli/abis/PopRules.json +++ b/packages/cli/abis/PopRules.json @@ -82,6 +82,11 @@ "type": "function", "name": "initialize", "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + }, { "name": "registry", "type": "address", diff --git a/packages/cli/package.json b/packages/cli/package.json index cd03b9bb..f1d6c562 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@parity/dotns-cli", "module": "index.ts", - "version": "0.9.1", + "version": "0.9.2", "type": "module", "private": true, "license": "MIT", diff --git a/packages/cli/src/cli/commands/register.ts b/packages/cli/src/cli/commands/register.ts index 40f5cb4e..7ea3b76d 100644 --- a/packages/cli/src/cli/commands/register.ts +++ b/packages/cli/src/cli/commands/register.ts @@ -120,6 +120,8 @@ function printRegistrationResult(result: RegistrationResult): void { export type TransferDestinationKind = "evm" | "substrate" | "label"; export type RegisterActionOptions = RegistrationCommandOptions & { + /** Subname registration: index into the owner's Label Store (default true). */ + persist?: boolean; transfer?: boolean; to?: string; parent?: string; @@ -380,7 +382,9 @@ export async function executeSubnameRegistration( console.log(chalk.gray(" Owner: ") + chalk.white(ownerAddress)); const result = await step("Registering subname", async () => - registerSubnode(session.ctx, sublabel, parentLabel, ownerAddress), + registerSubnode(session.ctx, sublabel, parentLabel, ownerAddress, { + persist: options.persist !== false, + }), ); console.log(chalk.gray(" tx: ") + chalk.blue(result.txHash)); diff --git a/packages/cli/src/cli/commands/registerCommand.ts b/packages/cli/src/cli/commands/registerCommand.ts index dfe6595a..65a944a7 100644 --- a/packages/cli/src/cli/commands/registerCommand.ts +++ b/packages/cli/src/cli/commands/registerCommand.ts @@ -93,6 +93,7 @@ export function attachRegisterCommand(root: Command) { .requiredOption("-n, --name