bulletin-deploy 0.7.20 → 0.7.21-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/assets/environments.json +2 -7
- package/bin/bulletin-deploy +0 -6
- package/dist/bug-report.js +4 -5
- package/dist/{chunk-CD27FW4F.js → chunk-7AYHUSPM.js} +3 -3
- package/dist/{chunk-GNVDLLZI.js → chunk-E72TXF32.js} +1 -1
- package/dist/{chunk-HUT7ZGRQ.js → chunk-F36C363Y.js} +3 -11
- package/dist/{chunk-EZUICRCA.js → chunk-GIOOPADS.js} +2 -2
- package/dist/{chunk-UVIG5UAV.js → chunk-GOVJUPYA.js} +72 -38
- package/dist/{chunk-6LODTEG3.js → chunk-LM6BNUST.js} +1 -1
- package/dist/{chunk-BR2EQ2X3.js → chunk-R6FPM5AL.js} +209 -483
- package/dist/{chunk-GGHSZZZ3.js → chunk-SOGWWFZE.js} +13 -19
- package/dist/chunk-probe.js +3 -4
- package/dist/chunker.js +0 -1
- package/dist/deploy.d.ts +1 -9
- package/dist/deploy.js +8 -9
- package/dist/dotns.d.ts +9 -33
- package/dist/dotns.js +3 -12
- package/dist/environments.d.ts +0 -4
- package/dist/environments.js +1 -2
- package/dist/errors.js +0 -1
- package/dist/gh-pages-mirror.js +0 -1
- package/dist/incremental-stats.js +0 -1
- package/dist/index.js +8 -9
- package/dist/manifest-embed.js +0 -1
- package/dist/manifest-fetch.js +0 -1
- package/dist/manifest-roundtrip.js +0 -1
- package/dist/manifest.js +0 -1
- package/dist/memory-report.js +2 -3
- package/dist/merkle.js +8 -9
- package/dist/mirror.js +0 -1
- package/dist/pool.js +0 -1
- package/dist/run-state.js +1 -2
- package/dist/telemetry.js +2 -3
- package/dist/version-check.js +3 -4
- package/docs/e2e-bootstrap.md +9 -15
- package/package.json +3 -3
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/wrapper-IFSKR7DG.js +0 -3651
package/README.md
CHANGED
|
@@ -223,8 +223,6 @@ await deploy("./dist", "my-app00.dot", { jsMerkle: true });
|
|
|
223
223
|
| `BULLETIN_ENVIRONMENTS_URL` | bulletin-deploy public mirror | Override the runtime URL for environments.json. Internal teams point this at a fork or local proxy. |
|
|
224
224
|
| `BULLETIN_DEPLOY_TELEMETRY` | off for external users, on for internal users | `1` to opt in, `0` to force off |
|
|
225
225
|
| `BULLETIN_DEPLOY_UPDATE_CHECK` | `1` | Set to `0` to disable version checks on failure |
|
|
226
|
-
| `BULLETIN_DEPLOY_DOTNS_CLI` | bundled `@parity/dotns-cli`, then host dispatch | Set to `host` for `process.execPath dotns ...` dispatch in bundled host CLIs, or to a `dotns` command/path |
|
|
227
|
-
| `DOTNS_STATUS` | `full` on testnet, `none` on mainnet | PoP level to self-grant before registration: `none`, `lite`, or `full` |
|
|
228
226
|
| `IPFS_CID` | unset | Skip storage and reuse an existing CID |
|
|
229
227
|
| `DEPLOY_TAG` | unset | Telemetry label equivalent to `--tag` |
|
|
230
228
|
| `BULLETIN_DEPLOY_HOST_APP` | unset | Name of the host app embedding bulletin-deploy (e.g. `playground-cli`). Sets `deploy.host_app` on telemetry spans. |
|
package/assets/environments.json
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"ipfs": "https://previewnet.substrate.dev/ipfs/",
|
|
10
10
|
"autoAccountMapping": true,
|
|
11
11
|
"bulletinAuthorizeV2": true,
|
|
12
|
-
"dotnsSelfAttest": false,
|
|
13
12
|
"contracts": {
|
|
14
13
|
"DOTNS_PROTOCOL_REGISTRY": "0xc07A2F24387DA27283CD87b9F24573b74C9e0c9b",
|
|
15
14
|
"DOTNS_REGISTRAR": "0x6c40817cdb96Ab57A4d9E9fa21D0eEa8307BDDE8",
|
|
@@ -25,8 +24,7 @@
|
|
|
25
24
|
"STORE_FACTORY": "0x9C38DFec452391696a8f0D3daFE71F7Eb29e08f8",
|
|
26
25
|
"LABEL_STORE_BEACON": "0x6B609A89Fec9898B441E17f1618670bdD08c437e",
|
|
27
26
|
"USER_STORE_BEACON": "0xbeb79e8BB2bC610822e8748e5439B9D890d88FF5"
|
|
28
|
-
}
|
|
29
|
-
"skipDotnsCli": true
|
|
27
|
+
}
|
|
30
28
|
},
|
|
31
29
|
{
|
|
32
30
|
"id": "paseo-next",
|
|
@@ -36,7 +34,6 @@
|
|
|
36
34
|
"description": "Production testnet for Polkadot App Testflight",
|
|
37
35
|
"backend": "https://identity-backend.parity-testnet.parity.io",
|
|
38
36
|
"ipfs": "https://paseo-ipfs.polkadot.io/ipfs",
|
|
39
|
-
"dotnsSelfAttest": true,
|
|
40
37
|
"uptimeUrl": "https://stats.uptimerobot.com/LISM1LRA8m"
|
|
41
38
|
},
|
|
42
39
|
{
|
|
@@ -58,7 +55,6 @@
|
|
|
58
55
|
"docsUrl": "https://sre.teleport.parity.io/environments/paseo-next/",
|
|
59
56
|
"autoAccountMapping": true,
|
|
60
57
|
"bulletinAuthorizeV2": true,
|
|
61
|
-
"dotnsSelfAttest": false,
|
|
62
58
|
"nativeToEthRatio": 100000000,
|
|
63
59
|
"contracts": {
|
|
64
60
|
"DOTNS_PROTOCOL_REGISTRY": "0x5Caef84563fc980178e28417414aa65bA32f6B4e",
|
|
@@ -76,8 +72,7 @@
|
|
|
76
72
|
"STORE_FACTORY": "0x0DE5De70d61cc6b44B45d6595afDe8dB9b55bc31",
|
|
77
73
|
"LABEL_STORE_BEACON": "0xD033F7Ada687E8BC776928AB239505F9f0479Ce7",
|
|
78
74
|
"USER_STORE_BEACON": "0x7eD9b7D137Fa535965048F93b3B0248fEd2fcd32"
|
|
79
|
-
}
|
|
80
|
-
"skipDotnsCli": true
|
|
75
|
+
}
|
|
81
76
|
},
|
|
82
77
|
{
|
|
83
78
|
"id": "polkadot",
|
package/bin/bulletin-deploy
CHANGED
|
@@ -43,7 +43,6 @@ for (let i = 0; i < args.length; i++) {
|
|
|
43
43
|
else if (args[i] === "--allow-large-deploy") { flags.allowLargeDeploy = true; }
|
|
44
44
|
else if (args[i] === "--reproducible") { flags.reproducibleSource = "commit"; }
|
|
45
45
|
else if (args[i].startsWith("--reproducible=")) { flags.reproducibleSource = args[i].slice("--reproducible=".length); }
|
|
46
|
-
else if (args[i] === "--skip-dotns-cli") { flags.skipDotnsCli = true; }
|
|
47
46
|
else if (args[i] === "--skip-automated-deployment-to-paseo-next-v2") { flags.skipMirrorToPaseoNextV2 = true; }
|
|
48
47
|
else if (args[i] === "--fail-on-mirror-error") { flags.failOnMirrorError = true; }
|
|
49
48
|
else if (args[i] === "--version" || args[i] === "-V") { flags.version = true; }
|
|
@@ -101,10 +100,6 @@ Options:
|
|
|
101
100
|
--description "..." Optional. Sets the "description" text record (≤100 chars recommended).
|
|
102
101
|
--gh-pages-mirror After deploy, push the CAR to the current repo's gh-pages branch
|
|
103
102
|
at bulletin/<domain>.dot.car (opt-in; also set GH_PAGES_MIRROR=1)
|
|
104
|
-
--skip-dotns-cli Use direct contract calls for DotNS operations instead of
|
|
105
|
-
dotns-cli. Auto-set for envs with custom contract addresses
|
|
106
|
-
(e.g. paseo-next-v2). Use to override when dotns-cli lacks
|
|
107
|
-
support for the target chain.
|
|
108
103
|
--skip-automated-deployment-to-paseo-next-v2
|
|
109
104
|
Suppress the automatic mirror deploy to paseo-next-v2.
|
|
110
105
|
--fail-on-mirror-error
|
|
@@ -271,7 +266,6 @@ try {
|
|
|
271
266
|
description: flags.description,
|
|
272
267
|
allowLargeDeploy: flags.allowLargeDeploy,
|
|
273
268
|
reproducibleSource: flags.reproducibleSource,
|
|
274
|
-
skipDotnsCli: flags.skipDotnsCli,
|
|
275
269
|
});
|
|
276
270
|
|
|
277
271
|
const output = process.env.GITHUB_OUTPUT;
|
package/dist/bug-report.js
CHANGED
|
@@ -9,11 +9,10 @@ import {
|
|
|
9
9
|
offerBugReport,
|
|
10
10
|
scrubSecrets,
|
|
11
11
|
setDeployContext
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-QGM4M3NI.js";
|
|
12
|
+
} from "./chunk-GIOOPADS.js";
|
|
13
|
+
import "./chunk-LM6BNUST.js";
|
|
14
|
+
import "./chunk-SOGWWFZE.js";
|
|
15
|
+
import "./chunk-7AYHUSPM.js";
|
|
17
16
|
export {
|
|
18
17
|
buildCliFlagsSummary,
|
|
19
18
|
buildLabels,
|
|
@@ -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
|
+
version: "0.7.21-rc.0",
|
|
10
10
|
private: false,
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
@@ -38,8 +38,9 @@ var package_default = {
|
|
|
38
38
|
scripts: {
|
|
39
39
|
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/mirror.ts --format esm --dts --clean --target node22",
|
|
40
40
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
41
|
+
"check:watched-dependencies": "node tools/check-watched-dependencies.mjs",
|
|
41
42
|
prepare: "npm run build",
|
|
42
|
-
test: "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js test/environments.test.js test/refresh-environments.test.js",
|
|
43
|
+
test: "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js test/environments.test.js test/refresh-environments.test.js test/watched-dependencies.test.js",
|
|
43
44
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
44
45
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
45
46
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
@@ -50,7 +51,6 @@ var package_default = {
|
|
|
50
51
|
"@ipld/car": "^5.4.3",
|
|
51
52
|
"@ipld/dag-pb": "^4.1.3",
|
|
52
53
|
"@noble/hashes": "^1.7.2",
|
|
53
|
-
"@parity/dotns-cli": "^0.6.1",
|
|
54
54
|
"@polkadot-api/metadata-builders": "^0.14.2",
|
|
55
55
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|
|
56
56
|
"@polkadot-labs/hdkd": "^0.0.28",
|
|
@@ -18,7 +18,6 @@ var environments_default = {
|
|
|
18
18
|
ipfs: "https://previewnet.substrate.dev/ipfs/",
|
|
19
19
|
autoAccountMapping: true,
|
|
20
20
|
bulletinAuthorizeV2: true,
|
|
21
|
-
dotnsSelfAttest: false,
|
|
22
21
|
contracts: {
|
|
23
22
|
DOTNS_PROTOCOL_REGISTRY: "0xc07A2F24387DA27283CD87b9F24573b74C9e0c9b",
|
|
24
23
|
DOTNS_REGISTRAR: "0x6c40817cdb96Ab57A4d9E9fa21D0eEa8307BDDE8",
|
|
@@ -34,8 +33,7 @@ var environments_default = {
|
|
|
34
33
|
STORE_FACTORY: "0x9C38DFec452391696a8f0D3daFE71F7Eb29e08f8",
|
|
35
34
|
LABEL_STORE_BEACON: "0x6B609A89Fec9898B441E17f1618670bdD08c437e",
|
|
36
35
|
USER_STORE_BEACON: "0xbeb79e8BB2bC610822e8748e5439B9D890d88FF5"
|
|
37
|
-
}
|
|
38
|
-
skipDotnsCli: true
|
|
36
|
+
}
|
|
39
37
|
},
|
|
40
38
|
{
|
|
41
39
|
id: "paseo-next",
|
|
@@ -45,7 +43,6 @@ var environments_default = {
|
|
|
45
43
|
description: "Production testnet for Polkadot App Testflight",
|
|
46
44
|
backend: "https://identity-backend.parity-testnet.parity.io",
|
|
47
45
|
ipfs: "https://paseo-ipfs.polkadot.io/ipfs",
|
|
48
|
-
dotnsSelfAttest: true,
|
|
49
46
|
uptimeUrl: "https://stats.uptimerobot.com/LISM1LRA8m"
|
|
50
47
|
},
|
|
51
48
|
{
|
|
@@ -67,7 +64,6 @@ var environments_default = {
|
|
|
67
64
|
docsUrl: "https://sre.teleport.parity.io/environments/paseo-next/",
|
|
68
65
|
autoAccountMapping: true,
|
|
69
66
|
bulletinAuthorizeV2: true,
|
|
70
|
-
dotnsSelfAttest: false,
|
|
71
67
|
nativeToEthRatio: 1e8,
|
|
72
68
|
contracts: {
|
|
73
69
|
DOTNS_PROTOCOL_REGISTRY: "0x5Caef84563fc980178e28417414aa65bA32f6B4e",
|
|
@@ -85,8 +81,7 @@ var environments_default = {
|
|
|
85
81
|
STORE_FACTORY: "0x0DE5De70d61cc6b44B45d6595afDe8dB9b55bc31",
|
|
86
82
|
LABEL_STORE_BEACON: "0xD033F7Ada687E8BC776928AB239505F9f0479Ce7",
|
|
87
83
|
USER_STORE_BEACON: "0x7eD9b7D137Fa535965048F93b3B0248fEd2fcd32"
|
|
88
|
-
}
|
|
89
|
-
skipDotnsCli: true
|
|
84
|
+
}
|
|
90
85
|
},
|
|
91
86
|
{
|
|
92
87
|
id: "polkadot",
|
|
@@ -324,8 +319,7 @@ var HARDCODED_FALLBACK = {
|
|
|
324
319
|
id: "paseo-next-v2",
|
|
325
320
|
name: "Paseo Next v2",
|
|
326
321
|
network: "testnet",
|
|
327
|
-
description: "Next iteration of the Paseo Next testnet (hardcoded fallback)"
|
|
328
|
-
dotnsSelfAttest: false
|
|
322
|
+
description: "Next iteration of the Paseo Next testnet (hardcoded fallback)"
|
|
329
323
|
}
|
|
330
324
|
],
|
|
331
325
|
chains: [
|
|
@@ -446,8 +440,6 @@ function resolveEndpoints(doc, envId) {
|
|
|
446
440
|
envName: env.name,
|
|
447
441
|
autoAccountMapping: env.autoAccountMapping ?? false,
|
|
448
442
|
bulletinAuthorizeV2: env.bulletinAuthorizeV2 ?? false,
|
|
449
|
-
dotnsSelfAttest: env.dotnsSelfAttest ?? true,
|
|
450
|
-
skipDotnsCli: env.skipDotnsCli ?? false,
|
|
451
443
|
contracts: env.contracts ?? {},
|
|
452
444
|
nativeToEthRatio: BigInt(env.nativeToEthRatio ?? 1e6)
|
|
453
445
|
};
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
classifyErrorArea,
|
|
3
3
|
isInteractive,
|
|
4
4
|
promptYesNo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LM6BNUST.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
getCurrentSentryTraceId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SOGWWFZE.js";
|
|
10
10
|
|
|
11
11
|
// src/bug-report.ts
|
|
12
12
|
import { execSync, execFileSync } from "child_process";
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
} from "./chunk-S7EM5VMW.js";
|
|
21
21
|
import {
|
|
22
22
|
setDeployContext
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GIOOPADS.js";
|
|
24
24
|
import {
|
|
25
25
|
probeChunks
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-E72TXF32.js";
|
|
27
27
|
import {
|
|
28
28
|
packSection
|
|
29
29
|
} from "./chunk-C2TS5MER.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
parseDomainName,
|
|
35
35
|
popStatusName,
|
|
36
36
|
verifyNonceAdvanced
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-R6FPM5AL.js";
|
|
38
38
|
import {
|
|
39
39
|
derivePoolAccounts,
|
|
40
40
|
detectTestnet,
|
|
@@ -56,12 +56,12 @@ import {
|
|
|
56
56
|
truncateAddress,
|
|
57
57
|
withDeploySpan,
|
|
58
58
|
withSpan
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-SOGWWFZE.js";
|
|
60
60
|
import {
|
|
61
61
|
DEFAULT_ENV_ID,
|
|
62
62
|
loadEnvironments,
|
|
63
63
|
resolveEndpoints
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-F36C363Y.js";
|
|
65
65
|
import {
|
|
66
66
|
NonRetryableError
|
|
67
67
|
} from "./chunk-ZOC4GITL.js";
|
|
@@ -416,18 +416,24 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
416
416
|
ss58 = provider.ss58;
|
|
417
417
|
ownsClient = true;
|
|
418
418
|
}
|
|
419
|
+
const refreshExistingClient = async (reason) => {
|
|
420
|
+
if (!reconnect) return false;
|
|
421
|
+
console.log(`
|
|
422
|
+
Connection lost (${reason}), reconnecting...`);
|
|
423
|
+
const fresh = await reconnect();
|
|
424
|
+
client = fresh.client;
|
|
425
|
+
unsafeApi = fresh.unsafeApi;
|
|
426
|
+
signer = fresh.signer;
|
|
427
|
+
ss58 = fresh.ss58;
|
|
428
|
+
ownsClient = true;
|
|
429
|
+
return true;
|
|
430
|
+
};
|
|
419
431
|
if (existingClient && reconnect) {
|
|
420
432
|
try {
|
|
421
433
|
await unsafeApi.query.System.Number.getValue();
|
|
422
434
|
} catch (e) {
|
|
423
435
|
if (isConnectionError(e)) {
|
|
424
|
-
|
|
425
|
-
const fresh = await reconnect();
|
|
426
|
-
client = fresh.client;
|
|
427
|
-
unsafeApi = fresh.unsafeApi;
|
|
428
|
-
signer = fresh.signer;
|
|
429
|
-
ss58 = fresh.ss58;
|
|
430
|
-
ownsClient = true;
|
|
436
|
+
await refreshExistingClient("stale client detected by pre-upload probe");
|
|
431
437
|
} else {
|
|
432
438
|
throw e;
|
|
433
439
|
}
|
|
@@ -435,10 +441,22 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
435
441
|
}
|
|
436
442
|
const requiredTxs = BigInt(chunks.length + 1);
|
|
437
443
|
const requiredBytes = BigInt(totalBytes);
|
|
438
|
-
const
|
|
444
|
+
const readUploadAuthorization = () => Promise.all([
|
|
439
445
|
unsafeApi.query.TransactionStorage.Authorizations.getValue(Enum("Account", ss58)),
|
|
440
446
|
unsafeApi.query.System.Number.getValue()
|
|
441
447
|
]);
|
|
448
|
+
let uploadAuth;
|
|
449
|
+
let currentBlockNum;
|
|
450
|
+
try {
|
|
451
|
+
[uploadAuth, currentBlockNum] = await readUploadAuthorization();
|
|
452
|
+
} catch (e) {
|
|
453
|
+
if (existingClient && reconnect && isConnectionError(e)) {
|
|
454
|
+
await refreshExistingClient("authorization preflight hit a stale chainHead");
|
|
455
|
+
[uploadAuth, currentBlockNum] = await readUploadAuthorization();
|
|
456
|
+
} else {
|
|
457
|
+
throw e;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
442
460
|
const txsRemaining = uploadAuth ? BigInt(uploadAuth.extent.transactions_allowance) - BigInt(uploadAuth.extent.transactions) : 0n;
|
|
443
461
|
const bytesRemaining = uploadAuth ? BigInt(uploadAuth.extent.bytes_allowance) - BigInt(uploadAuth.extent.bytes) : 0n;
|
|
444
462
|
const isAuthorized = uploadAuth !== void 0 && Number(uploadAuth.expiration ?? 0) > currentBlockNum;
|
|
@@ -492,6 +510,7 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
492
510
|
unsafeApi = fresh.unsafeApi;
|
|
493
511
|
signer = fresh.signer;
|
|
494
512
|
ss58 = fresh.ss58;
|
|
513
|
+
wsHaltDetected = false;
|
|
495
514
|
ownsClient = true;
|
|
496
515
|
sampleMemory(`reconnect_${reconnectionsUsed}_after`);
|
|
497
516
|
}
|
|
@@ -576,6 +595,9 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
576
595
|
}
|
|
577
596
|
}
|
|
578
597
|
for (const fail of failures) {
|
|
598
|
+
if (stored[fail.index] !== null) {
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
579
601
|
const failCid = createCID(fail.chunkData, CID_CONFIG.codec, 18);
|
|
580
602
|
if (probeFailedCids && probeFailedCids.has(failCid.toString()) && fail.error?.message?.includes("isValid:false")) {
|
|
581
603
|
console.log(` Chunk ${fail.index + 1}: isValid:false but CID was probe-failed \u2014 treating as already on chain`);
|
|
@@ -678,14 +700,39 @@ async function storeChunkedContent(chunks, { client: existingClient, unsafeApi:
|
|
|
678
700
|
}
|
|
679
701
|
}
|
|
680
702
|
if (missingCids.length > 0) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
703
|
+
console.log(` Re-uploading ${missingCids.length} via-fallback chunk(s) absent from chain...`);
|
|
704
|
+
let retryNonce = await _fetchNonce(BULLETIN_ENDPOINTS, ss58);
|
|
705
|
+
for (const missingCid of missingCids) {
|
|
706
|
+
const index = verifiedStored.findIndex((c) => c.cid.toString() === missingCid);
|
|
707
|
+
if (index < 0) {
|
|
708
|
+
throw new Error(`Internal error: missing via-fallback CID ${missingCid} was not found in stored chunk list`);
|
|
709
|
+
}
|
|
710
|
+
let reuploaded = false;
|
|
711
|
+
let lastError = null;
|
|
712
|
+
for (let attempt = 1; attempt <= MAX_CHUNK_RETRIES; attempt++) {
|
|
713
|
+
try {
|
|
714
|
+
const result2 = await storeChunk(unsafeApi, signer, chunks[index], retryNonce, ss58, { fetchNonce: fetchNonceOverride });
|
|
715
|
+
verifiedStored[index] = result2;
|
|
716
|
+
retryNonce++;
|
|
717
|
+
reuploaded = true;
|
|
718
|
+
break;
|
|
719
|
+
} catch (e) {
|
|
720
|
+
lastError = e;
|
|
721
|
+
if (isConnectionError(e) && reconnect && reconnectionsUsed < MAX_RECONNECTIONS) {
|
|
722
|
+
await doReconnect();
|
|
723
|
+
retryNonce = await _fetchNonce(BULLETIN_ENDPOINTS, ss58);
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
if (!reuploaded) {
|
|
730
|
+
throw lastError;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
686
733
|
}
|
|
687
734
|
const verifyMs = Date.now() - verifyStart;
|
|
688
|
-
console.log(` \u2713 All ${fallbackStored.length} via-fallback chunk(s) confirmed present
|
|
735
|
+
console.log(` \u2713 All ${fallbackStored.length} via-fallback chunk(s) confirmed present or re-uploaded (${verifyMs}ms)`);
|
|
689
736
|
}
|
|
690
737
|
console.log(` Building DAG-PB...`);
|
|
691
738
|
const fileData = new UnixFS({ type: "file", blockSizes: verifiedStored.map((c) => BigInt(c.len)) });
|
|
@@ -1135,17 +1182,15 @@ async function storeDirectoryV2(directoryPath, opts = {}) {
|
|
|
1135
1182
|
console.log("\n" + renderSummary(stats));
|
|
1136
1183
|
return { storageCid, ipfsCid: phaseB.cid, carBytes: phaseB.carBytes };
|
|
1137
1184
|
}
|
|
1138
|
-
function resolveDotnsConnectOptions(options, assetHubEndpoints, autoAccountMapping,
|
|
1185
|
+
function resolveDotnsConnectOptions(options, assetHubEndpoints, autoAccountMapping, contracts, nativeToEthRatio) {
|
|
1139
1186
|
const tail = assetHubEndpoints && assetHubEndpoints.length > 0 ? { assetHubEndpoints } : {};
|
|
1140
1187
|
const mappingTail = autoAccountMapping ? { autoAccountMapping } : {};
|
|
1141
|
-
const skipTail = options.skipDotnsCli || skipDotnsCli ? { skipDotnsCli: true } : {};
|
|
1142
1188
|
const contractsTail = contracts && Object.keys(contracts).length > 0 ? { contracts } : {};
|
|
1143
1189
|
const ratioTail = nativeToEthRatio ? { nativeToEthRatio } : {};
|
|
1144
|
-
const selfAttestTail = dotnsSelfAttest === false ? { dotnsSelfAttest: false } : {};
|
|
1145
1190
|
if (options.signer && options.signerAddress) {
|
|
1146
|
-
return { signer: options.signer, signerAddress: options.signerAddress, ...tail, ...mappingTail, ...
|
|
1191
|
+
return { signer: options.signer, signerAddress: options.signerAddress, ...tail, ...mappingTail, ...contractsTail, ...ratioTail };
|
|
1147
1192
|
}
|
|
1148
|
-
return { mnemonic: options.mnemonic, derivationPath: options.derivationPath, ...tail, ...mappingTail, ...
|
|
1193
|
+
return { mnemonic: options.mnemonic, derivationPath: options.derivationPath, ...tail, ...mappingTail, ...contractsTail, ...ratioTail };
|
|
1149
1194
|
}
|
|
1150
1195
|
async function estimateUploadBytes(content) {
|
|
1151
1196
|
try {
|
|
@@ -1181,11 +1226,9 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1181
1226
|
let envNetwork;
|
|
1182
1227
|
let envName;
|
|
1183
1228
|
let envAutoAccountMapping = false;
|
|
1184
|
-
let envSkipDotnsCli = false;
|
|
1185
1229
|
let envContracts = {};
|
|
1186
1230
|
let envBulletinAuthorizeV2 = false;
|
|
1187
1231
|
let envNativeToEthRatio;
|
|
1188
|
-
let envDotnsSelfAttest = true;
|
|
1189
1232
|
if (options.bulletinEndpoints && options.bulletinEndpoints.length > 0) {
|
|
1190
1233
|
envBulletin = options.bulletinEndpoints;
|
|
1191
1234
|
envAssetHub = options.assetHubEndpoints;
|
|
@@ -1199,11 +1242,9 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1199
1242
|
envNetwork = resolved.network;
|
|
1200
1243
|
envName = resolved.envName;
|
|
1201
1244
|
envAutoAccountMapping = resolved.autoAccountMapping;
|
|
1202
|
-
envSkipDotnsCli = resolved.skipDotnsCli;
|
|
1203
1245
|
envContracts = resolved.contracts;
|
|
1204
1246
|
envBulletinAuthorizeV2 = resolved.bulletinAuthorizeV2;
|
|
1205
1247
|
envNativeToEthRatio = resolved.nativeToEthRatio;
|
|
1206
|
-
envDotnsSelfAttest = resolved.dotnsSelfAttest;
|
|
1207
1248
|
} catch (e) {
|
|
1208
1249
|
if (e instanceof NonRetryableError) throw e;
|
|
1209
1250
|
if (options.env !== void 0) throw e;
|
|
@@ -1250,7 +1291,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1250
1291
|
console.log("Preflight");
|
|
1251
1292
|
console.log("=".repeat(60));
|
|
1252
1293
|
const preflight = new DotNS();
|
|
1253
|
-
await preflight.connect(resolveDotnsConnectOptions(options, envAssetHub, envAutoAccountMapping,
|
|
1294
|
+
await preflight.connect(resolveDotnsConnectOptions(options, envAssetHub, envAutoAccountMapping, envContracts, envNativeToEthRatio));
|
|
1254
1295
|
if (parsed?.isSubdomain) {
|
|
1255
1296
|
try {
|
|
1256
1297
|
const { owned: subOwned } = await preflight.checkSubdomainOwnership(parsed.sublabel, parsed.parentLabel);
|
|
@@ -1277,11 +1318,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1277
1318
|
console.log(` DotNS: ${name}.dot classifies as ${popStatusName(dotnsPreflight.classification.status)}`);
|
|
1278
1319
|
if (dotnsPreflight.canProceed) {
|
|
1279
1320
|
const fromName = popStatusName(dotnsPreflight.userStatus);
|
|
1280
|
-
|
|
1281
|
-
console.log(` PoP: ${fromName} \u2192 will upgrade to ${popStatusName(dotnsPreflight.targetPopStatus)}`);
|
|
1282
|
-
} else {
|
|
1283
|
-
console.log(` PoP: ${fromName} (no upgrade required)`);
|
|
1284
|
-
}
|
|
1321
|
+
console.log(` PoP: ${fromName}`);
|
|
1285
1322
|
console.log(` Domain: ${dotnsPreflight.plannedAction === "already-owned-by-us" ? "owned by you" : "available"}`);
|
|
1286
1323
|
}
|
|
1287
1324
|
if (!dotnsPreflight.canProceed) {
|
|
@@ -1465,7 +1502,7 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1465
1502
|
console.log("=".repeat(60));
|
|
1466
1503
|
await withSpan("deploy.dotns", "2. dotns", { "deploy.domain": name, "deploy.subdomain": String(parsed?.isSubdomain ?? false) }, async () => {
|
|
1467
1504
|
const dotns = new DotNS();
|
|
1468
|
-
await dotns.connect(resolveDotnsConnectOptions(options, envAssetHub, envAutoAccountMapping,
|
|
1505
|
+
await dotns.connect(resolveDotnsConnectOptions(options, envAssetHub, envAutoAccountMapping, envContracts, envNativeToEthRatio));
|
|
1469
1506
|
if (parsed?.isSubdomain) {
|
|
1470
1507
|
const { owned, owner } = await dotns.checkSubdomainOwnership(parsed.sublabel, parsed.parentLabel);
|
|
1471
1508
|
if (owned) {
|
|
@@ -1483,9 +1520,6 @@ async function deploy(content, domainName = null, options = {}) {
|
|
|
1483
1520
|
if (owned) {
|
|
1484
1521
|
console.log(` Status: Already owned`);
|
|
1485
1522
|
} else {
|
|
1486
|
-
if (dotnsPreflight !== null && dotnsPreflight.needsPopUpgrade && dotnsPreflight.targetPopStatus !== void 0 && dotnsPreflight.isTestnet) {
|
|
1487
|
-
await dotns.setUserPopStatus(dotnsPreflight.targetPopStatus);
|
|
1488
|
-
}
|
|
1489
1523
|
console.log(` Status: Registering...`);
|
|
1490
1524
|
await dotns.register(name);
|
|
1491
1525
|
}
|