@agoric/swingset-liveslots 0.10.3-mainnet1B-dev-26244e8.0 → 0.10.3-orchestration-dev-096c4e8.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.
Files changed (58) hide show
  1. package/README.md +2 -0
  2. package/package.json +25 -17
  3. package/src/cache.js +5 -3
  4. package/src/collectionManager.js +147 -69
  5. package/src/index.js +2 -1
  6. package/src/liveslots.js +52 -79
  7. package/src/message.js +4 -4
  8. package/src/types.js +8 -2
  9. package/src/vatDataTypes.d.ts +234 -0
  10. package/src/vatDataTypes.js +2 -0
  11. package/src/vatstore-iterators.js +2 -0
  12. package/src/virtualObjectManager.js +107 -63
  13. package/src/virtualReferences.js +51 -0
  14. package/src/watchedPromises.js +50 -15
  15. package/test/gc-and-finalize.js +30 -1
  16. package/test/gc-helpers.js +2 -1
  17. package/test/liveslots-helpers.js +6 -6
  18. package/test/mock-gc.js +1 -0
  19. package/test/storeGC/test-lifecycle.js +2 -2
  20. package/test/storeGC/test-refcount-management.js +1 -2
  21. package/test/storeGC/test-scalar-store-kind.js +0 -1
  22. package/test/storeGC/test-weak-key.js +1 -2
  23. package/test/test-baggage.js +1 -2
  24. package/test/test-cache.js +0 -1
  25. package/test/test-collection-schema-refcount.js +1 -2
  26. package/test/test-collection-upgrade.js +1 -3
  27. package/test/test-collections.js +117 -14
  28. package/test/test-dropped-collection-weakrefs.js +1 -2
  29. package/test/test-durabilityChecks.js +3 -3
  30. package/test/test-facetiousness.js +1 -2
  31. package/test/test-gc-sensitivity.js +2 -2
  32. package/test/test-handled-promises.js +5 -7
  33. package/test/test-initial-vrefs.js +2 -3
  34. package/test/test-liveslots-mock-gc.js +2 -2
  35. package/test/test-liveslots-real-gc.js +44 -35
  36. package/test/test-liveslots.js +13 -14
  37. package/test/test-vo-test-harness.js +0 -1
  38. package/test/test-vpid-liveslots.js +4 -5
  39. package/test/util.js +2 -2
  40. package/test/vat-util.js +1 -1
  41. package/test/virtual-objects/test-cease-recognition.js +2 -2
  42. package/test/virtual-objects/test-cross-facet.js +1 -2
  43. package/test/virtual-objects/test-empty-data.js +1 -2
  44. package/test/virtual-objects/test-facets.js +1 -2
  45. package/test/virtual-objects/test-kind-changes.js +2 -2
  46. package/test/virtual-objects/test-reachable-vrefs.js +2 -2
  47. package/test/virtual-objects/test-rep-tostring.js +2 -3
  48. package/test/virtual-objects/test-retain-remotable.js +25 -24
  49. package/test/virtual-objects/test-state-shape.js +2 -2
  50. package/test/virtual-objects/test-virtualObjectGC.js +2 -2
  51. package/test/virtual-objects/test-virtualObjectManager.js +126 -8
  52. package/test/virtual-objects/test-vo-real-gc.js +8 -8
  53. package/test/virtual-objects/test-weakcollections-vref-handling.js +1 -2
  54. package/tools/fakeVirtualSupport.js +48 -21
  55. package/tools/prepare-test-env.js +13 -0
  56. package/tools/setup-vat-data.js +62 -0
  57. package/CHANGELOG.md +0 -77
  58. package/test/kmarshal.js +0 -79
package/CHANGELOG.md DELETED
@@ -1,77 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ### [0.10.3-u12.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.3-u11wf.0...@agoric/swingset-liveslots@0.10.3-u12.0) (2023-11-10)
7
-
8
- **Note:** Version bump only for package @agoric/swingset-liveslots
9
-
10
-
11
-
12
-
13
-
14
- ### [0.10.3-u11wf.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.3-u11.0...@agoric/swingset-liveslots@0.10.3-u11wf.0) (2023-09-23)
15
-
16
- **Note:** Version bump only for package @agoric/swingset-liveslots
17
-
18
-
19
-
20
-
21
-
22
- ### [0.10.3-u11.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.2...@agoric/swingset-liveslots@0.10.3-u11.0) (2023-08-24)
23
-
24
- **Note:** Version bump only for package @agoric/swingset-liveslots
25
-
26
-
27
-
28
-
29
-
30
- ### [0.10.2](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.1...@agoric/swingset-liveslots@0.10.2) (2023-06-02)
31
-
32
- **Note:** Version bump only for package @agoric/swingset-liveslots
33
-
34
-
35
-
36
-
37
-
38
- ### [0.10.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.0...@agoric/swingset-liveslots@0.10.1) (2023-05-24)
39
-
40
- **Note:** Version bump only for package @agoric/swingset-liveslots
41
-
42
-
43
-
44
-
45
-
46
- ## 0.10.0 (2023-05-19)
47
-
48
-
49
- ### Features
50
-
51
- * better diagnostic for failed reanimate ([c0c9c94](https://github.com/Agoric/agoric-sdk/commit/c0c9c9433648d520aa2bcdbadbbfe877831567c7)), closes [Error#1](https://github.com/Agoric/Error/issues/1)
52
- * **swingset-liveslots:** label virtual instances ([4191eb6](https://github.com/Agoric/agoric-sdk/commit/4191eb62d0e64048c3c715e5f71a53a747267350))
53
- * add APIs for tracking/debugging undesired object retention (aka "leaks") ([0a7221b](https://github.com/Agoric/agoric-sdk/commit/0a7221b3c04f3b2894c30346fa2ea6fb0130c046)), closes [#7318](https://github.com/Agoric/agoric-sdk/issues/7318)
54
- * move liveslots and specific tests to a new package ([0921a89](https://github.com/Agoric/agoric-sdk/commit/0921a8903b72cfefdf05a5906bcfb826cac1cc2f)), closes [#6596](https://github.com/Agoric/agoric-sdk/issues/6596)
55
-
56
-
57
- ### Bug Fixes
58
-
59
- * **liveslots:** allow new Kind upgrade to add new facets ([6bc6694](https://github.com/Agoric/agoric-sdk/commit/6bc6694968e6d2f529e7c91ec1efb11fdff2e2d3)), closes [#7437](https://github.com/Agoric/agoric-sdk/issues/7437)
60
- * **liveslots:** retain WeakRefs to voAware collections ([3935723](https://github.com/Agoric/agoric-sdk/commit/393572396781afd17691e1366abeba696228a24e)), closes [#7371](https://github.com/Agoric/agoric-sdk/issues/7371)
61
- * **swingset-liveslots:** prevent VOM infinite loop if `globalThis.WeakSet` etc are replaced ([d7b35e2](https://github.com/Agoric/agoric-sdk/commit/d7b35e28715a715ef510f2717e0040fa017caab4))
62
- * adding dup entries to virtual sets is OK ([c81d367](https://github.com/Agoric/agoric-sdk/commit/c81d3677d8085eb4debe5baa416816ff94d582cf)), closes [#7234](https://github.com/Agoric/agoric-sdk/issues/7234)
63
- * code updates for new marshal ([292f971](https://github.com/Agoric/agoric-sdk/commit/292f971769db69e61782f96638c2f687c3f95ac2))
64
- * **SwingSet:** Don't send stopVat during upgrade ([5cc47d2](https://github.com/Agoric/agoric-sdk/commit/5cc47d2d8892690f8c1653630b41dd64cc42d73b)), closes [#6650](https://github.com/Agoric/agoric-sdk/issues/6650)
65
- * **types:** return value of deleter ([457f576](https://github.com/Agoric/agoric-sdk/commit/457f5765b9fc0a693e6eb5e6644ddf4af3b791db))
66
- * move many type definitions from swingset to liveslots ([727143d](https://github.com/Agoric/agoric-sdk/commit/727143d5562498e2e3013c34304f229b4dd11da5))
67
- * move rejectAllPromises from stopVat to kernels-side upgradeVat ([d79623f](https://github.com/Agoric/agoric-sdk/commit/d79623f3fb3b87653dba1c71eb1153711c9d962c)), closes [#6694](https://github.com/Agoric/agoric-sdk/issues/6694)
68
- * Move upgrade-time abandonExports responsibility into the kernel ([66ac657](https://github.com/Agoric/agoric-sdk/commit/66ac657d51d3d1be61ee4a6e9a621a664086ee57)), closes [#6696](https://github.com/Agoric/agoric-sdk/issues/6696)
69
- * only the exo api change ([5cf3bf1](https://github.com/Agoric/agoric-sdk/commit/5cf3bf10a71dd02094365a66e87032e5d17d004f))
70
- * **liveslots:** use Map for vrefStatus, not object ([1456e2a](https://github.com/Agoric/agoric-sdk/commit/1456e2ae006bb1c702383cedda5e5c407968840e))
71
- * **swingset:** move a bunch of types from swingset to swingset-liveslots ([14f9bb0](https://github.com/Agoric/agoric-sdk/commit/14f9bb00c82c085dc647f23b6c90b26e6a0a6dfd))
72
- * **swingset-liveslots:** Move promise rejection responsibility into the kernel ([dd29ff3](https://github.com/Agoric/agoric-sdk/commit/dd29ff35c5dc72efbbf7087849182aa7f04b2bb1)), closes [#6694](https://github.com/Agoric/agoric-sdk/issues/6694)
73
- * add 'v'/'d' virtual/durable annotations to vrefs ([b859e92](https://github.com/Agoric/agoric-sdk/commit/b859e92fe041415d6e34250f672a10ad927aa33e)), closes [#6695](https://github.com/Agoric/agoric-sdk/issues/6695)
74
- * update description of "FINALIZED" state ([809f366](https://github.com/Agoric/agoric-sdk/commit/809f3660c083467e76deb1487015cb24205a801d))
75
- * without assertKeyPattern ([#7035](https://github.com/Agoric/agoric-sdk/issues/7035)) ([c9fcd7f](https://github.com/Agoric/agoric-sdk/commit/c9fcd7f82757732435cd96f3377e4fbfb6586ce7))
76
- * **swingset-liveslots:** copy helper files to new liveslots package ([be7229f](https://github.com/Agoric/agoric-sdk/commit/be7229f7217c1ecc523069a57945a372f4a1e00e))
77
- * **swingset-liveslots:** update imports of helper files ([0b4b38a](https://github.com/Agoric/agoric-sdk/commit/0b4b38a1f9efbb3e1e860172b0b802548d18ae2e))
package/test/kmarshal.js DELETED
@@ -1,79 +0,0 @@
1
- import { Far, makeMarshal, passStyleOf } from '@endo/marshal';
2
- import { assert } from '@agoric/assert';
3
-
4
- // Simple wrapper for serializing and unserializing marshalled values inside the
5
- // kernel, where we don't actually want to use clists nor actually allocate real
6
- // objects, but instead to stay entirely within the domain of krefs. This is
7
- // used to enable syntactic manipulation of serialized values while remaining
8
- // agnostic about the internal details of the serialization encoding.
9
-
10
- const refMap = new WeakMap();
11
-
12
- export const kslot = (kref, iface) => {
13
- assert.typeof(kref, 'string');
14
- if (iface && iface.startsWith('Alleged: ')) {
15
- // Encoder prepends "Alleged: " to iface string, but the decoder doesn't strip it
16
- // Unclear whether it's the decoder or me who is wrong
17
- iface = iface.slice(9);
18
- }
19
- if (
20
- kref.startsWith('p') ||
21
- kref.startsWith('kp') ||
22
- kref.startsWith('lp') ||
23
- kref.startsWith('rp')
24
- ) {
25
- // TODO: temporary hack because smallcaps encodes promise references
26
- // differently from remotable object references, and the current version of
27
- // the smallcaps decoder annoyingly insists that if the encoded body string
28
- // says a slot is a promise, then convertSlotToVal had better by damn return
29
- // an actual Promise, even if, as in the intended use case here, we neither
30
- // want nor need a promise, nor the overhead of a map to keep track of it
31
- // with. This behavior is in service of defense against a hypothesized
32
- // security issue whose exact nature has largely been forgotton in the
33
- // months since it was first encountered. MarkM is currently researching
34
- // what the problem was thought to have been, to see if it is real and to
35
- // understand it if so. This will eventually result in either changes to
36
- // the smallcaps encoding or to the marshal setup API to support the purely
37
- // manipulative use case. In the meantime, this ugliness...
38
- const p = new Promise(() => undefined);
39
- refMap.set(p, kref);
40
- return harden(p);
41
- } else {
42
- const o = Far(iface, {
43
- iface: () => iface,
44
- getKref: () => `${kref}`,
45
- });
46
- return o;
47
- }
48
- };
49
-
50
- export const krefOf = obj => {
51
- const fromMap = refMap.get(obj);
52
- if (fromMap) {
53
- return fromMap;
54
- }
55
- // When krefOf() is called as part of kmarshal.serialize, marshal
56
- // will only give it things that are 'remotable' (Promises and the
57
- // Far objects created by kslot()). When krefOf() is called by
58
- // kernel code (as part of extractSingleSlot() or the vat-comms
59
- // equivalent), it ought to throw if 'obj' is not one of the Far
60
- // objects created by our kslot().
61
- assert.equal(passStyleOf(obj), 'remotable', obj);
62
- const getKref = obj.getKref;
63
- assert.typeof(getKref, 'function');
64
- return getKref();
65
- };
66
-
67
- const kmarshal = makeMarshal(krefOf, kslot, {
68
- serializeBodyFormat: 'smallcaps',
69
- errorTagging: 'off',
70
- });
71
-
72
- export const kser = value => kmarshal.serialize(harden(value));
73
-
74
- export const kunser = serializedValue => kmarshal.unserialize(serializedValue);
75
-
76
- export function makeError(message) {
77
- assert.typeof(message, 'string');
78
- return kser(Error(message));
79
- }