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

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/assets/environments.json +0 -2
  2. package/dist/bug-report.js +4 -4
  3. package/dist/{chunk-KJH2T5TQ.js → chunk-37M4NISG.js} +1 -1
  4. package/dist/{chunk-43HLT335.js → chunk-64KTKZ7H.js} +1 -1
  5. package/dist/{chunk-DNXH4QTI.js → chunk-6Y3XJGV7.js} +112 -16
  6. package/dist/{chunk-QTZNULSH.js → chunk-7NKOV5SU.js} +1 -1
  7. package/dist/{chunk-OITUIM2E.js → chunk-HZKRLQLG.js} +0 -3
  8. package/dist/{chunk-KHVTYIIX.js → chunk-IW3X2MJF.js} +2 -0
  9. package/dist/chunk-L2SKSKB6.js +308 -0
  10. package/dist/{chunk-MFTODIIT.js → chunk-LFKP64TQ.js} +13 -7
  11. package/dist/{chunk-ADNBLFDP.js → chunk-THZU3FZU.js} +2 -2
  12. package/dist/{chunk-P6CHOMN3.js → chunk-TPDF24MG.js} +25 -36
  13. package/dist/{chunk-QMYW3D6E.js → chunk-Y7XKC43A.js} +54 -100
  14. package/dist/{chunk-NF2FL4ZO.js → chunk-ZJDGVUN3.js} +3 -3
  15. package/dist/chunk-probe.js +3 -3
  16. package/dist/deploy.d.ts +1 -2
  17. package/dist/deploy.js +11 -11
  18. package/dist/dotns.d.ts +10 -1
  19. package/dist/dotns.js +9 -5
  20. package/dist/environments.d.ts +0 -2
  21. package/dist/environments.js +1 -1
  22. package/dist/incremental-stats.d.ts +2 -0
  23. package/dist/incremental-stats.js +1 -1
  24. package/dist/index.js +12 -12
  25. package/dist/manifest/publish.js +12 -12
  26. package/dist/manifest-fetch.d.ts +2 -1
  27. package/dist/manifest-fetch.js +1 -1
  28. package/dist/manifest-roundtrip.js +1 -1
  29. package/dist/memory-report.js +2 -2
  30. package/dist/merkle.js +11 -11
  31. package/dist/personhood/bootstrap.js +5 -5
  32. package/dist/personhood/people-client.js +5 -5
  33. package/dist/pool.d.ts +6 -13
  34. package/dist/pool.js +3 -1
  35. package/dist/run-state.js +1 -1
  36. package/dist/telemetry.d.ts +1 -1
  37. package/dist/telemetry.js +2 -2
  38. package/dist/version-check.js +3 -3
  39. package/package.json +1 -1
  40. package/dist/chunk-FZWJV5AD.js +0 -231
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  package_default,
3
3
  writeRunState
4
- } from "./chunk-KJH2T5TQ.js";
4
+ } from "./chunk-37M4NISG.js";
5
5
 
6
6
  // src/memory-report.ts
7
7
  import * as fs2 from "fs";
@@ -211,6 +211,10 @@ function getDeployAttributes(domain) {
211
211
  // testnet auto-top-up" metrics. Flipped by gateOnFeeBalance.
212
212
  "deploy.dotns.signer_below_floor": "false",
213
213
  "deploy.dotns.toppedup": "false",
214
+ // Seeded "false" so every span carries the attribute for ratio queries.
215
+ // Flipped to "true" by pool.ts ensureAuthorized / topUpBy when authorize_account
216
+ // actually submits (i.e. re-auth was needed, not short-circuited).
217
+ "deploy.unblock.bulletin_auth.fired": "false",
214
218
  // Seeded "hash" so spans missing an explicit set (non-DotNS deploys) group
215
219
  // cleanly in the "hash" bucket.
216
220
  "deploy.dotns.tx_resolution_kind": "hash",
@@ -276,7 +280,7 @@ function isExpectedError(msg) {
276
280
  }
277
281
  function classifyDeployError(msg) {
278
282
  if (isExpectedError(msg)) return "user";
279
- if (/chunk.*failed after.*retr|tx dropped from best chain|timed out after \d+s waiting for block|Contract reverted|Contract execution would revert|dotns register failed|All promises were rejected|"type"\s*:\s*"Invalid"|Commitment still too new|not finalised after \d+s|chain may have (dropped|evicted)|ReviveApi.*timed out/i.test(msg)) return "environment";
283
+ if (/chunk.*failed after.*retr|tx dropped from best chain|timed out after \d+s waiting for block|Contract reverted|Contract execution would revert|dotns register failed|All promises were rejected|"type"\s*:\s*"Invalid"|Commitment still too new|not finalised after \d+s|chain may have (dropped|evicted)|ReviveApi.*timed out|\b(?:commit|register|setSubnodeOwner|setResolver|setContenthash|setText|publish|unpublish|Revive\.call|Utility\.batch_all) timed out after \d+ms|transaction watcher silent for/i.test(msg)) return "environment";
280
284
  if (/javascript heap out of memory|allocation failed.*heap|External signer mode is not supported with dotns-cli/i.test(msg)) return "internal";
281
285
  return "unknown";
282
286
  }
@@ -301,13 +305,15 @@ var ERROR_KIND_RULES = [
301
305
  [/timed out after \d+s waiting for block|Transaction not included after \d+s|Transaction did not settle within/i, "chain-timeout"],
302
306
  [/\bstale\b.*nonce|nonce.*\bstale\b|"type"\s*:\s*"(?:Future|Stale)"|Invalid::Future|tx rejected by pool/i, "nonce-stale"],
303
307
  [/heartbeat timeout|WS halt|Unable to connect|ChainHead disjointed|websocket.*closed|socket closed|disconnect/i, "connection"],
304
- [/requires ProofOfPersonhoodFull,\s*but this signer is NoStatus/i, "naming.pop_required"],
308
+ [/requires ProofOfPersonhood(?:Full|Lite|Light),\s*but this signer is NoStatus/i, "naming.pop_required"],
305
309
  [/Domain\s+\S+\.dot\s+is already owned by\s+0x[a-fA-F0-9]+/i, "naming.already_owned"],
306
310
  [/Cannot deploy\s+[\w.-]+\.dot:\s*parent\s+[\w.-]+\.dot\s+is owned by/i, "naming.subdomain_orphan"],
307
311
  [/Post-deploy verification failed for .+: on-chain contenthash is /i, "verify.contenthash_mismatch"],
308
312
  [/Deploy verification failed:\s*DAG-PB root.+not finalised/i, "verify.dagpb_not_finalised"],
309
313
  [/Retry budget exhausted:.*recovery attempts/i, "network.recovery_exhausted"],
310
314
  [/ReviveApi\.\w+ timed out after \d+ms/i, "chain.api_timeout"],
315
+ [/transaction watcher silent for \d+s/i, "chain.tx_silent"],
316
+ [/^(?:commit|register|setSubnodeOwner|setResolver|setContenthash|setText|publish|unpublish|Revive\.call|Utility\.batch_all) timed out after \d+ms/i, "chain.tx_timeout"],
311
317
  [/^INVARIANT FAILED:/i, "tool.invariant"]
312
318
  ];
313
319
  function classifyErrorKind(msg) {
@@ -394,10 +400,10 @@ function sampleMemory(stage) {
394
400
  if (m.external > memoryPeak.external) memoryPeak.external = m.external;
395
401
  if (m.arrayBuffers > memoryPeak.arrayBuffers) memoryPeak.arrayBuffers = m.arrayBuffers;
396
402
  if (deployRootSpan) {
397
- deployRootSpan.setAttribute("deploy.mem.peak_rss_bytes", memoryPeak.rss);
398
- deployRootSpan.setAttribute("deploy.mem.peak_heap_used_bytes", memoryPeak.heapUsed);
399
- deployRootSpan.setAttribute("deploy.mem.peak_external_bytes", memoryPeak.external);
400
- deployRootSpan.setAttribute("deploy.mem.peak_array_buffers_bytes", memoryPeak.arrayBuffers);
403
+ deployRootSpan.setAttribute("deploy.mem.peak_rss_mb", String(toMb(memoryPeak.rss)));
404
+ deployRootSpan.setAttribute("deploy.mem.peak_heap_used_mb", String(toMb(memoryPeak.heapUsed)));
405
+ deployRootSpan.setAttribute("deploy.mem.peak_external_mb", String(toMb(memoryPeak.external)));
406
+ deployRootSpan.setAttribute("deploy.mem.peak_array_buffers_mb", String(toMb(memoryPeak.arrayBuffers)));
401
407
  }
402
408
  }
403
409
  if (runStateActive && memoryPeak) {
@@ -2,11 +2,11 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-43HLT335.js";
5
+ } from "./chunk-64KTKZ7H.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId
9
- } from "./chunk-MFTODIIT.js";
9
+ } from "./chunk-LFKP64TQ.js";
10
10
 
11
11
  // src/bug-report.ts
12
12
  import { execSync, execFileSync } from "child_process";
@@ -2,7 +2,7 @@ import {
2
2
  computeStats,
3
3
  renderSummary,
4
4
  telemetryAttributes
5
- } from "./chunk-KHVTYIIX.js";
5
+ } from "./chunk-IW3X2MJF.js";
6
6
  import {
7
7
  finaliseEmbeddedManifest,
8
8
  writeEmbeddedManifestPlaceholder
@@ -11,7 +11,7 @@ import {
11
11
  extractManifestFromCar,
12
12
  fetchPreviousManifest,
13
13
  writePersistentLocalManifest
14
- } from "./chunk-FZWJV5AD.js";
14
+ } from "./chunk-L2SKSKB6.js";
15
15
  import {
16
16
  MANIFEST_PATH,
17
17
  MANIFEST_VERSION,
@@ -20,10 +20,10 @@ import {
20
20
  } from "./chunk-S7EM5VMW.js";
21
21
  import {
22
22
  setDeployContext
23
- } from "./chunk-ADNBLFDP.js";
23
+ } from "./chunk-THZU3FZU.js";
24
24
  import {
25
25
  probeChunks
26
- } from "./chunk-QTZNULSH.js";
26
+ } from "./chunk-7NKOV5SU.js";
27
27
  import {
28
28
  packSection
29
29
  } from "./chunk-C2TS5MER.js";
@@ -35,7 +35,7 @@ import {
35
35
  parseDomainName,
36
36
  popStatusName,
37
37
  verifyNonceAdvanced
38
- } from "./chunk-DNXH4QTI.js";
38
+ } from "./chunk-6Y3XJGV7.js";
39
39
  import {
40
40
  derivePoolAccounts,
41
41
  detectTestnet,
@@ -43,7 +43,7 @@ import {
43
43
  fetchPoolAuthorizations,
44
44
  selectAccount,
45
45
  topUpBy
46
- } from "./chunk-QMYW3D6E.js";
46
+ } from "./chunk-Y7XKC43A.js";
47
47
  import {
48
48
  VERSION,
49
49
  captureWarning,
@@ -57,13 +57,13 @@ import {
57
57
  truncateAddress,
58
58
  withDeploySpan,
59
59
  withSpan
60
- } from "./chunk-MFTODIIT.js";
60
+ } from "./chunk-LFKP64TQ.js";
61
61
  import {
62
62
  DEFAULT_ENV_ID,
63
63
  getPopSelfServeConfig,
64
64
  loadEnvironments,
65
65
  resolveEndpoints
66
- } from "./chunk-OITUIM2E.js";
66
+ } from "./chunk-HZKRLQLG.js";
67
67
  import {
68
68
  NonRetryableError
69
69
  } from "./chunk-ZOC4GITL.js";
@@ -232,23 +232,11 @@ async function getProvider() {
232
232
  await cryptoWaitReady();
233
233
  const poolMnemonic = process.env.BULLETIN_POOL_MNEMONIC || void 0;
234
234
  const poolAccounts = derivePoolAccounts(POOL_SIZE, poolMnemonic);
235
- const [authorizations, currentBlockForPool] = await Promise.all([
236
- fetchPoolAuthorizations(unsafeApi, poolAccounts),
237
- unsafeApi.query.System.Number.getValue()
238
- ]);
239
- const selectionResult = selectAccount(authorizations, Math.random, currentBlockForPool);
240
- let selectedAccount;
241
- let eligibleCount = 0;
242
- if (!selectionResult) {
243
- const best = authorizations.reduce((a, b) => a.transactions > b.transactions ? a : b);
244
- console.log(` All pool accounts low on capacity, auto-authorizing account ${best.index}...`);
245
- await ensureAuthorized(unsafeApi, best.address, `pool account ${best.index}`);
246
- selectedAccount = best;
247
- } else {
248
- selectedAccount = selectionResult.account;
249
- eligibleCount = selectionResult.eligibleCount;
250
- await ensureAuthorized(unsafeApi, selectedAccount.address, `pool account ${selectedAccount.index}`);
251
- }
235
+ const authorizations = await fetchPoolAuthorizations(unsafeApi, poolAccounts);
236
+ const selectionResult = selectAccount(authorizations);
237
+ const selectedAccount = selectionResult.account;
238
+ const eligibleCount = selectionResult.eligibleCount;
239
+ await ensureAuthorized(unsafeApi, selectedAccount.address, `pool account ${selectedAccount.index}`);
252
240
  console.log(` Using pool account ${selectedAccount.index}: ${selectedAccount.address}`);
253
241
  setDeployAttribute("deploy.signer.mode", "pool");
254
242
  setDeployAttribute("deploy.pool.account", truncateAddress(selectedAccount.address));
@@ -260,7 +248,7 @@ async function getProvider() {
260
248
  throw e;
261
249
  }
262
250
  }
263
- async function getDirectProvider(mnemonic, derivationPath = "", bulletinAuthorizeV2) {
251
+ async function getDirectProvider(mnemonic, derivationPath = "") {
264
252
  const primary = BULLETIN_ENDPOINTS[0];
265
253
  console.log(` Connecting to Bulletin: ${primary}`);
266
254
  const client = createPolkadotClient(getWsProvider(
@@ -277,7 +265,7 @@ async function getDirectProvider(mnemonic, derivationPath = "", bulletinAuthoriz
277
265
  let now = currentBlock.number;
278
266
  if (!auth || Number(auth.expiration ?? 0) <= now) {
279
267
  try {
280
- await ensureAuthorized(unsafeApi, ss58, "direct signer", bulletinAuthorizeV2);
268
+ await ensureAuthorized(unsafeApi, ss58, "direct signer");
281
269
  [auth, currentBlock] = await Promise.all([
282
270
  unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum("Account", ss58)),
283
271
  client.getFinalizedBlock()
@@ -411,7 +399,7 @@ function assignDenseNonces(stored, startNonce) {
411
399
  return nonces;
412
400
  }
413
401
  var __assignDenseNoncesForTest = assignDenseNonces;
414
- async function storeChunkedContent(chunks, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect, fetchNonce: fetchNonceOverride, skipCids, probeFailedCids, gateway: providerGateway, bulletinAuthorizeV2, trustedCids, skipRootStore } = {}) {
402
+ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect, fetchNonce: fetchNonceOverride, skipCids, probeFailedCids, gateway: providerGateway, trustedCids, skipRootStore } = {}) {
415
403
  const _fetchNonce = fetchNonceOverride ?? fetchNonce;
416
404
  console.log(`
417
405
  Chunks: ${chunks.length}`);
@@ -483,7 +471,7 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
483
471
  Account needs re-authorization (authorized=${isAuthorized}, need ${requiredTxs} txs / ${(totalBytes / 1e6).toFixed(1)}MB, have ${txsRemainingDisplay} txs / ${(Number(bytesRemainingDisplay) / 1e6).toFixed(2)}MB)`);
484
472
  console.log(` Attempting to re-authorize with Alice...`);
485
473
  try {
486
- await ensureAuthorized(unsafeApi, ss58, void 0, bulletinAuthorizeV2, { txs: requiredTxs, bytes: requiredBytes });
474
+ await ensureAuthorized(unsafeApi, ss58, void 0, { txs: requiredTxs, bytes: requiredBytes });
487
475
  console.log(` Re-authorization successful`);
488
476
  } catch (e) {
489
477
  throw new NonRetryableError(`Account ${ss58} has insufficient Bulletin authorization and auto-authorization via Alice failed (${e.message}). Authorize the account on-chain.`);
@@ -954,8 +942,10 @@ async function storeDirectory(directoryPath, providerOrOptions = {}, password, j
954
942
  chunkCount: carChunks.length,
955
943
  totalSize: `${(carContent.length / 1024 / 1024).toFixed(2)} MB`
956
944
  });
957
- const carMb = String(Math.round(carContent.length / 1024 / 1024 * 100) / 100);
958
- const storageCid = await withSpan("deploy.chunk-upload", "1b. chunk-upload", { "deploy.chunks.total": carChunks.length, "deploy.car.bytes": carContent.length, "deploy.car.mb": carMb }, async () => {
945
+ const carMbFloat = Math.round(carContent.length / 1024 / 1024 * 100) / 100;
946
+ const carMb = String(carMbFloat);
947
+ const carSizeBucket = carMbFloat < 1 ? "tiny" : carMbFloat < 5 ? "small" : carMbFloat < 15 ? "medium" : carMbFloat < 50 ? "large" : "xlarge";
948
+ const storageCid = await withSpan("deploy.chunk-upload", "1b. chunk-upload", { "deploy.chunks.total": carChunks.length, "deploy.car.bytes": carContent.length, "deploy.car.mb": carMb, "deploy.car.size_bucket": carSizeBucket }, async () => {
959
949
  sampleMemory("chunk_upload_start");
960
950
  const r = await storeChunkedContent(carChunks, provider);
961
951
  sampleMemory("chunk_upload_end");
@@ -1398,6 +1388,7 @@ async function storeDirectoryV2(directoryPath, opts = {}) {
1398
1388
  const stats = computeStats({
1399
1389
  manifestSource: fetched.source,
1400
1390
  manifestFetchAttempts: fetched.source === "none" ? 0 : fetched.attempts ?? 0,
1391
+ manifestFetchReason: fetched.source === "heuristic_fallback" ? fetched.reason : void 0,
1401
1392
  manifestBytes: fetched.source === "embedded" ? fetched.bytesDownloaded ?? 0 : 0,
1402
1393
  framework,
1403
1394
  filesTotal: filesTotalCount,
@@ -1549,7 +1540,6 @@ async function deploy(content, domainName = null, options = {}) {
1549
1540
  let envIpfs;
1550
1541
  let envAutoAccountMapping = false;
1551
1542
  let envContracts = {};
1552
- let envBulletinAuthorizeV2 = false;
1553
1543
  let envNativeToEthRatio;
1554
1544
  let envRegisterStorageDeposit;
1555
1545
  let envPopSelfServe = null;
@@ -1568,7 +1558,6 @@ async function deploy(content, domainName = null, options = {}) {
1568
1558
  envIpfs = resolved.ipfs;
1569
1559
  envAutoAccountMapping = resolved.autoAccountMapping;
1570
1560
  envContracts = resolved.contracts;
1571
- envBulletinAuthorizeV2 = resolved.bulletinAuthorizeV2;
1572
1561
  envNativeToEthRatio = resolved.nativeToEthRatio;
1573
1562
  envRegisterStorageDeposit = resolved.registerStorageDeposit;
1574
1563
  envPopSelfServe = getPopSelfServeConfig(doc, envId);
@@ -1611,7 +1600,7 @@ async function deploy(content, domainName = null, options = {}) {
1611
1600
  if (process.env.CI) console.log(` Runner: ${resolveRunner()} (${resolveRunnerType()})`);
1612
1601
  if (options.password) console.log(` Encrypted: yes`);
1613
1602
  let provider;
1614
- const reconnect = options.mnemonic ? () => getDirectProvider(options.mnemonic, options.derivationPath, envBulletinAuthorizeV2) : () => getProvider();
1603
+ const reconnect = options.mnemonic ? () => getDirectProvider(options.mnemonic, options.derivationPath) : () => getProvider();
1615
1604
  let dotnsPreflight = null;
1616
1605
  let previousContenthashCid = null;
1617
1606
  try {
@@ -1665,7 +1654,7 @@ async function deploy(content, domainName = null, options = {}) {
1665
1654
  }
1666
1655
  }
1667
1656
  provider = await reconnect();
1668
- const providerWithReconnect = { ...provider, reconnect, bulletinAuthorizeV2: envBulletinAuthorizeV2 };
1657
+ const providerWithReconnect = { ...provider, reconnect };
1669
1658
  const [isTestnet, estimated] = await Promise.all([
1670
1659
  detectTestnet(provider.unsafeApi),
1671
1660
  estimateUploadBytes(content)
@@ -1675,7 +1664,7 @@ async function deploy(content, domainName = null, options = {}) {
1675
1664
  const uploadBytes = Math.ceil(estimated * 1.2);
1676
1665
  const chunksNeeded = Math.max(1, Math.ceil(uploadBytes / CHUNK_SIZE));
1677
1666
  const needs = { txs: BigInt(chunksNeeded + 2), bytes: BigInt(uploadBytes) };
1678
- await topUpBy(provider.unsafeApi, provider.ss58, needs, "uploader", envBulletinAuthorizeV2);
1667
+ await topUpBy(provider.unsafeApi, provider.ss58, needs, "uploader");
1679
1668
  }
1680
1669
  console.log("\n" + "=".repeat(60));
1681
1670
  console.log("Storage");
@@ -1,3 +1,7 @@
1
+ import {
2
+ setDeployAttribute
3
+ } from "./chunk-LFKP64TQ.js";
4
+
1
5
  // src/pool.ts
2
6
  import { sr25519CreateDerive } from "@polkadot-labs/hdkd";
3
7
  import { DEV_PHRASE, entropyToMiniSecret, mnemonicToEntropy } from "@polkadot-labs/hdkd-helpers";
@@ -14,7 +18,6 @@ var DEPLOY_PATH_PREFIX = "//deploy";
14
18
  var TOPUP_TRANSACTIONS = 1e3;
15
19
  var TOPUP_BYTES = 100000000n;
16
20
  var WS_HEARTBEAT_TIMEOUT_MS = 3e5;
17
- var AUTHORIZATION_EXTENSION_BLOCKS = 2e6;
18
21
  function derivePoolAccounts(poolSize = 10, mnemonic = DEV_PHRASE) {
19
22
  const entropy = mnemonicToEntropy(mnemonic);
20
23
  const miniSecret = entropyToMiniSecret(entropy);
@@ -30,23 +33,19 @@ function derivePoolAccounts(poolSize = 10, mnemonic = DEV_PHRASE) {
30
33
  }
31
34
  return accounts;
32
35
  }
33
- function isAuthorizationSufficient(auth, currentBlock, check = {}) {
36
+ function isAuthorizationSufficient(auth, currentBlock, needs) {
34
37
  if (auth === void 0) return false;
35
38
  if (Number(auth.expiration ?? 0) <= currentBlock) return false;
36
- if (check.bulletinAuthorizeV2 && check.needs) {
39
+ if (needs) {
37
40
  const txsRemaining = BigInt(auth.extent.transactions_allowance) - BigInt(auth.extent.transactions);
38
41
  const bytesRemaining = BigInt(auth.extent.bytes_allowance) - BigInt(auth.extent.bytes);
39
- if (txsRemaining < check.needs.txs) return false;
40
- if (bytesRemaining < check.needs.bytes) return false;
42
+ if (txsRemaining < needs.txs) return false;
43
+ if (bytesRemaining < needs.bytes) return false;
41
44
  }
42
45
  return true;
43
46
  }
44
- function selectAccount(authorizations, random = Math.random, currentBlock) {
45
- const eligible = authorizations.filter(
46
- (a) => currentBlock === void 0 || a.expiration > currentBlock
47
- );
48
- if (eligible.length === 0) return null;
49
- return { account: eligible[Math.floor(random() * eligible.length)], eligibleCount: eligible.length };
47
+ function selectAccount(authorizations, random = Math.random) {
48
+ return { account: authorizations[Math.floor(random() * authorizations.length)], eligibleCount: authorizations.length };
50
49
  }
51
50
  async function fetchPoolAuthorizations(api, accounts) {
52
51
  const results = await Promise.all(
@@ -145,83 +144,59 @@ function clampU32(n, name) {
145
144
  if (n > U32_MAX) throw new Error(`${name} (${n}) exceeds u32 max \u2014 split the deploy into smaller batches`);
146
145
  return Number(n);
147
146
  }
148
- async function ensureAuthorized(api, address, label, bulletinAuthorizeV2, needs) {
147
+ function markBulletinAuthGranted() {
148
+ setDeployAttribute("deploy.unblock.bulletin_auth.fired", "true");
149
+ setDeployAttribute("deploy.unblock.bulletin_auth.granted_txs", String(TOPUP_TRANSACTIONS));
150
+ setDeployAttribute("deploy.unblock.bulletin_auth.granted_bytes", String(TOPUP_BYTES));
151
+ }
152
+ async function ensureAuthorized(api, address, label, needs) {
149
153
  const [auth, currentBlock] = await Promise.all([
150
154
  api.query.TransactionStorage.Authorizations.getValue(Enum("Account", address)),
151
155
  api.query.System.Number.getValue()
152
156
  ]);
153
- if (isAuthorizationSufficient(auth, currentBlock, { needs, bulletinAuthorizeV2 })) return;
157
+ if (isAuthorizationSufficient(auth, currentBlock, needs)) return;
154
158
  console.log(` Auto-authorizing ${label ?? "account"} (${address.slice(0, 8)}...)...`);
155
159
  const { signer } = aliceKeyring();
156
- if (bulletinAuthorizeV2) {
157
- await submitAliceTxWithRetry(
158
- () => api.tx.TransactionStorage.authorize_account({
159
- who: address,
160
- transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
161
- bytes: TOPUP_BYTES
162
- }),
163
- signer,
164
- `authorize_account(${label ?? "account"})`
165
- );
166
- console.log(` Authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
167
- } else {
168
- const newExpiration = currentBlock + AUTHORIZATION_EXTENSION_BLOCKS;
169
- await submitAliceTxWithRetry(
170
- () => api.tx.TransactionStorage.authorize_account({
171
- who: address,
172
- expiration: newExpiration
173
- }),
174
- signer,
175
- `authorize_account(${label ?? "account"})`
176
- );
177
- console.log(` Authorized: expires at block ${newExpiration} (current: ${currentBlock})`);
178
- }
160
+ await submitAliceTxWithRetry(
161
+ () => api.tx.TransactionStorage.authorize_account({
162
+ who: address,
163
+ transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
164
+ bytes: TOPUP_BYTES
165
+ }),
166
+ signer,
167
+ `authorize_account(${label ?? "account"})`
168
+ );
169
+ console.log(` Authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
170
+ markBulletinAuthGranted();
179
171
  }
180
- async function topUpBy(api, address, needs, label, bulletinAuthorizeV2) {
172
+ async function topUpBy(api, address, needs, label) {
181
173
  const [currentAuth, currentBlock] = await Promise.all([
182
174
  api.query.TransactionStorage.Authorizations.getValue(Enum("Account", address)),
183
175
  api.query.System.Number.getValue()
184
176
  ]);
185
- if (isAuthorizationSufficient(currentAuth, currentBlock, { needs, bulletinAuthorizeV2 })) {
177
+ if (isAuthorizationSufficient(currentAuth, currentBlock, needs)) {
186
178
  const expiration = Number(currentAuth.expiration);
187
- if (currentAuth.extent) {
188
- const fmtMB = (b) => (Number(b) / 1e6).toFixed(1);
189
- const txsRemaining = BigInt(currentAuth.extent.transactions_allowance) - BigInt(currentAuth.extent.transactions);
190
- const bytesRemaining = BigInt(currentAuth.extent.bytes_allowance) - BigInt(currentAuth.extent.bytes);
191
- console.log(` Pre-auth skipped for ${label ?? "account"} (${address.slice(0, 8)}...): authorized until block ${expiration}, ${txsRemaining} txs / ${fmtMB(bytesRemaining)}MB remaining.`);
192
- } else {
193
- console.log(` Pre-auth skipped for ${label ?? "account"} (${address.slice(0, 8)}...): authorized until block ${expiration}.`);
194
- }
179
+ const fmtMB = (b) => (Number(b) / 1e6).toFixed(1);
180
+ const txsRemaining = BigInt(currentAuth.extent.transactions_allowance) - BigInt(currentAuth.extent.transactions);
181
+ const bytesRemaining = BigInt(currentAuth.extent.bytes_allowance) - BigInt(currentAuth.extent.bytes);
182
+ console.log(` Pre-auth skipped for ${label ?? "account"} (${address.slice(0, 8)}...): authorized until block ${expiration}, ${txsRemaining} txs / ${fmtMB(bytesRemaining)}MB remaining.`);
195
183
  return;
196
184
  }
197
185
  const { signer } = aliceKeyring();
198
- if (bulletinAuthorizeV2) {
199
- console.log(` Pre-authorizing ${label ?? "account"} (${address.slice(0, 8)}...): granting ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB...`);
200
- await submitAliceTxWithRetry(
201
- () => api.tx.TransactionStorage.authorize_account({
202
- who: address,
203
- transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
204
- bytes: TOPUP_BYTES
205
- }),
206
- signer,
207
- `topUpBy(${label ?? "account"})`
208
- );
209
- console.log(` Pre-authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
210
- } else {
211
- const newExpiration = currentBlock + AUTHORIZATION_EXTENSION_BLOCKS;
212
- console.log(` Pre-authorizing ${label ?? "account"} (${address.slice(0, 8)}...): extending authorization to block ${newExpiration}...`);
213
- await submitAliceTxWithRetry(
214
- () => api.tx.TransactionStorage.authorize_account({
215
- who: address,
216
- expiration: newExpiration
217
- }),
218
- signer,
219
- `topUpBy(${label ?? "account"})`
220
- );
221
- console.log(` Pre-authorized: expires at block ${newExpiration}`);
222
- }
186
+ console.log(` Pre-authorizing ${label ?? "account"} (${address.slice(0, 8)}...): granting ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB...`);
187
+ await submitAliceTxWithRetry(
188
+ () => api.tx.TransactionStorage.authorize_account({
189
+ who: address,
190
+ transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
191
+ bytes: TOPUP_BYTES
192
+ }),
193
+ signer,
194
+ `topUpBy(${label ?? "account"})`
195
+ );
196
+ console.log(` Pre-authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
197
+ markBulletinAuthGranted();
223
198
  }
224
- async function bootstrapPool(bulletinRpc, poolSize = 10, mnemonic, opts = {}) {
199
+ async function bootstrapPool(bulletinRpc, poolSize = 10, mnemonic) {
225
200
  console.log(`Bootstrapping ${poolSize} pool accounts on ${bulletinRpc}...
226
201
  `);
227
202
  await cryptoWaitReady();
@@ -238,40 +213,19 @@ async function bootstrapPool(bulletinRpc, poolSize = 10, mnemonic, opts = {}) {
238
213
  const aliceBalance = BigInt(aliceAccount.data.free);
239
214
  console.log(`Alice balance: ${formatPasBalance(aliceBalance)} PAS
240
215
  `);
241
- const currentBlock = await api.query.System.Number.getValue();
242
- if (opts.bulletinAuthorizeV2) {
243
- console.log(`Authorizing accounts with V2 (${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB)
244
- `);
245
- } else {
246
- const authExpiration = currentBlock + AUTHORIZATION_EXTENSION_BLOCKS;
247
- console.log(`Authorizing accounts until block ${authExpiration} (current: ${currentBlock})
216
+ console.log(`Authorizing accounts (${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB)
248
217
  `);
249
- }
250
218
  for (const account of accounts) {
251
219
  console.log(`Account ${account.index}: ${account.address}`);
252
220
  try {
253
- let tx;
254
- if (opts.bulletinAuthorizeV2) {
255
- tx = api.tx.TransactionStorage.authorize_account({
256
- who: account.address,
257
- transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
258
- bytes: TOPUP_BYTES
259
- });
260
- } else {
261
- const authExpiration = currentBlock + AUTHORIZATION_EXTENSION_BLOCKS;
262
- tx = api.tx.TransactionStorage.authorize_account({
263
- who: account.address,
264
- expiration: authExpiration
265
- });
266
- }
221
+ const tx = api.tx.TransactionStorage.authorize_account({
222
+ who: account.address,
223
+ transactions: clampU32(BigInt(TOPUP_TRANSACTIONS), "transactions"),
224
+ bytes: TOPUP_BYTES
225
+ });
267
226
  const result = await tx.signAndSubmit(aliceSigner);
268
227
  if (!result.ok) throw new Error("dispatch failed");
269
- if (opts.bulletinAuthorizeV2) {
270
- console.log(` Authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
271
- } else {
272
- const authExpiration = currentBlock + AUTHORIZATION_EXTENSION_BLOCKS;
273
- console.log(` Authorized: expires at block ${authExpiration}`);
274
- }
228
+ console.log(` Authorized: ${TOPUP_TRANSACTIONS} txs / ${Number(TOPUP_BYTES) / 1e6}MB`);
275
229
  } catch (e) {
276
230
  console.log(` Authorization failed: ${e.message?.slice(0, 80)}`);
277
231
  }
@@ -6,15 +6,15 @@ import {
6
6
  resolveDotnsConnectOptions,
7
7
  storeDirectory,
8
8
  storeFile
9
- } from "./chunk-P6CHOMN3.js";
9
+ } from "./chunk-TPDF24MG.js";
10
10
  import {
11
11
  DotNS
12
- } from "./chunk-DNXH4QTI.js";
12
+ } from "./chunk-6Y3XJGV7.js";
13
13
  import {
14
14
  getPopSelfServeConfig,
15
15
  loadEnvironments,
16
16
  resolveEndpoints
17
- } from "./chunk-OITUIM2E.js";
17
+ } from "./chunk-HZKRLQLG.js";
18
18
  import {
19
19
  NonRetryableError
20
20
  } from "./chunk-ZOC4GITL.js";
@@ -5,9 +5,9 @@ import {
5
5
  _decodeStorageValue,
6
6
  _resetProbeSession,
7
7
  probeChunks
8
- } from "./chunk-QTZNULSH.js";
9
- import "./chunk-MFTODIIT.js";
10
- import "./chunk-KJH2T5TQ.js";
8
+ } from "./chunk-7NKOV5SU.js";
9
+ import "./chunk-LFKP64TQ.js";
10
+ import "./chunk-37M4NISG.js";
11
11
  export {
12
12
  ChainProbeCrossValidationError,
13
13
  ChainProbeMetadataError,
package/dist/deploy.d.ts CHANGED
@@ -29,7 +29,6 @@ interface ExistingProvider {
29
29
  skipCids?: Set<string>;
30
30
  probeFailedCids?: Set<string>;
31
31
  gateway?: string;
32
- bulletinAuthorizeV2?: boolean;
33
32
  /**
34
33
  * CIDs the caller vouches are already on-chain. Chunks matching these CIDs
35
34
  * are skipped without any re-probe (unlike `skipCids` which re-probes before
@@ -86,7 +85,7 @@ declare function storeFile(contentBytes: Uint8Array, { client: existingClient, u
86
85
  */
87
86
  declare function assignDenseNonces(stored: (StoredChunk | null)[], startNonce: number): Map<number, number>;
88
87
  declare const __assignDenseNoncesForTest: typeof assignDenseNonces;
89
- declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect, fetchNonce: fetchNonceOverride, skipCids, probeFailedCids, gateway: providerGateway, bulletinAuthorizeV2, trustedCids, skipRootStore }?: ExistingProvider): Promise<{
88
+ declare function storeChunkedContent(chunks: Uint8Array[], { client: existingClient, unsafeApi: existingApi, signer: existingSigner, ss58: existingSS58, reconnect, fetchNonce: fetchNonceOverride, skipCids, probeFailedCids, gateway: providerGateway, trustedCids, skipRootStore }?: ExistingProvider): Promise<{
90
89
  storageCid: string;
91
90
  tier2Verified: number;
92
91
  tier2Inconclusive: number;
package/dist/deploy.js CHANGED
@@ -35,20 +35,20 @@ import {
35
35
  storeDirectoryV2,
36
36
  storeFile,
37
37
  unpublish
38
- } from "./chunk-P6CHOMN3.js";
39
- import "./chunk-KHVTYIIX.js";
38
+ } from "./chunk-TPDF24MG.js";
39
+ import "./chunk-IW3X2MJF.js";
40
40
  import "./chunk-KOSF5FDO.js";
41
- import "./chunk-FZWJV5AD.js";
41
+ import "./chunk-L2SKSKB6.js";
42
42
  import "./chunk-S7EM5VMW.js";
43
- import "./chunk-ADNBLFDP.js";
44
- import "./chunk-43HLT335.js";
45
- import "./chunk-QTZNULSH.js";
43
+ import "./chunk-THZU3FZU.js";
44
+ import "./chunk-64KTKZ7H.js";
45
+ import "./chunk-7NKOV5SU.js";
46
46
  import "./chunk-C2TS5MER.js";
47
- import "./chunk-DNXH4QTI.js";
48
- import "./chunk-QMYW3D6E.js";
49
- import "./chunk-MFTODIIT.js";
50
- import "./chunk-KJH2T5TQ.js";
51
- import "./chunk-OITUIM2E.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";
52
52
  import {
53
53
  EXIT_CODE_NO_RETRY,
54
54
  NonRetryableError
package/dist/dotns.d.ts CHANGED
@@ -112,6 +112,7 @@ declare const OPERATION_TIMEOUT_MS: number;
112
112
  declare const TX_TIMEOUT_MS: number;
113
113
  declare const TX_CHAIN_TIME_BUDGET_MS: number;
114
114
  declare const TX_WALL_CLOCK_CEILING_MS: number;
115
+ declare const TX_NO_PROGRESS_MS: number;
115
116
  declare const WS_HEARTBEAT_TIMEOUT_MS: number;
116
117
  declare const DOTNS_TX_MAX_ATTEMPTS: number;
117
118
  declare function classifyTxRetryDecision(err: unknown): "retry" | "abort";
@@ -231,6 +232,7 @@ declare function stripTrailingDigits(label: string): string;
231
232
  declare function sanitizeDomainLabel(label: string): string;
232
233
  declare function validateDomainLabel(label: string, opts?: {
233
234
  checkReserved?: boolean;
235
+ skipSanitize?: boolean;
234
236
  }): string;
235
237
  declare function isCommitmentMature(chainNowSeconds: number, commitTimestampSeconds: number, minimumAgeSeconds: number): boolean;
236
238
  declare function isCommitmentTimingBarerevert(msg: string): boolean;
@@ -289,6 +291,13 @@ declare class ReviveClientWrapper {
289
291
  args?: unknown[];
290
292
  }[], signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void): Promise<TxResolution>;
291
293
  }
294
+ /**
295
+ * Formats a papi 2.x dispatchError object into a readable string.
296
+ * papi typed enums default .toString() returns "[object Object]"; this
297
+ * serialises the structure with BigInt-safe JSON so error messages are
298
+ * useful for debugging (e.g. {type:"Module",value:{type:"Revive",...}}).
299
+ */
300
+ declare function formatDispatchError(err: unknown): string;
292
301
  type AliasAccountState = "not-bound" | "bound-likely-stale" | "wrong-context" | "bound-fresh";
293
302
  interface AliasAccountClassification {
294
303
  state: AliasAccountState;
@@ -503,4 +512,4 @@ declare class DotNS {
503
512
  }
504
513
  declare const dotns: DotNS;
505
514
 
506
- 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_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, formatPersonhoodRemediation, formatPopShortfallReason, isCommitmentMature, isCommitmentTimingBarerevert, parseDomainName, parseProofOfPersonhoodStatus, popStatusName, sanitizeDomainLabel, stripTrailingDigits, validateDomainLabel, verifyNonceAdvanced };
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 };
package/dist/dotns.js CHANGED
@@ -18,6 +18,7 @@ import {
18
18
  TX_CHAIN_TIME_BUDGET_MS,
19
19
  TX_KIND_HASH,
20
20
  TX_KIND_NONCE_ADVANCED,
21
+ TX_NO_PROGRESS_MS,
21
22
  TX_TIMEOUT_MS,
22
23
  TX_WALL_CLOCK_CEILING_MS,
23
24
  WS_HEARTBEAT_TIMEOUT_MS,
@@ -34,6 +35,7 @@ import {
34
35
  feeFloorFor,
35
36
  fetchNonce,
36
37
  fmtPas,
38
+ formatDispatchError,
37
39
  formatPersonhoodRemediation,
38
40
  formatPopShortfallReason,
39
41
  isCommitmentMature,
@@ -45,11 +47,11 @@ import {
45
47
  stripTrailingDigits,
46
48
  validateDomainLabel,
47
49
  verifyNonceAdvanced
48
- } from "./chunk-DNXH4QTI.js";
49
- import "./chunk-QMYW3D6E.js";
50
- import "./chunk-MFTODIIT.js";
51
- import "./chunk-KJH2T5TQ.js";
52
- import "./chunk-OITUIM2E.js";
50
+ } from "./chunk-6Y3XJGV7.js";
51
+ import "./chunk-Y7XKC43A.js";
52
+ import "./chunk-LFKP64TQ.js";
53
+ import "./chunk-37M4NISG.js";
54
+ import "./chunk-HZKRLQLG.js";
53
55
  import "./chunk-ZOC4GITL.js";
54
56
  export {
55
57
  ATTR_TX_RESOLUTION_KIND,
@@ -71,6 +73,7 @@ export {
71
73
  TX_CHAIN_TIME_BUDGET_MS,
72
74
  TX_KIND_HASH,
73
75
  TX_KIND_NONCE_ADVANCED,
76
+ TX_NO_PROGRESS_MS,
74
77
  TX_TIMEOUT_MS,
75
78
  TX_WALL_CLOCK_CEILING_MS,
76
79
  WS_HEARTBEAT_TIMEOUT_MS,
@@ -87,6 +90,7 @@ export {
87
90
  feeFloorFor,
88
91
  fetchNonce,
89
92
  fmtPas,
93
+ formatDispatchError,
90
94
  formatPersonhoodRemediation,
91
95
  formatPopShortfallReason,
92
96
  isCommitmentMature,