@parity/product-deploy 0.10.1-dev.0 → 0.11.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 (40) hide show
  1. package/bin/bulletin-deploy +42 -10
  2. package/dist/auth-config.js +3 -3
  3. package/dist/bug-report.js +4 -4
  4. package/dist/{chunk-J63XPPZW.js → chunk-5LJPUNCB.js} +1 -1
  5. package/dist/chunk-7OVS6LIV.js +78 -0
  6. package/dist/{chunk-ZNZOAGMR.js → chunk-A43XBCGD.js} +122 -91
  7. package/dist/{chunk-VMQDFI4D.js → chunk-AUVTECEP.js} +6 -11
  8. package/dist/{chunk-QIMAKL3Z.js → chunk-C5RIKMTP.js} +1 -1
  9. package/dist/{chunk-LSZEHAFU.js → chunk-GF2QXG66.js} +1 -1
  10. package/dist/{chunk-FMUO4UBG.js → chunk-GRRZ4PUX.js} +2 -2
  11. package/dist/{chunk-NBBV3IS3.js → chunk-LXSTFGUA.js} +10 -5
  12. package/dist/{chunk-QGGISN4D.js → chunk-MDLFWWXZ.js} +1 -1
  13. package/dist/{chunk-4GDFP7XR.js → chunk-PDCSBS5T.js} +55 -10
  14. package/dist/{chunk-HX6BOXMG.js → chunk-TK4IZ73C.js} +14 -1
  15. package/dist/chunk-probe.js +3 -3
  16. package/dist/commands/login.js +22 -21
  17. package/dist/commands/logout.js +7 -7
  18. package/dist/commands/transfer.js +3 -3
  19. package/dist/commands/whoami.js +3 -3
  20. package/dist/deploy-actors.d.ts +84 -3
  21. package/dist/deploy-actors.js +12 -35
  22. package/dist/deploy.d.ts +30 -4
  23. package/dist/deploy.js +13 -9
  24. package/dist/dotns.d.ts +42 -2
  25. package/dist/dotns.js +3 -3
  26. package/dist/index.js +21 -17
  27. package/dist/manifest/publish.js +14 -10
  28. package/dist/memory-report.js +2 -2
  29. package/dist/merkle.js +13 -9
  30. package/dist/personhood/bootstrap.js +6 -6
  31. package/dist/personhood/people-client.js +3 -3
  32. package/dist/run-state.js +1 -1
  33. package/dist/sss-allowance-cache.js +4 -4
  34. package/dist/storage-signer.js +13 -9
  35. package/dist/suppress-localstorage-warning.d.ts +2 -0
  36. package/dist/suppress-localstorage-warning.js +7 -0
  37. package/dist/telemetry.d.ts +9 -1
  38. package/dist/telemetry.js +6 -2
  39. package/dist/version-check.js +3 -3
  40. package/package.json +6 -11
@@ -1,5 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // Must be the FIRST import: installs process.emitWarning suppressor before any
4
+ // SDK module-init code runs. In ESM, static imports are evaluated before inline
5
+ // code, so the suppressor must live in a separate module imported ahead of the
6
+ // SDK modules that trigger the "@parity/product-sdk-logger" localStorage warning.
7
+ import "../dist/suppress-localstorage-warning.js";
8
+
3
9
  import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY, isConnectionError, isBenignTeardownError, unpublish } from "../dist/deploy.js";
4
10
  import { VERSION, setDeployAttribute, captureWarning, closeTelemetry, setRunStateActive, markRelaunchOomHintShown } from "../dist/telemetry.js";
5
11
  import { handleFailedDeploy, handlePreflightVersionCheck, fetchVersionInfo, preReleaseWarning, checkNodeVersion } from "../dist/version-check.js";
@@ -7,16 +13,7 @@ import { setDeployContext, installLogCapture, buildCliFlagsSummary } from "../di
7
13
  import { loadRunState, writeRunState, shouldSkipStaleWarning, shouldShowOomHint, probablyOomRssMb } from "../dist/run-state.js";
8
14
  import { loadEnvironments, listEnvironments, formatEnvironmentTable, DEFAULT_ENV_ID } from "../dist/environments.js";
9
15
  import * as fs from "fs";
10
-
11
- // Suppress "@parity/product-sdk-logger" localStorage warning in Node.js v22+.
12
- // The logger tries to read log-level config from localStorage which doesn't exist
13
- // in Node.js — it emits a NoSuchNativeMethod warning we cannot fix upstream.
14
- const _origEmitWarning = process.emitWarning.bind(process);
15
- process.emitWarning = (warning, ...rest) => {
16
- const msg = (typeof warning === "string" ? warning : warning?.message ?? String(warning)).toLowerCase();
17
- if (msg.includes("localstorage") || msg.includes("local storage")) return;
18
- _origEmitWarning(warning, ...rest);
19
- };
16
+ import * as readline from "readline";
20
17
 
21
18
  // Install early so anything printed during flag parsing / preflight is
22
19
  // available to the bug-report log tail.
@@ -477,6 +474,41 @@ try {
477
474
  publish: flags.publish,
478
475
  failOnPublishError: flags.failOnPublishError,
479
476
  transferToSignedInUser: !flags.noTransferToSignedinUser,
477
+ // Human-first phone signing hooks (spec: 2026-06-13-human-first-phone-signing-design).
478
+ onPhoneSignaturePlan: (steps) => {
479
+ if (steps.length === 1) {
480
+ console.log(`\nHave your phone ready — 1 signature needed (${steps[0].toLowerCase()})`);
481
+ } else if (steps.length > 1) {
482
+ const display = steps.flatMap((s, i) =>
483
+ s === "Register" && steps[i - 1] === "Commitment" ? ["(wait)", s] : [s]
484
+ );
485
+ console.log(`\nHave your phone ready — ${steps.length} signatures needed`);
486
+ console.log(` ${display.map(s => s.toLowerCase()).join(" · ")}`);
487
+ }
488
+ },
489
+ confirmPhoneReady: ({ label, attempt }) => new Promise((resolve, reject) => {
490
+ if (attempt >= 2) {
491
+ console.log(`\n Re-sign needed (attempt ${attempt}) — approve on your phone, then press Y to continue (Ctrl-C to abort).`);
492
+ } else {
493
+ console.log(`\n Check your phone → ${label}`);
494
+ console.log(` Press Y when ready (Ctrl-C to abort):`);
495
+ }
496
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
497
+ let settled = false;
498
+ const settle = (fn) => { if (!settled) { settled = true; rl.close(); fn(); } };
499
+ rl.on("close", () => settle(reject.bind(null, new Error("aborted by user"))));
500
+ const ask = () => {
501
+ rl.question(" > ", (line) => {
502
+ const answer = line.trim().toLowerCase();
503
+ if (answer === "y" || answer === "") {
504
+ settle(resolve);
505
+ } else {
506
+ ask();
507
+ }
508
+ });
509
+ };
510
+ ask();
511
+ }),
480
512
  });
481
513
 
482
514
  const output = process.env.GITHUB_OUTPUT;
@@ -9,10 +9,10 @@ import {
9
9
  getPeopleChainEndpoints,
10
10
  hasPersistedSession,
11
11
  resolveBulletinEndpoints
12
- } from "./chunk-QGGISN4D.js";
12
+ } from "./chunk-MDLFWWXZ.js";
13
13
  import "./chunk-TSPERKUS.js";
14
- import "./chunk-HX6BOXMG.js";
15
- import "./chunk-VMQDFI4D.js";
14
+ import "./chunk-TK4IZ73C.js";
15
+ import "./chunk-AUVTECEP.js";
16
16
  import "./chunk-QRKI6MMK.js";
17
17
  import "./chunk-ZOC4GITL.js";
18
18
  export {
@@ -9,10 +9,10 @@ import {
9
9
  offerBugReport,
10
10
  scrubSecrets,
11
11
  setDeployContext
12
- } from "./chunk-NBBV3IS3.js";
13
- import "./chunk-J63XPPZW.js";
14
- import "./chunk-HX6BOXMG.js";
15
- import "./chunk-VMQDFI4D.js";
12
+ } from "./chunk-LXSTFGUA.js";
13
+ import "./chunk-5LJPUNCB.js";
14
+ import "./chunk-TK4IZ73C.js";
15
+ import "./chunk-AUVTECEP.js";
16
16
  export {
17
17
  buildCliFlagsSummary,
18
18
  buildLabels,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-HX6BOXMG.js";
3
+ } from "./chunk-TK4IZ73C.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -0,0 +1,78 @@
1
+ import {
2
+ BULLETIN_RESOURCE,
3
+ resolveSigner
4
+ } from "./chunk-5FLTDWWP.js";
5
+ import {
6
+ DOT_PRODUCT_ID
7
+ } from "./chunk-MDLFWWXZ.js";
8
+ import {
9
+ DEFAULT_MNEMONIC
10
+ } from "./chunk-PDCSBS5T.js";
11
+
12
+ // src/deploy-actors.ts
13
+ var DEFAULT_WORKER_SURI = DEFAULT_MNEMONIC;
14
+ var MainnetDefaultWorkerError = class extends Error {
15
+ constructor() {
16
+ super(
17
+ "Refusing to default the deploy worker to Alice on a non-testnet environment. Pass --mnemonic <a funded, sufficiently-verified key> to do the transfer flow, or --no-transfer-to-signedin-user to sign directly with your mobile session."
18
+ );
19
+ this.name = "MainnetDefaultWorkerError";
20
+ }
21
+ };
22
+ async function resolveDeployActors(authClient, { suri, transferEnabled, isTestnet, sessionPresent }) {
23
+ if (sessionPresent && transferEnabled) {
24
+ if (!suri && !isTestnet) throw new MainnetDefaultWorkerError();
25
+ const worker2 = await resolveSigner(authClient, { suri: suri ?? DEFAULT_WORKER_SURI });
26
+ const handle = await authClient.getSessionSigner();
27
+ if (!handle) throw new Error("transfer mode active but no session resolved; pass --no-transfer-to-signedin-user.");
28
+ try {
29
+ return { worker: worker2, recipientH160: handle.addresses.productH160 };
30
+ } finally {
31
+ handle.destroy();
32
+ }
33
+ }
34
+ const worker = await resolveSigner(authClient, { suri });
35
+ return { worker };
36
+ }
37
+ async function resolveStorageSigner(session, deps) {
38
+ if (!session?.userSession || !session?.adapter) return null;
39
+ const { userSession, adapter } = session;
40
+ try {
41
+ const signerResult = await deps.getBulletinSigner(userSession.id, DOT_PRODUCT_ID, adapter);
42
+ if (signerResult.isOk() && signerResult.value) {
43
+ const signer = signerResult.value;
44
+ const slotAddress = deps.ss58Encode(signer.publicKey);
45
+ return { signer, slotAddress, owned: true };
46
+ }
47
+ const reason = signerResult.error?.reason;
48
+ if (reason === "NoSession") {
49
+ return null;
50
+ }
51
+ deps.promptBeforeAllocation();
52
+ const outcomes = await deps.requestResourceAllocation(
53
+ userSession,
54
+ adapter,
55
+ [BULLETIN_RESOURCE]
56
+ );
57
+ const outcome = outcomes[0];
58
+ if (!outcome || outcome.tag !== "Allocated") {
59
+ return null;
60
+ }
61
+ if (deps.createSlotAccountSigner) {
62
+ const slotSigner = await deps.createSlotAccountSigner(adapter, BULLETIN_RESOURCE);
63
+ if (slotSigner) {
64
+ const slotAddress = deps.ss58Encode(slotSigner.publicKey);
65
+ return { signer: slotSigner, slotAddress, owned: true };
66
+ }
67
+ }
68
+ return null;
69
+ } catch {
70
+ return null;
71
+ }
72
+ }
73
+
74
+ export {
75
+ MainnetDefaultWorkerError,
76
+ resolveDeployActors,
77
+ resolveStorageSigner
78
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  preflightSssAllowance
3
- } from "./chunk-QIMAKL3Z.js";
3
+ } from "./chunk-C5RIKMTP.js";
4
4
  import {
5
5
  statementSigningAccount
6
6
  } from "./chunk-GRPLHUYC.js";
@@ -29,21 +29,27 @@ import {
29
29
  classifyFile,
30
30
  parseManifest
31
31
  } from "./chunk-S7EM5VMW.js";
32
- import {
33
- DOT_PRODUCT_ID,
34
- STALE_SESSION_MESSAGE,
35
- getPeopleChainEndpoints,
36
- hasPersistedSession
37
- } from "./chunk-QGGISN4D.js";
38
32
  import {
39
33
  setDeployContext
40
- } from "./chunk-NBBV3IS3.js";
34
+ } from "./chunk-LXSTFGUA.js";
41
35
  import {
42
36
  probeChunks
43
- } from "./chunk-LSZEHAFU.js";
37
+ } from "./chunk-GF2QXG66.js";
44
38
  import {
45
39
  packSection
46
40
  } from "./chunk-C2TS5MER.js";
41
+ import {
42
+ resolveStorageSigner
43
+ } from "./chunk-7OVS6LIV.js";
44
+ import {
45
+ createSlotAccountSigner,
46
+ requestResourceAllocation
47
+ } from "./chunk-5FLTDWWP.js";
48
+ import {
49
+ STALE_SESSION_MESSAGE,
50
+ getPeopleChainEndpoints,
51
+ hasPersistedSession
52
+ } from "./chunk-MDLFWWXZ.js";
47
53
  import {
48
54
  CLI_NAME
49
55
  } from "./chunk-TSPERKUS.js";
@@ -56,7 +62,7 @@ import {
56
62
  parseDomainName,
57
63
  popStatusName,
58
64
  verifyNonceAdvanced
59
- } from "./chunk-4GDFP7XR.js";
65
+ } from "./chunk-PDCSBS5T.js";
60
66
  import {
61
67
  derivePoolAccounts,
62
68
  detectTestnet,
@@ -78,7 +84,7 @@ import {
78
84
  truncateAddress,
79
85
  withDeploySpan,
80
86
  withSpan
81
- } from "./chunk-HX6BOXMG.js";
87
+ } from "./chunk-TK4IZ73C.js";
82
88
  import {
83
89
  DEFAULT_ENV_ID,
84
90
  getPopSelfServeConfig,
@@ -601,8 +607,11 @@ function isPhoneSignerActive(options) {
601
607
  function shouldHandoverName(opts) {
602
608
  return !!opts.transferTo && opts.registeredFresh;
603
609
  }
604
- function formatStorageSignerLine(slotAddress, failReason) {
605
- if (slotAddress) return ` Storage signer: allowance slot ${slotAddress}`;
610
+ function formatStorageSignerLine(slotAddress, failReason, owned) {
611
+ if (slotAddress) {
612
+ const prefix = owned ? "your allowance slot" : "allowance slot";
613
+ return ` Storage signer: ${prefix} ${slotAddress}`;
614
+ }
606
615
  return ` Storage signer: pool fallback (${failReason ?? "no session"})`;
607
616
  }
608
617
  function selectStorageReconnect(options) {
@@ -936,7 +945,18 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
936
945
  }
937
946
  console.log(` Cache check: ${confirmedCount} confirmed, ${tier2Fallback} missing${tier2Fallback > 0 ? " (will upload)" : ""}`);
938
947
  }
939
- const assignedNonces = assignDenseNonces(stored, startNonce);
948
+ let assignedNonces = assignDenseNonces(stored, startNonce);
949
+ const doReconnectAndRebase = async () => {
950
+ const prevSS58 = ss58;
951
+ await doReconnect();
952
+ const currentNonce = await _fetchNonce(BULLETIN_ENDPOINTS, ss58);
953
+ const changed = ss58 !== prevSS58;
954
+ if (changed) {
955
+ assignedNonces = assignDenseNonces(stored, currentNonce);
956
+ startNonce = currentNonce;
957
+ }
958
+ return { changed, currentNonce };
959
+ };
940
960
  const uploadTotal = stored.filter((s) => s === null).length;
941
961
  let uploadEmitted = 0;
942
962
  const nonceAdvanceIndices = /* @__PURE__ */ new Set();
@@ -979,18 +999,19 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
979
999
  const failures = results.map((r, j) => r.status === "rejected" ? { index: batchIndices[j], chunkData: batchChunks[j], error: r.reason } : null).filter(Boolean);
980
1000
  const needsReconnect = failures.some((f) => isConnectionError(f.error));
981
1001
  if (needsReconnect && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
982
- await doReconnect();
983
- const currentNonce = await _fetchNonce(BULLETIN_ENDPOINTS, ss58);
984
- for (const idx of batchIndices) {
985
- const chunkNonce = assignedNonces.get(idx);
986
- if (chunkNonce !== void 0 && chunkNonce < currentNonce && stored[idx] === null) {
987
- console.log(` Chunk ${idx + 1}: nonce ${chunkNonce} consumed (current=${currentNonce}), treating as included`);
988
- stored[idx] = { cid: createCID(chunks[idx], CID_CONFIG.codec, 18), len: chunks[idx].length, viaFallback: true };
989
- nonceAdvanceIndices.add(idx);
990
- assignedNonces.delete(idx);
1002
+ const { changed, currentNonce } = await doReconnectAndRebase();
1003
+ if (!changed) {
1004
+ for (const idx of batchIndices) {
1005
+ const chunkNonce = assignedNonces.get(idx);
1006
+ if (chunkNonce !== void 0 && chunkNonce < currentNonce && stored[idx] === null) {
1007
+ console.log(` Chunk ${idx + 1}: nonce ${chunkNonce} consumed (current=${currentNonce}), treating as included`);
1008
+ stored[idx] = { cid: createCID(chunks[idx], CID_CONFIG.codec, 18), len: chunks[idx].length, viaFallback: true };
1009
+ nonceAdvanceIndices.add(idx);
1010
+ assignedNonces.delete(idx);
1011
+ }
991
1012
  }
1013
+ startNonce = Math.max(startNonce, currentNonce);
992
1014
  }
993
- startNonce = Math.max(startNonce, currentNonce);
994
1015
  if (failures.some((f) => stored[f.index] === null)) {
995
1016
  continue;
996
1017
  }
@@ -1017,9 +1038,10 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
1017
1038
  const retryDelay = Math.min(RETRY_BASE_DELAY_MS * Math.pow(2, attempt - 1), RETRY_MAX_DELAY_MS);
1018
1039
  console.log(` Retrying chunk ${fail.index + 1} (attempt ${attempt}/${MAX_CHUNK_RETRIES}) in ${(retryDelay / 1e3).toFixed(0)}s...`);
1019
1040
  await new Promise((r) => setTimeout(r, retryDelay));
1041
+ let perRetryChanged = false;
1020
1042
  if (isConnectionError(fail.error) && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
1021
1043
  try {
1022
- await doReconnect();
1044
+ ({ changed: perRetryChanged } = await doReconnectAndRebase());
1023
1045
  } catch (reconnectErr) {
1024
1046
  console.log(` Reconnect failed: ${reconnectErr.message?.slice(0, 80)}`);
1025
1047
  break;
@@ -1028,7 +1050,7 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
1028
1050
  try {
1029
1051
  const currentNonce = await _fetchNonce(BULLETIN_ENDPOINTS, ss58);
1030
1052
  const originalNonce = assignedNonces.get(fail.index);
1031
- if (originalNonce !== void 0 && originalNonce < currentNonce) {
1053
+ if (!perRetryChanged && originalNonce !== void 0 && originalNonce < currentNonce) {
1032
1054
  console.log(` Chunk ${fail.index + 1}: nonce ${originalNonce} consumed (current=${currentNonce}), treating as included`);
1033
1055
  stored[fail.index] = { cid: createCID(fail.chunkData, CID_CONFIG.codec, 18), len: fail.chunkData.length, viaFallback: true };
1034
1056
  nonceAdvanceIndices.add(fail.index);
@@ -1083,6 +1105,10 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
1083
1105
  collision_count: missingResults.length
1084
1106
  });
1085
1107
  }
1108
+ if (wsHaltDetected && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
1109
+ wsHaltDetected = false;
1110
+ await doReconnect();
1111
+ }
1086
1112
  let reuploadCount = 0;
1087
1113
  for (const m of missingResults) {
1088
1114
  const idx = cidToIndex.get(m.cid);
@@ -1095,6 +1121,12 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
1095
1121
  reuploadCount++;
1096
1122
  break;
1097
1123
  } catch (e) {
1124
+ if (isConnectionError(e) && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
1125
+ try {
1126
+ await doReconnect();
1127
+ } catch {
1128
+ }
1129
+ }
1098
1130
  if (attempt === MAX_REPROBE_RETRIES) {
1099
1131
  throw new Error(`Nonce-collision re-upload of chunk ${idx + 1} failed after ${MAX_REPROBE_RETRIES} attempts: ${e.message?.slice(0, 100)}`);
1100
1132
  }
@@ -1652,33 +1684,46 @@ async function storeDirectoryV2(directoryPath, opts = {}) {
1652
1684
  const roundSuffix = round > 1 ? ` (round ${round}/${GRANDPA_REUPLOAD_MAX_ROUNDS}, retry after fork)` : "";
1653
1685
  console.log(` ${missingCids.size} chunks still missing after wait \u2014 re-uploading${roundSuffix}`);
1654
1686
  const reuploadList = [...missingCids];
1655
- for (let i = 0; i < reuploadList.length; i++) {
1656
- const cid = reuploadList[i];
1657
- const freshNonce = await fetchNonceFn(BULLETIN_ENDPOINTS, phaseALiveProvider.ss58);
1658
- if (cid === storageCid) {
1659
- const rootTx = phaseALiveProvider.unsafeApi.tx.TransactionStorage.store_with_cid_config({
1660
- cid: { codec: BigInt(112), hashing: toHashingEnum(rootHashCode) },
1661
- data: rootDagBytes
1662
- });
1663
- await watchTransaction(rootTx, phaseALiveProvider.signer, { mortality: { mortal: true, period: 256 }, nonce: freshNonce }, () => storageCid, {
1664
- label: "root-reupload",
1665
- rpc: BULLETIN_ENDPOINTS,
1666
- senderSS58: phaseALiveProvider.ss58,
1667
- expectedNonce: freshNonce,
1668
- timeoutMs: CHUNK_TIMEOUT_MS,
1669
- fetchNonce: phaseALiveProvider.fetchNonce
1670
- });
1671
- } else {
1672
- const chunkBytes = phaseBChunkByCid.get(cid);
1673
- if (!chunkBytes) {
1674
- throw new Error(
1675
- `Deploy verification failed: chunk ${cid.slice(0, 20)}\u2026 missing at finalised head and its bytes are not in phaseB.chunks (cannot re-upload). This indicates an internal state issue.`
1676
- );
1687
+ try {
1688
+ for (let i = 0; i < reuploadList.length; i++) {
1689
+ const cid = reuploadList[i];
1690
+ const freshNonce = await fetchNonceFn(BULLETIN_ENDPOINTS, phaseALiveProvider.ss58);
1691
+ if (cid === storageCid) {
1692
+ const rootTx = phaseALiveProvider.unsafeApi.tx.TransactionStorage.store_with_cid_config({
1693
+ cid: { codec: BigInt(112), hashing: toHashingEnum(rootHashCode) },
1694
+ data: rootDagBytes
1695
+ });
1696
+ await watchTransaction(rootTx, phaseALiveProvider.signer, { mortality: { mortal: true, period: 256 }, nonce: freshNonce }, () => storageCid, {
1697
+ label: "root-reupload",
1698
+ rpc: BULLETIN_ENDPOINTS,
1699
+ senderSS58: phaseALiveProvider.ss58,
1700
+ expectedNonce: freshNonce,
1701
+ timeoutMs: CHUNK_TIMEOUT_MS,
1702
+ fetchNonce: phaseALiveProvider.fetchNonce
1703
+ });
1704
+ } else {
1705
+ const chunkBytes = phaseBChunkByCid.get(cid);
1706
+ if (!chunkBytes) {
1707
+ throw new Error(
1708
+ `Deploy verification failed: chunk ${cid.slice(0, 20)}\u2026 missing at finalised head and its bytes are not in phaseB.chunks (cannot re-upload). This indicates an internal state issue.`
1709
+ );
1710
+ }
1711
+ await storeChunk(phaseALiveProvider.unsafeApi, phaseALiveProvider.signer, chunkBytes, freshNonce, phaseALiveProvider.ss58, { fetchNonce: phaseALiveProvider.fetchNonce });
1677
1712
  }
1678
- await storeChunk(phaseALiveProvider.unsafeApi, phaseALiveProvider.signer, chunkBytes, freshNonce, phaseALiveProvider.ss58, { fetchNonce: phaseALiveProvider.fetchNonce });
1713
+ reuploadCount++;
1714
+ console.log(` [${i + 1}/${reuploadList.length}] re-uploaded ${cid.slice(0, 20)}\u2026 (nonce ${freshNonce})`);
1679
1715
  }
1680
- reuploadCount++;
1681
- console.log(` [${i + 1}/${reuploadList.length}] re-uploaded ${cid.slice(0, 20)}\u2026 (nonce ${freshNonce})`);
1716
+ } catch (e) {
1717
+ if (isConnectionError(e) && phaseALiveProvider.reconnect) {
1718
+ try {
1719
+ phaseALiveProvider.client.destroy();
1720
+ } catch {
1721
+ }
1722
+ const fresh = await phaseALiveProvider.reconnect();
1723
+ phaseALiveProvider = { ...phaseALiveProvider, ...fresh };
1724
+ continue;
1725
+ }
1726
+ throw e;
1682
1727
  }
1683
1728
  const reuploadStart = Date.now();
1684
1729
  while (Date.now() - reuploadStart < GRANDPA_REUPLOAD_TIMEOUT_MS && missingCids.size > 0) {
@@ -2038,29 +2083,28 @@ async function deploy(content, domainName = null, options = {}) {
2038
2083
  }
2039
2084
  }
2040
2085
  if (!options.storageSigner) {
2041
- let storageLine = null;
2042
- try {
2043
- if (resolvedUserSession?.userSession && resolvedUserSession?.adapter) {
2044
- const { ss58Encode } = await import("@parity/product-sdk-address");
2045
- const signerResult = await resolvedUserSession.adapter.allowance.getBulletinSigner(
2046
- resolvedUserSession.userSession.id,
2047
- DOT_PRODUCT_ID
2048
- );
2049
- if (signerResult.isOk()) {
2050
- const slotSigner = signerResult.value;
2051
- const slotAddress = ss58Encode(slotSigner.publicKey);
2052
- options = { ...options, storageSigner: slotSigner, storageSignerAddress: slotAddress };
2053
- storageLine = formatStorageSignerLine(slotAddress);
2054
- } else {
2055
- storageLine = formatStorageSignerLine(null, signerResult.error.reason);
2086
+ const { ss58Encode } = await import("@parity/product-sdk-address");
2087
+ const slotResult = await resolveStorageSigner(
2088
+ resolvedUserSession ?? null,
2089
+ {
2090
+ getBulletinSigner: (sessionId, productId, adapter) => adapter.allowance.getBulletinSigner(sessionId, productId),
2091
+ requestResourceAllocation,
2092
+ createSlotAccountSigner,
2093
+ ss58Encode: (pk) => ss58Encode(pk),
2094
+ promptBeforeAllocation: () => {
2095
+ console.log(
2096
+ `
2097
+ \u26A0 Your account has no Bulletin allowance. Approve one on your phone to deploy with your own account, or press Ctrl-C to use the shared pool.`
2098
+ );
2056
2099
  }
2057
- } else {
2058
- storageLine = formatStorageSignerLine(null);
2059
2100
  }
2060
- } catch {
2061
- storageLine = formatStorageSignerLine(null, "error");
2101
+ );
2102
+ if (slotResult) {
2103
+ options = { ...options, storageSigner: slotResult.signer, storageSignerAddress: slotResult.slotAddress };
2104
+ console.log(formatStorageSignerLine(slotResult.slotAddress, void 0, slotResult.owned));
2105
+ } else {
2106
+ console.log(formatStorageSignerLine(null, resolvedUserSession ? "no allowance" : void 0));
2062
2107
  }
2063
- if (storageLine) console.log(storageLine);
2064
2108
  }
2065
2109
  initTelemetry();
2066
2110
  const randomSuffix = Math.floor(Math.random() * 100).toString().padStart(2, "0");
@@ -2173,17 +2217,7 @@ async function deploy(content, domainName = null, options = {}) {
2173
2217
  }
2174
2218
  if (phoneSignerActive) {
2175
2219
  const steps = computePhoneSigningSteps(dotnsPreflight, preflightPublishNeeded);
2176
- if (steps.length === 1) {
2177
- console.log(`
2178
- Have your phone ready \u2014 1 signature needed (${steps[0].toLowerCase()})`);
2179
- } else if (steps.length > 1) {
2180
- const display = steps.flatMap(
2181
- (s, i) => s === "Register" && steps[i - 1] === "Commitment" ? ["(wait)", s] : [s]
2182
- );
2183
- console.log(`
2184
- Have your phone ready \u2014 ${steps.length} signatures needed`);
2185
- console.log(` ${display.map((s) => s.toLowerCase()).join(" \xB7 ")}`);
2186
- }
2220
+ options.onPhoneSignaturePlan?.(steps);
2187
2221
  }
2188
2222
  provider = await reconnect();
2189
2223
  const providerWithReconnect = { ...provider, reconnect };
@@ -2392,13 +2426,10 @@ Have your phone ready \u2014 ${steps.length} signatures needed`);
2392
2426
  };
2393
2427
  await ownerDotns.connect({
2394
2428
  ...resolveDotnsConnectOptions({ ...options, signer: owner.signer, signerAddress: owner.address }, envAssetHub, envAutoAccountMapping, envContracts, envNativeToEthRatio, envId, envPopSelfServe, envRegisterStorageDeposit),
2395
- onPhoneSigningRequired: (label) => console.log(`
2396
- Check your phone \u2192 ${label}`)
2429
+ confirmPhoneReady: options.confirmPhoneReady
2397
2430
  });
2398
2431
  const willPublish = !!(options.publish && parsed && preflightPublishNeeded !== false);
2399
- console.log(willPublish ? `
2400
- Have your phone ready \u2014 2 signatures needed (link content \xB7 publish)` : `
2401
- Have your phone ready \u2014 1 signature needed (link content)`);
2432
+ ownerDotns.setPhoneSignatureTotal(willPublish ? 2 : 1);
2402
2433
  const contenthashHex2 = `0x${encodeContenthash(cid)}`;
2403
2434
  await ownerDotns.setContenthash(name, contenthashHex2, { feeAsset: "pgas" });
2404
2435
  if (willPublish) await publish(ownerDotns, parsed, options.failOnPublishError);
@@ -2407,11 +2438,11 @@ Have your phone ready \u2014 1 signature needed (link content)`);
2407
2438
  const dotns = new DotNS();
2408
2439
  await dotns.connect({
2409
2440
  ...resolveDotnsConnectOptions(options, envAssetHub, envAutoAccountMapping, envContracts, envNativeToEthRatio, envId, envPopSelfServe, envRegisterStorageDeposit),
2410
- // Per-step "check your phone" reminder — only for a phone-backed signer
2411
- // (see phoneSignerActive); a transfer-mode local worker signs locally.
2412
- ...phoneSignerActive ? { onPhoneSigningRequired: (label) => console.log(`
2413
- Check your phone \u2192 ${label}`) } : {}
2441
+ confirmPhoneReady: options.confirmPhoneReady
2414
2442
  });
2443
+ if (phoneSignerActive) {
2444
+ dotns.setPhoneSignatureTotal(computePhoneSigningSteps(dotnsPreflight, preflightPublishNeeded).length);
2445
+ }
2415
2446
  let registeredFresh = false;
2416
2447
  if (parsed?.isSubdomain) {
2417
2448
  const { owned, owner } = await dotns.checkSubdomainOwnership(parsed.sublabel, parsed.parentLabel);
@@ -6,7 +6,7 @@ import * as path from "path";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@parity/product-deploy",
9
- version: "0.10.1-dev.0",
9
+ version: "0.11.0-rc.1",
10
10
  private: false,
11
11
  repository: {
12
12
  type: "git",
@@ -51,7 +51,7 @@ var package_default = {
51
51
  "tools/release-retry-wrapper.mjs"
52
52
  ],
53
53
  scripts: {
54
- build: "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/commands/transfer.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts src/sss-allowance-cache.ts src/deploy-actors.ts --format esm --dts --clean --target node22",
54
+ build: "tsup src/suppress-localstorage-warning.ts src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/commands/transfer.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts src/sss-allowance-cache.ts src/deploy-actors.ts --format esm --dts --clean --target node22",
55
55
  "refresh-environments": "node scripts/refresh-environments.mjs",
56
56
  postinstall: "patch-package || true",
57
57
  prepare: "npm run build",
@@ -68,9 +68,9 @@ var package_default = {
68
68
  "@ipld/dag-pb": "^4.1.3",
69
69
  "@noble/hashes": "^1.7.2",
70
70
  "@parity/product-sdk-address": "^0.1.1",
71
- "@parity/product-sdk-keys": "^0.3.0",
72
- "@parity/product-sdk-terminal": "^0.4.0",
73
- "@parity/product-sdk-tx": "^0.2.4",
71
+ "@parity/product-sdk-keys": "^0.3.8",
72
+ "@parity/product-sdk-terminal": "^0.5.1",
73
+ "@parity/product-sdk-tx": "^0.2.12",
74
74
  "@polkadot-api/metadata-builders": "^0.14.2",
75
75
  "@polkadot-api/substrate-bindings": "^0.20.2",
76
76
  "@polkadot-labs/hdkd": "^0.0.28",
@@ -96,12 +96,7 @@ var package_default = {
96
96
  vitest: "^4.1.0"
97
97
  },
98
98
  overrides: {
99
- "@polkadot-api/json-rpc-provider": "^0.2.0",
100
- "@novasamatech/host-api": "0.8.6",
101
- "@novasamatech/host-papp": "0.8.6",
102
- "@novasamatech/scale": "0.8.6",
103
- "@novasamatech/statement-store": "0.8.6",
104
- "@novasamatech/storage-adapter": "0.8.6"
99
+ "@polkadot-api/json-rpc-provider": "^0.2.0"
105
100
  },
106
101
  minimumVersion: "0.5.6",
107
102
  engines: {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GRPLHUYC.js";
4
4
  import {
5
5
  DOT_DAPP_ID
6
- } from "./chunk-QGGISN4D.js";
6
+ } from "./chunk-MDLFWWXZ.js";
7
7
 
8
8
  // src/sss-allowance-cache.ts
9
9
  import { mkdir, readFile, writeFile, unlink } from "fs/promises";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  captureWarning
3
- } from "./chunk-HX6BOXMG.js";
3
+ } from "./chunk-TK4IZ73C.js";
4
4
 
5
5
  // src/chunk-probe.ts
6
6
  import { Twox128, Blake2128Concat, decAnyMetadata, unifyMetadata } from "@polkadot-api/substrate-bindings";
@@ -7,10 +7,10 @@ import {
7
7
  resolveDotnsConnectOptions,
8
8
  storeDirectory,
9
9
  storeFile
10
- } from "./chunk-ZNZOAGMR.js";
10
+ } from "./chunk-A43XBCGD.js";
11
11
  import {
12
12
  DotNS
13
- } from "./chunk-4GDFP7XR.js";
13
+ } from "./chunk-PDCSBS5T.js";
14
14
  import {
15
15
  getPopSelfServeConfig,
16
16
  loadEnvironments,
@@ -2,15 +2,20 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-J63XPPZW.js";
5
+ } from "./chunk-5LJPUNCB.js";
6
6
  import {
7
7
  VERSION,
8
- getCurrentSentryTraceId
9
- } from "./chunk-HX6BOXMG.js";
8
+ getCurrentSentryTraceId,
9
+ resolveIssueRepoSlug
10
+ } from "./chunk-TK4IZ73C.js";
11
+ import {
12
+ package_default
13
+ } from "./chunk-AUVTECEP.js";
10
14
 
11
15
  // src/bug-report.ts
12
16
  import { execSync, execFileSync } from "child_process";
13
17
  import * as os from "os";
18
+ var ISSUE_REPO = resolveIssueRepoSlug(package_default.repository);
14
19
  var _deployContext = {};
15
20
  function setDeployContext(ctx) {
16
21
  _deployContext = { ..._deployContext, ...ctx };
@@ -148,7 +153,7 @@ function createGhIssue(title, body, labels) {
148
153
  "issue",
149
154
  "create",
150
155
  "--repo",
151
- "paritytech/bulletin-deploy",
156
+ ISSUE_REPO,
152
157
  "--title",
153
158
  title,
154
159
  ...labels.flatMap((l) => ["--label", l]),
@@ -179,7 +184,7 @@ async function offerBugReport(error) {
179
184
  const labels = buildLabels(error);
180
185
  if (!hasGhCli()) {
181
186
  console.error("\n gh CLI not found. Debug info below \u2014 paste into a new issue:\n");
182
- console.error(` https://github.com/paritytech/bulletin-deploy/issues/new
187
+ console.error(` https://github.com/${ISSUE_REPO}/issues/new
183
188
  `);
184
189
  printFallback(title, body, labels);
185
190
  return;