@parity/product-deploy 0.7.28 → 0.7.30-rc.0

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 (53) hide show
  1. package/assets/environments.json +34 -30
  2. package/dist/bug-report.js +4 -4
  3. package/dist/{chunk-TPDF24MG.js → chunk-2ULXHYB4.js} +58 -7
  4. package/dist/{chunk-37M4NISG.js → chunk-2WWR3DVD.js} +3 -3
  5. package/dist/{chunk-2VAUMZB2.js → chunk-7Y7RDOGT.js} +39 -8
  6. package/dist/{chunk-BMAEWZYV.js → chunk-AFBOKCCQ.js} +3 -3
  7. package/dist/{chunk-THZU3FZU.js → chunk-E62JHC4N.js} +2 -2
  8. package/dist/{chunk-ZJDGVUN3.js → chunk-EYWOZU4M.js} +3 -3
  9. package/dist/{chunk-Y7XKC43A.js → chunk-FIKBEVYL.js} +1 -1
  10. package/dist/{chunk-HZKRLQLG.js → chunk-GL2HHK4G.js} +34 -30
  11. package/dist/{chunk-5VZQ2KSU.js → chunk-JCOZV25R.js} +18 -15
  12. package/dist/{chunk-IDYGYIMH.js → chunk-LHLCPDGL.js} +1 -1
  13. package/dist/{chunk-6Y3XJGV7.js → chunk-MZ4Z5AXI.js} +115 -62
  14. package/dist/{chunk-T7EEVWNU.js → chunk-SI2ZUOYD.js} +5 -5
  15. package/dist/chunk-SLE4P6MO.js +39 -0
  16. package/dist/chunk-XAB7WM3S.js +90 -0
  17. package/dist/{chunk-64KTKZ7H.js → chunk-YCVK36KC.js} +1 -1
  18. package/dist/{chunk-LFKP64TQ.js → chunk-YP6AS724.js} +5 -1
  19. package/dist/{chunk-7NKOV5SU.js → chunk-ZGH7YHV5.js} +1 -1
  20. package/dist/chunk-probe.js +3 -3
  21. package/dist/deploy.d.ts +3 -1
  22. package/dist/deploy.js +11 -9
  23. package/dist/dotns.d.ts +19 -2
  24. package/dist/dotns.js +7 -5
  25. package/dist/environments.js +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +10 -10
  28. package/dist/manifest/publish.js +10 -10
  29. package/dist/memory-report.js +2 -2
  30. package/dist/merkle.js +9 -9
  31. package/dist/personhood/bind-paid-alias.d.ts +1 -1
  32. package/dist/personhood/bind-paid-alias.js +3 -2
  33. package/dist/personhood/bind-personal-id.js +2 -2
  34. package/dist/personhood/bootstrap.d.ts +7 -0
  35. package/dist/personhood/bootstrap.js +29 -17
  36. package/dist/personhood/chain-prereqs.d.ts +76 -0
  37. package/dist/personhood/chain-prereqs.js +17 -0
  38. package/dist/personhood/claim-pgas.d.ts +33 -2
  39. package/dist/personhood/claim-pgas.js +4 -2
  40. package/dist/personhood/constants.d.ts +5 -5
  41. package/dist/personhood/constants.js +3 -3
  42. package/dist/personhood/member-key.js +2 -2
  43. package/dist/personhood/people-client.js +5 -5
  44. package/dist/personhood/proof-validity.d.ts +41 -0
  45. package/dist/personhood/proof-validity.js +12 -0
  46. package/dist/personhood/reprove.d.ts +1 -1
  47. package/dist/personhood/reprove.js +10 -13
  48. package/dist/pool.js +3 -3
  49. package/dist/run-state.js +1 -1
  50. package/dist/telemetry.d.ts +43 -1
  51. package/dist/telemetry.js +4 -2
  52. package/dist/version-check.js +3 -3
  53. package/package.json +3 -3
@@ -1,16 +1,17 @@
1
1
  import {
2
2
  isTestnetSpecName
3
- } from "./chunk-Y7XKC43A.js";
3
+ } from "./chunk-FIKBEVYL.js";
4
4
  import {
5
5
  captureWarning,
6
+ markCodePath,
6
7
  setDeployAttribute,
7
8
  setDeploySentryTag,
8
9
  truncateAddress,
9
10
  withSpan
10
- } from "./chunk-LFKP64TQ.js";
11
+ } from "./chunk-YP6AS724.js";
11
12
  import {
12
13
  validateContractAddresses
13
- } from "./chunk-HZKRLQLG.js";
14
+ } from "./chunk-GL2HHK4G.js";
14
15
  import {
15
16
  NonRetryableError
16
17
  } from "./chunk-ZOC4GITL.js";
@@ -39,6 +40,17 @@ import {
39
40
  concatHex
40
41
  } from "viem";
41
42
  import { CID } from "multiformats/cid";
43
+
44
+ // src/code-paths.ts
45
+ var CODE_PATHS = {
46
+ // Auto-account-mapping branch (ensureMappedAccountReady, dotns.ts)
47
+ // true → automated mapping via EVM key derivation
48
+ // false → standard check (already-mapped or manually register)
49
+ DOTNS_AUTO_MAPPING: "dotns.auto-mapping",
50
+ DOTNS_MANUAL_MAPPING: "dotns.manual-mapping"
51
+ };
52
+
53
+ // src/dotns.ts
42
54
  var TX_KIND_HASH = "hash";
43
55
  var TX_KIND_NONCE_ADVANCED = "nonce-advanced";
44
56
  var ATTR_TX_RESOLUTION_KIND = "deploy.dotns.tx_resolution_kind";
@@ -400,7 +412,7 @@ function sanitizeDomainLabel(label) {
400
412
  return label;
401
413
  }
402
414
  function validateDomainLabel(label, opts = {}) {
403
- if (!/^[a-z0-9-]{3,}$/.test(label)) throw new Error("Invalid domain label: must contain only lowercase letters, digits, and hyphens, min 3 chars");
415
+ if (!/^[a-z0-9-]{3,63}$/.test(label)) throw new Error("Invalid domain label: must be 3-63 chars and contain only lowercase letters, digits, and hyphens");
404
416
  if (label.startsWith("-") || label.endsWith("-")) throw new Error("Invalid domain label: cannot start or end with hyphen");
405
417
  const sanitized = opts.skipSanitize ? label : sanitizeDomainLabel(label);
406
418
  if (!opts.skipSanitize && /-\d+$/.test(sanitized)) {
@@ -431,10 +443,10 @@ function isCommitmentTimingBarerevert(msg) {
431
443
  function classifyDotnsLabel(label) {
432
444
  const totalLength = label.length;
433
445
  const trailingDigits = countTrailingDigits(label);
434
- if (trailingDigits > 2) {
446
+ if (trailingDigits === 1 || trailingDigits > 2) {
435
447
  return {
436
448
  status: ProofOfPersonhoodStatus.Reserved,
437
- message: `Name has ${trailingDigits} trailing digits; DotNS allows at most 2 trailing digits. Use a base name with 0-2 trailing digits.`
449
+ 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.`
438
450
  };
439
451
  }
440
452
  const baselength = totalLength - trailingDigits;
@@ -448,10 +460,9 @@ function classifyDotnsLabel(label) {
448
460
  if (trailingDigits === 2) return { status: ProofOfPersonhoodStatus.ProofOfPersonhoodLite, message: "Requires Light personhood verification" };
449
461
  return { status: ProofOfPersonhoodStatus.ProofOfPersonhoodFull, message: "Requires Full personhood verification" };
450
462
  }
451
- if (trailingDigits === 2) return { status: ProofOfPersonhoodStatus.NoStatus, message: "Available to all" };
452
- return { status: ProofOfPersonhoodStatus.ProofOfPersonhoodFull, message: "Requires Full personhood verification" };
463
+ return { status: ProofOfPersonhoodStatus.NoStatus, message: "Available to all" };
453
464
  }
454
- function canRegister(requiredStatus, userStatus, trailingDigits) {
465
+ function canRegister(requiredStatus, userStatus) {
455
466
  if (requiredStatus === ProofOfPersonhoodStatus.Reserved) return false;
456
467
  if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull) {
457
468
  return userStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull;
@@ -459,7 +470,7 @@ function canRegister(requiredStatus, userStatus, trailingDigits) {
459
470
  if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite) {
460
471
  return userStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite || userStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull;
461
472
  }
462
- return trailingDigits !== 0 && userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodLite;
473
+ return true;
463
474
  }
464
475
  function exampleNoStatusLabel(label) {
465
476
  const base = stripTrailingDigits(validateDomainLabel(label, { checkReserved: false })).replace(/[^a-z0-9-]/g, "x");
@@ -810,6 +821,16 @@ function logTxResolution(res) {
810
821
  }
811
822
  }
812
823
  var DOTNS_CONTEXT_HEX_LOWER = "0x646f746e73000000000000000000000000000000000000000000000000000000";
824
+ function classifyAliasAccountRow(row) {
825
+ if (!row) return { state: "not-bound" };
826
+ const r = row;
827
+ const contextHex = typeof r.ca?.context === "string" ? r.ca.context.toLowerCase() : "";
828
+ const revision = Number(r.revision ?? 0);
829
+ if (contextHex === DOTNS_CONTEXT_HEX_LOWER) {
830
+ return { state: "bound-likely-stale", storedContextHex: contextHex, revision };
831
+ }
832
+ return { state: "wrong-context", storedContextHex: contextHex, revision };
833
+ }
813
834
  function formatPersonhoodRemediation(state, popSelfServe, environmentId) {
814
835
  if (!popSelfServe?.stateAwareGuidance) {
815
836
  return "Self-attestation is no longer available. Contact the DotNS team for whitelisting / Personhood status help.";
@@ -977,10 +998,12 @@ var DotNS = class {
977
998
  throw new Error("Account mapping unavailable before DotNS signer is initialized");
978
999
  }
979
1000
  if (autoAccountMapping) {
1001
+ markCodePath(CODE_PATHS.DOTNS_AUTO_MAPPING);
980
1002
  setDeployAttribute("deploy.dotns.mapping_source", "auto-account-mapping");
981
1003
  await this.ensureAutoMappedAccountReady();
982
1004
  return;
983
1005
  }
1006
+ markCodePath(CODE_PATHS.DOTNS_MANUAL_MAPPING);
984
1007
  if (await this.clientWrapper.checkIfAccountMapped(this.substrateAddress)) {
985
1008
  setDeployAttribute("deploy.dotns.mapping_source", "already-mapped");
986
1009
  console.log(` Account: mapped`);
@@ -1095,17 +1118,7 @@ var DotNS = class {
1095
1118
  try {
1096
1119
  const api = this.clientWrapper.client;
1097
1120
  const row = await api.query.AliasAccounts.AccountToAlias.getValue(ss58, { at: "best" });
1098
- if (!row) return { state: "not-bound" };
1099
- const contextHex = typeof row.ca?.context === "string" ? row.ca.context.toLowerCase() : "";
1100
- const paid = Boolean(row.paid);
1101
- const revision = Number(row.revision ?? 0);
1102
- if (paid && contextHex === DOTNS_CONTEXT_HEX_LOWER) {
1103
- return { state: "bound-likely-stale", storedContextHex: contextHex, paid, revision };
1104
- }
1105
- if (!paid || contextHex !== DOTNS_CONTEXT_HEX_LOWER) {
1106
- return { state: "wrong-context", storedContextHex: contextHex, paid, revision };
1107
- }
1108
- return { state: "bound-fresh", storedContextHex: contextHex, paid, revision };
1121
+ return classifyAliasAccountRow(row);
1109
1122
  } catch {
1110
1123
  return { state: "not-bound" };
1111
1124
  }
@@ -1727,8 +1740,43 @@ var DotNS = class {
1727
1740
  console.log(` Already published \u2014 skipping`);
1728
1741
  return { status: "already-published" };
1729
1742
  }
1743
+ const MAX_VERIFY_CHAIN_SECONDS = 30;
1744
+ const PUBLISH_POLL_INTERVAL_MS = 2e3;
1745
+ const verifyEffect = async () => {
1746
+ const wrapper = this.clientWrapper;
1747
+ if (!this.connected || !wrapper) return false;
1748
+ const startChainMs = Number(await wrapper.client.query.Timestamp.Now.getValue());
1749
+ let lastPrintedElapsed = -1;
1750
+ while (true) {
1751
+ const liveWrapper = this.clientWrapper;
1752
+ if (!this.connected || !liveWrapper) return false;
1753
+ const [published, nowChainMs] = await Promise.all([
1754
+ this.contractCall(publisher, PUBLISHER_ABI, "isPublished", [labelhash]),
1755
+ liveWrapper.client.query.Timestamp.Now.getValue().then(Number)
1756
+ ]);
1757
+ if (published === true) return true;
1758
+ const chainElapsed = (nowChainMs - startChainMs) / 1e3;
1759
+ if (chainElapsed >= MAX_VERIFY_CHAIN_SECONDS) return false;
1760
+ const floored = Math.floor(chainElapsed);
1761
+ if (floored > lastPrintedElapsed) {
1762
+ console.log(` Awaiting publish finalization [verifyEffect] (chain time +${floored}s / ${MAX_VERIFY_CHAIN_SECONDS}s)...`);
1763
+ lastPrintedElapsed = floored;
1764
+ }
1765
+ await new Promise((r) => setTimeout(r, PUBLISH_POLL_INTERVAL_MS));
1766
+ }
1767
+ };
1730
1768
  try {
1731
- const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "publish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true });
1769
+ const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "publish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect });
1770
+ const finalPublished = await withTimeout(
1771
+ this.contractCall(publisher, PUBLISHER_ABI, "isPublished", [labelhash]),
1772
+ 3e4,
1773
+ "isPublished"
1774
+ );
1775
+ if (finalPublished !== true) {
1776
+ throw new Error(
1777
+ `Post-publish verification failed for ${label}.dot: isPublished returned ${finalPublished} after the publish tx. The publish tx may have silently failed via nonce-advance, or another party removed the label. Re-run to retry.`
1778
+ );
1779
+ }
1732
1780
  logTxResolution(txRes);
1733
1781
  const txHash = txRes.kind === TX_KIND_HASH ? txRes.hash : TX_KIND_NONCE_ADVANCED;
1734
1782
  return { status: "published", txHash };
@@ -1765,8 +1813,43 @@ var DotNS = class {
1765
1813
  console.log(` Not currently published \u2014 skipping`);
1766
1814
  return { status: "already-unpublished" };
1767
1815
  }
1816
+ const MAX_VERIFY_CHAIN_SECONDS = 30;
1817
+ const UNPUBLISH_POLL_INTERVAL_MS = 2e3;
1818
+ const verifyEffect = async () => {
1819
+ const wrapper = this.clientWrapper;
1820
+ if (!this.connected || !wrapper) return false;
1821
+ const startChainMs = Number(await wrapper.client.query.Timestamp.Now.getValue());
1822
+ let lastPrintedElapsed = -1;
1823
+ while (true) {
1824
+ const liveWrapper = this.clientWrapper;
1825
+ if (!this.connected || !liveWrapper) return false;
1826
+ const [published, nowChainMs] = await Promise.all([
1827
+ this.contractCall(publisher, PUBLISHER_ABI, "isPublished", [labelhash]),
1828
+ liveWrapper.client.query.Timestamp.Now.getValue().then(Number)
1829
+ ]);
1830
+ if (published !== true) return true;
1831
+ const chainElapsed = (nowChainMs - startChainMs) / 1e3;
1832
+ if (chainElapsed >= MAX_VERIFY_CHAIN_SECONDS) return false;
1833
+ const floored = Math.floor(chainElapsed);
1834
+ if (floored > lastPrintedElapsed) {
1835
+ console.log(` Awaiting unpublish finalization [verifyEffect] (chain time +${floored}s / ${MAX_VERIFY_CHAIN_SECONDS}s)...`);
1836
+ lastPrintedElapsed = floored;
1837
+ }
1838
+ await new Promise((r) => setTimeout(r, UNPUBLISH_POLL_INTERVAL_MS));
1839
+ }
1840
+ };
1768
1841
  try {
1769
- const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "unpublish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true });
1842
+ const txRes = await this.contractTransaction(publisher, 0n, PUBLISHER_ABI, "unpublish", [label], (s) => console.log(` ${s}`), { useNoncePolling: true, verifyEffect });
1843
+ const finalPublished = await withTimeout(
1844
+ this.contractCall(publisher, PUBLISHER_ABI, "isPublished", [labelhash]),
1845
+ 3e4,
1846
+ "isPublished"
1847
+ );
1848
+ if (finalPublished === true) {
1849
+ throw new Error(
1850
+ `Post-unpublish verification failed for ${label}.dot: isPublished still returned true after the unpublish tx. The unpublish tx may have silently failed via nonce-advance, or another party re-published the label. Re-run to retry.`
1851
+ );
1852
+ }
1770
1853
  logTxResolution(txRes);
1771
1854
  const txHash = txRes.kind === TX_KIND_HASH ? txRes.hash : TX_KIND_NONCE_ADVANCED;
1772
1855
  return { status: "unpublished", txHash };
@@ -1891,15 +1974,10 @@ var DotNS = class {
1891
1974
  const message = classificationResult[1];
1892
1975
  const userStatus = await this.getUserPopStatus();
1893
1976
  if (requiredStatus === ProofOfPersonhoodStatus.Reserved) throw new Error(message);
1894
- if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull) {
1895
- if (userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodFull) throw new Error("Requires Full Personhood verification");
1896
- } else if (requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite) {
1897
- if (userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodLite && userStatus !== ProofOfPersonhoodStatus.ProofOfPersonhoodFull) throw new Error("Requires Personhood Lite verification");
1898
- } else {
1899
- const trailingDigitCount = countTrailingDigits(label);
1900
- if (trailingDigitCount === 0 || userStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite) {
1901
- throw new Error("Personhood Lite cannot register base names \u2014 this name class requires a Full or NoStatus signer");
1902
- }
1977
+ if (!canRegister(requiredStatus, userStatus)) {
1978
+ throw new Error(
1979
+ requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull ? "Requires Full Personhood verification" : "Requires Personhood Lite verification"
1980
+ );
1903
1981
  }
1904
1982
  const priceMeta = await withTimeout(this.contractCall(this._contracts.POP_RULES, POP_RULES_ABI, "priceWithCheck", [label, this.evmAddress]), 3e4, "priceWithCheck");
1905
1983
  const priceRaw = priceMeta?.price;
@@ -2056,27 +2134,7 @@ var DotNS = class {
2056
2134
  };
2057
2135
  }
2058
2136
  const targetPopStatus = userStatus;
2059
- if (!canRegister(classification.status, userStatus, trailingDigits)) {
2060
- if (classification.status === ProofOfPersonhoodStatus.NoStatus && userStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodLite) {
2061
- return {
2062
- label: validated,
2063
- classification,
2064
- userStatus,
2065
- trailingDigits,
2066
- baselength,
2067
- isAvailable: true,
2068
- existingOwner: null,
2069
- isBaseNameReserved: isReserved,
2070
- reservationOwner,
2071
- isTestnet,
2072
- canProceed: false,
2073
- reason: `${validated}.dot: this name class is NoStatus-compatible, but Personhood Lite signers cannot register NoStatus-class labels. Self-attestation is no longer available. Use a NoStatus or Full signer, or contact the DotNS team for whitelisting / Personhood status help.`,
2074
- plannedAction: "abort",
2075
- needsPopUpgrade: false,
2076
- targetPopStatus,
2077
- signerFreeBalance
2078
- };
2079
- }
2137
+ if (!canRegister(classification.status, userStatus)) {
2080
2138
  if (userStatus === ProofOfPersonhoodStatus.NoStatus && isTestnet && this._popSelfServe?.stateAwareGuidance === true && this.substrateAddress) {
2081
2139
  const aliasState = await this.classifyAliasAccountState(this.substrateAddress);
2082
2140
  if (aliasState.state === "bound-likely-stale" && !this._usesExternalSigner && this._localMnemonic && !reproveAttempted) {
@@ -2246,7 +2304,6 @@ var DotNS = class {
2246
2304
  return withSpan("deploy.dotns.register", `2a. register ${label}.dot`, {}, async () => {
2247
2305
  if (!this.connected) await this.connect(options);
2248
2306
  label = validateDomainLabel(label);
2249
- const trailingDigitCount = countTrailingDigits(label);
2250
2307
  const preClassification = classifyDotnsLabel(label);
2251
2308
  const preRequiredStatus = preClassification.status;
2252
2309
  if (preRequiredStatus === ProofOfPersonhoodStatus.Reserved) {
@@ -2255,11 +2312,6 @@ var DotNS = class {
2255
2312
  const isTestnet = await this.isTestnet();
2256
2313
  const registerAliasState = isTestnet && this._popSelfServe?.stateAwareGuidance === true && this.substrateAddress ? await this.classifyAliasAccountState(this.substrateAddress) : null;
2257
2314
  const rejectIneligible = (statusRequired, userStatus2) => {
2258
- if (statusRequired === ProofOfPersonhoodStatus.NoStatus && userStatus2 === ProofOfPersonhoodStatus.ProofOfPersonhoodLite) {
2259
- throw new Error(
2260
- `${label}.dot: this name class is NoStatus-compatible, but Personhood Lite signers cannot register NoStatus-class labels. Self-attestation is no longer available. Use a NoStatus or Full signer, or contact the DotNS team for whitelisting / Personhood status help.`
2261
- );
2262
- }
2263
2315
  throw new Error(
2264
2316
  formatPopShortfallReason({
2265
2317
  label,
@@ -2283,7 +2335,7 @@ var DotNS = class {
2283
2335
  throw new Error(classification.message);
2284
2336
  }
2285
2337
  const userStatus = await this.getUserPopStatus();
2286
- if (!canRegister(requiredStatus, userStatus, trailingDigitCount)) {
2338
+ if (!canRegister(requiredStatus, userStatus)) {
2287
2339
  rejectIneligible(requiredStatus, userStatus);
2288
2340
  }
2289
2341
  const doCommitAndRegister = async () => {
@@ -2338,8 +2390,8 @@ var DotNS = class {
2338
2390
  account: this.substrateAddress,
2339
2391
  memberKey,
2340
2392
  signCall: this.signer,
2341
- buildRingProof: async ({ members, context, msg }) => {
2342
- const r = verifiable.one_shot(memberEntropy, members, context, msg);
2393
+ buildRingProof: async ({ ringExponent, members, context, msg }) => {
2394
+ const r = verifiable.one_shot(ringExponent, memberEntropy, members, context, msg);
2343
2395
  return { proof: r.proof, alias: r.alias };
2344
2396
  }
2345
2397
  });
@@ -2425,6 +2477,7 @@ export {
2425
2477
  parseProofOfPersonhoodStatus,
2426
2478
  popStatusName,
2427
2479
  formatDispatchError,
2480
+ classifyAliasAccountRow,
2428
2481
  formatPersonhoodRemediation,
2429
2482
  formatPopShortfallReason,
2430
2483
  DotNS,
@@ -13,11 +13,11 @@ var PGAS_ASSET_LOCATION = {
13
13
  ]
14
14
  }
15
15
  };
16
- var PROOF_BYTES = 788;
17
- var BANDERSNATCH_SIGNATURE_BYTES = 96;
18
- var PEOPLE_MEMBER_IDENTIFIER_HEX = "0x70656f706c652020202020202020202020202020202020202020202020202020";
16
+ var PROOF_BYTES = 785;
17
+ var BANDERSNATCH_SIGNATURE_BYTES = 64;
18
+ var PEOPLE_MEMBER_IDENTIFIER_HEX = "0x706f703a706f6c6b61646f742e6e6574776f726b2f70656f706c652020202020";
19
19
  var MEMBER_ENTROPY_KEY = new TextEncoder().encode("candidate");
20
- var PAID_PROOF_TAG = new TextEncoder().encode("alias-accounts:paid");
20
+ var ALIAS_PROOF_TAG = new TextEncoder().encode("alias-accounts");
21
21
 
22
22
  export {
23
23
  DOTNS_CONTEXT_HEX,
@@ -28,5 +28,5 @@ export {
28
28
  BANDERSNATCH_SIGNATURE_BYTES,
29
29
  PEOPLE_MEMBER_IDENTIFIER_HEX,
30
30
  MEMBER_ENTROPY_KEY,
31
- PAID_PROOF_TAG
31
+ ALIAS_PROOF_TAG
32
32
  };
@@ -0,0 +1,39 @@
1
+ import {
2
+ ALIAS_PROOF_TAG
3
+ } from "./chunk-SI2ZUOYD.js";
4
+ import {
5
+ blake2_256,
6
+ concatBytes
7
+ } from "./chunk-ZYVGHDMU.js";
8
+
9
+ // src/personhood/proof-validity.ts
10
+ var u64LeBytes = (v) => {
11
+ const buf = new Uint8Array(8);
12
+ new DataView(buf.buffer).setBigUint64(
13
+ 0,
14
+ v,
15
+ true
16
+ /* little-endian */
17
+ );
18
+ return buf;
19
+ };
20
+ var buildAliasProofMessage = (accountPub, proofValidAt) => {
21
+ if (accountPub.length !== 32) {
22
+ throw new Error(
23
+ `buildAliasProofMessage: accountPub must be 32 bytes, got ${accountPub.length}`
24
+ );
25
+ }
26
+ return blake2_256(
27
+ concatBytes(ALIAS_PROOF_TAG, accountPub, u64LeBytes(proofValidAt))
28
+ );
29
+ };
30
+ var getProofValidAtSec = async (ahApi) => {
31
+ const nowMs = await ahApi.query.Timestamp.Now.getValue({ at: "best" });
32
+ return nowMs / 1000n;
33
+ };
34
+
35
+ export {
36
+ u64LeBytes,
37
+ buildAliasProofMessage,
38
+ getProofValidAtSec
39
+ };
@@ -0,0 +1,90 @@
1
+ import {
2
+ PGAS_ASSET_ID
3
+ } from "./chunk-SI2ZUOYD.js";
4
+
5
+ // src/personhood/chain-prereqs.ts
6
+ var NATIVE_LOC = {
7
+ parents: 1,
8
+ interior: { type: "Here", value: void 0 }
9
+ };
10
+ var PGAS_LOC = {
11
+ parents: 0,
12
+ interior: {
13
+ type: "X2",
14
+ value: [
15
+ { type: "PalletInstance", value: 50 },
16
+ { type: "GeneralIndex", value: BigInt(PGAS_ASSET_ID) }
17
+ ]
18
+ }
19
+ };
20
+ async function probeRingCollectionExponents(ahUnsafeApi, peopleIdent) {
21
+ const ah = ahUnsafeApi;
22
+ let exp;
23
+ try {
24
+ exp = await ah.query.MembersSubscriber.RingCollectionExponents.getValue(
25
+ peopleIdent,
26
+ { at: "best" }
27
+ );
28
+ } catch (err) {
29
+ throw new Error(
30
+ `chain prerequisite check failed: MembersSubscriber.RingCollectionExponents.getValue threw \u2014 RPC error or storage not available. Cause: ${err instanceof Error ? err.message : String(err)}`,
31
+ { cause: err }
32
+ );
33
+ }
34
+ if (exp === void 0 || exp === null) {
35
+ throw new Error(
36
+ `chain prerequisite missing: MembersSubscriber.RingCollectionExponents[${peopleIdent}] is not set. Every ring-VRF proof will be rejected with InvalidTransaction::BadProof (CollectionNotFound). Chain operator must populate this entry (run sudo-fix-preview-people-exponent.ts or equivalent). See docs-internal/dotns-bootstrap-handover.md \xA76.1.`
37
+ );
38
+ }
39
+ }
40
+ async function probePgasAsset(ahUnsafeApi) {
41
+ const ah = ahUnsafeApi;
42
+ let pgas;
43
+ try {
44
+ pgas = await ah.query.Assets.Asset.getValue(PGAS_ASSET_ID, { at: "best" });
45
+ } catch (err) {
46
+ throw new Error(
47
+ `chain prerequisite check failed: Assets.Asset.getValue(${PGAS_ASSET_ID}) threw \u2014 RPC error or storage not available. Cause: ${err instanceof Error ? err.message : String(err)}`,
48
+ { cause: err }
49
+ );
50
+ }
51
+ if (pgas === void 0 || pgas === null) {
52
+ throw new Error(
53
+ `chain prerequisite missing: Assets.Asset[${PGAS_ASSET_ID}] (PGAS) is not created on this chain. Pgas.claim_pgas will reject with InvalidTransaction::Custom(233) = PgasAssetNotCreated. Chain operator must create the PGAS asset via Pgas.create_pgas_asset (authorized origin). See docs-internal/dotns-bootstrap-handover.md \xA76.3.`
54
+ );
55
+ }
56
+ }
57
+ async function probePgasNativePool(ahUnsafeApi, nativeLoc = NATIVE_LOC, pgasLoc = PGAS_LOC) {
58
+ const ah = ahUnsafeApi;
59
+ let pool;
60
+ try {
61
+ pool = await ah.query.AssetConversion.Pools.getValue(
62
+ [nativeLoc, pgasLoc],
63
+ { at: "best" }
64
+ );
65
+ } catch (err) {
66
+ throw new Error(
67
+ `chain prerequisite check failed: AssetConversion.Pools.getValue threw \u2014 RPC error or storage not available. Cause: ${err instanceof Error ? err.message : String(err)}`,
68
+ { cause: err }
69
+ );
70
+ }
71
+ if (pool === void 0 || pool === null) {
72
+ throw new Error(
73
+ `chain prerequisite missing: AssetConversion.Pools[NATIVE\u2194PGAS] does not exist on this chain. PGAS-fee routing via ChargeAssetTxPayment will fail with InvalidTransaction::Payment. Chain operator must create the pool (sudo-create-pgas-pool.ts or equivalent). See docs-internal/dotns-bootstrap-handover.md \xA76.2.`
74
+ );
75
+ }
76
+ }
77
+ async function runChainPrereqProbes(ahUnsafeApi, peopleIdent) {
78
+ await probeRingCollectionExponents(ahUnsafeApi, peopleIdent);
79
+ await probePgasAsset(ahUnsafeApi);
80
+ await probePgasNativePool(ahUnsafeApi);
81
+ }
82
+
83
+ export {
84
+ NATIVE_LOC,
85
+ PGAS_LOC,
86
+ probeRingCollectionExponents,
87
+ probePgasAsset,
88
+ probePgasNativePool,
89
+ runChainPrereqProbes
90
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-LFKP64TQ.js";
3
+ } from "./chunk-YP6AS724.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  package_default,
3
3
  writeRunState
4
- } from "./chunk-37M4NISG.js";
4
+ } from "./chunk-2WWR3DVD.js";
5
5
 
6
6
  // src/memory-report.ts
7
7
  import * as fs2 from "fs";
@@ -550,6 +550,9 @@ function setDeploySentryTag(key, value) {
550
550
  if (!Sentry) return;
551
551
  Sentry.setTag(key, value);
552
552
  }
553
+ function markCodePath(id) {
554
+ setDeployAttribute(`code.path.${id}`, "true");
555
+ }
553
556
  function captureWarning(message, context) {
554
557
  if (!Sentry) return;
555
558
  try {
@@ -726,6 +729,7 @@ export {
726
729
  __setSentryForTest,
727
730
  getCurrentSentryTraceId,
728
731
  setDeploySentryTag,
732
+ markCodePath,
729
733
  captureWarning,
730
734
  flush
731
735
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  captureWarning
3
- } from "./chunk-LFKP64TQ.js";
3
+ } from "./chunk-YP6AS724.js";
4
4
 
5
5
  // src/chunk-probe.ts
6
6
  import { Twox128, Blake2128Concat, decAnyMetadata, unifyMetadata } from "@polkadot-api/substrate-bindings";
@@ -5,9 +5,9 @@ import {
5
5
  _decodeStorageValue,
6
6
  _resetProbeSession,
7
7
  probeChunks
8
- } from "./chunk-7NKOV5SU.js";
9
- import "./chunk-LFKP64TQ.js";
10
- import "./chunk-37M4NISG.js";
8
+ } from "./chunk-ZGH7YHV5.js";
9
+ import "./chunk-YP6AS724.js";
10
+ import "./chunk-2WWR3DVD.js";
11
11
  export {
12
12
  ChainProbeCrossValidationError,
13
13
  ChainProbeMetadataError,
package/dist/deploy.d.ts CHANGED
@@ -75,6 +75,8 @@ declare const ENCRYPT_TAG_LEN = 16;
75
75
  declare const ENCRYPT_KEY_LEN = 32;
76
76
  declare const ENCRYPT_PBKDF2_ITERATIONS = 100000;
77
77
  declare function encryptContent(data: Uint8Array, password: string): Promise<Uint8Array>;
78
+ /** Signer > mnemonic > pool precedence, mirroring resolveDotnsConnectOptions. Exported for unit testing. */
79
+ declare function __selectStorageProviderModeForTest(options: Pick<DeployOptions, "signer" | "signerAddress" | "mnemonic">): "signer" | "direct" | "pool";
78
80
  declare function storeFile(contentBytes: Uint8Array, { client: existingClient, unsafeApi: existingApi, signer: existingSigner }?: ExistingProvider): Promise<string>;
79
81
  /**
80
82
  * Pre-compute dense nonces for chunks that need submission.
@@ -295,4 +297,4 @@ declare function unpublish(domainName: string, options?: {
295
297
  }>;
296
298
  declare function deploy(content: DeployContent, domainName?: string | null, options?: DeployOptions): Promise<DeployResult>;
297
299
 
298
- export { CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, type SizeDecision, type StoreDirectoryOptions, __assignDenseNoncesForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, buildFilesMap, checkDeploySize, chunk, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, friendlyChainError, hasIPFS, isConnectionError, merkleize, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
300
+ export { CHUNK_MORTALITY_PERIOD, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, type DeployContent, type DeployOptions, type DeployResult, ENCRYPT_KEY_LEN, ENCRYPT_MAGIC, ENCRYPT_NONCE_LEN, ENCRYPT_PBKDF2_ITERATIONS, ENCRYPT_SALT_LEN, ENCRYPT_TAG_LEN, type SizeDecision, type StoreDirectoryOptions, __assignDenseNoncesForTest, __selectStorageProviderModeForTest, applyManifestFetchAttributes, assertSubdomainOwnerMatchesSigner, buildFilesMap, checkDeploySize, chunk, computeStorageCid, createCID, deploy, deriveRootSigner, detectFramework, encodeContenthash, encryptContent, estimateUploadBytes, friendlyChainError, hasIPFS, isConnectionError, merkleize, resolveDotnsConnectOptions, resolveReproducibleTimestamp, retryBudgetExhausted, setWsHaltCallback, storeChunkedContent, storeDirectory, storeDirectoryV2, storeFile, unpublish };
package/dist/deploy.js CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  ENCRYPT_SALT_LEN,
10
10
  ENCRYPT_TAG_LEN,
11
11
  __assignDenseNoncesForTest,
12
+ __selectStorageProviderModeForTest,
12
13
  applyManifestFetchAttributes,
13
14
  assertSubdomainOwnerMatchesSigner,
14
15
  buildFilesMap,
@@ -35,20 +36,20 @@ import {
35
36
  storeDirectoryV2,
36
37
  storeFile,
37
38
  unpublish
38
- } from "./chunk-TPDF24MG.js";
39
+ } from "./chunk-2ULXHYB4.js";
39
40
  import "./chunk-IW3X2MJF.js";
40
41
  import "./chunk-KOSF5FDO.js";
41
42
  import "./chunk-L2SKSKB6.js";
42
43
  import "./chunk-S7EM5VMW.js";
43
- import "./chunk-THZU3FZU.js";
44
- import "./chunk-64KTKZ7H.js";
45
- import "./chunk-7NKOV5SU.js";
44
+ import "./chunk-E62JHC4N.js";
45
+ import "./chunk-YCVK36KC.js";
46
+ import "./chunk-ZGH7YHV5.js";
46
47
  import "./chunk-C2TS5MER.js";
47
- import "./chunk-6Y3XJGV7.js";
48
- import "./chunk-Y7XKC43A.js";
49
- import "./chunk-LFKP64TQ.js";
50
- import "./chunk-37M4NISG.js";
51
- import "./chunk-HZKRLQLG.js";
48
+ import "./chunk-MZ4Z5AXI.js";
49
+ import "./chunk-FIKBEVYL.js";
50
+ import "./chunk-YP6AS724.js";
51
+ import "./chunk-2WWR3DVD.js";
52
+ import "./chunk-GL2HHK4G.js";
52
53
  import {
53
54
  EXIT_CODE_NO_RETRY,
54
55
  NonRetryableError
@@ -67,6 +68,7 @@ export {
67
68
  EXIT_CODE_NO_RETRY,
68
69
  NonRetryableError,
69
70
  __assignDenseNoncesForTest,
71
+ __selectStorageProviderModeForTest,
70
72
  applyManifestFetchAttributes,
71
73
  assertSubdomainOwnerMatchesSigner,
72
74
  buildFilesMap,
package/dist/dotns.d.ts CHANGED
@@ -4,6 +4,7 @@ import { PolkadotSigner } from 'polkadot-api';
4
4
  import './personhood/bind-personal-id.js';
5
5
  import './personhood/claim-pgas.js';
6
6
  import './personhood/bind-paid-alias.js';
7
+ import './personhood/chain-prereqs.js';
7
8
 
8
9
  interface DotNSConnectOptions {
9
10
  rpc?: string;
@@ -240,7 +241,7 @@ declare function classifyDotnsLabel(label: string): {
240
241
  status: number;
241
242
  message: string;
242
243
  };
243
- declare function canRegister(requiredStatus: number, userStatus: number, trailingDigits: number): boolean;
244
+ declare function canRegister(requiredStatus: number, userStatus: number): boolean;
244
245
  declare function parseDomainName(input: string): ParsedDomainName;
245
246
  declare function parseProofOfPersonhoodStatus(status: string): number;
246
247
  declare function popStatusName(status: number): string;
@@ -305,6 +306,22 @@ interface AliasAccountClassification {
305
306
  paid?: boolean;
306
307
  revision?: number;
307
308
  }
309
+ /**
310
+ * Pure classifier — interprets an `AliasAccounts.AccountToAlias` storage row
311
+ * (or `undefined` for "no row") and returns the alias-state classification.
312
+ *
313
+ * Split out from `classifyAliasAccountState` so the row → state mapping can
314
+ * be unit-tested without a chain connection.
315
+ *
316
+ * AliasAccounts pallet rewrite (paritytech/individuality#955, May 2026)
317
+ * collapsed the paid/free path split — every binding now pays `AliasFee`
318
+ * and the `paid` field no longer exists on the row. Classification keys
319
+ * on context alone: rows under the `dotns` context are heuristically
320
+ * flagged stale for reprove; rows under any other context are wrong-context;
321
+ * absent rows are not-bound. See docs-internal/dotns-bootstrap-handover.md
322
+ * §3 for the pallet contract.
323
+ */
324
+ declare function classifyAliasAccountRow(row: unknown): AliasAccountClassification;
308
325
  /**
309
326
  * Format a user-facing remediation message for the "no personhood" preflight failure.
310
327
  * Pure function — unit-testable without a chain connection.
@@ -512,4 +529,4 @@ declare class DotNS {
512
529
  }
513
530
  declare const dotns: DotNS;
514
531
 
515
- export { ATTR_TX_RESOLUTION_KIND, type AliasAccountClassification, type AliasAccountState, CONNECTION_TIMEOUT_MS, CONTRACTS, ContractDryRunRevertError, DECIMALS, DEFAULT_MNEMONIC, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, type DotnsSuccessAction, MINIMUM_REGISTER_STORAGE_DEPOSIT, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, PUBLISHER_ABI, type ParsedDomainName, type PriceValidationResult, ProofOfPersonhoodStatus, PublisherNotSupportedError, RPC_ENDPOINTS, TX_CHAIN_TIME_BUDGET_MS, TX_KIND_HASH, TX_KIND_NONCE_ADVANCED, TX_NO_PROGRESS_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, type TxResolution, WS_HEARTBEAT_TIMEOUT_MS, __formatContractDryRunFailureForTest, canRegister, classifyDotnsLabel, classifyTxRetryDecision, computeDomainTokenId, convertToHexString, convertWeiToNative, countTrailingDigits, decodePublisherRevert, dotns, feeFloorFor, fetchNonce, fmtPas, formatDispatchError, formatPersonhoodRemediation, formatPopShortfallReason, isCommitmentMature, isCommitmentTimingBarerevert, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel, verifyNonceAdvanced };
532
+ export { ATTR_TX_RESOLUTION_KIND, type AliasAccountClassification, type AliasAccountState, CONNECTION_TIMEOUT_MS, CONTRACTS, ContractDryRunRevertError, DECIMALS, DEFAULT_MNEMONIC, DOTNS_TX_MAX_ATTEMPTS, DOT_NODE, DotNS, type DotNSConnectOptions, type DotnsPreflightResult, type DotnsSuccessAction, MINIMUM_REGISTER_STORAGE_DEPOSIT, NATIVE_TO_ETH_RATIO, OPERATION_TIMEOUT_MS, type OwnershipResult, PUBLISHER_ABI, type ParsedDomainName, type PriceValidationResult, ProofOfPersonhoodStatus, PublisherNotSupportedError, RPC_ENDPOINTS, TX_CHAIN_TIME_BUDGET_MS, TX_KIND_HASH, TX_KIND_NONCE_ADVANCED, TX_NO_PROGRESS_MS, TX_TIMEOUT_MS, TX_WALL_CLOCK_CEILING_MS, type TxResolution, WS_HEARTBEAT_TIMEOUT_MS, __formatContractDryRunFailureForTest, canRegister, classifyAliasAccountRow, classifyDotnsLabel, classifyTxRetryDecision, computeDomainTokenId, convertToHexString, convertWeiToNative, countTrailingDigits, decodePublisherRevert, dotns, feeFloorFor, fetchNonce, fmtPas, formatDispatchError, formatPersonhoodRemediation, formatPopShortfallReason, isCommitmentMature, isCommitmentTimingBarerevert, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel, verifyNonceAdvanced };