bulletin-deploy 0.6.12 → 0.6.14

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.
@@ -2,10 +2,10 @@ import {
2
2
  classifyErrorArea,
3
3
  isInteractive,
4
4
  promptYesNo
5
- } from "./chunk-ELKNME32.js";
5
+ } from "./chunk-O24K3T6Z.js";
6
6
  import {
7
7
  VERSION
8
- } from "./chunk-VL2Q4CNZ.js";
8
+ } from "./chunk-4DFHLH3R.js";
9
9
  import "./chunk-QGM4M3NI.js";
10
10
 
11
11
  // src/bug-report.ts
@@ -7,7 +7,7 @@ import * as path from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "bulletin-deploy",
10
- version: "0.6.12",
10
+ version: "0.6.14",
11
11
  private: false,
12
12
  repository: {
13
13
  type: "git",
@@ -55,7 +55,6 @@ var package_default = {
55
55
  "@polkadot/keyring": "^13.0.0",
56
56
  "@polkadot/util-crypto": "^13.0.0",
57
57
  "@sentry/node": "^9.14.0",
58
- "blockstore-core": "^6.1.3",
59
58
  "ipfs-unixfs": "^11.2.0",
60
59
  "ipfs-unixfs-importer": "^16.1.4",
61
60
  multiformats: "^13.4.1",
@@ -281,6 +280,10 @@ function setDeployAttribute(key, value) {
281
280
  const span = Sentry.getActiveSpan();
282
281
  if (span) span.setAttribute(key, value);
283
282
  }
283
+ function setDeploySentryTag(key, value) {
284
+ if (!Sentry) return;
285
+ Sentry.setTag(key, value);
286
+ }
284
287
  function captureWarning(message, context) {
285
288
  if (!Sentry) return;
286
289
  try {
@@ -313,6 +316,7 @@ export {
313
316
  withSpan,
314
317
  withDeploySpan,
315
318
  setDeployAttribute,
319
+ setDeploySentryTag,
316
320
  captureWarning,
317
321
  flush
318
322
  };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  captureWarning,
6
6
  withSpan
7
- } from "./chunk-VL2Q4CNZ.js";
7
+ } from "./chunk-4DFHLH3R.js";
8
8
 
9
9
  // src/dotns.ts
10
10
  import crypto from "crypto";
@@ -220,10 +220,18 @@ function classifyDotnsLabel(label) {
220
220
  const totalLength = label.length;
221
221
  const trailingDigits = countTrailingDigits(label);
222
222
  if (trailingDigits > 2) {
223
- return { status: ProofOfPersonhoodStatus.Reserved, message: "Name can have maximum 2 digit suffix" };
223
+ return {
224
+ status: ProofOfPersonhoodStatus.Reserved,
225
+ message: `Name has ${trailingDigits} trailing digits; DotNS allows at most 2 trailing digits. Use a base name with 0-2 trailing digits.`
226
+ };
224
227
  }
225
228
  const baselength = totalLength - trailingDigits;
226
- if (baselength <= 5) return { status: ProofOfPersonhoodStatus.Reserved, message: "Reserved for Governance" };
229
+ if (baselength <= 5) {
230
+ return {
231
+ status: ProofOfPersonhoodStatus.Reserved,
232
+ message: `Base name is ${baselength} char${baselength === 1 ? "" : "s"}; DotNS reserves base names of 5 chars or fewer for governance (PopRules). Use a base name of 6+ chars \u2014 role prefixes like 'rc<N>pool' / 'rc<N>dir' / 'nightly-<role>' work well.`
233
+ };
234
+ }
227
235
  if (baselength >= 6 && baselength <= 8) {
228
236
  if (trailingDigits === 2) return { status: ProofOfPersonhoodStatus.ProofOfPersonhoodLite, message: "Requires Light personhood verification" };
229
237
  return { status: ProofOfPersonhoodStatus.ProofOfPersonhoodFull, message: "Requires Full personhood verification" };
@@ -730,6 +738,16 @@ var DotNS = class {
730
738
  }
731
739
  console.log(` Owner: ${actualOwner}`);
732
740
  }
741
+ async getContenthash(domainName) {
742
+ this.ensureConnected();
743
+ const node = namehash(`${domainName}.dot`);
744
+ const result = await withTimeout(
745
+ this.contractCall(CONTRACTS.DOTNS_CONTENT_RESOLVER, DOTNS_CONTENT_RESOLVER_ABI, "contenthash", [node]),
746
+ 3e4,
747
+ "contenthash"
748
+ );
749
+ return typeof result === "string" ? result : result?.toString?.() ?? String(result);
750
+ }
733
751
  async setContenthash(domainName, contenthashHex) {
734
752
  return withSpan("deploy.dotns.set-contenthash", "2b. set-contenthash", {}, async () => {
735
753
  this.ensureConnected();
@@ -745,7 +763,15 @@ var DotNS = class {
745
763
  console.log(` Setting contenthash: ${ipfsCid || contenthashHex}`);
746
764
  const txHash = await this.contractTransaction(CONTRACTS.DOTNS_CONTENT_RESOLVER, 0n, DOTNS_CONTENT_RESOLVER_ABI, "setContenthash", [node, contenthashHex], (s) => console.log(` ${s}`), { useNoncePolling: true });
747
765
  console.log(` Tx: ${txHash}`);
748
- console.log(` Contenthash set successfully!
766
+ const onChainRaw = await this.getContenthash(domainName);
767
+ const onChain = (onChainRaw || "0x").toLowerCase();
768
+ const expected = contenthashHex.toLowerCase();
769
+ if (onChain !== expected) {
770
+ throw new Error(
771
+ `Post-deploy verification failed for ${domainName}.dot: on-chain contenthash is ${onChain}, not the ${expected} we just wrote. The setContenthash tx may have silently failed, or another party overwrote the domain. Re-run the deploy to retry.`
772
+ );
773
+ }
774
+ console.log(` Verified on-chain: ${ipfsCid || contenthashHex}
749
775
  `);
750
776
  return { node };
751
777
  });
@@ -761,6 +787,7 @@ var DotNS = class {
761
787
  const baselength = validated.length - trailingDigits;
762
788
  const classification = classifyDotnsLabel(validated);
763
789
  if (classification.status === ProofOfPersonhoodStatus.Reserved) {
790
+ const sanitizeTrail = label !== validated ? `Input "${label}" was sanitized to "${validated}" (excess trailing digits trimmed). ` : "";
764
791
  return {
765
792
  label: validated,
766
793
  classification,
@@ -773,7 +800,7 @@ var DotNS = class {
773
800
  reservationOwner: null,
774
801
  isTestnet: false,
775
802
  canProceed: false,
776
- reason: classification.message,
803
+ reason: `${sanitizeTrail}${classification.message}`,
777
804
  plannedAction: "abort",
778
805
  needsPopUpgrade: false
779
806
  };
@@ -5,10 +5,10 @@ import {
5
5
  fetchNonce,
6
6
  popStatusName,
7
7
  validateDomainLabel
8
- } from "./chunk-M6WNBKCT.js";
8
+ } from "./chunk-6OJJ47RG.js";
9
9
  import {
10
10
  merkleizeJS
11
- } from "./chunk-GZ5UUECB.js";
11
+ } from "./chunk-QILGABSF.js";
12
12
  import {
13
13
  derivePoolAccounts,
14
14
  detectTestnet,
@@ -24,10 +24,11 @@ import {
24
24
  resolveRunner,
25
25
  resolveRunnerType,
26
26
  setDeployAttribute,
27
+ setDeploySentryTag,
27
28
  truncateAddress,
28
29
  withDeploySpan,
29
30
  withSpan
30
- } from "./chunk-VL2Q4CNZ.js";
31
+ } from "./chunk-4DFHLH3R.js";
31
32
 
32
33
  // src/deploy.ts
33
34
  import { Buffer } from "buffer";
@@ -885,7 +886,10 @@ async function deploy(content, domainName = null, options = {}) {
885
886
  const name = validateDomainLabel(rawName);
886
887
  return withDeploySpan(name, async () => {
887
888
  const deployTag = options.tag ?? process.env.DEPLOY_TAG;
888
- if (deployTag) setDeployAttribute("deploy.tag", deployTag);
889
+ if (deployTag) {
890
+ setDeployAttribute("deploy.tag", deployTag);
891
+ setDeploySentryTag("deploy.tag", deployTag);
892
+ }
889
893
  let cid;
890
894
  let ipfsCid;
891
895
  console.log("\n" + "=".repeat(60));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-VL2Q4CNZ.js";
3
+ } from "./chunk-4DFHLH3R.js";
4
4
 
5
5
  // src/version-check.ts
6
6
  import { execSync, execFileSync } from "child_process";
@@ -2,8 +2,17 @@
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
4
  import { importer } from "ipfs-unixfs-importer";
5
- import { MemoryBlockstore } from "blockstore-core/memory";
6
5
  import { CarWriter } from "@ipld/car/writer";
6
+ var CidPreservingBlockstore = class {
7
+ data = /* @__PURE__ */ new Map();
8
+ async put(cid, bytes) {
9
+ this.data.set(cid.toString(), { cid, bytes });
10
+ return cid;
11
+ }
12
+ *all() {
13
+ yield* this.data.values();
14
+ }
15
+ };
7
16
  function walkDirectory(dirPath, prefix = "") {
8
17
  let dirents;
9
18
  try {
@@ -43,7 +52,7 @@ async function collectBytes(iter) {
43
52
  async function merkleizeJS(directoryPath) {
44
53
  console.log(` Merkleizing (JS): ${directoryPath}`);
45
54
  const files = walkDirectory(directoryPath);
46
- const blockstore = new MemoryBlockstore();
55
+ const blockstore = new CidPreservingBlockstore();
47
56
  const source = files.map((file) => ({
48
57
  path: file.path,
49
58
  content: (async function* () {
@@ -63,8 +72,8 @@ async function merkleizeJS(directoryPath) {
63
72
  }
64
73
  const { writer, out } = CarWriter.create([rootCid]);
65
74
  const collectPromise = collectBytes(out);
66
- for await (const { cid, bytes } of blockstore.getAll()) {
67
- await writer.put({ cid, bytes: await collectBytes(bytes) });
75
+ for (const { cid, bytes } of blockstore.all()) {
76
+ await writer.put({ cid, bytes });
68
77
  }
69
78
  await writer.close();
70
79
  const carBytes = await collectPromise;
package/dist/deploy.js CHANGED
@@ -23,11 +23,11 @@ import {
23
23
  storeChunkedContent,
24
24
  storeDirectory,
25
25
  storeFile
26
- } from "./chunk-RECT3AEW.js";
27
- import "./chunk-M6WNBKCT.js";
28
- import "./chunk-GZ5UUECB.js";
26
+ } from "./chunk-6YXRLX5V.js";
27
+ import "./chunk-6OJJ47RG.js";
28
+ import "./chunk-QILGABSF.js";
29
29
  import "./chunk-JHNW2EKY.js";
30
- import "./chunk-VL2Q4CNZ.js";
30
+ import "./chunk-4DFHLH3R.js";
31
31
  import "./chunk-QGM4M3NI.js";
32
32
  export {
33
33
  DEFAULT_BULLETIN_RPC,
package/dist/dotns.d.ts CHANGED
@@ -153,6 +153,7 @@ declare class DotNS {
153
153
  getPriceAndValidate(label: string): Promise<PriceValidationResult>;
154
154
  finalizeRegistration(registration: any, priceWei: bigint): Promise<void>;
155
155
  verifyOwnership(label: string): Promise<void>;
156
+ getContenthash(domainName: string): Promise<string>;
156
157
  setContenthash(domainName: string, contenthashHex: string): Promise<{
157
158
  node: string;
158
159
  }>;
package/dist/dotns.js CHANGED
@@ -29,9 +29,9 @@ import {
29
29
  simulateUserStatus,
30
30
  stripTrailingDigits,
31
31
  validateDomainLabel
32
- } from "./chunk-M6WNBKCT.js";
32
+ } from "./chunk-6OJJ47RG.js";
33
33
  import "./chunk-JHNW2EKY.js";
34
- import "./chunk-VL2Q4CNZ.js";
34
+ import "./chunk-4DFHLH3R.js";
35
35
  import "./chunk-QGM4M3NI.js";
36
36
  export {
37
37
  CONNECTION_TIMEOUT_MS,
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  deploy
3
- } from "./chunk-RECT3AEW.js";
3
+ } from "./chunk-6YXRLX5V.js";
4
4
  import {
5
5
  DotNS
6
- } from "./chunk-M6WNBKCT.js";
6
+ } from "./chunk-6OJJ47RG.js";
7
7
  import {
8
8
  merkleizeJS
9
- } from "./chunk-GZ5UUECB.js";
9
+ } from "./chunk-QILGABSF.js";
10
10
  import {
11
11
  bootstrapPool,
12
12
  derivePoolAccounts,
@@ -14,7 +14,7 @@ import {
14
14
  fetchPoolAuthorizations,
15
15
  selectAccount
16
16
  } from "./chunk-JHNW2EKY.js";
17
- import "./chunk-VL2Q4CNZ.js";
17
+ import "./chunk-4DFHLH3R.js";
18
18
  import "./chunk-QGM4M3NI.js";
19
19
  export {
20
20
  DotNS,
package/dist/merkle.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  merkleizeJS
3
- } from "./chunk-GZ5UUECB.js";
3
+ } from "./chunk-QILGABSF.js";
4
4
  import "./chunk-QGM4M3NI.js";
5
5
  export {
6
6
  merkleizeJS
@@ -19,7 +19,8 @@ declare function isExpectedError(msg: string): boolean;
19
19
  declare function withSpan<T>(op: string, description: string, attributes: Record<string, string | number | boolean | undefined>, fn: () => T | Promise<T>): Promise<T>;
20
20
  declare function withDeploySpan<T>(domain: string, fn: () => T | Promise<T>): Promise<T>;
21
21
  declare function setDeployAttribute(key: string, value: string | number | boolean): void;
22
+ declare function setDeploySentryTag(key: string, value: string): void;
22
23
  declare function captureWarning(message: string, context?: Record<string, unknown>): void;
23
24
  declare function flush(): Promise<void>;
24
25
 
25
- export { type InternalContextSignals, VERSION, captureWarning, flush, getDeployAttributes, initTelemetry, isExpectedError, isInternalContext, isInternalContextFromSignals, resolveRepo, resolveRunner, resolveRunnerType, sanitizeBranch, sanitizeRepo, scrubPaths, setDeployAttribute, truncateAddress, withDeploySpan, withSpan };
26
+ export { type InternalContextSignals, VERSION, captureWarning, flush, getDeployAttributes, initTelemetry, isExpectedError, isInternalContext, isInternalContextFromSignals, resolveRepo, resolveRunner, resolveRunnerType, sanitizeBranch, sanitizeRepo, scrubPaths, setDeployAttribute, setDeploySentryTag, truncateAddress, withDeploySpan, withSpan };
package/dist/telemetry.js CHANGED
@@ -14,10 +14,11 @@ import {
14
14
  sanitizeRepo,
15
15
  scrubPaths,
16
16
  setDeployAttribute,
17
+ setDeploySentryTag,
17
18
  truncateAddress,
18
19
  withDeploySpan,
19
20
  withSpan
20
- } from "./chunk-VL2Q4CNZ.js";
21
+ } from "./chunk-4DFHLH3R.js";
21
22
  import "./chunk-QGM4M3NI.js";
22
23
  export {
23
24
  VERSION,
@@ -35,6 +36,7 @@ export {
35
36
  sanitizeRepo,
36
37
  scrubPaths,
37
38
  setDeployAttribute,
39
+ setDeploySentryTag,
38
40
  truncateAddress,
39
41
  withDeploySpan,
40
42
  withSpan
@@ -8,8 +8,8 @@ import {
8
8
  isPreReleaseVersion,
9
9
  preReleaseWarning,
10
10
  promptYesNo
11
- } from "./chunk-ELKNME32.js";
12
- import "./chunk-VL2Q4CNZ.js";
11
+ } from "./chunk-O24K3T6Z.js";
12
+ import "./chunk-4DFHLH3R.js";
13
13
  import "./chunk-QGM4M3NI.js";
14
14
  export {
15
15
  assessVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulletin-deploy",
3
- "version": "0.6.12",
3
+ "version": "0.6.14",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,7 +48,6 @@
48
48
  "@polkadot/keyring": "^13.0.0",
49
49
  "@polkadot/util-crypto": "^13.0.0",
50
50
  "@sentry/node": "^9.14.0",
51
- "blockstore-core": "^6.1.3",
52
51
  "ipfs-unixfs": "^11.2.0",
53
52
  "ipfs-unixfs-importer": "^16.1.4",
54
53
  "multiformats": "^13.4.1",