bulletin-deploy 0.17.1 → 0.18.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +5 -6
  2. package/assets/environments.json +0 -3
  3. package/dist/auth-config.js +4 -4
  4. package/dist/bug-report.js +4 -4
  5. package/dist/chain-health.js +3 -3
  6. package/dist/{chunk-AVK74F4Y.js → chunk-3TNM2EMS.js} +4 -4
  7. package/dist/{chunk-JB4OIM7X.js → chunk-46WB256R.js} +13 -13
  8. package/dist/{chunk-X4IXDGEY.js → chunk-7I3MTGOR.js} +43 -15
  9. package/dist/{chunk-5P2IARIJ.js → chunk-EJO2NP7X.js} +80 -37
  10. package/dist/{chunk-S7OW6CYF.js → chunk-ESBF6QTE.js} +1 -1
  11. package/dist/{chunk-6ZOTJHVI.js → chunk-HDGD5FYX.js} +0 -3
  12. package/dist/{chunk-JQZDP2TS.js → chunk-KZ7CW4IQ.js} +2 -2
  13. package/dist/{chunk-SCLX3WSE.js → chunk-L7MA5DA3.js} +1 -1
  14. package/dist/{chunk-6GLMR2T2.js → chunk-NCN7SLIE.js} +2 -2
  15. package/dist/{chunk-6FNOSDZU.js → chunk-PJ75CY6I.js} +3 -3
  16. package/dist/{chunk-YVHS6WA3.js → chunk-PXLB7TU7.js} +2 -2
  17. package/dist/{chunk-VRHVH6RM.js → chunk-THLTNP6Q.js} +1 -1
  18. package/dist/{chunk-T6HNSBZD.js → chunk-TUEKXRRI.js} +1 -1
  19. package/dist/{chunk-63EPGOEW.js → chunk-YL5EFGBR.js} +1 -1
  20. package/dist/chunk-probe.js +3 -3
  21. package/dist/commands/login.js +13 -13
  22. package/dist/commands/logout.js +5 -5
  23. package/dist/commands/transfer.js +6 -6
  24. package/dist/commands/whoami.js +4 -4
  25. package/dist/deploy-actors.js +8 -8
  26. package/dist/deploy.d.ts +2 -2
  27. package/dist/deploy.js +13 -13
  28. package/dist/dotns-protocol.d.ts +69 -4
  29. package/dist/dotns-protocol.js +5 -1
  30. package/dist/dotns.d.ts +18 -4
  31. package/dist/dotns.js +8 -6
  32. package/dist/environments.js +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +14 -14
  35. package/dist/manifest/publish.js +14 -14
  36. package/dist/memory-report.js +2 -2
  37. package/dist/merkle.js +13 -13
  38. package/dist/personhood/bootstrap.js +6 -6
  39. package/dist/personhood/people-client.js +6 -6
  40. package/dist/run-state.js +1 -1
  41. package/dist/sss-allowance-cache.js +5 -5
  42. package/dist/storage-signer.js +13 -13
  43. package/dist/telemetry.js +2 -2
  44. package/dist/version-check.js +3 -3
  45. package/package.json +2 -2
package/README.md CHANGED
@@ -79,17 +79,16 @@ Subcommands: `login`, `logout`, `whoami` (session management, above) and `transf
79
79
 
80
80
  ## Naming
81
81
 
82
- A DotNS label is 3-63 lowercase letters, digits, and hyphens, and it must satisfy the on-chain registration rules (PopRules) to be self-registrable:
82
+ A DotNS label is 3-63 lowercase letters, digits, and hyphens, and it must satisfy the on-chain registration rules (PopRules) to be self-registrable. **The exact rules differ by DotNS generation** — trailing-digit handling and how the base length gets measured both vary — and bulletin-deploy detects which generation the connected chain is running and applies the right one automatically; a label that only satisfies one generation will break the moment it deploys to another.
83
83
 
84
- - **Trailing digits:** the label's trailing digit run must be exactly **0 or 2** digits. `myapp1` (one trailing digit) is rejected; `myapp01` or `myapp` both work.
85
- - **Base length:** the label minus its trailing digit run must be **more than 5 characters**. Shorter base names are reserved for governance.
84
+ If a name violates the connected generation's rules, the deploy fails with a message that offers a compliant alternative derived from your own input — no name gets silently substituted.
86
85
 
87
- If a name violates either rule, the deploy fails with a message that offers a compliant alternative derived from your own input — no name gets silently substituted.
86
+ **The one rule that's safe everywhere:** keep the label's trailing digit run to exactly 0 or 2 digits, and keep the base (measured with that trailing run stripped) at **9 characters or more**. `myapp-preview07` — base `myapp-preview` at 13 chars — is `NoStatus` (self-registrable by anyone) on every generation. A shorter base isn't: `myapp-pr07` has an 8-char base (`myapp-pr`) on older DotNS generations, so it lands in the 6-8 band that demands proof of personhood — most callers don't have it, so the deploy fails — even though the same label measures 10 characters as written and clears the newest generation outright.
88
87
 
89
- **PR-preview labels** are the case this trips up most often: a bare PR number gives exactly one trailing digit for PRs 1-9 (`myapp-pr7`), which always fails. Zero-pad the PR number instead — `myapp-pr07` — so it stays valid across the full PR range:
88
+ **PR-preview labels** are the case this trips up most often: a bare PR number gives exactly one trailing digit for PRs 1-9 (`myapp-pr7`), which older DotNS generations reject outright. Zero-padding alone isn't enough — `myapp-pr07` still fails on those same generations for the reason above. Pad the number **and** use a prefix long enough to clear the 9-character base:
90
89
 
91
90
  ```sh
92
- bulletin-deploy ./dist "myapp-pr$(printf '%02d' "$PR_NUMBER")"
91
+ bulletin-deploy ./dist "myapp-preview$(printf '%02d' "$PR_NUMBER")"
93
92
  ```
94
93
 
95
94
  ## Environments
@@ -55,7 +55,6 @@
55
55
  "DOTNS_REGISTRAR_CONTROLLER": "0x35f8594c8e68a0ad079bca5f72bf6c9560ac22b0",
56
56
  "DOTNS_REGISTRY": "0x64e619ea4d8a593c68533c0feaf3e36d3666495b",
57
57
  "DOTNS_POP_CONTROLLER": "0xb0dd60b3da4a563cdc8aa78ec9d5b169f81046f1",
58
- "ROOT_GATEWAY_DISPATCHER": "0x2cedd39924d216b4a49f4c532e03fe79d006e89e",
59
58
  "DOTNS_RESOLVER": "0x5296344ed752c19cdee2bb3e5e5b015ba69982c7",
60
59
  "DOTNS_CONTENT_RESOLVER": "0xa27c323a30c7ee1f0a7a35f48983d98d18c53445",
61
60
  "DOTNS_REVERSE_RESOLVER": "0x099b539bf034c741404d393ab95946e4923bc7ab",
@@ -124,7 +123,6 @@
124
123
  "DOTNS_REGISTRAR_CONTROLLER": "0xBdaA01bD1bA67d709F2b1fF286Da0d854977EA30",
125
124
  "DOTNS_REGISTRY": "0xf34054fd76BbF85f216cf9908226D5f0A72E50CA",
126
125
  "DOTNS_POP_CONTROLLER": "0xCC932348606cc1f3318cADeC5A5Cd2CA447f8a4b",
127
- "ROOT_GATEWAY_DISPATCHER": "0xa889CCA3Fb4B07b98a11cc54C10f13dDA20bc3db",
128
126
  "DOTNS_RESOLVER": "0xbd1165E549DF96F083c0A16f61590927bC187009",
129
127
  "DOTNS_CONTENT_RESOLVER": "0x7F74D7CD50f5a834270E2ad395a01b01891AB37d",
130
128
  "DOTNS_REVERSE_RESOLVER": "0xee3883d7eB60Ee9BCD7F3bcD8f2f05302A9Cc035",
@@ -154,7 +152,6 @@
154
152
  "DOTNS_REGISTRAR_CONTROLLER": "0x45fDEa4Ad7b8607Fc22DBC3DBE3cD8b350F8bede",
155
153
  "DOTNS_REGISTRY": "0x527b08a640b527a3dae0C4BE04D7344E430B6E50",
156
154
  "DOTNS_POP_CONTROLLER": "0x1884819F6747576883805Cb2b7BB68d29484d1b0",
157
- "ROOT_GATEWAY_DISPATCHER": "0x63d7F768e2B2Fa6A270E0fc7b93738a18cb8E73A",
158
155
  "DOTNS_RESOLVER": "0xC28796526Bf3E9295f09655a1001F30f77AfCF0D",
159
156
  "DOTNS_CONTENT_RESOLVER": "0x326bdE29315199c814B1c58b431D84D16EA5cE41",
160
157
  "DOTNS_REVERSE_RESOLVER": "0xfd2594FcF920B38A970011C486e1E3041563147F",
@@ -9,12 +9,12 @@ import {
9
9
  getPeopleChainEndpoints,
10
10
  hasPersistedSession,
11
11
  resolveBulletinEndpoints
12
- } from "./chunk-6GLMR2T2.js";
12
+ } from "./chunk-NCN7SLIE.js";
13
13
  import "./chunk-TSPERKUS.js";
14
- import "./chunk-6ZOTJHVI.js";
14
+ import "./chunk-HDGD5FYX.js";
15
15
  import "./chunk-ZOC4GITL.js";
16
- import "./chunk-S7OW6CYF.js";
17
- import "./chunk-YVHS6WA3.js";
16
+ import "./chunk-ESBF6QTE.js";
17
+ import "./chunk-PXLB7TU7.js";
18
18
  export {
19
19
  DOT_DAPP_ID,
20
20
  DOT_DERIVATION_INDEX,
@@ -10,10 +10,10 @@ import {
10
10
  offerBugReport,
11
11
  scrubSecrets,
12
12
  setDeployContext
13
- } from "./chunk-6FNOSDZU.js";
14
- import "./chunk-63EPGOEW.js";
15
- import "./chunk-S7OW6CYF.js";
16
- import "./chunk-YVHS6WA3.js";
13
+ } from "./chunk-PJ75CY6I.js";
14
+ import "./chunk-YL5EFGBR.js";
15
+ import "./chunk-ESBF6QTE.js";
16
+ import "./chunk-PXLB7TU7.js";
17
17
  export {
18
18
  buildCliFlagsSummary,
19
19
  buildLabels,
@@ -3,9 +3,9 @@ import {
3
3
  DEFAULT_WINDOW_BLOCKS,
4
4
  MAX_SPANS_PER_SAMPLER,
5
5
  endpointHost
6
- } from "./chunk-T6HNSBZD.js";
7
- import "./chunk-S7OW6CYF.js";
8
- import "./chunk-YVHS6WA3.js";
6
+ } from "./chunk-TUEKXRRI.js";
7
+ import "./chunk-ESBF6QTE.js";
8
+ import "./chunk-PXLB7TU7.js";
9
9
  export {
10
10
  ChainHealthSampler,
11
11
  DEFAULT_WINDOW_BLOCKS,
@@ -13,19 +13,19 @@ import {
13
13
  setBulletinEndpoints,
14
14
  storeDirectory,
15
15
  storeFile
16
- } from "./chunk-JB4OIM7X.js";
16
+ } from "./chunk-46WB256R.js";
17
17
  import {
18
18
  DEFAULT_TLD,
19
19
  DotNS,
20
20
  TX_KIND_SKIPPED,
21
21
  stripTldSuffix
22
- } from "./chunk-5P2IARIJ.js";
22
+ } from "./chunk-EJO2NP7X.js";
23
23
  import {
24
24
  DEFAULT_ENV_ID,
25
25
  getPopSelfServeConfig,
26
26
  loadEnvironments,
27
27
  resolveEndpoints
28
- } from "./chunk-6ZOTJHVI.js";
28
+ } from "./chunk-HDGD5FYX.js";
29
29
  import {
30
30
  NonRetryableError
31
31
  } from "./chunk-ZOC4GITL.js";
@@ -33,7 +33,7 @@ import {
33
33
  setDeployAttribute,
34
34
  withManifestSpan,
35
35
  withSpan
36
- } from "./chunk-S7OW6CYF.js";
36
+ } from "./chunk-ESBF6QTE.js";
37
37
 
38
38
  // src/manifest/publish.ts
39
39
  import * as fs2 from "fs/promises";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-M5AKL3FL.js";
4
4
  import {
5
5
  preflightSssAllowance
6
- } from "./chunk-VRHVH6RM.js";
6
+ } from "./chunk-THLTNP6Q.js";
7
7
  import {
8
8
  statementSigningAccount
9
9
  } from "./chunk-GRPLHUYC.js";
@@ -29,18 +29,18 @@ import {
29
29
  } from "./chunk-WPC2PUCV.js";
30
30
  import {
31
31
  setDeployContext
32
- } from "./chunk-6FNOSDZU.js";
32
+ } from "./chunk-PJ75CY6I.js";
33
33
  import {
34
34
  getBestBlockNumber,
35
35
  probeChunks,
36
36
  probeFinalityGap
37
- } from "./chunk-SCLX3WSE.js";
37
+ } from "./chunk-L7MA5DA3.js";
38
38
  import {
39
39
  packSection
40
40
  } from "./chunk-C2TS5MER.js";
41
41
  import {
42
42
  resolveStorageSigner
43
- } from "./chunk-JQZDP2TS.js";
43
+ } from "./chunk-KZ7CW4IQ.js";
44
44
  import {
45
45
  createSlotAccountSigner,
46
46
  requestResourceAllocation
@@ -55,7 +55,7 @@ import {
55
55
  parseDomainName,
56
56
  popStatusName,
57
57
  verifyNonceAdvanced
58
- } from "./chunk-5P2IARIJ.js";
58
+ } from "./chunk-EJO2NP7X.js";
59
59
  import {
60
60
  derivePoolAccounts,
61
61
  detectTestnet,
@@ -69,7 +69,7 @@ import {
69
69
  STALE_SESSION_MESSAGE,
70
70
  getPeopleChainEndpoints,
71
71
  hasPersistedSession
72
- } from "./chunk-6GLMR2T2.js";
72
+ } from "./chunk-NCN7SLIE.js";
73
73
  import {
74
74
  CLI_NAME
75
75
  } from "./chunk-TSPERKUS.js";
@@ -78,13 +78,13 @@ import {
78
78
  getPopSelfServeConfig,
79
79
  loadEnvironments,
80
80
  resolveEndpoints
81
- } from "./chunk-6ZOTJHVI.js";
81
+ } from "./chunk-HDGD5FYX.js";
82
82
  import {
83
83
  NonRetryableError
84
84
  } from "./chunk-ZOC4GITL.js";
85
85
  import {
86
86
  ChainHealthSampler
87
- } from "./chunk-T6HNSBZD.js";
87
+ } from "./chunk-TUEKXRRI.js";
88
88
  import {
89
89
  VERSION,
90
90
  captureWarning,
@@ -98,7 +98,7 @@ import {
98
98
  truncateAddress,
99
99
  withDeploySpan,
100
100
  withSpan
101
- } from "./chunk-S7OW6CYF.js";
101
+ } from "./chunk-ESBF6QTE.js";
102
102
 
103
103
  // src/merkle.ts
104
104
  import * as fs2 from "fs";
@@ -2024,7 +2024,7 @@ function assertSubdomainOwnerMatchesSigner(result, signerEvmAddress, sublabel, p
2024
2024
  );
2025
2025
  }
2026
2026
  }
2027
- function formatSubdomainParentError(fullName, parentLabel, parentOwner, selfAddress, tld = DEFAULT_TLD) {
2027
+ function formatSubdomainParentError(fullName, parentLabel, parentOwner, selfAddress, tld = DEFAULT_TLD, profile = "poprules-startingPrice") {
2028
2028
  if (parentOwner !== null) {
2029
2029
  const transferBullet = selfAddress ? ` - ask the ${parentOwner} account to hand the parent to this signer, run BY that account: ${CLI_NAME} transfer ${parentLabel}.${tld} --to ${selfAddress} --mnemonic <the ${parentOwner} account's key>
2030
2030
  ` : "";
@@ -2034,14 +2034,14 @@ function formatSubdomainParentError(fullName, parentLabel, parentOwner, selfAddr
2034
2034
  ` + (transferBullet ? `Either:
2035
2035
  ${transferBullet}${ownedParentBullet}` : ownedParentBullet);
2036
2036
  }
2037
- const registrability = classifyRegistrability(parentLabel);
2037
+ const registrability = classifyRegistrability(parentLabel, profile);
2038
2038
  if (registrability.registrable) {
2039
2039
  return `Cannot deploy ${fullName}: parent ${parentLabel}.${tld} is owned by no one, not by this signer.
2040
2040
 
2041
2041
  Register the parent with this signer first, then redeploy the subdomain unchanged:
2042
2042
  ${CLI_NAME} <build-dir> ${parentLabel}.${tld}`;
2043
2043
  }
2044
- return `Cannot deploy ${fullName}: parent ${formatUnregistrableReason({ label: parentLabel, registrability, existingOwner: null, selfAddress, tld })}`;
2044
+ return `Cannot deploy ${fullName}: parent ${formatUnregistrableReason({ label: parentLabel, registrability, existingOwner: null, selfAddress, tld, profile })}`;
2045
2045
  }
2046
2046
  function browserUrlFor(name, envId, webGateway) {
2047
2047
  const host = webGateway ?? "dot.li";
@@ -2299,7 +2299,7 @@ async function deploy(content, domainName = null, options = {}) {
2299
2299
  const { owned: parentOwned, owner: parentOwner } = await preflight.checkOwnership(parsed.parentLabel);
2300
2300
  if (!parentOwned) {
2301
2301
  throw new NonRetryableError(
2302
- formatSubdomainParentError(parsed.fullName, parsed.parentLabel, parentOwner ?? null, preflight.evmAddress ?? "", envTld)
2302
+ formatSubdomainParentError(parsed.fullName, parsed.parentLabel, parentOwner ?? null, preflight.evmAddress ?? "", envTld, preflight.protocolVersion)
2303
2303
  );
2304
2304
  }
2305
2305
  }
@@ -9,17 +9,22 @@ var DOTNS_ABI_PROFILES = {
9
9
  introducedAt: "v0.5.8-rc1",
10
10
  abiPackage: "dotns-abis-v0.5.8-rc1.zip",
11
11
  discriminator: "pricingVersion"
12
+ },
13
+ "v0.6.0": {
14
+ introducedAt: "v0.6.0",
15
+ abiPackage: "dotns-abis-v0.6.0.zip",
16
+ discriminator: "isPopIssued"
12
17
  }
13
18
  };
14
19
  function classifyProtocolVersion(probe) {
15
- const { hasCode, pricingVersionOk, startingPriceOk } = probe;
20
+ const { hasCode, pricingVersionOk, startingPriceOk, isPopIssuedOk } = probe;
16
21
  if (hasCode === false) {
17
22
  return {
18
23
  profile: null,
19
24
  reason: "No contract deployed at this address \u2014 could not detect the DotNS ABI profile because no contract code was found here. Check environments.json / --contract config for this network."
20
25
  };
21
26
  }
22
- if (pricingVersionOk) return { profile: "v0.5.8-rc1" };
27
+ if (pricingVersionOk) return { profile: isPopIssuedOk === true ? "v0.6.0" : "v0.5.8-rc1" };
23
28
  if (startingPriceOk) return { profile: "poprules-startingPrice" };
24
29
  const reason = hasCode === true ? "Could not determine the DotNS ABI profile: contract code is present at POP_RULES, but neither pricingVersion() (v0.5.8-rc1) nor startingPrice() (poprules-startingPrice) answered." : "Could not determine the DotNS ABI profile: neither pricingVersion() (v0.5.8-rc1) nor startingPrice() (poprules-startingPrice) answered. Code presence at this address could not be verified either (the runtime code-presence query failed), so a wrong/undeployed POP_RULES address is also possible.";
25
30
  return { profile: null, reason };
@@ -69,6 +74,10 @@ var V0_5_8_RC1_POP_RULES_ABI = [
69
74
  { inputs: [], name: "pricingVersion", outputs: [{ name: "", type: "uint256" }], stateMutability: "view", type: "function" },
70
75
  { inputs: [{ name: "name", type: "string" }, { name: "userAddress", type: "address" }, { name: "version", type: "uint256" }], name: "priceWithCheckAtVersion", outputs: [PRICE_WITH_CHECK_METADATA_OUTPUT], stateMutability: "view", type: "function" }
71
76
  ];
77
+ var POP_CONTROLLER_PROBE_ABI = [
78
+ { inputs: [{ name: "label", type: "string" }], name: "isPopIssued", outputs: [{ name: "issued", type: "bool" }], stateMutability: "view", type: "function" }
79
+ ];
80
+ var PROTOCOL_PROBE_LABEL = "probelabel";
72
81
  function withTenPercentBuffer(priceWei) {
73
82
  return priceWei * 110n / 100n;
74
83
  }
@@ -84,19 +93,15 @@ var oldAdapter = {
84
93
  return { functionName: "startingPrice", args: [] };
85
94
  }
86
95
  };
87
- var v058rc1Adapter = {
88
- profile: "v0.5.8-rc1",
89
- needsPricingBeforeCommit: true,
90
- controllerAbi: V0_5_8_RC1_CONTROLLER_ABI,
91
- popRulesAbi: V0_5_8_RC1_POP_RULES_ABI,
92
- buildRegistration(base, pricing) {
96
+ function buildPricedRegistration(profileLabel) {
97
+ return (base, pricing) => {
93
98
  if (pricing.pricingVersion === void 0) {
94
99
  throw new Error(
95
- "DotNS v0.5.8-rc1 registration requires pricing.pricingVersion (read PopRules.pricingVersion() before committing \u2014 it must be known before makeCommitment since it is part of the committed tuple)."
100
+ `DotNS ${profileLabel} registration requires pricing.pricingVersion (read PopRules.pricingVersion() before committing \u2014 it must be known before makeCommitment since it is part of the committed tuple).`
96
101
  );
97
102
  }
98
103
  if (pricing.priceWei === void 0) {
99
- throw new Error("DotNS v0.5.8-rc1 registration requires pricing.priceWei to compute maxPrice.");
104
+ throw new Error(`DotNS ${profileLabel} registration requires pricing.priceWei to compute maxPrice.`);
100
105
  }
101
106
  return {
102
107
  label: base.label,
@@ -106,13 +111,34 @@ var v058rc1Adapter = {
106
111
  maxPrice: withTenPercentBuffer(pricing.priceWei),
107
112
  pricingVersion: pricing.pricingVersion
108
113
  };
109
- },
110
- depositCall(label) {
111
- return { functionName: "price", args: [label] };
112
- }
114
+ };
115
+ }
116
+ function pricedDepositCall(label) {
117
+ return { functionName: "price", args: [label] };
118
+ }
119
+ var v058rc1Adapter = {
120
+ profile: "v0.5.8-rc1",
121
+ needsPricingBeforeCommit: true,
122
+ controllerAbi: V0_5_8_RC1_CONTROLLER_ABI,
123
+ popRulesAbi: V0_5_8_RC1_POP_RULES_ABI,
124
+ buildRegistration: buildPricedRegistration("v0.5.8-rc1"),
125
+ depositCall: pricedDepositCall
126
+ };
127
+ var v060Adapter = {
128
+ profile: "v0.6.0",
129
+ needsPricingBeforeCommit: true,
130
+ controllerAbi: V0_5_8_RC1_CONTROLLER_ABI,
131
+ popRulesAbi: V0_5_8_RC1_POP_RULES_ABI,
132
+ buildRegistration: buildPricedRegistration("v0.6.0"),
133
+ depositCall: pricedDepositCall
134
+ };
135
+ var ADAPTERS = {
136
+ "poprules-startingPrice": oldAdapter,
137
+ "v0.5.8-rc1": v058rc1Adapter,
138
+ "v0.6.0": v060Adapter
113
139
  };
114
140
  function getAdapter(profile) {
115
- return profile === "v0.5.8-rc1" ? v058rc1Adapter : oldAdapter;
141
+ return ADAPTERS[profile];
116
142
  }
117
143
 
118
144
  export {
@@ -122,6 +148,8 @@ export {
122
148
  V0_5_8_RC1_CONTROLLER_ABI,
123
149
  OLD_POP_RULES_ABI,
124
150
  V0_5_8_RC1_POP_RULES_ABI,
151
+ POP_CONTROLLER_PROBE_ABI,
152
+ PROTOCOL_PROBE_LABEL,
125
153
  withTenPercentBuffer,
126
154
  getAdapter
127
155
  };
@@ -7,13 +7,13 @@ import {
7
7
  } from "./chunk-AYAVRPAP.js";
8
8
  import {
9
9
  validateContractAddresses
10
- } from "./chunk-6ZOTJHVI.js";
10
+ } from "./chunk-HDGD5FYX.js";
11
11
  import {
12
12
  NonRetryableError
13
13
  } from "./chunk-ZOC4GITL.js";
14
14
  import {
15
15
  ChainHealthSampler
16
- } from "./chunk-T6HNSBZD.js";
16
+ } from "./chunk-TUEKXRRI.js";
17
17
  import {
18
18
  captureWarning,
19
19
  markCodePath,
@@ -21,12 +21,14 @@ import {
21
21
  setDeploySentryTag,
22
22
  truncateAddress,
23
23
  withSpan
24
- } from "./chunk-S7OW6CYF.js";
24
+ } from "./chunk-ESBF6QTE.js";
25
25
  import {
26
+ POP_CONTROLLER_PROBE_ABI,
27
+ PROTOCOL_PROBE_LABEL,
26
28
  classifyProtocolVersion,
27
29
  getAdapter,
28
30
  withTenPercentBuffer
29
- } from "./chunk-X4IXDGEY.js";
31
+ } from "./chunk-7I3MTGOR.js";
30
32
 
31
33
  // src/dotns.ts
32
34
  import crypto from "crypto";
@@ -243,6 +245,7 @@ function makeRetryStatusFilter(sink) {
243
245
  }
244
246
  var DEFAULT_MNEMONIC = "bottom drive obey lake curtain smoke basket hold race lonely fit walk";
245
247
  var DEFAULT_TLD = "dot";
248
+ var DEFAULT_DOTNS_PROFILE = "poprules-startingPrice";
246
249
  var KNOWN_TLDS = ["dot", "paseo", "test", "testnet"];
247
250
  function normalizeOnChainTld(raw) {
248
251
  return raw.startsWith(".") ? raw.slice(1) : raw;
@@ -609,16 +612,40 @@ function sanitizeDomainLabel(label) {
609
612
  console.log(` Domain label sanitized: "${label}" \u2192 "${stripped}" (normalized trailing digits to 0)`);
610
613
  return stripped;
611
614
  }
612
- function classifyLabelStatus(label) {
613
- const trailingDigits = countTrailingDigits(label);
614
- const baseLength = label.length - trailingDigits;
615
- if (trailingDigits === 1 || trailingDigits > 2 || baseLength <= 5) {
616
- return { status: ProofOfPersonhoodStatus.Reserved, trailingDigits, baseLength };
617
- }
615
+ var LITE_USERNAME_RE = /^([a-z]+)\.(\d{2})$/;
616
+ function classifyByLadder(baseLength, isLiteSignal) {
617
+ if (baseLength <= 5) return ProofOfPersonhoodStatus.Reserved;
618
618
  if (baseLength <= 8) {
619
- return { status: trailingDigits === 2 ? ProofOfPersonhoodStatus.ProofOfPersonhoodLite : ProofOfPersonhoodStatus.ProofOfPersonhoodFull, trailingDigits, baseLength };
619
+ return isLiteSignal ? ProofOfPersonhoodStatus.ProofOfPersonhoodLite : ProofOfPersonhoodStatus.ProofOfPersonhoodFull;
620
+ }
621
+ return ProofOfPersonhoodStatus.NoStatus;
622
+ }
623
+ var TRAILING_DIGIT_COUNT_GATE_APPLIES = {
624
+ "poprules-startingPrice": true,
625
+ "v0.5.8-rc1": true,
626
+ "v0.6.0": false
627
+ };
628
+ function classifyLabelStatus(label, profile = DEFAULT_DOTNS_PROFILE) {
629
+ const trailingDigits = countTrailingDigits(label);
630
+ switch (profile) {
631
+ case "v0.6.0": {
632
+ const lite = LITE_USERNAME_RE.exec(label);
633
+ const baseLength = lite ? lite[1].length : label.length;
634
+ return { status: classifyByLadder(baseLength, lite !== null), trailingDigits, baseLength };
635
+ }
636
+ case "poprules-startingPrice":
637
+ case "v0.5.8-rc1": {
638
+ const baseLength = label.length - trailingDigits;
639
+ if (trailingDigits === 1 || trailingDigits > 2) {
640
+ return { status: ProofOfPersonhoodStatus.Reserved, trailingDigits, baseLength };
641
+ }
642
+ return { status: classifyByLadder(baseLength, trailingDigits === 2), trailingDigits, baseLength };
643
+ }
644
+ default: {
645
+ const unhandled = profile;
646
+ throw new Error(`classifyLabelStatus: unhandled DotNS profile ${String(unhandled)}`);
647
+ }
620
648
  }
621
- return { status: ProofOfPersonhoodStatus.NoStatus, trailingDigits, baseLength };
622
649
  }
623
650
  function tierDescriptionFor(status) {
624
651
  if (status === ProofOfPersonhoodStatus.NoStatus) return "open to any account";
@@ -629,7 +656,7 @@ function tierDescriptionFor(status) {
629
656
  function noStatusFallbackBase(base) {
630
657
  return `${base.padEnd(9, "x").slice(0, 9)}00`;
631
658
  }
632
- function buildLabelAlternatives(label) {
659
+ function buildLabelAlternatives(label, profile = DEFAULT_DOTNS_PROFILE) {
633
660
  const trailingRun = label.slice(label.length - countTrailingDigits(label));
634
661
  const base = stripTrailingDigits(label);
635
662
  const twoDigitSuffix = trailingRun.length >= 2 ? trailingRun.slice(-2) : trailingRun.padStart(2, "0");
@@ -650,7 +677,7 @@ function buildLabelAlternatives(label) {
650
677
  if (!/^[a-z0-9-]{3,63}$/.test(candidate)) continue;
651
678
  if (candidate.startsWith("-") || candidate.endsWith("-")) continue;
652
679
  if (/-\d+$/.test(candidate)) continue;
653
- const { status, baseLength } = classifyLabelStatus(candidate);
680
+ const { status, baseLength } = classifyLabelStatus(candidate, profile);
654
681
  if (status === ProofOfPersonhoodStatus.Reserved) continue;
655
682
  alternatives.push({ label: candidate, baseLength, status, tierDescription: tierDescriptionFor(status) });
656
683
  }
@@ -659,9 +686,9 @@ function buildLabelAlternatives(label) {
659
686
  function formatAlternativesList(alternatives, tld = DEFAULT_TLD) {
660
687
  return alternatives.map((a) => ` - ${a.label}.${tld} \u2014 base ${a.baseLength}, ${a.tierDescription}`).join("\n");
661
688
  }
662
- function classifyRegistrability(label) {
663
- const { trailingDigits, baseLength } = classifyLabelStatus(label);
664
- if (trailingDigits !== 0 && trailingDigits !== 2) {
689
+ function classifyRegistrability(label, profile = DEFAULT_DOTNS_PROFILE) {
690
+ const { trailingDigits, baseLength } = classifyLabelStatus(label, profile);
691
+ if (TRAILING_DIGIT_COUNT_GATE_APPLIES[profile] && trailingDigits !== 0 && trailingDigits !== 2) {
665
692
  const digitWord = trailingDigits === 1 ? "digit" : "digits";
666
693
  return {
667
694
  registrable: false,
@@ -687,8 +714,8 @@ function classifyRegistrability(label) {
687
714
  return { registrable: true };
688
715
  }
689
716
  function formatUnregistrableReason(args) {
690
- const { label, registrability, existingOwner, tld = DEFAULT_TLD } = args;
691
- const alternatives = buildLabelAlternatives(label);
717
+ const { label, registrability, existingOwner, tld = DEFAULT_TLD, profile = DEFAULT_DOTNS_PROFILE } = args;
718
+ const alternatives = buildLabelAlternatives(label, profile);
692
719
  const alternativesBlock = alternatives.length > 0 ? `
693
720
 
694
721
  Alternatively, use a name you can register yourself:
@@ -707,7 +734,7 @@ Then re-run this deploy unchanged.` + alternativesBlock;
707
734
  This signer does not hold that name. If you control ${existingOwner}'s key, redeploy with that account (e.g. via --mnemonic) to update its content directly.` + alternativesBlock;
708
735
  }
709
736
  function decideRegistrabilityOutcome(args) {
710
- const { label, registrability, existingOwner, selfAddress, tld = DEFAULT_TLD } = args;
737
+ const { label, registrability, existingOwner, selfAddress, tld = DEFAULT_TLD, profile = DEFAULT_DOTNS_PROFILE } = args;
711
738
  if (existingOwner !== null && existingOwner === selfAddress) {
712
739
  return { canProceed: true, plannedAction: "already-owned-by-us" };
713
740
  }
@@ -717,7 +744,7 @@ function decideRegistrabilityOutcome(args) {
717
744
  return {
718
745
  canProceed: false,
719
746
  plannedAction: "abort",
720
- reason: formatUnregistrableReason({ label, registrability, existingOwner, selfAddress, tld })
747
+ reason: formatUnregistrableReason({ label, registrability, existingOwner, selfAddress, tld, profile })
721
748
  };
722
749
  }
723
750
  function validateDomainLabel(label) {
@@ -731,16 +758,16 @@ function isCommitmentMature(chainNowSeconds, commitTimestampSeconds, minimumAgeS
731
758
  function isCommitmentTimingBarerevert(msg) {
732
759
  return /bare-revert.*\(empty 0x\)/i.test(msg) || /commitment.*too new.*expired/i.test(msg) || /expired.*commitment/i.test(msg);
733
760
  }
734
- function classifyDotnsLabel(label, tld = DEFAULT_TLD) {
735
- const { status, trailingDigits, baseLength } = classifyLabelStatus(label);
761
+ function classifyDotnsLabel(label, tld = DEFAULT_TLD, profile = DEFAULT_DOTNS_PROFILE) {
762
+ const { status, trailingDigits, baseLength } = classifyLabelStatus(label, profile);
736
763
  if (status === ProofOfPersonhoodStatus.Reserved) {
737
- if (trailingDigits === 1 || trailingDigits > 2) {
764
+ if (TRAILING_DIGIT_COUNT_GATE_APPLIES[profile] && (trailingDigits === 1 || trailingDigits > 2)) {
738
765
  return {
739
766
  status,
740
767
  message: `Name has ${trailingDigits} trailing digit${trailingDigits === 1 ? "" : "s"}; DotNS allows exactly 0 or 2 trailing digits. Use a base name with no trailing digits or a 2-digit suffix.`
741
768
  };
742
769
  }
743
- const alternatives = buildLabelAlternatives(label);
770
+ const alternatives = buildLabelAlternatives(label, profile);
744
771
  const suggestion = alternatives.length > 0 ? `
745
772
 
746
773
  Use a name you can register instead:
@@ -1293,8 +1320,8 @@ var DotNS = class _DotNS {
1293
1320
  // ensureConnected() first. That is what makes a default safe here rather
1294
1321
  // than the silent-fallback hazard it would otherwise be — do not "simplify"
1295
1322
  // this into a throw-if-unset without re-checking both of those.
1296
- _protocolVersion = "poprules-startingPrice";
1297
- _adapter = getAdapter("poprules-startingPrice");
1323
+ _protocolVersion = DEFAULT_DOTNS_PROFILE;
1324
+ _adapter = getAdapter(DEFAULT_DOTNS_PROFILE);
1298
1325
  _onPhoneSigningRequired = void 0;
1299
1326
  _confirmPhoneReady = void 0;
1300
1327
  /** Total phone-signature count for this DotNS session (drives the `total` field passed to confirmPhoneReady). */
@@ -1898,17 +1925,30 @@ var DotNS = class _DotNS {
1898
1925
  * proof the contract is there regardless of what hasContractCode says — so
1899
1926
  * all three run in one Promise.all rather than gating the probes behind
1900
1927
  * hasContractCode resolving first.
1928
+ *
1929
+ * A fourth probe (isPopIssued, against DOTNS_POP_CONTROLLER — see
1930
+ * DotnsProtocolProbe.isPopIssuedOk's own comment) runs in the SAME
1931
+ * Promise.all, not after: it's the only thing that tells v0.6.0 apart from
1932
+ * v0.5.8-rc1 (pricingVersion answers on both), and classifyProtocolVersion
1933
+ * already only consults it when pricingVersionOk is true, so gating it
1934
+ * behind that result resolving first would just add a serialized
1935
+ * round-trip for no benefit — worse once v0.6.0 is live everywhere (#1410),
1936
+ * since that "no benefit" case becomes the common one. Resolves to `null`
1937
+ * immediately (no RPC at all) when DOTNS_POP_CONTROLLER has no configured
1938
+ * address.
1901
1939
  */
1902
1940
  async detectProtocolVersion() {
1903
1941
  this.ensureConnected();
1904
1942
  const popRulesAddress = this._contracts.POP_RULES;
1943
+ const popControllerAddress = this._contracts.DOTNS_POP_CONTROLLER;
1905
1944
  const env = this._environmentId ?? "unknown";
1906
- const [hasCodeResult, pricingVersionOk, startingPriceOk] = await Promise.all([
1945
+ const [hasCodeResult, pricingVersionOk, startingPriceOk, isPopIssuedOk] = await Promise.all([
1907
1946
  this.clientWrapper.hasContractCode(popRulesAddress),
1908
1947
  this.probeViewFunctionOk(popRulesAddress, getAdapter("v0.5.8-rc1").popRulesAbi, "pricingVersion", []),
1909
- this.probeViewFunctionOk(popRulesAddress, getAdapter("poprules-startingPrice").popRulesAbi, "startingPrice", [])
1948
+ this.probeViewFunctionOk(popRulesAddress, getAdapter("poprules-startingPrice").popRulesAbi, "startingPrice", []),
1949
+ popControllerAddress ? this.probeViewFunctionOk(popControllerAddress, POP_CONTROLLER_PROBE_ABI, "isPopIssued", [PROTOCOL_PROBE_LABEL]) : Promise.resolve(null)
1910
1950
  ]);
1911
- const classification = classifyProtocolVersion({ hasCode: hasCodeResult, pricingVersionOk, startingPriceOk });
1951
+ const classification = classifyProtocolVersion({ hasCode: hasCodeResult, pricingVersionOk, startingPriceOk, isPopIssuedOk });
1912
1952
  if (classification.profile === null) {
1913
1953
  throw new Error(`${env} (${dotnsContractName(popRulesAddress, this._contracts)} ${popRulesAddress}): ${classification.reason}`);
1914
1954
  }
@@ -1917,6 +1957,9 @@ var DotNS = class _DotNS {
1917
1957
  this._adapter = getAdapter(profile);
1918
1958
  setDeployAttribute("deploy.dotns.protocol_version", profile);
1919
1959
  console.log(` DotNS ABI profile ${profile} detected on ${env}`);
1960
+ if (profile === "v0.5.8-rc1" && pricingVersionOk && isPopIssuedOk === null) {
1961
+ console.log(` NOTE: could not confirm whether ${env} is v0.5.8-rc1 or v0.6.0 \u2014 DOTNS_POP_CONTROLLER has no configured address here, so the isPopIssued discriminator probe was never attempted. Defaulting to v0.5.8-rc1 label semantics (registration itself is unaffected: both profiles share an identical ABI/adapter).`);
1962
+ }
1920
1963
  }
1921
1964
  async contractCall(contractAddress, contractAbi, functionName, args = []) {
1922
1965
  this.ensureConnected();
@@ -2907,10 +2950,9 @@ var DotNS = class _DotNS {
2907
2950
  setDeployAttribute("deploy.dotns.reprove.auto", "false");
2908
2951
  this.ensureConnected();
2909
2952
  const validated = validateDomainLabel(label);
2910
- const trailingDigits = countTrailingDigits(validated);
2911
- const baselength = validated.length - trailingDigits;
2912
- const classification = classifyDotnsLabel(validated, this._tld);
2913
- const registrability = classifyRegistrability(validated);
2953
+ const { trailingDigits, baseLength: baselength } = classifyLabelStatus(validated, this._protocolVersion);
2954
+ const classification = classifyDotnsLabel(validated, this._tld, this._protocolVersion);
2955
+ const registrability = classifyRegistrability(validated, this._protocolVersion);
2914
2956
  const baseName = stripTrailingDigits(validated);
2915
2957
  const [userStatus, baseReservation, ownership, isTestnet, signerFreeBalance] = await Promise.all([
2916
2958
  this.getUserPopStatus(),
@@ -2990,7 +3032,7 @@ var DotNS = class _DotNS {
2990
3032
  };
2991
3033
  }
2992
3034
  if (!registrability.registrable) {
2993
- const decision = decideRegistrabilityOutcome({ label: validated, registrability, existingOwner, selfAddress, tld: this._tld });
3035
+ const decision = decideRegistrabilityOutcome({ label: validated, registrability, existingOwner, selfAddress, tld: this._tld, profile: this._protocolVersion });
2994
3036
  if (!decision.canProceed) {
2995
3037
  return {
2996
3038
  label: validated,
@@ -3236,9 +3278,9 @@ var DotNS = class _DotNS {
3236
3278
  return withSpan("deploy.dotns.register", `2a. register ${label}.${this._tld}`, {}, async () => {
3237
3279
  if (!this.connected) await this.connect(options);
3238
3280
  label = validateDomainLabel(label);
3239
- const registrability = classifyRegistrability(label);
3281
+ const registrability = classifyRegistrability(label, this._protocolVersion);
3240
3282
  if (!registrability.registrable) {
3241
- const decision = decideRegistrabilityOutcome({ label, registrability, existingOwner: null, selfAddress: this.evmAddress.toLowerCase(), tld: this._tld });
3283
+ const decision = decideRegistrabilityOutcome({ label, registrability, existingOwner: null, selfAddress: this.evmAddress.toLowerCase(), tld: this._tld, profile: this._protocolVersion });
3242
3284
  throw new NonRetryableError(decision.reason);
3243
3285
  }
3244
3286
  const isTestnet = await this.isTestnet();
@@ -3456,6 +3498,7 @@ export {
3456
3498
  makeRetryStatusFilter,
3457
3499
  DEFAULT_MNEMONIC,
3458
3500
  DEFAULT_TLD,
3501
+ DEFAULT_DOTNS_PROFILE,
3459
3502
  KNOWN_TLDS,
3460
3503
  normalizeOnChainTld,
3461
3504
  stripTldSuffix,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  package_default,
3
3
  writeRunState
4
- } from "./chunk-YVHS6WA3.js";
4
+ } from "./chunk-PXLB7TU7.js";
5
5
 
6
6
  // src/memory-report.ts
7
7
  import * as fs2 from "fs";
@@ -64,7 +64,6 @@ var environments_default = {
64
64
  DOTNS_REGISTRAR_CONTROLLER: "0x35f8594c8e68a0ad079bca5f72bf6c9560ac22b0",
65
65
  DOTNS_REGISTRY: "0x64e619ea4d8a593c68533c0feaf3e36d3666495b",
66
66
  DOTNS_POP_CONTROLLER: "0xb0dd60b3da4a563cdc8aa78ec9d5b169f81046f1",
67
- ROOT_GATEWAY_DISPATCHER: "0x2cedd39924d216b4a49f4c532e03fe79d006e89e",
68
67
  DOTNS_RESOLVER: "0x5296344ed752c19cdee2bb3e5e5b015ba69982c7",
69
68
  DOTNS_CONTENT_RESOLVER: "0xa27c323a30c7ee1f0a7a35f48983d98d18c53445",
70
69
  DOTNS_REVERSE_RESOLVER: "0x099b539bf034c741404d393ab95946e4923bc7ab",
@@ -133,7 +132,6 @@ var environments_default = {
133
132
  DOTNS_REGISTRAR_CONTROLLER: "0xBdaA01bD1bA67d709F2b1fF286Da0d854977EA30",
134
133
  DOTNS_REGISTRY: "0xf34054fd76BbF85f216cf9908226D5f0A72E50CA",
135
134
  DOTNS_POP_CONTROLLER: "0xCC932348606cc1f3318cADeC5A5Cd2CA447f8a4b",
136
- ROOT_GATEWAY_DISPATCHER: "0xa889CCA3Fb4B07b98a11cc54C10f13dDA20bc3db",
137
135
  DOTNS_RESOLVER: "0xbd1165E549DF96F083c0A16f61590927bC187009",
138
136
  DOTNS_CONTENT_RESOLVER: "0x7F74D7CD50f5a834270E2ad395a01b01891AB37d",
139
137
  DOTNS_REVERSE_RESOLVER: "0xee3883d7eB60Ee9BCD7F3bcD8f2f05302A9Cc035",
@@ -163,7 +161,6 @@ var environments_default = {
163
161
  DOTNS_REGISTRAR_CONTROLLER: "0x45fDEa4Ad7b8607Fc22DBC3DBE3cD8b350F8bede",
164
162
  DOTNS_REGISTRY: "0x527b08a640b527a3dae0C4BE04D7344E430B6E50",
165
163
  DOTNS_POP_CONTROLLER: "0x1884819F6747576883805Cb2b7BB68d29484d1b0",
166
- ROOT_GATEWAY_DISPATCHER: "0x63d7F768e2B2Fa6A270E0fc7b93738a18cb8E73A",
167
164
  DOTNS_RESOLVER: "0xC28796526Bf3E9295f09655a1001F30f77AfCF0D",
168
165
  DOTNS_CONTENT_RESOLVER: "0x326bdE29315199c814B1c58b431D84D16EA5cE41",
169
166
  DOTNS_REVERSE_RESOLVER: "0xfd2594FcF920B38A970011C486e1E3041563147F",