Skip to content

Commit 4b5dff2

Browse files
authored
fix(liveslots): do not leak known resolved promises (#11119)
closes: #11118 refs: #10794 best reviewed commit-by-commit ## Description Remove unreferenced vpids from know resolutions ### Security Considerations None ### Scaling Considerations None ### Documentation Considerations None ### Testing Considerations Verified manually using [mhofman/fu-impact](dc-fu-impact...mhofman/fu-impact). Adds failing unit tests for the leak then marks the test as non failing in the fix commit Adds a failing test for a remaining leak from #10756 not currently mitigated. It would likely be solved by #10778 ### Upgrade Considerations This will require a vat upgrade of all vats potentially resolving with known settled promises. We know of at least the smart wallet doing this, but others may also be affected. Since we cannot unilaterally upgrade vats yet (#8405), we'll have to look at which vats are impacted and include an explicit upgrade.
2 parents bdbd5df + dfab8ab commit 4b5dff2

File tree

4 files changed

+533
-207
lines changed

4 files changed

+533
-207
lines changed

packages/swingset-liveslots/src/liveslots.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ function build(
797797
for (const resolution of resolutions) {
798798
const [xvpid] = resolution;
799799
maybeNewVPIDs.delete(xvpid);
800+
unregisterUnreferencedVPID(xvpid);
800801
}
801802
}
802803
for (const newVPID of Array.from(maybeNewVPIDs).sort()) {
@@ -1012,14 +1013,13 @@ function build(
10121013
for (const resolution of resolutions) {
10131014
const [xvpid] = resolution;
10141015
maybeNewVPIDs.delete(xvpid);
1016+
unregisterUnreferencedVPID(xvpid);
10151017
}
10161018
// track everything that's left
10171019
for (const newVPID of Array.from(maybeNewVPIDs).sort()) {
10181020
maybeExportPromise(newVPID);
10191021
}
10201022

1021-
// only the primary can possibly be newly resolved
1022-
unregisterUnreferencedVPID(vpid);
10231023
exportedVPIDs.delete(vpid);
10241024
}
10251025

0 commit comments

Comments
 (0)