bulletin-deploy 0.7.9-rc.3 → 0.7.10

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.
@@ -9,10 +9,10 @@ import {
9
9
  offerBugReport,
10
10
  scrubSecrets,
11
11
  setDeployContext
12
- } from "./chunk-ENYTGUYK.js";
13
- import "./chunk-57YIJ7UN.js";
14
- import "./chunk-PAELXYOM.js";
15
- import "./chunk-U4TKK7NL.js";
12
+ } from "./chunk-E2ZOGJ5R.js";
13
+ import "./chunk-DFD2WF67.js";
14
+ import "./chunk-IXUFM7P6.js";
15
+ import "./chunk-B2MLOHKF.js";
16
16
  import "./chunk-QGM4M3NI.js";
17
17
  export {
18
18
  buildCliFlagsSummary,
@@ -6,7 +6,7 @@ import * as path from "path";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "bulletin-deploy",
9
- version: "0.7.9-rc.3",
9
+ version: "0.7.10",
10
10
  private: false,
11
11
  repository: {
12
12
  type: "git",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-PAELXYOM.js";
3
+ } from "./chunk-IXUFM7P6.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -2,11 +2,11 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-57YIJ7UN.js";
5
+ } from "./chunk-DFD2WF67.js";
6
6
  import {
7
7
  VERSION,
8
8
  getCurrentSentryTraceId
9
- } from "./chunk-PAELXYOM.js";
9
+ } from "./chunk-IXUFM7P6.js";
10
10
 
11
11
  // src/bug-report.ts
12
12
  import { execSync, execFileSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  package_default,
3
3
  writeRunState
4
- } from "./chunk-U4TKK7NL.js";
4
+ } from "./chunk-B2MLOHKF.js";
5
5
 
6
6
  // src/memory-report.ts
7
7
  import * as fs2 from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  setDeployContext
3
- } from "./chunk-ENYTGUYK.js";
3
+ } from "./chunk-E2ZOGJ5R.js";
4
4
  import {
5
5
  DotNS,
6
6
  TX_TIMEOUT_MS,
@@ -8,7 +8,7 @@ import {
8
8
  parseDomainName,
9
9
  popStatusName,
10
10
  verifyNonceAdvanced
11
- } from "./chunk-YJ6X5JQ3.js";
11
+ } from "./chunk-TOFKHL4S.js";
12
12
  import {
13
13
  MirrorSkipped,
14
14
  mirrorToGitHubPages,
@@ -27,7 +27,7 @@ import {
27
27
  truncateAddress,
28
28
  withDeploySpan,
29
29
  withSpan
30
- } from "./chunk-PAELXYOM.js";
30
+ } from "./chunk-IXUFM7P6.js";
31
31
  import {
32
32
  merkleizeJS
33
33
  } from "./chunk-B7GUYYAN.js";
@@ -2,7 +2,7 @@ import {
2
2
  captureWarning,
3
3
  setDeployAttribute,
4
4
  withSpan
5
- } from "./chunk-PAELXYOM.js";
5
+ } from "./chunk-IXUFM7P6.js";
6
6
  import {
7
7
  isTestnetSpecName
8
8
  } from "./chunk-RP4YJYNB.js";
@@ -158,6 +158,8 @@ var DOTNS_REGISTRAR_ABI = [
158
158
  var POP_RULES_ABI = [
159
159
  { inputs: [{ name: "name", type: "string" }], name: "classifyName", outputs: [{ name: "requirement", type: "uint8" }, { name: "message", type: "string" }], stateMutability: "pure", type: "function" },
160
160
  { inputs: [{ name: "name", type: "string" }], name: "price", outputs: [{ name: "", type: "uint256" }], stateMutability: "view", type: "function" },
161
+ { inputs: [{ name: "name", type: "string" }, { name: "userAddress", type: "address" }], name: "priceWithCheck", outputs: [{ name: "metadata", type: "tuple", components: [{ name: "price", type: "uint256" }, { name: "status", type: "uint8" }, { name: "userStatus", type: "uint8" }, { name: "message", type: "string" }] }], stateMutability: "view", type: "function" },
162
+ { inputs: [{ name: "name", type: "string" }, { name: "userAddress", type: "address" }], name: "priceWithoutCheck", outputs: [{ name: "metadata", type: "tuple", components: [{ name: "price", type: "uint256" }, { name: "status", type: "uint8" }, { name: "userStatus", type: "uint8" }, { name: "message", type: "string" }] }], stateMutability: "view", type: "function" },
161
163
  { inputs: [{ name: "", type: "address" }], name: "userPopStatus", outputs: [{ name: "", type: "uint8" }], stateMutability: "view", type: "function" },
162
164
  { inputs: [{ name: "status", type: "uint8" }], name: "setUserPopStatus", outputs: [], stateMutability: "nonpayable", type: "function" },
163
165
  { inputs: [{ name: "name", type: "string" }], name: "isBaseNameReserved", outputs: [{ name: "isReserved", type: "bool" }, { name: "reservationOwner", type: "address" }, { name: "expiryTimestamp", type: "uint64" }], stateMutability: "view", type: "function" }
@@ -214,6 +216,42 @@ function extractStorageDepositCharge(rawStorageDeposit) {
214
216
  if (rawStorageDeposit.value != null) return convertToBigInt(rawStorageDeposit.value, 0n);
215
217
  return 0n;
216
218
  }
219
+ function dotnsContractName(address) {
220
+ const normalized = address.toLowerCase();
221
+ for (const [name, contractAddress] of Object.entries(CONTRACTS)) {
222
+ if (contractAddress.toLowerCase() === normalized) return name;
223
+ }
224
+ return "unknown";
225
+ }
226
+ function stringifyDebugValue(value) {
227
+ return JSON.stringify(value, (_key, nested) => typeof nested === "bigint" ? nested.toString() : nested);
228
+ }
229
+ function dotnsTxDebugEnabled() {
230
+ return process.env.BULLETIN_DEPLOY_DOTNS_DEBUG === "1" || process.env.DOTNS_DEBUG === "1";
231
+ }
232
+ function formatWeight(weight) {
233
+ if (!weight) return "unknown";
234
+ return `ref_time=${weight.referenceTime.toString()} proof_size=${weight.proofSize.toString()}`;
235
+ }
236
+ function formatContractDryRunFailure(gasEstimate, context) {
237
+ const functionName = context.functionName ?? "unknown";
238
+ const contractName = dotnsContractName(context.contractAddress);
239
+ const lines = [
240
+ `Contract execution would revert during ${functionName} on ${contractName}`,
241
+ ` contract: ${context.contractAddress}`,
242
+ ` signer: ${context.signerSubstrateAddress}${context.signerEvmAddress ? ` (${context.signerEvmAddress})` : ""}`,
243
+ ` value: ${context.value.toString()}`,
244
+ ` revert: flags=${gasEstimate.revertFlags?.toString() ?? "unknown"} data=${gasEstimate.revertData ?? "0x"}`,
245
+ ` gasRequired: ${formatWeight(gasEstimate.gasRequired)}`,
246
+ ` gasConsumed: ${formatWeight(gasEstimate.gasConsumed)}`,
247
+ ` storageDeposit: ${gasEstimate.storageDeposit?.toString() ?? "unknown"}`
248
+ ];
249
+ if (dotnsTxDebugEnabled()) {
250
+ lines.push(` calldata: ${context.encodedData}`);
251
+ if (context.args) lines.push(` args: ${stringifyDebugValue(context.args)}`);
252
+ }
253
+ return lines.join("\n");
254
+ }
217
255
  function unwrapExecutionResult(rawResult) {
218
256
  if (!rawResult) return { ok: null, err: null, successFlag: null };
219
257
  if (typeof rawResult.success === "boolean") {
@@ -526,10 +564,21 @@ var ReviveClientWrapper = class _ReviveClientWrapper {
526
564
  }
527
565
  throw lastError instanceof Error ? lastError : new Error(String(lastError));
528
566
  }
529
- async submitTransaction(contractAddress, value, encodedData, signerSubstrateAddress, signer, statusCallback, { rpcs, useNoncePolling }) {
567
+ async submitTransaction(contractAddress, value, encodedData, signerSubstrateAddress, signer, statusCallback, { rpcs, useNoncePolling, functionName, args }) {
530
568
  await this.ensureAccountMapped(signerSubstrateAddress, signer);
569
+ const signerEvmAddress = await this.getEvmAddress(signerSubstrateAddress);
531
570
  const gasEstimate = await this.estimateGasForCall(signerSubstrateAddress, contractAddress, value, encodedData);
532
- if (!gasEstimate.success) throw new Error(`Contract execution would revert: ${gasEstimate.revertData ?? "0x"}`);
571
+ if (!gasEstimate.success) {
572
+ throw new Error(formatContractDryRunFailure(gasEstimate, {
573
+ contractAddress,
574
+ functionName,
575
+ signerSubstrateAddress,
576
+ signerEvmAddress,
577
+ value,
578
+ encodedData,
579
+ args
580
+ }));
581
+ }
533
582
  const weightLimit = { proof_size: gasEstimate.gasRequired.proofSize, ref_time: gasEstimate.gasRequired.referenceTime };
534
583
  const minimumStorageDeposit = 2000000000000n;
535
584
  let storageDepositLimit = gasEstimate.storageDeposit === 0n ? minimumStorageDeposit : gasEstimate.storageDeposit * 120n / 100n;
@@ -867,7 +916,7 @@ var DotNS = class {
867
916
  const encodedCallData = encodeFunctionData({ abi: contractAbi, functionName, args });
868
917
  const rpcs = this.rpc ? [this.rpc, ...RPC_ENDPOINTS.filter((ep) => ep !== this.rpc)] : RPC_ENDPOINTS;
869
918
  return await withTimeout(
870
- this.clientWrapper.submitTransaction(contractAddress, value, encodedCallData, this.substrateAddress, this.signer, statusCallback, { rpcs, useNoncePolling }),
919
+ this.clientWrapper.submitTransaction(contractAddress, value, encodedCallData, this.substrateAddress, this.signer, statusCallback, { rpcs, useNoncePolling, functionName, args }),
871
920
  OPERATION_TIMEOUT_MS,
872
921
  functionName
873
922
  );
@@ -1203,7 +1252,8 @@ var DotNS = class {
1203
1252
  throw new Error("Personhood Lite cannot register base names \u2014 this name class requires a Full or NoStatus signer");
1204
1253
  }
1205
1254
  }
1206
- const priceRaw = await withTimeout(this.contractCall(CONTRACTS.POP_RULES, POP_RULES_ABI, "price", [label]), 3e4, "price");
1255
+ const priceMeta = await withTimeout(this.contractCall(CONTRACTS.POP_RULES, POP_RULES_ABI, "priceWithCheck", [label, this.evmAddress]), 3e4, "priceWithCheck");
1256
+ const priceRaw = priceMeta.price ?? (Array.isArray(priceMeta) ? priceMeta[0] : 0n);
1207
1257
  const priceWei = typeof priceRaw === "bigint" ? priceRaw : BigInt(priceRaw);
1208
1258
  console.log(` Required status: ${popStatusName(requiredStatus)}`);
1209
1259
  console.log(` User status: ${popStatusName(userStatus)}`);
package/dist/deploy.js CHANGED
@@ -26,13 +26,13 @@ import {
26
26
  storeChunkedContent,
27
27
  storeDirectory,
28
28
  storeFile
29
- } from "./chunk-P5E4OGPH.js";
30
- import "./chunk-ENYTGUYK.js";
31
- import "./chunk-57YIJ7UN.js";
32
- import "./chunk-YJ6X5JQ3.js";
29
+ } from "./chunk-PGCTJF2J.js";
30
+ import "./chunk-E2ZOGJ5R.js";
31
+ import "./chunk-DFD2WF67.js";
32
+ import "./chunk-TOFKHL4S.js";
33
33
  import "./chunk-HOTQDYHD.js";
34
- import "./chunk-PAELXYOM.js";
35
- import "./chunk-U4TKK7NL.js";
34
+ import "./chunk-IXUFM7P6.js";
35
+ import "./chunk-B2MLOHKF.js";
36
36
  import "./chunk-B7GUYYAN.js";
37
37
  import "./chunk-RP4YJYNB.js";
38
38
  import "./chunk-QGM4M3NI.js";
package/dist/dotns.d.ts CHANGED
@@ -141,9 +141,11 @@ declare class ReviveClientWrapper {
141
141
  expectedNonce: number;
142
142
  };
143
143
  }): Promise<string>;
144
- submitTransaction(contractAddress: string, value: bigint, encodedData: string, signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void, { rpcs, useNoncePolling }: {
144
+ submitTransaction(contractAddress: string, value: bigint, encodedData: string, signerSubstrateAddress: string, signer: PolkadotSigner, statusCallback: (status: string) => void, { rpcs, useNoncePolling, functionName, args }: {
145
145
  rpcs: string[];
146
146
  useNoncePolling?: boolean;
147
+ functionName?: string;
148
+ args?: unknown[];
147
149
  }): Promise<string>;
148
150
  }
149
151
  declare function runDotnsCli(argv: string[], env?: Record<string, string>): Promise<unknown>;
package/dist/dotns.js CHANGED
@@ -35,9 +35,9 @@ import {
35
35
  stripTrailingDigits,
36
36
  validateDomainLabel,
37
37
  verifyNonceAdvanced
38
- } from "./chunk-YJ6X5JQ3.js";
39
- import "./chunk-PAELXYOM.js";
40
- import "./chunk-U4TKK7NL.js";
38
+ } from "./chunk-TOFKHL4S.js";
39
+ import "./chunk-IXUFM7P6.js";
40
+ import "./chunk-B2MLOHKF.js";
41
41
  import "./chunk-RP4YJYNB.js";
42
42
  import "./chunk-QGM4M3NI.js";
43
43
  export {
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-P5E4OGPH.js";
4
- import "./chunk-ENYTGUYK.js";
5
- import "./chunk-57YIJ7UN.js";
3
+ } from "./chunk-PGCTJF2J.js";
4
+ import "./chunk-E2ZOGJ5R.js";
5
+ import "./chunk-DFD2WF67.js";
6
6
  import {
7
7
  DotNS,
8
8
  parseDomainName
9
- } from "./chunk-YJ6X5JQ3.js";
9
+ } from "./chunk-TOFKHL4S.js";
10
10
  import "./chunk-HOTQDYHD.js";
11
- import "./chunk-PAELXYOM.js";
11
+ import "./chunk-IXUFM7P6.js";
12
12
  import {
13
13
  VERSION,
14
14
  loadRunState,
@@ -18,7 +18,7 @@ import {
18
18
  shouldSkipStaleWarning,
19
19
  stateFilePath,
20
20
  writeRunState
21
- } from "./chunk-U4TKK7NL.js";
21
+ } from "./chunk-B2MLOHKF.js";
22
22
  import {
23
23
  merkleizeJS
24
24
  } from "./chunk-B7GUYYAN.js";
@@ -5,8 +5,8 @@ import {
5
5
  maybeWriteMemoryReport,
6
6
  safeHeap,
7
7
  sampleFromBytes
8
- } from "./chunk-PAELXYOM.js";
9
- import "./chunk-U4TKK7NL.js";
8
+ } from "./chunk-IXUFM7P6.js";
9
+ import "./chunk-B2MLOHKF.js";
10
10
  import "./chunk-QGM4M3NI.js";
11
11
  export {
12
12
  DEFAULT_THRESHOLD_MB,
package/dist/run-state.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  shouldSkipStaleWarning,
8
8
  stateFilePath,
9
9
  writeRunState
10
- } from "./chunk-U4TKK7NL.js";
10
+ } from "./chunk-B2MLOHKF.js";
11
11
  import "./chunk-QGM4M3NI.js";
12
12
  export {
13
13
  VERSION,
package/dist/telemetry.js CHANGED
@@ -24,8 +24,8 @@ import {
24
24
  truncateAddress,
25
25
  withDeploySpan,
26
26
  withSpan
27
- } from "./chunk-PAELXYOM.js";
28
- import "./chunk-U4TKK7NL.js";
27
+ } from "./chunk-IXUFM7P6.js";
28
+ import "./chunk-B2MLOHKF.js";
29
29
  import "./chunk-QGM4M3NI.js";
30
30
  export {
31
31
  VERSION,
@@ -8,9 +8,9 @@ import {
8
8
  isPreReleaseVersion,
9
9
  preReleaseWarning,
10
10
  promptYesNo
11
- } from "./chunk-57YIJ7UN.js";
12
- import "./chunk-PAELXYOM.js";
13
- import "./chunk-U4TKK7NL.js";
11
+ } from "./chunk-DFD2WF67.js";
12
+ import "./chunk-IXUFM7P6.js";
13
+ import "./chunk-B2MLOHKF.js";
14
14
  import "./chunk-QGM4M3NI.js";
15
15
  export {
16
16
  assessVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulletin-deploy",
3
- "version": "0.7.9-rc.3",
3
+ "version": "0.7.10",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",