bulletin-deploy 0.16.0 → 0.16.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.
- package/dist/auth-config.js +3 -3
- package/dist/bug-report.js +4 -4
- package/dist/chain-health.js +3 -3
- package/dist/{chunk-CI3SDMS5.js → chunk-4FIJGSCK.js} +1 -1
- package/dist/{chunk-CWN3AISD.js → chunk-4HUEHLSW.js} +3 -3
- package/dist/{chunk-7THFMRL4.js → chunk-AREGYTFD.js} +15 -15
- package/dist/{chunk-FYRDIYAS.js → chunk-C7CZK4IE.js} +1 -1
- package/dist/{chunk-3P3EVKUH.js → chunk-DB5U6SLK.js} +3 -3
- package/dist/{chunk-KYO2QBAO.js → chunk-HLU2BVBP.js} +145 -24
- package/dist/{chunk-Y5CLGNWO.js → chunk-IFZCCNIV.js} +3 -3
- package/dist/{chunk-367SWF2F.js → chunk-KZKU7RSW.js} +1 -1
- package/dist/{chunk-5AIPL53U.js → chunk-PPC5SPAP.js} +1 -1
- package/dist/{chunk-AV4MFZ3A.js → chunk-TZYNQJ7P.js} +1 -1
- package/dist/{chunk-ICLASM7T.js → chunk-UUZ7BYG3.js} +4 -4
- package/dist/chunk-UX3XZNVO.js +112 -0
- package/dist/{chunk-C7OZ7REN.js → chunk-ZYICAJKW.js} +1 -1
- package/dist/chunk-probe.js +3 -3
- package/dist/commands/login.js +14 -13
- package/dist/commands/logout.js +4 -4
- package/dist/commands/transfer.js +8 -7
- package/dist/commands/whoami.js +3 -3
- package/dist/deploy-actors.js +8 -7
- package/dist/deploy.d.ts +1 -0
- package/dist/deploy.js +13 -12
- package/dist/dotns-protocol.d.ts +325 -0
- package/dist/dotns-protocol.js +16 -0
- package/dist/dotns.d.ts +54 -1
- package/dist/dotns.js +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -13
- package/dist/manifest/publish.d.ts +1 -0
- package/dist/manifest/publish.js +14 -13
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +13 -12
- package/dist/personhood/bootstrap.js +5 -4
- package/dist/personhood/people-client.js +5 -4
- package/dist/run-state.js +1 -1
- package/dist/sss-allowance-cache.js +4 -4
- package/dist/storage-signer.js +13 -12
- package/dist/telemetry.js +2 -2
- package/dist/version-check.js +3 -3
- package/package.json +3 -3
package/dist/auth-config.js
CHANGED
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
getPeopleChainEndpoints,
|
|
10
10
|
hasPersistedSession,
|
|
11
11
|
resolveBulletinEndpoints
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4FIJGSCK.js";
|
|
13
13
|
import "./chunk-TSPERKUS.js";
|
|
14
14
|
import "./chunk-7CHUI4JX.js";
|
|
15
15
|
import "./chunk-ZOC4GITL.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-PPC5SPAP.js";
|
|
17
|
+
import "./chunk-IFZCCNIV.js";
|
|
18
18
|
export {
|
|
19
19
|
DOT_DAPP_ID,
|
|
20
20
|
DOT_DERIVATION_INDEX,
|
package/dist/bug-report.js
CHANGED
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
offerBugReport,
|
|
11
11
|
scrubSecrets,
|
|
12
12
|
setDeployContext
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-DB5U6SLK.js";
|
|
14
|
+
import "./chunk-KZKU7RSW.js";
|
|
15
|
+
import "./chunk-PPC5SPAP.js";
|
|
16
|
+
import "./chunk-IFZCCNIV.js";
|
|
17
17
|
export {
|
|
18
18
|
buildCliFlagsSummary,
|
|
19
19
|
buildLabels,
|
package/dist/chain-health.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
DEFAULT_WINDOW_BLOCKS,
|
|
4
4
|
MAX_SPANS_PER_SAMPLER,
|
|
5
5
|
endpointHost
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ZYICAJKW.js";
|
|
7
|
+
import "./chunk-PPC5SPAP.js";
|
|
8
|
+
import "./chunk-IFZCCNIV.js";
|
|
9
9
|
export {
|
|
10
10
|
ChainHealthSampler,
|
|
11
11
|
DEFAULT_WINDOW_BLOCKS,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
setBulletinEndpoints,
|
|
10
10
|
storeDirectory,
|
|
11
11
|
storeFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AREGYTFD.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_TLD,
|
|
15
15
|
DotNS,
|
|
16
16
|
TX_KIND_SKIPPED,
|
|
17
17
|
stripTldSuffix
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HLU2BVBP.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_ENV_ID,
|
|
21
21
|
getPopSelfServeConfig,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
setDeployAttribute,
|
|
30
30
|
withManifestSpan,
|
|
31
31
|
withSpan
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PPC5SPAP.js";
|
|
33
33
|
|
|
34
34
|
// src/manifest/publish.ts
|
|
35
35
|
import * as fs from "fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
preflightSssAllowance
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C7CZK4IE.js";
|
|
4
4
|
import {
|
|
5
5
|
statementSigningAccount
|
|
6
6
|
} from "./chunk-GRPLHUYC.js";
|
|
@@ -26,30 +26,22 @@ import {
|
|
|
26
26
|
} from "./chunk-S7EM5VMW.js";
|
|
27
27
|
import {
|
|
28
28
|
setDeployContext
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DB5U6SLK.js";
|
|
30
30
|
import {
|
|
31
31
|
getBestBlockNumber,
|
|
32
32
|
probeChunks,
|
|
33
33
|
probeFinalityGap
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-TZYNQJ7P.js";
|
|
35
35
|
import {
|
|
36
36
|
packSection
|
|
37
37
|
} from "./chunk-C2TS5MER.js";
|
|
38
38
|
import {
|
|
39
39
|
resolveStorageSigner
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UUZ7BYG3.js";
|
|
41
41
|
import {
|
|
42
42
|
createSlotAccountSigner,
|
|
43
43
|
requestResourceAllocation
|
|
44
44
|
} from "./chunk-5FLTDWWP.js";
|
|
45
|
-
import {
|
|
46
|
-
STALE_SESSION_MESSAGE,
|
|
47
|
-
getPeopleChainEndpoints,
|
|
48
|
-
hasPersistedSession
|
|
49
|
-
} from "./chunk-CI3SDMS5.js";
|
|
50
|
-
import {
|
|
51
|
-
CLI_NAME
|
|
52
|
-
} from "./chunk-TSPERKUS.js";
|
|
53
45
|
import {
|
|
54
46
|
DEFAULT_TLD,
|
|
55
47
|
DotNS,
|
|
@@ -62,7 +54,7 @@ import {
|
|
|
62
54
|
parseDomainName,
|
|
63
55
|
popStatusName,
|
|
64
56
|
verifyNonceAdvanced
|
|
65
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-HLU2BVBP.js";
|
|
66
58
|
import {
|
|
67
59
|
derivePoolAccounts,
|
|
68
60
|
detectTestnet,
|
|
@@ -72,6 +64,14 @@ import {
|
|
|
72
64
|
readAccountAuthorization,
|
|
73
65
|
selectAccount
|
|
74
66
|
} from "./chunk-KJVRJOKC.js";
|
|
67
|
+
import {
|
|
68
|
+
STALE_SESSION_MESSAGE,
|
|
69
|
+
getPeopleChainEndpoints,
|
|
70
|
+
hasPersistedSession
|
|
71
|
+
} from "./chunk-4FIJGSCK.js";
|
|
72
|
+
import {
|
|
73
|
+
CLI_NAME
|
|
74
|
+
} from "./chunk-TSPERKUS.js";
|
|
75
75
|
import {
|
|
76
76
|
DEFAULT_ENV_ID,
|
|
77
77
|
getPopSelfServeConfig,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-ZOC4GITL.js";
|
|
84
84
|
import {
|
|
85
85
|
ChainHealthSampler
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-ZYICAJKW.js";
|
|
87
87
|
import {
|
|
88
88
|
VERSION,
|
|
89
89
|
captureWarning,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
truncateAddress,
|
|
98
98
|
withDeploySpan,
|
|
99
99
|
withSpan
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-PPC5SPAP.js";
|
|
101
101
|
|
|
102
102
|
// src/merkle.ts
|
|
103
103
|
import * as fs2 from "fs";
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
classifyErrorArea,
|
|
3
3
|
isInteractive,
|
|
4
4
|
promptYesNo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZKU7RSW.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
getCurrentSentryTraceId,
|
|
9
9
|
resolveIssueRepoSlug
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PPC5SPAP.js";
|
|
11
11
|
import {
|
|
12
12
|
package_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IFZCCNIV.js";
|
|
14
14
|
|
|
15
15
|
// src/bug-report.ts
|
|
16
16
|
import { execSync, execFileSync } from "child_process";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-ZOC4GITL.js";
|
|
13
13
|
import {
|
|
14
14
|
ChainHealthSampler
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZYICAJKW.js";
|
|
16
16
|
import {
|
|
17
17
|
captureWarning,
|
|
18
18
|
markCodePath,
|
|
@@ -20,7 +20,11 @@ import {
|
|
|
20
20
|
setDeploySentryTag,
|
|
21
21
|
truncateAddress,
|
|
22
22
|
withSpan
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-PPC5SPAP.js";
|
|
24
|
+
import {
|
|
25
|
+
classifyProtocolVersion,
|
|
26
|
+
getAdapter
|
|
27
|
+
} from "./chunk-UX3XZNVO.js";
|
|
24
28
|
|
|
25
29
|
// src/dotns.ts
|
|
26
30
|
import crypto from "crypto";
|
|
@@ -1288,6 +1292,19 @@ var DotNS = class _DotNS {
|
|
|
1288
1292
|
_popSelfServe = null;
|
|
1289
1293
|
_registerStorageDeposit = MINIMUM_REGISTER_STORAGE_DEPOSIT;
|
|
1290
1294
|
_tld = DEFAULT_TLD;
|
|
1295
|
+
// Defaults to v1 so every existing test/library caller that constructs a
|
|
1296
|
+
// DotNS instance and stubs its chain-accessing methods WITHOUT ever calling
|
|
1297
|
+
// connect() keeps today's exact v1 behaviour (call order, ABI shape,
|
|
1298
|
+
// deposit-gate function) — connect()'s live probe overwrites both fields
|
|
1299
|
+
// once it runs. Never left unset/throwing: that would break every such
|
|
1300
|
+
// caller, which is most of the existing unit suite.
|
|
1301
|
+
// Production can never reach a register with an unprobed adapter: connect()
|
|
1302
|
+
// always runs detectProtocolVersion(), and every register-path method calls
|
|
1303
|
+
// ensureConnected() first. That is what makes a default safe here rather
|
|
1304
|
+
// than the silent-fallback hazard it would otherwise be — do not "simplify"
|
|
1305
|
+
// this into a throw-if-unset without re-checking both of those.
|
|
1306
|
+
_protocolVersion = "v1";
|
|
1307
|
+
_adapter = getAdapter("v1");
|
|
1291
1308
|
_onPhoneSigningRequired = void 0;
|
|
1292
1309
|
_confirmPhoneReady = void 0;
|
|
1293
1310
|
/** Total phone-signature count for this DotNS session (drives the `total` field passed to confirmPhoneReady). */
|
|
@@ -1316,6 +1333,15 @@ var DotNS = class _DotNS {
|
|
|
1316
1333
|
__setReproveFallbackForTest(result) {
|
|
1317
1334
|
this._reproveFallbackForTest = result;
|
|
1318
1335
|
}
|
|
1336
|
+
/** The DotNS protocol generation detected by connect()'s live probe (readonly; for telemetry and tests). Defaults to "v1" before connect() runs — see the field's own comment. */
|
|
1337
|
+
get protocolVersion() {
|
|
1338
|
+
return this._protocolVersion;
|
|
1339
|
+
}
|
|
1340
|
+
/** Test-only: bypass connect()'s live probe and pin the adapter directly, for unit tests that stub chain calls without going through connect(). */
|
|
1341
|
+
__setProtocolVersionForTest(version) {
|
|
1342
|
+
this._protocolVersion = version;
|
|
1343
|
+
this._adapter = getAdapter(version);
|
|
1344
|
+
}
|
|
1319
1345
|
constructor() {
|
|
1320
1346
|
this.client = null;
|
|
1321
1347
|
this.clientWrapper = null;
|
|
@@ -1493,6 +1519,13 @@ var DotNS = class _DotNS {
|
|
|
1493
1519
|
setDeployAttribute("deploy.dotns.evm_address", this.evmAddress);
|
|
1494
1520
|
this.connected = true;
|
|
1495
1521
|
await this.resolveAndVerifyTld(options.tld);
|
|
1522
|
+
await this.detectProtocolVersion();
|
|
1523
|
+
if (options.dotnsProtocol && options.dotnsProtocol !== this._protocolVersion) {
|
|
1524
|
+
this.connected = false;
|
|
1525
|
+
throw new Error(
|
|
1526
|
+
`DotNS protocol mismatch on ${this._environmentId ?? "unknown"}: environments.json pins dotnsProtocol="${options.dotnsProtocol}" but the live probe detected "${this._protocolVersion}". The pin and the chain disagree \u2014 update the pin or investigate why the chain doesn't match it.`
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1496
1529
|
await this.resolveNativeToEthRatio(options);
|
|
1497
1530
|
try {
|
|
1498
1531
|
await this.ensureMappedAccountReady(options.autoAccountMapping ?? false);
|
|
@@ -1816,6 +1849,65 @@ var DotNS = class _DotNS {
|
|
|
1816
1849
|
const value = decodeFunctionResult({ abi: DOTNS_PROTOCOL_REGISTRY_ABI, functionName, data: rawData });
|
|
1817
1850
|
return { ok: true, value };
|
|
1818
1851
|
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Low-level "did this view function answer" probe, used by the DotNS
|
|
1854
|
+
* protocol-version detection below. Same non-throwing-on-revert posture as
|
|
1855
|
+
* dryRunRegistryString and for the same reason: "the function doesn't
|
|
1856
|
+
* exist on this generation" (a revert or empty data) must be
|
|
1857
|
+
* distinguishable from "the RPC call itself never completed" (a THROW,
|
|
1858
|
+
* which propagates here — a network blip must never be silently read as
|
|
1859
|
+
* "this probe says no").
|
|
1860
|
+
*/
|
|
1861
|
+
async probeViewFunctionOk(contractAddress, abi, functionName, args = []) {
|
|
1862
|
+
this.ensureConnected();
|
|
1863
|
+
if (!this.clientWrapper) throw new Error(`DotNS protocol probe (${functionName}): polkadot-api client not available`);
|
|
1864
|
+
const encodedCallData = encodeFunctionData({ abi, functionName, args });
|
|
1865
|
+
const callResult = await this.clientWrapper.performDryRunCall(this.substrateAddress, contractAddress, 0n, encodedCallData);
|
|
1866
|
+
if (!callResult.result.isOk) return false;
|
|
1867
|
+
const rawData = callResult.result.value.data ?? "0x";
|
|
1868
|
+
return rawData.length > 2;
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Detect the live DotNS protocol generation by probing POP_RULES — never by
|
|
1872
|
+
* trusting configured addresses, since CREATE3 keeps them identical across
|
|
1873
|
+
* generations (the exact reason the 2026-09-01 outage went unflagged by the
|
|
1874
|
+
* address-drift guardrail). Dry-run read only: no transactions, no state
|
|
1875
|
+
* writes. Caches nothing itself — connect() calls this once per instance
|
|
1876
|
+
* and stores the result on _protocolVersion/_adapter.
|
|
1877
|
+
*
|
|
1878
|
+
* Three-valued by construction (classifyProtocolVersion does the actual
|
|
1879
|
+
* classification): "no contract code at POP_RULES" is a config problem,
|
|
1880
|
+
* not a version verdict, and reuses the SAME wording contractCall already
|
|
1881
|
+
* uses for that case elsewhere in this file, for consistency. "Code
|
|
1882
|
+
* present but neither probe answers" is a distinct, explicit
|
|
1883
|
+
* unknown-version error naming both probes and this env id — v1 must never
|
|
1884
|
+
* be a silent fallback for "everything that isn't v2".
|
|
1885
|
+
*/
|
|
1886
|
+
async detectProtocolVersion() {
|
|
1887
|
+
this.ensureConnected();
|
|
1888
|
+
const popRulesAddress = this._contracts.POP_RULES;
|
|
1889
|
+
const env = this._environmentId ?? "unknown";
|
|
1890
|
+
const hasCodeResult = await this.clientWrapper.hasContractCode(popRulesAddress);
|
|
1891
|
+
const hasCode = hasCodeResult === true;
|
|
1892
|
+
if (!hasCode) {
|
|
1893
|
+
throw new Error(
|
|
1894
|
+
`No contract deployed at ${popRulesAddress} (POP_RULES) env=${env} \u2014 could not detect the DotNS protocol version because no contract code was found at this address. Check environments.json / --contract config for this network.`
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
const [pricingVersionOk, startingPriceOk] = await Promise.all([
|
|
1898
|
+
this.probeViewFunctionOk(popRulesAddress, getAdapter("v2").popRulesAbi, "pricingVersion", []),
|
|
1899
|
+
this.probeViewFunctionOk(popRulesAddress, getAdapter("v1").popRulesAbi, "startingPrice", [])
|
|
1900
|
+
]);
|
|
1901
|
+
const classification = classifyProtocolVersion({ hasCode, pricingVersionOk, startingPriceOk });
|
|
1902
|
+
if (classification.version === null) {
|
|
1903
|
+
throw new Error(`${env} (POP_RULES ${popRulesAddress}): ${classification.reason}`);
|
|
1904
|
+
}
|
|
1905
|
+
const version = classification.version;
|
|
1906
|
+
this._protocolVersion = version;
|
|
1907
|
+
this._adapter = getAdapter(version);
|
|
1908
|
+
setDeployAttribute("deploy.dotns.protocol_version", version);
|
|
1909
|
+
console.log(` DotNS protocol ${version} detected on ${env}`);
|
|
1910
|
+
}
|
|
1819
1911
|
async contractCall(contractAddress, contractAbi, functionName, args = []) {
|
|
1820
1912
|
this.ensureConnected();
|
|
1821
1913
|
if (!this.clientWrapper) throw new Error("contractCall: polkadot-api client not available");
|
|
@@ -2668,14 +2760,15 @@ var DotNS = class _DotNS {
|
|
|
2668
2760
|
}
|
|
2669
2761
|
console.log(` ${label}.${this._tld} is available`);
|
|
2670
2762
|
}
|
|
2671
|
-
async generateCommitment(label, includeReverse = false) {
|
|
2763
|
+
async generateCommitment(label, includeReverse = false, pricing) {
|
|
2672
2764
|
this.ensureConnected();
|
|
2673
2765
|
console.log(`
|
|
2674
2766
|
Generating commitment hash...`);
|
|
2675
2767
|
label = validateDomainLabel(label);
|
|
2676
2768
|
const secret = `0x${crypto.randomBytes(32).toString("hex")}`;
|
|
2677
|
-
const
|
|
2678
|
-
const
|
|
2769
|
+
const base = { label, owner: this.evmAddress, secret, reserved: includeReverse };
|
|
2770
|
+
const registration = this._adapter.buildRegistration(base, pricing ?? {});
|
|
2771
|
+
const commitment = await withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER, this._adapter.controllerAbi, "makeCommitment", [registration]), 3e4, "Commitment generation");
|
|
2679
2772
|
console.log(` Commitment: ${commitment}`);
|
|
2680
2773
|
return { commitment, registration };
|
|
2681
2774
|
}
|
|
@@ -2685,13 +2778,13 @@ var DotNS = class _DotNS {
|
|
|
2685
2778
|
Submitting commitment...`);
|
|
2686
2779
|
const verifyCommitted = async () => {
|
|
2687
2780
|
try {
|
|
2688
|
-
const ts = await this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER,
|
|
2781
|
+
const ts = await this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER, this._adapter.controllerAbi, "commitments", [commitment]);
|
|
2689
2782
|
return ts != null && BigInt(ts) > 0n;
|
|
2690
2783
|
} catch {
|
|
2691
2784
|
return false;
|
|
2692
2785
|
}
|
|
2693
2786
|
};
|
|
2694
|
-
const commitTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, 0n,
|
|
2787
|
+
const commitTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, 0n, this._adapter.controllerAbi, "commit", [commitment], (s) => console.log(` ${s}`), { phoneLabel: "Commitment", verifyEffect: verifyCommitted });
|
|
2695
2788
|
logTxResolution(commitTxRes);
|
|
2696
2789
|
console.log(` Committed at: ${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
2697
2790
|
}
|
|
@@ -2702,9 +2795,9 @@ var DotNS = class _DotNS {
|
|
|
2702
2795
|
console.log(`
|
|
2703
2796
|
Reading minimum commitment age...`);
|
|
2704
2797
|
const [minimumAge, maximumAge, initialCommitTimestamp] = await Promise.all([
|
|
2705
|
-
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER,
|
|
2706
|
-
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER,
|
|
2707
|
-
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER,
|
|
2798
|
+
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER, this._adapter.controllerAbi, "minCommitmentAge", []), 3e4, "minCommitmentAge"),
|
|
2799
|
+
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER, this._adapter.controllerAbi, "maxCommitmentAge", []), 3e4, "maxCommitmentAge"),
|
|
2800
|
+
withTimeout(this.contractCall(this._contracts.DOTNS_REGISTRAR_CONTROLLER, this._adapter.controllerAbi, "commitments", [commitment]), 3e4, "commitments")
|
|
2708
2801
|
]);
|
|
2709
2802
|
const minimumAgeSeconds = typeof minimumAge === "bigint" ? Number(minimumAge) : minimumAge;
|
|
2710
2803
|
const maximumAgeSeconds = typeof maximumAge === "bigint" ? Number(maximumAge) : maximumAge ?? 86400;
|
|
@@ -2758,17 +2851,39 @@ var DotNS = class _DotNS {
|
|
|
2758
2851
|
requiredStatus === ProofOfPersonhoodStatus.ProofOfPersonhoodFull ? "Requires Full Personhood verification" : "Requires Personhood Lite verification"
|
|
2759
2852
|
);
|
|
2760
2853
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
if (
|
|
2764
|
-
|
|
2765
|
-
|
|
2854
|
+
let priceWei;
|
|
2855
|
+
let pricingVersion;
|
|
2856
|
+
if (this._adapter.needsPricingBeforeCommit) {
|
|
2857
|
+
pricingVersion = await withTimeout(
|
|
2858
|
+
this.contractCall(this._contracts.POP_RULES, this._adapter.popRulesAbi, "pricingVersion", []),
|
|
2859
|
+
3e4,
|
|
2860
|
+
"pricingVersion"
|
|
2861
|
+
);
|
|
2862
|
+
const priceMeta = await withTimeout(
|
|
2863
|
+
this.contractCall(this._contracts.POP_RULES, this._adapter.popRulesAbi, "priceWithCheckAtVersion", [label, this.evmAddress, pricingVersion]),
|
|
2864
|
+
3e4,
|
|
2865
|
+
"priceWithCheckAtVersion"
|
|
2766
2866
|
);
|
|
2867
|
+
const priceRaw = priceMeta?.price;
|
|
2868
|
+
if (priceRaw == null) {
|
|
2869
|
+
throw new Error(
|
|
2870
|
+
`priceWithCheckAtVersion returned unexpected shape (expected object with .price): ` + JSON.stringify(priceMeta, (_, v) => typeof v === "bigint" ? v.toString() : v)
|
|
2871
|
+
);
|
|
2872
|
+
}
|
|
2873
|
+
priceWei = typeof priceRaw === "bigint" ? priceRaw : BigInt(priceRaw);
|
|
2874
|
+
} else {
|
|
2875
|
+
const priceMeta = await withTimeout(this.contractCall(this._contracts.POP_RULES, POP_RULES_ABI, "priceWithCheck", [label, this.evmAddress]), 3e4, "priceWithCheck");
|
|
2876
|
+
const priceRaw = priceMeta?.price;
|
|
2877
|
+
if (priceRaw == null) {
|
|
2878
|
+
throw new Error(
|
|
2879
|
+
`priceWithCheck returned unexpected shape (expected object with .price): ` + JSON.stringify(priceMeta, (_, v) => typeof v === "bigint" ? v.toString() : v)
|
|
2880
|
+
);
|
|
2881
|
+
}
|
|
2882
|
+
priceWei = typeof priceRaw === "bigint" ? priceRaw : BigInt(priceRaw);
|
|
2767
2883
|
}
|
|
2768
|
-
const priceWei = typeof priceRaw === "bigint" ? priceRaw : BigInt(priceRaw);
|
|
2769
2884
|
console.log(` User status: ${popStatusName(userStatus)}`);
|
|
2770
2885
|
console.log(` Price: ${formatEther(priceWei)} PAS`);
|
|
2771
|
-
return { priceWei, requiredStatus, userStatus, message };
|
|
2886
|
+
return { priceWei, requiredStatus, userStatus, message, pricingVersion };
|
|
2772
2887
|
}
|
|
2773
2888
|
async finalizeRegistration(registration, priceWei) {
|
|
2774
2889
|
this.ensureConnected();
|
|
@@ -2793,7 +2908,7 @@ var DotNS = class _DotNS {
|
|
|
2793
2908
|
return false;
|
|
2794
2909
|
}
|
|
2795
2910
|
};
|
|
2796
|
-
const registerTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, bufferedPaymentNative,
|
|
2911
|
+
const registerTxRes = await this.contractTransaction(this._contracts.DOTNS_REGISTRAR_CONTROLLER, bufferedPaymentNative, this._adapter.controllerAbi, "register", [registration], (s) => console.log(` ${s}`), { phoneLabel: "Register", verifyEffect: verifyRegistered });
|
|
2797
2912
|
logTxResolution(registerTxRes);
|
|
2798
2913
|
if (registerTxRes.kind === TX_KIND_HASH) {
|
|
2799
2914
|
setDeployAttribute("deploy.register.tx", registerTxRes.hash);
|
|
@@ -3108,12 +3223,13 @@ var DotNS = class _DotNS {
|
|
|
3108
3223
|
async gateOnFeeBalance(candidate, signerFreeBalance, isTestnet, transferFeeNative = 0n) {
|
|
3109
3224
|
let rentPriceNative = 0n;
|
|
3110
3225
|
if (candidate.plannedAction === "register" && candidate.userStatus === ProofOfPersonhoodStatus.NoStatus) {
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3226
|
+
const deposit = this._adapter.depositCall(candidate.label);
|
|
3227
|
+
const depositWei = await withTimeout(
|
|
3228
|
+
this.contractCall(this._contracts.POP_RULES, this._adapter.popRulesAbi, deposit.functionName, deposit.args),
|
|
3113
3229
|
3e4,
|
|
3114
|
-
|
|
3230
|
+
deposit.functionName
|
|
3115
3231
|
);
|
|
3116
|
-
rentPriceNative = bufferedWeiToNative(
|
|
3232
|
+
rentPriceNative = bufferedWeiToNative(depositWei, this._nativeToEthRatio);
|
|
3117
3233
|
}
|
|
3118
3234
|
const feeFloor = feeFloorFor(candidate.plannedAction, this._registerStorageDeposit, rentPriceNative, transferFeeNative);
|
|
3119
3235
|
let effectiveBalance = signerFreeBalance;
|
|
@@ -3191,10 +3307,15 @@ var DotNS = class _DotNS {
|
|
|
3191
3307
|
rejectIneligible(requiredStatus, userStatus);
|
|
3192
3308
|
}
|
|
3193
3309
|
const doCommitAndRegister = async () => {
|
|
3194
|
-
const
|
|
3310
|
+
const pricingEarly = this._adapter.needsPricingBeforeCommit ? await withSpan("deploy.dotns.price-validation", "2a-0. price-validation", {}, () => this.getPriceAndValidate(label)) : null;
|
|
3311
|
+
const { commitment, registration } = await this.generateCommitment(
|
|
3312
|
+
label,
|
|
3313
|
+
reverse,
|
|
3314
|
+
pricingEarly ? { priceWei: pricingEarly.priceWei, pricingVersion: pricingEarly.pricingVersion } : void 0
|
|
3315
|
+
);
|
|
3195
3316
|
await withSpan("deploy.dotns.submit-commitment", "2a-i. submit-commitment", {}, () => this.submitCommitment(commitment));
|
|
3196
3317
|
await withSpan("deploy.dotns.wait-commitment-age", "2a-ii. wait-commitment-age", {}, () => this.waitForCommitmentAge(commitment));
|
|
3197
|
-
const pricing = await withSpan("deploy.dotns.price-validation", "2a-iii. price-validation", {}, () => this.getPriceAndValidate(label));
|
|
3318
|
+
const pricing = pricingEarly ?? await withSpan("deploy.dotns.price-validation", "2a-iii. price-validation", {}, () => this.getPriceAndValidate(label));
|
|
3198
3319
|
await withSpan("deploy.dotns.finalize-registration", "2a-iv. finalize-registration", {}, () => this.finalizeRegistration(registration, pricing.priceWei));
|
|
3199
3320
|
};
|
|
3200
3321
|
try {
|
|
@@ -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.16.
|
|
9
|
+
version: "0.16.1",
|
|
10
10
|
private: false,
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
@@ -52,11 +52,11 @@ var package_default = {
|
|
|
52
52
|
"tools/verify-baked-dsn.mjs"
|
|
53
53
|
],
|
|
54
54
|
scripts: {
|
|
55
|
-
build: "tsup src/suppress-localstorage-warning.ts src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/chain-health.ts src/memory-report.ts src/merkle.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
|
+
build: "tsup src/suppress-localstorage-warning.ts src/index.ts src/deploy.ts src/dotns.ts src/dotns-protocol.ts src/pool.ts src/telemetry.ts src/chain-health.ts src/memory-report.ts src/merkle.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",
|
|
56
56
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
57
57
|
postinstall: "patch-package || true",
|
|
58
58
|
prepare: "npm run build",
|
|
59
|
-
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/chunk-sharing-report.test.js test/dotns-deployments-parser.test.js test/dotns-token-id.test.js test/dotns-subnode-id.test.js test/product-manifest.test.js test/cache-savings-totals.test.js test/error-pattern-signature.test.js test/exit-codes.test.js test/probe-env-health.test.js test/e2e-chain-calls.test.js test/auth-config.test.js test/whoami.test.js test/login.test.js test/logout.test.js test/auth-resolve.test.js test/storage-signer.test.js test/spinner.test.js test/sss-allowance.test.js test/sss-allowance-cache.test.js test/dotns-transfer.test.js test/deploy-actors.test.js test/transfer-command.test.js test/dotns-register-fee.test.js test/deploy-label-ordering.test.js test/benign-teardown.test.js test/verify-baked-dsn.test.js test/test-release-retry-wrapper.js && npm run test:vendor",
|
|
59
|
+
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/chunk-sharing-report.test.js test/dotns-deployments-parser.test.js test/dotns-token-id.test.js test/dotns-subnode-id.test.js test/dotns-protocol.test.js test/product-manifest.test.js test/cache-savings-totals.test.js test/error-pattern-signature.test.js test/exit-codes.test.js test/probe-env-health.test.js test/e2e-chain-calls.test.js test/auth-config.test.js test/whoami.test.js test/login.test.js test/logout.test.js test/auth-resolve.test.js test/storage-signer.test.js test/spinner.test.js test/sss-allowance.test.js test/sss-allowance-cache.test.js test/dotns-transfer.test.js test/deploy-actors.test.js test/transfer-command.test.js test/dotns-register-fee.test.js test/deploy-label-ordering.test.js test/benign-teardown.test.js test/verify-baked-dsn.test.js test/test-release-retry-wrapper.js && npm run test:vendor",
|
|
60
60
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
61
61
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
62
62
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
BULLETIN_RESOURCE,
|
|
3
3
|
resolveSigner
|
|
4
4
|
} from "./chunk-5FLTDWWP.js";
|
|
5
|
-
import {
|
|
6
|
-
DOT_PRODUCT_ID
|
|
7
|
-
} from "./chunk-CI3SDMS5.js";
|
|
8
5
|
import {
|
|
9
6
|
DEFAULT_MNEMONIC
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HLU2BVBP.js";
|
|
8
|
+
import {
|
|
9
|
+
DOT_PRODUCT_ID
|
|
10
|
+
} from "./chunk-4FIJGSCK.js";
|
|
11
11
|
|
|
12
12
|
// src/deploy-actors.ts
|
|
13
13
|
var DEFAULT_WORKER_SURI = DEFAULT_MNEMONIC;
|