@agoric/cosmic-swingset 0.41.4-dev-75e8d38.0 → 0.41.4-dev-0e6a9f4.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/package.json +12 -12
- package/src/chain-main.js +21 -32
- package/tools/test-kit.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmic-swingset",
|
|
3
|
-
"version": "0.41.4-dev-
|
|
3
|
+
"version": "0.41.4-dev-0e6a9f4.0+0e6a9f4",
|
|
4
4
|
"description": "Agoric's Cosmos blockchain integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"author": "Agoric",
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@agoric/builders": "0.1.1-dev-
|
|
26
|
-
"@agoric/cosmos": "0.34.2-dev-
|
|
27
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
28
|
-
"@agoric/internal": "0.3.3-dev-
|
|
29
|
-
"@agoric/store": "0.9.3-dev-
|
|
30
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
31
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
32
|
-
"@agoric/telemetry": "0.6.3-dev-
|
|
33
|
-
"@agoric/vm-config": "0.1.1-dev-
|
|
25
|
+
"@agoric/builders": "0.1.1-dev-0e6a9f4.0+0e6a9f4",
|
|
26
|
+
"@agoric/cosmos": "0.34.2-dev-0e6a9f4.0+0e6a9f4",
|
|
27
|
+
"@agoric/deploy-script-support": "0.10.4-dev-0e6a9f4.0+0e6a9f4",
|
|
28
|
+
"@agoric/internal": "0.3.3-dev-0e6a9f4.0+0e6a9f4",
|
|
29
|
+
"@agoric/store": "0.9.3-dev-0e6a9f4.0+0e6a9f4",
|
|
30
|
+
"@agoric/swing-store": "0.9.2-dev-0e6a9f4.0+0e6a9f4",
|
|
31
|
+
"@agoric/swingset-vat": "0.32.3-dev-0e6a9f4.0+0e6a9f4",
|
|
32
|
+
"@agoric/telemetry": "0.6.3-dev-0e6a9f4.0+0e6a9f4",
|
|
33
|
+
"@agoric/vm-config": "0.1.1-dev-0e6a9f4.0+0e6a9f4",
|
|
34
34
|
"@endo/bundle-source": "^3.5.1",
|
|
35
35
|
"@endo/env-options": "^1.1.8",
|
|
36
36
|
"@endo/errors": "^1.2.9",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"tmp": "^0.2.1"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@agoric/kmarshal": "0.1.1-dev-
|
|
55
|
+
"@agoric/kmarshal": "0.1.1-dev-0e6a9f4.0+0e6a9f4",
|
|
56
56
|
"ava": "^5.3.0",
|
|
57
57
|
"better-sqlite3": "^9.1.1",
|
|
58
58
|
"c8": "^10.1.2"
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"typeCoverage": {
|
|
76
76
|
"atLeast": 84.59
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0e6a9f409040c4805179f0f8adee40cd1bd22ae2"
|
|
79
79
|
}
|
package/src/chain-main.js
CHANGED
|
@@ -37,6 +37,7 @@ import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';
|
|
|
37
37
|
import { makeInitMsg } from '@agoric/internal/src/chain-utils.js';
|
|
38
38
|
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
|
|
39
39
|
import * as ActionType from '@agoric/internal/src/action-types.js';
|
|
40
|
+
import { makeTempDirFactory } from '@agoric/internal/src/tmpDir.js';
|
|
40
41
|
import { BridgeId, CosmosInitKeyToBridgeId } from '@agoric/internal';
|
|
41
42
|
import {
|
|
42
43
|
makeArchiveSnapshot,
|
|
@@ -64,6 +65,8 @@ import {
|
|
|
64
65
|
|
|
65
66
|
const ignore = () => {};
|
|
66
67
|
|
|
68
|
+
const tmpDir = makeTempDirFactory(tmp);
|
|
69
|
+
|
|
67
70
|
// eslint-disable-next-line no-unused-vars
|
|
68
71
|
let whenHellFreezesOver = null;
|
|
69
72
|
|
|
@@ -700,38 +703,24 @@ export default async function main(
|
|
|
700
703
|
});
|
|
701
704
|
stateSyncExport = exportData;
|
|
702
705
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
if (stateSyncExport !== exportData) {
|
|
722
|
-
// @ts-expect-error wrong type definitions
|
|
723
|
-
cleanup(cleanupDone);
|
|
724
|
-
} else {
|
|
725
|
-
console.warn('unexpected call of state-sync cleanup');
|
|
726
|
-
cleanupDone();
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
await cleanupResult;
|
|
730
|
-
};
|
|
731
|
-
resolve(null);
|
|
732
|
-
},
|
|
733
|
-
);
|
|
734
|
-
});
|
|
706
|
+
const [exportDir, cleanup] = tmpDir(`agd-state-sync-${blockHeight}-`);
|
|
707
|
+
exportData.exportDir = exportDir;
|
|
708
|
+
/** @type {Promise<void> | undefined} */
|
|
709
|
+
let cleanupResult;
|
|
710
|
+
exportData.cleanup = async () => {
|
|
711
|
+
cleanupResult ||= new Promise(cleanupDone => {
|
|
712
|
+
// If the exporter is still the same, then the retriever
|
|
713
|
+
// is in charge of cleanups
|
|
714
|
+
if (stateSyncExport !== exportData) {
|
|
715
|
+
// @ts-expect-error wrong type definitions
|
|
716
|
+
cleanup(cleanupDone);
|
|
717
|
+
} else {
|
|
718
|
+
console.warn('unexpected call of state-sync cleanup');
|
|
719
|
+
cleanupDone();
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
await cleanupResult;
|
|
723
|
+
};
|
|
735
724
|
|
|
736
725
|
console.warn(
|
|
737
726
|
'Initiating SwingSet state snapshot at block height',
|
package/tools/test-kit.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from '@agoric/internal/src/action-types.js';
|
|
14
14
|
import * as STORAGE_PATH from '@agoric/internal/src/chain-storage-paths.js';
|
|
15
15
|
import { deepCopyJsonable } from '@agoric/internal/src/js-utils.js';
|
|
16
|
+
import { makeTempDirFactory } from '@agoric/internal/src/tmpDir.js';
|
|
16
17
|
import { makeRunUtils } from '@agoric/swingset-vat/tools/run-utils.js';
|
|
17
18
|
import { initSwingStore } from '@agoric/swing-store';
|
|
18
19
|
import {
|
|
@@ -28,6 +29,8 @@ import { makeQueue } from '../src/helpers/make-queue.js';
|
|
|
28
29
|
/** @import { ManagerType, SwingSetConfig } from '@agoric/swingset-vat' */
|
|
29
30
|
/** @import { InboundQueue } from '../src/launch-chain.js'; */
|
|
30
31
|
|
|
32
|
+
const tmpDir = makeTempDirFactory(tmp);
|
|
33
|
+
|
|
31
34
|
/**
|
|
32
35
|
* @template T
|
|
33
36
|
* @typedef {(input: T) => T} Replacer
|
|
@@ -245,10 +248,7 @@ export const makeCosmicSwingsetTestKit = async (
|
|
|
245
248
|
STORAGE_PATH.HIGH_PRIORITY_QUEUE,
|
|
246
249
|
);
|
|
247
250
|
|
|
248
|
-
const
|
|
249
|
-
prefix: debugName || 'testdb',
|
|
250
|
-
unsafeCleanup: true,
|
|
251
|
-
});
|
|
251
|
+
const [dbDir, cleanupDB] = tmpDir(debugName || 'testdb');
|
|
252
252
|
const launchChain = makeLaunchChain(fakeAgcc, dbDir, {
|
|
253
253
|
env,
|
|
254
254
|
fs,
|