-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
liveslots leaks slotToVal entries for Promises when settled before refcount=0 #10757
Comments
Liveslots has a bug (#10757) which leaks slotToVal entries when a tracked Promise is still being held in virtual data (e.g. a merely-virtual MapStore) at the time it becomes settled. This is triggered by `watchPromise` because of the order in which we attach two handlers: one which notices the resolution and is inhibited from deleting the slotToVal entry, and a second which removes the Promise from the (virtual) `promiseRegistrations` collection (thus enabling the deletion). For any watched Promise that is resolved, we leave a `slotToVal` entry (with an empty WeakRef) in RAM until the end of the incarnation. This PR does not fix the underlying bug, but it rearranges the handler order to avoid triggering it. The attached unit test fails with the original handler order (`slotToVal.size` grows), and passes with the swapped order (`slotToVal.size` remains constant). closes #10756 refs #10706
Liveslots has a bug (#10757) which leaks slotToVal entries when a tracked Promise is still being held in virtual data (e.g. a merely-virtual MapStore) at the time it becomes settled. This is triggered by `watchPromise` because of the order in which we attach two handlers: one which notices the resolution and is inhibited from deleting the slotToVal entry, and a second which removes the Promise from the (virtual) `promiseRegistrations` collection (thus enabling the deletion). For any watched Promise that is resolved, we leave a `slotToVal` entry (with an empty WeakRef) in RAM until the end of the incarnation. This commit adds a test.failing to demonstrate the presence of the bug. Each time we watch and then resolve a promise, the slotToVal table grows by one entry. refs #10756
Liveslots has a bug (#10757) which leaks slotToVal entries when a tracked Promise is still being held in virtual data (e.g. a merely-virtual MapStore) at the time it becomes settled. This is triggered by `watchPromise` because of the order in which we attach two handlers: one which notices the resolution and is inhibited from deleting the slotToVal entry, and a second which removes the Promise from the (virtual) `promiseRegistrations` collection (thus enabling the deletion). For any watched Promise that is resolved, we leave a `slotToVal` entry (with an empty WeakRef) in RAM until the end of the incarnation. This PR does not fix the underlying bug, but it rearranges the handler order to avoid triggering it. closes #10756 refs #10706
) Liveslots has a bug (#10757) which leaks slotToVal entries when a tracked Promise is still being held in virtual data (e.g. a merely-virtual MapStore) at the time it becomes settled. This is triggered by `watchPromise` because of the order in which we attach two handlers: one which notices the resolution and is inhibited from deleting the slotToVal entry, and a second which removes the Promise from the (virtual) `promiseRegistrations` collection (thus enabling the deletion). For any watched Promise that is resolved, we leave a `slotToVal` entry (with an empty WeakRef) in RAM until the end of the incarnation. This PR does not fix the underlying bug, but it rearranges the handler order to avoid triggering it. The attached unit test fails with the original handler order (`slotToVal.size` grows), and passes with the swapped order (`slotToVal.size` remains constant). closes #10756 refs #10706
## Description Created as per instructions in MAINTAINERS.md. Includes an additional step to update yarn.lock for multichain-testing, a3p-integration/proposals/s:stake-bld and a3p-integration/proposals/z:acceptance ## Changes - @agoric/cosmos@0.35.0-u18.5 - @agoric/ertp@0.16.3-u18.1 - @agoric/swingset-vat@0.33.0-u18.1 - @agoric/access-token@0.4.22-u18.1 - agoric@0.22.0-u18.6 - @agoric/async-flow@0.2.0-u18.1 - @agoric/base-zone@0.1.1-u18.1 - @agoric/benchmark@0.1.1-u18.6 - @agoric/boot@0.2.0-u18.6 - @agoric/builders@0.2.0-u18.6 - @agoric/cache@0.3.3-u18.1 - @agoric/casting@0.4.3-u18.5 - @agoric/client-utils@0.2.0-u18.0 - @agoric/cosmic-proto@0.5.0-u18.5 - @agoric/cosmic-swingset@0.42.0-u18.6 - @agoric/create-dapp@0.1.1-u18.6 - @agoric/deploy-script-support@0.10.4-u18.5 - @agoric/deployment@4.0.0-u18.1 - @agoric/eslint-config@0.4.1-u18.1 - @agoric/fast-usdc@0.2.0-u18.0 - @agoric/governance@0.10.4-u18.1 - @agoric/import-manager@0.3.12-u18.1 - @agoric/inter-protocol@0.17.0-u18.6 - @agoric/internal@0.4.0-u18.1 - @agoric/kmarshal@0.1.1-u18.1 - @agoric/network@0.2.0-u18.1 - @agoric/notifier@0.7.0-u18.1 - @agoric/orchestration@0.2.0-u18.5 - @agoric/pegasus@0.8.0-u18.5 - @agoric/smart-wallet@0.5.4-u18.5 - @agoric/solo@0.11.0-u18.6 - @agoric/spawner@0.6.9-u18.1 - @agoric/stat-logger@0.4.29-u18.1 - @agoric/store@0.9.3-u18.1 - @agoric/swing-store@0.10.0-u18.1 - @agoric/swingset-liveslots@0.10.3-u18.1 - @agoric/swingset-runner@0.22.3-u18.6 - @agoric/swingset-xsnap-supervisor@0.10.3-u18.1 - @agoric/telemetry@0.6.3-u18.4 - @agoric/time@0.3.3-u18.1 - @agoric/vat-data@0.5.3-u18.1 - @agoric/vats@0.16.0-u18.5 - @agoric/vm-config@0.1.1-u18.1 - @agoric/vow@0.2.0-u18.1 - @agoric/wallet@0.19.0-u18.1 - @agoric/xsnap-lockdown@0.14.1-u18.1 - @agoric/xsnap@0.14.3-u18.1 - @agoric/zoe@0.26.3-u18.1 - @agoric/zone@0.3.0-u18.1 - @agoric/wallet-backend@0.15.0-u18.5 ## Packages that have NEWS.md updates ```diff --- a/golang/cosmos/CHANGELOG.md +++ b/golang/cosmos/CHANGELOG.md @@ -3,6 +3,32 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.35.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmos@0.35.0-u18.4...@agoric/cosmos@0.35.0-u18.5) (2024-12-24) + + +### Features + +* **cosmos:** Support arbitrary core eval builder arguments ([#10767](#10767)) ([a944f4c](a944f4c)), closes [#10752](#10752) [#10752](#10752) +* **cosmos:** use `x/vbank` ConsensusVersion to upgrade monitoring ([0e367d3](0e367d3)) +* migrate upgrade of v7-board from upgrade 19 to upgrade 18 ([#10761](#10761)) ([837776e](837776e)), closes [#10760](#10760) +* upgrade v7-board and test it ([#10516](#10516)) ([d8a109e](d8a109e)), closes [#10394](#10394) +* **vbank:** new param `allowed_monitoring_accounts` ([5ac4c52](5ac4c52)) +* **vtransfer:** extract base address from parameterized address ([3d44b53](3d44b53)) +* **vtransfer:** port some `address-hooks.js` functions to Go ([159098b](159098b)) +* **x/swingset:** Add parameters for controlling vat cleanup budget ([02c8138](02c8138)), closes [#8928](#8928) +* **x/swingset:** Define default vat cleanup budget as { default: 5, kv: 50 } ([d86ee6d](d86ee6d)) +* **x/swingset:** Read beansPerUnit in each message handler and pass down to helpers ([55b9b49](55b9b49)) +* **x/swingset:** Require a non-empty vat cleanup budget to include `default` ([28c4d8b](28c4d8b)) + + +### Bug Fixes + +* **agd:** upgrade all orchestration vats to new liveslots ([59fa82c](59fa82c)) +* **cosmos:** return an error if version is unsupported ([d17e55b](d17e55b)) +* **x/swingset:** Let migration see incomplete Params structs ([315cdd5](315cdd5)) + + + ## [0.35.0-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmos@0.35.0-u18.3...@agoric/cosmos@0.35.0-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/cosmos --- a/packages/ERTP/CHANGELOG.md +++ b/packages/ERTP/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.16.3-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/ertp@0.16.3-u18.0...@agoric/ertp@0.16.3-u18.1) (2024-12-24) + + +### Bug Fixes + +* **ertp:** remove unneeded ertp type imports ([#10467](#10467)) ([e96ff82](e96ff82)), closes [#10456](#10456) +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) + + + ### [0.16.3-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/ertp@0.16.2...@agoric/ertp@0.16.3-u18.0) (2024-10-31) --- a/packages/SwingSet/CHANGELOG.md +++ b/packages/SwingSet/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.33.0-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-vat@0.33.0-u18.0...@agoric/swingset-vat@0.33.0-u18.1) (2024-12-24) + + +### Features + +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) + + +### Bug Fixes + +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) +* **SwingSet:** Introduce a termination-dedicated "VatUndertaker" analog to "VatKeeper" ([b786414](b786414)) + + + ## [0.33.0-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-vat@0.32.2...@agoric/swingset-vat@0.33.0-u18.0) (2024-10-31) --- a/packages/agoric-cli/CHANGELOG.md +++ b/packages/agoric-cli/CHANGELOG.md @@ -3,6 +3,37 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.22.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/agoric@0.22.0-u18.5...agoric@0.22.0-u18.6) (2024-12-24) + + +### ⚠ BREAKING CHANGES + +* remove agoricNames from VstorageKit + +### Features + +* **agoric-cli:** Add `agoric wallet send` gas limit options ([21a03f8](21a03f8)) +* **agoric-cli:** Block `agoric wallet send` on tx inclusion ([0389a21](0389a21)) +* client-utils package ([50af71f](50af71f)) +* export cli lib ([0d2d4aa](0d2d4aa)) +* fetchEnvNetworkConfig ([9bdba57](9bdba57)) +* makeWalletUtils wo/spawn ([bc10509](bc10509)) +* makeWalletUtils wo/spawn ([20083ae](20083ae)) +* VstorageKit ([71486d7](71486d7)) + + +### Bug Fixes + +* **agoric-cli:** use readPublished consistently in agops oracle ([e8f6de2](e8f6de2)) +* proposeParamChange options ([202ba1e](202ba1e)) + + +### Miscellaneous Chores + +* remove agoricNames from VstorageKit ([1c69d39](1c69d39)) + + + ## [0.22.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/agoric@0.22.0-u18.4...agoric@0.22.0-u18.5) (2024-12-17) **Note:** Version bump only for package agoric --- a/packages/boot/CHANGELOG.md +++ b/packages/boot/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/boot@0.2.0-u18.5...@agoric/boot@0.2.0-u18.6) (2024-12-24) + + +### Features + +* add `bech32Prefix?: string` to `CosmosChainInfo` ([cb9e1ee](cb9e1ee)) +* consistent publishTxnRecord (record) ([dbf3934](dbf3934)) +* **fast-usdc:** publish feeConfig to vstorage ([08b2e13](08b2e13)) +* **fast-usdc:** support risk assessment arg ([ff6737a](ff6737a)) +* **fast-usdc:** write chain policies to vstorage ([#10532](#10532)) ([9d6cff1](9d6cff1)) +* **fast-usdc:** write status updates to vstorage ([#10552](#10552)) ([419df4e](419df4e)) +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) +* publish OBSERVED with first evidence ([7e62d8f](7e62d8f)) +* readPublished in SwingsetTestKit ([0b383c9](0b383c9)) +* record instances that will be replaced so we can manage them ([c883c39](c883c39)) +* send-anywhere inits chainHub ([2fa2f75](2fa2f75)) +* **types:** TransactionRecord ([ccb9e28](ccb9e28)) +* vstorage status --> txns ([aebb4d7](aebb4d7)) + + + ## [0.2.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/boot@0.2.0-u18.4...@agoric/boot@0.2.0-u18.5) (2024-12-17) **Note:** Version bump only for package @agoric/boot --- a/packages/builders/CHANGELOG.md +++ b/packages/builders/CHANGELOG.md @@ -3,6 +3,41 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u18.5...@agoric/builders@0.2.0-u18.6) (2024-12-24) + + +### Features + +* `ForwardOpts` accepts `intermediateRecipient` ([eb975f1](eb975f1)) +* `ForwardOptsShape` ([50b1717](50b1717)) +* add `bech32Prefix?: string` to `CosmosChainInfo` ([cb9e1ee](cb9e1ee)) +* advancer with fees ([087f3a8](087f3a8)) +* assetInfo as array of entries ([51e7a9c](51e7a9c)) +* **builders:** --noNoble option for init-fast-usdc ([508a3e0](508a3e0)) +* **builders:** fast-usdc builder w/CLI config ([9f45a05](9f45a05)) +* **builders:** fast-usdc oracleSet option for MAINNET, ... ([3bf01a2](3bf01a2)) +* **builders:** fast-usdc policy update builder ([8ded3d8](8ded3d8)) +* chain-capabilities.js constants ([52ff70a](52ff70a)) +* export `DenomDetailShape` ([2dfddb3](2dfddb3)) +* export `OrchestrationPowersShape` ([34b61ea](34b61ea)) +* **fast-usdc:** write chain policies to vstorage ([#10532](#10532)) ([9d6cff1](9d6cff1)) +* fusdc assetInfo and chainInfo by netname ([afb4f34](afb4f34)) +* parameterize fusdc with chainInfo and assetInfo ([e5a8b64](e5a8b64)) +* record instances that will be replaced so we can manage them ([c883c39](c883c39)) +* register interchain bank assets proposal ([0e20707](0e20707)) +* registerChainsAndAssets ([e72782d](e72782d)) +* save the outgoing EC Charter instance and kit ([c2c9be3](c2c9be3)) +* send-anywhere inits chainHub ([2fa2f75](2fa2f75)) +* upgrade v7-board and test it ([#10516](#10516)) ([d8a109e](d8a109e)), closes [#10394](#10394) + + +### Bug Fixes + +* **agd:** upgrade all orchestration vats to new liveslots ([59fa82c](59fa82c)) +* **orchestration:** denomAmounts must be non-negative ([#10458](#10458)) ([40e0e4e](40e0e4e)) + + + ## [0.2.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/builders@0.2.0-u18.4...@agoric/builders@0.2.0-u18.5) (2024-12-17) **Note:** Version bump only for package @agoric/builders --- a/packages/casting/CHANGELOG.md +++ b/packages/casting/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.4.3-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/casting@0.4.3-u18.4...@agoric/casting@0.4.3-u18.5) (2024-12-24) + + +### Features + +* makeTendermintRpcClient ([129516a](129516a)) + + + ### [0.4.3-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/casting@0.4.3-u18.3...@agoric/casting@0.4.3-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/casting --- a/packages/client-utils/CHANGELOG.md +++ b/packages/client-utils/CHANGELOG.md @@ -1 +1,41 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 0.2.0-u18.0 (2024-12-24) + + +### ⚠ BREAKING CHANGES + +* remove agoricNames from VstorageKit + +### Features + +* client-utils package ([50af71f](50af71f)) +* export makeStargateClient ([186d268](186d268)) +* fetchEnvNetworkConfig ([9bdba57](9bdba57)) +* getCurrentWalletRecord ([2740748](2740748)) +* makeWalletUtils wo/spawn ([20083ae](20083ae)) +* ocap makeStargateClient ([c8f7407](c8f7407)) +* one marshaller per WalletUtils ([b141ce6](b141ce6)) +* **sync-tools:** add method to wait until offer exited ([c9370f2](c9370f2)) +* **types:** TypedPublished ([88939bf](88939bf)) +* vstorage without instance binding ([2c4e2e3](2c4e2e3)) +* VstorageKit ([71486d7](71486d7)) +* VstorageKit readPublished ([e48c53c](e48c53c)) + + +### Bug Fixes + +* **client-utils:** only call `fetch` as a function, not a method ([#10671](#10671)) ([fbae24c](fbae24c)), closes [/github.com/endojs/endo/issues/31#issuecomment-1255624116](https://github.com/Agoric//github.com/endojs/endo/issues/31/issues/issuecomment-1255624116) +* **client-utils:** Retry at least every other interval ([fd9394b](fd9394b)) + + +### Miscellaneous Chores + +* remove agoricNames from VstorageKit ([1c69d39](1c69d39)) + + + # Change Log --- a/packages/cosmic-proto/CHANGELOG.md +++ b/packages/cosmic-proto/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.5.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-proto@0.5.0-u18.4...@agoric/cosmic-proto@0.5.0-u18.5) (2024-12-24) + + +### Features + +* **vats:** first cut of Address Hooks in JS ([dbad30b](dbad30b)) + + +### Bug Fixes + +* **address-hooks:** throw if the version is unsupported ([e3c2665](e3c2665)) +* **address-hooks:** use `harden` (or `freeze`) ([80fee60](80fee60)) + + + ## [0.5.0-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-proto@0.5.0-u18.3...@agoric/cosmic-proto@0.5.0-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/cosmic-proto --- a/packages/cosmic-swingset/CHANGELOG.md +++ b/packages/cosmic-swingset/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.42.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.42.0-u18.5...@agoric/cosmic-swingset@0.42.0-u18.6) (2024-12-24) + + +### Features + +* **cosmic-swingset:** Add support for testing blocks of a mock chain ([48b6405](48b6405)) +* **cosmic-swingset:** Allow `launch` to accept an already-open swingStore ([c65e5b1](c65e5b1)) +* **cosmic-swingset:** Update parseParams to read and validate vat cleanup budget data ([80bcca0](80bcca0)), closes [#8928](#8928) +* **cosmic-swingset:** Use vat cleanup budget values to allow slow cleanup ([508ea8e](508ea8e)), closes [#8928](#8928) +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) +* **x/swingset:** Define default vat cleanup budget as { default: 5, kv: 50 } ([d86ee6d](d86ee6d)) + + +### Bug Fixes + +* **cosmic-swingset:** expect chain --halt-height exit status > 1 ([c025cb7](c025cb7)) + + + ## [0.42.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmic-swingset@0.42.0-u18.4...@agoric/cosmic-swingset@0.42.0-u18.5) (2024-12-17) --- a/packages/fast-usdc/CHANGELOG.md +++ b/packages/fast-usdc/CHANGELOG.md @@ -3,6 +3,128 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 0.2.0-u18.0 (2024-12-24) + + +### Features + +* error on conflicting evidence ([cd2a40c](cd2a40c)) +* **fast-usdc:** add FastLP/ufastlp to vbank ([ae1963e](ae1963e)) +* **fast-usdc:** detect transfer completion in cli ([2828444](2828444)) +* **fast-usdc:** support risk assessment arg ([ff6737a](ff6737a)) +* operator majority logic ([bc28201](bc28201)) +* record fee split in transaction ([8846972](8846972)) + +## 0.35.0-u18.4 (2024-12-17) + + +### ⚠ BREAKING CHANGES + +* remove agoricNames from VstorageKit + +### Features + +* consistent publishTxnRecord (record) ([dbf3934](dbf3934)) +* deleteCompletedTxs ([f0078ee](f0078ee)) +* **fast-usdc:** cli for lp deposit and withdraw ([4c0c372](4c0c372)) +* **fast-usdc:** limited operation before connecting to noble ([eb82ae3](eb82ae3)) +* include 'sender' in CctpTxEvidence ([f99e7b8](f99e7b8)) +* publish CctpTxEvidence ([2916c8f](2916c8f)) +* publish OBSERVED with first evidence ([7e62d8f](7e62d8f)) +* simplify seenTxs key ([fd05a7e](fd05a7e)) +* **types:** TransactionRecord ([ccb9e28](ccb9e28)) +* vstorage status --> txns ([aebb4d7](aebb4d7)) + + +### Bug Fixes + +* do not stringify logs ([d04c5ea](d04c5ea)) +* vstorage fastUsdc path ([1f47164](1f47164)) + + +### Miscellaneous Chores + +* remove agoricNames from VstorageKit ([1c69d39](1c69d39)) + +## 0.35.0-u18.3 (2024-12-09) + + +### ⚠ BREAKING CHANGES + +* `getAsset` and `getDenomInfo` require `srcChainName` param + +### Features + +* `getAsset` and `getDenomInfo` require `srcChainName` param ([fc802ad](fc802ad)) +* assetInfo as array of entries ([51e7a9c](51e7a9c)) +* **fast-usdc:** core-eval to update feed policy ([db283e1](db283e1)) +* **fast-usdc:** operator attest cli command ([448aa3a](448aa3a)) +* **fast-usdc:** publish feeConfig to vstorage ([08b2e13](08b2e13)) +* **fast-usdc:** settler disburses or forwards funds ([17b0423](17b0423)) +* **fast-usdc:** write chain policies to vstorage ([#10532](#10532)) ([9d6cff1](9d6cff1)) +* **fast-usdc:** write status updates to vstorage ([#10552](#10552)) ([419df4e](419df4e)) +* operator accept cmd ([ae2cf1e](ae2cf1e)) +* parameterize fusdc with chainInfo and assetInfo ([e5a8b64](e5a8b64)) +* scaffold operator commands ([36375fd](36375fd)) + + +### Bug Fixes + +* `brandKey` not part of `DenomDetail` ([9a65478](9a65478)) + +## 0.35.0-u18.2 (2024-11-21) + + +### Features + +* `Advancer` uses `borrower` facet ([35eb7ad](35eb7ad)) +* integrate `Advancer` with contract ([c5d67af](c5d67af)) +* liquidity pool borrower and repayer facets ([3117eef](3117eef)) + +## 0.35.0-u18.1 (2024-11-19) + + +### Features + +* `Advancer` exo behaviors ([4cd2f3f](4cd2f3f)), closes [#10390](#10390) +* `CctpTxEvidenceShape`, `PendingTxShape` typeGuards ([5a7b3d2](5a7b3d2)) +* `getQueryParams` takes shape parameter ([99707ef](99707ef)) +* `StatusManager` scaffold ([980463f](980463f)) +* `StatusManager` tracks `seenTxs` ([f3d1e36](f3d1e36)) +* `TxStatus` const for `StatusManager` states ([1376020](1376020)) +* advancer with fees ([087f3a8](087f3a8)) +* defineInertInvitation ([f756412](f756412)) +* **fast-usdc:** .start.js core-eval w/oracle invitations ([7b6820a](7b6820a)) +* **fast-usdc:** add cli config and args for deposit and withdraw ([#10487](#10487)) ([fb2d05c](fb2d05c)) +* **fast-usdc:** deposit, withdraw liquidity in exchange for shares ([5ae543d](5ae543d)) +* **fast-usdc:** implement config cli command ([d121e1d](d121e1d)) +* **fast-usdc:** implement transfer cli command ([504818f](504818f)) +* **fast-usdc:** stub config cli command ([81e14b2](81e14b2)) +* **fast-usdc:** stub transfer cli command ([1b64d82](1b64d82)) +* feed access controls ([8f4a66d](8f4a66d)) +* makeTestPushInvitation handles evidence ([7e99cfa](7e99cfa)) +* minimal `addressTools` for query param parsing ([6f97e13](6f97e13)) +* operators evidence flows through feed ([2161a6f](2161a6f)) +* publish when all oracle operators agree ([d06ae2b](d06ae2b)) +* TransactionFeedKit ([8eb7dee](8eb7dee)) +* uniform configuration with LegibleCapData ([968903a](968903a)) + + +### Bug Fixes + +* **fast-usdc:** ensure cli non-zero exit code on failure ([6c0e77b](6c0e77b)) +* **fast-usdc:** fix url encoding ([d46cefd](d46cefd)) +* **fast-usdc:** use correct address format in cli ([d225974](d225974)) + +## 0.35.0-u18.0 (2024-10-31) + + +### Features + +* add CLI for fast-usdc package ([92bc5b1](92bc5b1)) + + + ### [0.1.1-u18.5](https://github.com/Agoric/agoric-sdk/compare/fast-usdc@0.1.1-u18.4...fast-usdc@0.1.1-u18.5) (2024-12-17) **Note:** Version bump only for package fast-usdc --- a/packages/governance/CHANGELOG.md +++ b/packages/governance/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.10.4-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/governance@0.10.4-u18.0...@agoric/governance@0.10.4-u18.1) (2024-12-24) + + +### Bug Fixes + +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) + + + ### [0.10.4-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/governance@0.10.3...@agoric/governance@0.10.4-u18.0) (2024-10-31) --- a/packages/inter-protocol/CHANGELOG.md +++ b/packages/inter-protocol/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.17.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/inter-protocol@0.17.0-u18.5...@agoric/inter-protocol@0.17.0-u18.6) (2024-12-24) + + +### Features + +* add an accessor for the vaultDirector's parameters ([32f1398](32f1398)) +* record instances that will be replaced so we can manage them ([c883c39](c883c39)) +* save the outgoing EC Charter instance and kit ([c2c9be3](c2c9be3)) + + +### Bug Fixes + +* makeReserveTerms ([27ce0b0](27ce0b0)) +* remove addInstance call from add-auction.js ([d16781f](d16781f)) + + + ## [0.17.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/inter-protocol@0.17.0-u18.4...@agoric/inter-protocol@0.17.0-u18.5) (2024-12-17) **Note:** Version bump only for package @agoric/inter-protocol --- a/packages/internal/CHANGELOG.md +++ b/packages/internal/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.4.0-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/internal@0.4.0-u18.0...@agoric/internal@0.4.0-u18.1) (2024-12-24) + + +### Features + +* consistent publishTxnRecord (record) ([dbf3934](dbf3934)) +* defaultSerializer util ([19d5e03](19d5e03)) +* getValues for sequence nodes ([b5698ce](b5698ce)) +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) +* pureDataMarshaller ([6df7f1f](6df7f1f)) +* showValue option for documentStorageSchema ([07d12d4](07d12d4)) +* storage-test-utils report missing data ([02c111b](02c111b)) + + + ## [0.4.0-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/internal@0.3.2...@agoric/internal@0.4.0-u18.0) (2024-10-31) --- a/packages/orchestration/CHANGELOG.md +++ b/packages/orchestration/CHANGELOG.md @@ -3,6 +3,48 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/orchestration@0.2.0-u18.4...@agoric/orchestration@0.2.0-u18.5) (2024-12-24) + + +### ⚠ BREAKING CHANGES + +* `getAsset` and `getDenomInfo` require `srcChainName` param + +### Features + +* `assetOn` `DenomDetail` helper ([05fe515](05fe515)) +* `chainHub.makeTransferRoute` ([0215b6f](0215b6f)) +* `ForwardOpts` accepts `intermediateRecipient` ([eb975f1](eb975f1)) +* `ForwardOptsShape` ([50b1717](50b1717)) +* `getAsset` and `getDenomInfo` require `srcChainName` param ([fc802ad](fc802ad)) +* `withOrchestration` returns `baggage` ([e4a6c6d](e4a6c6d)) +* add `bech32Prefix?: string` to `CosmosChainInfo` ([cb9e1ee](cb9e1ee)) +* assetInfo as array of entries ([51e7a9c](51e7a9c)) +* chain-capabilities.js constants ([52ff70a](52ff70a)) +* **chainHub:** `getChainInfoByAddress` helper ([d6c487c](d6c487c)) +* **cosmos-orch-account:** expose `.executeEncodedTx` ([9d10be1](9d10be1)) +* CosmosChainInfo includes `pfmEnabled?: boolean` ([e1c35da](e1c35da)) +* export `DenomDetailShape` ([2dfddb3](2dfddb3)) +* export `OrchestrationPowersShape` ([34b61ea](34b61ea)) +* **local-orchestration-account:** support multi-hop pfm transfers ([c35fac7](c35fac7)) +* registerChainsAndAssets ([e72782d](e72782d)) +* send-anywhere inits chainHub ([2fa2f75](2fa2f75)) + + +### Bug Fixes + +* `brandKey` not part of `DenomDetail` ([9a65478](9a65478)) +* `convertChainInfo` connection sorting ([8ba4699](8ba4699)) +* do not stringify logs ([d04c5ea](d04c5ea)) +* **orchestration:** denomAmounts must be non-negative ([#10458](#10458)) ([40e0e4e](40e0e4e)) +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) +* **orchestration:** harden result of reverseConnInfo ([5c1219c](5c1219c)) +* subscribeToTransfers atomically ([7b77993](7b77993)) +* use `asVow` in case `owned()` throws ([e67e86b](e67e86b)) +* yarn codegen script ([9eea3fd](9eea3fd)) + + + ## [0.2.0-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/orchestration@0.2.0-u18.3...@agoric/orchestration@0.2.0-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/orchestration --- a/packages/solo/CHANGELOG.md +++ b/packages/solo/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.11.0-u18.6](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.11.0-u18.5...@agoric/solo@0.11.0-u18.6) (2024-12-24) + + +### Features + +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) + + + ## [0.11.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/solo@0.11.0-u18.4...@agoric/solo@0.11.0-u18.5) (2024-12-17) **Note:** Version bump only for package @agoric/solo --- a/packages/swing-store/CHANGELOG.md +++ b/packages/swing-store/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.10.0-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swing-store@0.10.0-u18.0...@agoric/swing-store@0.10.0-u18.1) (2024-12-24) + + +### Features + +* **cosmic-swingset:** Allow `launch` to accept an already-open swingStore ([c65e5b1](c65e5b1)) + + + ## [0.10.0-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swing-store@0.9.1...@agoric/swing-store@0.10.0-u18.0) (2024-10-31) --- a/packages/swingset-liveslots/CHANGELOG.md +++ b/packages/swingset-liveslots/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.10.3-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.3-u18.0...@agoric/swingset-liveslots@0.10.3-u18.1) (2024-12-24) + + +### Bug Fixes + +* **liveslots:** avoid slotToVal memory leak for watched promises ([874196c](874196c)), closes [#10757](#10757) [#10756](#10756) [#10706](#10706) + + + ### [0.10.3-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/swingset-liveslots@0.10.2...@agoric/swingset-liveslots@0.10.3-u18.0) (2024-10-31) --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.6.3-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/telemetry@0.6.3-u18.3...@agoric/telemetry@0.6.3-u18.4) (2024-12-24) + + +### Bug Fixes + +* **telemetry:** add missing slog type ([1aec8d0](1aec8d0)) +* **telemetry:** Empty context persisted when remaining beans are negative after run finish ([#10635](#10635)) ([ad4e83e](ad4e83e)) +* **telemetry:** event name typo ([9e19321](9e19321)) +* **telemetry:** timer-poll run.id ([#10672](#10672)) ([3b478fb](3b478fb)), closes [#10357](#10357) [#10357](#10357) + + + ### [0.6.3-u18.3](https://github.com/Agoric/agoric-sdk/compare/@agoric/telemetry@0.6.3-u18.2...@agoric/telemetry@0.6.3-u18.3) (2024-12-13) --- a/packages/time/CHANGELOG.md +++ b/packages/time/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.3.3-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/time@0.3.3-u18.0...@agoric/time@0.3.3-u18.1) (2024-12-24) + + +### Bug Fixes + +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) + + + ### [0.3.3-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/time@0.3.2...@agoric/time@0.3.3-u18.0) (2024-10-31) --- a/packages/vats/CHANGELOG.md +++ b/packages/vats/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.16.0-u18.5](https://github.com/Agoric/agoric-sdk/compare/@agoric/vats@0.16.0-u18.4...@agoric/vats@0.16.0-u18.5) (2024-12-24) + + +### Features + +* **cosmic-swingset:** Add support for testing blocks of a mock chain ([48b6405](48b6405)) +* upgrade v7-board and test it ([#10516](#10516)) ([d8a109e](d8a109e)), closes [#10394](#10394) + + +### Bug Fixes + +* **ERTP,vats:** fix 9407 AmountPatternShape ([#9863](#9863)) ([59b1a9f](59b1a9f)), closes [#9410](#9410) [#9407](#9407) [#9410](#9410) [#9407](#9407) [#9410](#9410) [#9407](#9407) [#9410](#9410) +* **vaultFactory:** fix proposal description ([bc1f87a](bc1f87a)) + + + ## [0.16.0-u18.4](https://github.com/Agoric/agoric-sdk/compare/@agoric/vats@0.16.0-u18.3...@agoric/vats@0.16.0-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/vats --- a/packages/wallet/CHANGELOG.md +++ b/packages/wallet/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.19.0-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/wallet@0.19.0-u18.0...@agoric/wallet@0.19.0-u18.1) (2024-12-24) + +## 0.35.0-u18.4 (2024-12-17) + +## 0.35.0-u18.3 (2024-12-09) + +## 0.35.0-u18.2 (2024-11-21) + +## 0.35.0-u18.1 (2024-11-19) + + +### Features + +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) + + + ## [0.19.0-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/wallet@0.18.3...@agoric/wallet@0.19.0-u18.0) (2024-10-31) --- a/packages/wallet/api/CHANGELOG.md +++ b/packages/wallet/api/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.15.0-u18.5](https://github.com/Agoric/agoric/compare/@agoric/wallet-backend@0.15.0-u18.4...@agoric/wallet-backend@0.15.0-u18.5) (2024-12-24) + + +### Features + +* **internal:** Introduce deepCopyJsonable ([f875bb0](f875bb0)) + + + ## [0.15.0-u18.4](https://github.com/Agoric/agoric/compare/@agoric/wallet-backend@0.15.0-u18.3...@agoric/wallet-backend@0.15.0-u18.4) (2024-12-17) **Note:** Version bump only for package @agoric/wallet-backend --- a/packages/zoe/CHANGELOG.md +++ b/packages/zoe/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.26.3-u18.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/zoe@0.26.3-u18.0...@agoric/zoe@0.26.3-u18.1) (2024-12-24) + + +### Bug Fixes + +* **orchestration:** harden exported patterns ([#10470](#10470)) ([47bebb8](47bebb8)), closes [#10456](#10456) + + + ### [0.26.3-u18.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/zoe@0.26.2...@agoric/zoe@0.26.3-u18.0) (2024-10-31) ```
@mhofman and I had a good chat about this: The first pillar is really "known to the kernel" rather than "settled". For vpids that are known to the kernel (in the c-list), we reliably remove it from the c-list at the same time we share the settlement across the vat/kernel boundary (the kernel removes it after translating, but before invoking Fortunately, "known to the kernel" is well-captured by the vpid's presence in So the solution plan is:
function vpidBecomesUnreferencedByVData(vpid) {
if (!exportedVPIDs.has(vpid) && !importedVPIDs.has(vpid)) {
const p = slotToVal.get(vpid).deref();
assert(p);
slotToVal.delete(vpid);
valToSlot.delete(p);
}
}
The unit test for this needs to exercise the four edges of the 2-pillar square. It should be possible to write these tests in The tests should also exercise the "add to vdata, remove from vdata, then export to kernel" case. Here, the promise may be assigned one vpid when added to vdata, then that mapping is removed when it leaves vdata, then a second vpid is assigned when exported to kernel. (actually, we should test doing the add+remove twice, and see that we get new VPIDs each time). As long as the kernel doesn't know about the VPID (and there are no promiseWatchers), it doesn't need to be stable. |
This is the underlying bug that causes #10756. We have a quick workaround for that consequence, so it is tracked separately, but this ticket is for the deeper issue that may take more time to resolve.
Liveslots needs to track the mapping from vref (really vpid) to Promise object, at least until the Promise is settled (fulfilled or rejected), so that serialization and deserialization will get the right vpid or Promise. Unlike with object-style vrefs (Presences, Representatives,
Far()
/"Remotable"s), we don't try detect when the Promise object becomes unreachable by user code (with a FinalizationRegistry). It would be nice to drop the c-list entry when the vat no longer cares about the Promise, but we don't get enough information from the JS engine to do that safely: userspace might have called.then
to add a callback and then dropped the Promise, in which case liveslots must remain subscribed so it can call the fulfill/reject functions at the right time.So our rule is that we retain the Promise (and thus a stable vpid-Promise mapping) until it settles, after which deserialization is allowed to return any correctly-settled Promise, and serialization is not obligated to return the original vpid. (If we could somehow hook
.then
, then GCing Promises might be possible, as would stable serialization of settled Promises, ala #2381, which is related to auxdata in #2069).The vpid-to-Promise mapping is held in the
slotToVal
, which (for the benefit of objects) has values which are WeakRefs (so it's really a vpid-to-WeakRef-to-Promise mapping). This lets liveslots deserialize correctly/stably while the Presence/Representative is still around, but create a replacement Presence/Representative when necessary. We use WeakRef values for all vrefs, both objects and promises, which means we need some strong reference to keep the Promises alive.To manage that, liveslots uses a pair of (strong) vpid-to-Promise Maps:
exportedVPIDs
andimportedVPIDs
, for "exported" promises (decided by this vat, first appeared in data of outboundsyscall.send
orsyscall.resolve
), and "imported" promises (decided by the kernel, first appeared in the data of inbounddispatch.deliver
ordispatch.notify
). These keep the Promise alive until settled, and (forimportedVPIDs
) holds the resolve/reject functions needed to service adispatch.notify
when the kernel notifies the vat of the vpid being settled.We remove the vpid/Promise pair from those Maps when the promise settles. However, the
valToSlot
entry is not necessarily removed at that time. If the vpid also appears in virtual-data, we need to retain the ability to deserialize that data later, and obtain an equivalent Promise.(note that such Promises can only appear in the
state
of a merely-virtual object, or in the value of a merely-virtual collection. Fully durably objects or collections cannot hold Promises, because Promises are not durable. The durable promise watcher has one such (possibly the only such) collection)For simplicity, we retain the actual Promise in this case. We do this with a check of
vrm.getReachablePromiseRefCount()
insideunregisterUnreferencedVPID
:agoric-sdk/packages/swingset-liveslots/src/liveslots.js
Lines 966 to 969 in 10b789b
This
unregisterUnreferencedVPID
is called at the (end of the handler)[https://github.com/Agoric/agoric-sdk/blob/10b789bc98ae3fa44cf4ab00ba4ec6e480e1f15f/packages/swingset-liveslots/src/liveslots.js#L1020].then
-attached byfollowForKernel
(for exported Promises), and bydispatch.notify
(for imported Promises), just before those functions delete the strong reference withexportedVPIDs.delete(vpid)
orimportedVPIDs.delete(vpid)
.If the Promise settles, we can+should drop the strong reference, but if it still has a virtual-data reference, we can+should retain the
slotToVal
mapping (through the WeakRef), so that new deserializations of the old vpid map to the pre-existing (settled) Promise. If we droppedslotToVal
while vdata still referenced the vpid, any deserialization of that vdata would need to create a new Promise, without knowing that it should be settled, and without knowing what data it should be fulfilled/rejected to. The kernel knows about settled promises, so if one reappears indispatch.deliver
, the kernel will follow up with adispatch.notify
, but within a vat, the virtual-data layer does not remember the resolution state of each Promise. So we need to retain the original Promise until nothing inside the vat remembers the vpid.This means we have a two-pillar retention rule for the Promise objects (like our three-pillar "RAM, vdata, export" rule for retaining Presences and Representatives). In this case the two pillars are "settlement" and "referenced by vdata". If the Promise is not yet settled, we must retain the original (because it's the one whose fulfill/reject callbacks will be invoked). Or if vdata references the vpid, we must retain the original (because it might be settled, and that original Promise object is the only thing that remembers how and to what).
Two pillars means the state diagram has four states: both standing, first standing, second standing, and neither standing, and we retain the Promise until neither are standing. To implement that, you need the code that processes the true-to-false transition of the first piller to check on the status of the second pillar, and vice versa.
For us, that means:
slotToVal
if it is down (refcount === 0)slotToVal
if it is settledThe bug is that we don't implement that second case. The refcount decrement happens in
removeReachableVref
, and the Promise case is in the second clause:agoric-sdk/packages/swingset-liveslots/src/virtualReferences.js
Lines 427 to 430 in 10b789b
Currently, if the refcount reaches zero (i.e.
oldRefCount === 1
, so the new refcount will be zero), we delete the refcount-tracking Map entry, we setdroppedMemoryReference
to signal liveslots to loop back around and see if the released RAM might have shaken loose additional objects, but we don't perform any check of settlement status, and we don't make any attempt to deleteslotToVal
.So, if a Promise gets added to virtual data, then settled (either by the kernel or by the vat), then removed from virtual data, we'll leave the
slotToVal
entry in place. The WeakRef that it points to will be empty (because there are no longer any strong references to the Promise), but we still spend four XS slots on the Map entry and the WeakRef object. That vpid will never be referenced again: the vat no longer has a Promise object, nor vdata which references the vpid, and the kernel knows it was resolved and will remove it from the c-list (and if the same kpid is delivered again later, it will be assigned a new vpid).Directions For A Fix
Roughly, we need
removeReachableVref
to implement the missing state-machine edge. This probably requires code that keeps track of the resolution status of each Promise, so it can tell if the settlement has happened yet or not. But settlement cannot be checked synchronously: the best we can do is add a.then
handler and record a note when it settles. This introduces a race condition between the.then
handler that will perform the "first pillar has dropped" edge (inunregisterUnreferencedVPID
), and the one that updates the flag used by the "second pillar has dropped" edge (inremoveReachableVref
).We'll need to think more carefully about how this fix should fit in.
Other Thoughts
Also, in
watchedPromises.js
, maybepromiseRegistrations
should be a plain Map, instead of a virtual MapStore, but maybe we really do need to keep the valToSlot mapping pinned, to keep the mapping stable.. this needs more analysis. See #10778The text was updated successfully, but these errors were encountered: