@agoric/swing-store 0.9.2-dev-de95355.0 → 0.9.2-dev-b6c58f2.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/docs/snapstore.md CHANGED
@@ -42,7 +42,7 @@ The SnapStore doesn't provide an explicit API to call when a vat is first create
42
42
 
43
43
  When terminating a vat, the kernel should first call `snapStore.stopUsingLastSnapshot(vatID)`, the same call it would make at the end of an incarnation, to indicate that we're no longer using the last snapshot. This results in zero in-use snapshots.
44
44
 
45
- Then, the kernel must either call `snapStore.deleteVatSnapshots(vatID, undefined)` to delete everything at once, or make a series of calls (spread out over time/blocks) to `snapStore.deleteVatSnapshots(vatID, budget)`. Each will return `{ done, cleanups }`, which can be used to manage the rate-limiting and know when the process is finished.
45
+ Then, the kernel must either call `snapStore.deleteVatSnapshots(vatID)` or `deleteVatSnapshots(vatID, Infinity)` to delete everything at once, or make a series of calls (spread out over time/blocks) to `snapStore.deleteVatSnapshots(vatID, budget)`. Each will return `{ done, cleanups }`, which can be used to manage the rate-limiting and know when the process is finished.
46
46
 
47
47
  The `stopUsingLastSnapshot()` is a performance improvement, but is not mandatory. If omitted, exports will continue to include the vat's snapshot artifacts until the first call to `deleteVatSnapshots()`, after which they will go away. Snapshots are deleted in descending `snapPos` order, so the first call will delete the only `inUse = 1` snapshot, after which exports will omit all artifacts for the vatID. `stopUsingLastSnapshot()` is idempotent, and extra calls will leave the DB unchanged.
48
48
 
@@ -63,7 +63,7 @@ Unlike the [SnapStore](./snapstore.md), the TranscriptStore *does* have an expli
63
63
 
64
64
  When a vat is terminated, the kernel should first call `transcriptStore.stopUsingTranscript(vatID)`. This will mark the single current span as `isCurrent = 0`. The kernel must not attempt to read, add, or rollover spans or items while in this state. While in this state, exports (export for `mode = debug`) will not emit artifacts for this VatID: export-data records will still exist for all spans, as these must be deleted slowly, however there will be no associated artifacts or artifact names.
65
65
 
66
- Then, the kernel should either call `transcriptStore.deleteVatTranscripts(vatID, undefined)` exactly once, or it should call `transcriptStore.deleteVatTranscripts(vatID, budget)` until it returns `{ done: true }`.
66
+ Then, the kernel should either call `transcriptStore.deleteVatTranscripts(vatID)` exactly once, or it should call `transcriptStore.deleteVatTranscripts(vatID, budget)` until it returns `{ done: true }`.
67
67
 
68
68
  As with snapshots, the `stopUsingTranscript()` is a non-mandatory performance improvement. If omitted, exports will continue to include (many) span artifacts for this vat until the first call to `deleteVatTranscripts()` removes the one `isCurrent = 1` span (since spans are deleted most-recent-first). After that point, exports will stop including any artifacts for the vatID. `stopUsingTranscript()` is idempotent, and extra calls will leave the DB unchanged.
69
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/swing-store",
3
- "version": "0.9.2-dev-de95355.0+de95355",
3
+ "version": "0.9.2-dev-b6c58f2.0+b6c58f2",
4
4
  "description": "Persistent storage for SwingSet",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -21,7 +21,7 @@
21
21
  "lint:eslint": "eslint ."
22
22
  },
23
23
  "dependencies": {
24
- "@agoric/internal": "0.3.3-dev-de95355.0+de95355",
24
+ "@agoric/internal": "0.3.3-dev-b6c58f2.0+b6c58f2",
25
25
  "@endo/base64": "^1.0.6",
26
26
  "@endo/bundle-source": "^3.3.0",
27
27
  "@endo/check-bundle": "^1.0.8",
@@ -51,5 +51,5 @@
51
51
  "typeCoverage": {
52
52
  "atLeast": 76.31
53
53
  },
54
- "gitHead": "de9535585f4913e792caf662d869d6f041881985"
54
+ "gitHead": "b6c58f297e8f902f046cc2c71fe7f6162fe0c76d"
55
55
  }
package/src/snapStore.js CHANGED
@@ -393,9 +393,9 @@ export function makeSnapStore(
393
393
  * @param {number} [budget]
394
394
  * @returns {{ done: boolean, cleanups: number }}
395
395
  */
396
- function deleteVatSnapshots(vatID, budget = undefined) {
396
+ function deleteVatSnapshots(vatID, budget = Infinity) {
397
397
  ensureTxn();
398
- const deleteAll = budget === undefined;
398
+ const deleteAll = budget === Infinity;
399
399
  assert(deleteAll || budget >= 1, 'budget must be undefined or positive');
400
400
  // We can't use .iterate because noteExport can write to the DB,
401
401
  // and overlapping queries are not supported.
@@ -394,9 +394,9 @@ export function makeTranscriptStore(
394
394
  * @param {number} [budget]
395
395
  * @returns {{ done: boolean, cleanups: number }}
396
396
  */
397
- function deleteVatTranscripts(vatID, budget = undefined) {
397
+ function deleteVatTranscripts(vatID, budget = Infinity) {
398
398
  ensureTxn();
399
- const deleteAll = budget === undefined;
399
+ const deleteAll = budget === Infinity;
400
400
  assert(deleteAll || budget >= 1, 'budget must be undefined or positive');
401
401
  // We can't use .iterate because noteExport can write to the DB,
402
402
  // and overlapping queries are not supported.